Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

small fixes

Steven Tey5b5af2e74363
diff --git a/apps/web/lib/openapi/customers/get-customer.ts b/apps/web/lib/openapi/customers/get-customer.ts
index 90520a872e..32bb661e7e 100644
--- a/apps/web/lib/openapi/customers/get-customer.ts
+++ b/apps/web/lib/openapi/customers/get-customer.ts
@@ -5,8 +5,8 @@ import { CustomerSchema } from "../../zod/schemas/customers";
export const getCustomer: ZodOpenApiOperationObject = {
operationId: "getCustomer",
"x-speakeasy-name-override": "get",
- summary: "Get a customer",
- description: "Get a customer by ID for the authenticated workspace.",
+ summary: "Retrieve a customer",
+ description: "Retrieve a customer by ID for the authenticated workspace.",
requestParams: {
path: CustomerSchema.pick({ id: true }),
},
diff --git a/apps/web/lib/openapi/customers/get-customers.ts b/apps/web/lib/openapi/customers/get-customers.ts
index a741dac066..59e7a93751 100644
--- a/apps/web/lib/openapi/customers/get-customers.ts
+++ b/apps/web/lib/openapi/customers/get-customers.ts
@@ -6,8 +6,8 @@ import { CustomerSchema } from "../../zod/schemas/customers";
export const getCustomers: ZodOpenApiOperationObject = {
operationId: "getCustomers",
"x-speakeasy-name-override": "list",
- summary: "Get a list of customers",
- description: "Get a list of customers for the authenticated workspace.",
+ summary: "Retrieve a list of customers",
+ description: "Retrieve a list of customers for the authenticated workspace.",
responses: {
"200": {
description: "The list of customers.",
diff --git a/apps/web/scripts/backfill-dots-user.ts b/apps/web/scripts/backfill-dots-user.ts
index 519eee1ee0..aa205a9014 100644
--- a/apps/web/scripts/backfill-dots-user.ts
+++ b/apps/web/scripts/backfill-dots-user.ts
@@ -4,7 +4,7 @@ import { prisma } from "@/lib/prisma";
import "dotenv-flow/config";
const partnerId = "pn_DlsZeePb38RVcnrfbD0SrKzB";
-const dotsAppId = "f821f11e-f5d0-44f9-8f6c-adb4816c5f03";
+const dotsAppId = "7af68b86-abad-4b2d-a598-0becf6770fb7";
// REMEMBER TO CHANGE TO PROD ENVS FIRST OR THIS WONT WORK
async function main() {
diff --git a/apps/web/scripts/backfill-missing-sales.ts b/apps/web/scripts/backfill-missing-sales.ts
new file mode 100644
index 0000000000..ba1bc9a055
--- /dev/null
+++ b/apps/web/scripts/backfill-missing-sales.ts
@@ -0,0 +1,54 @@
+import { prisma } from "@/lib/prisma";
+import "dotenv-flow/config";
+import * as fs from "fs";
+import * as Papa from "papaparse";
+
+const projectId = "xxx";
+let customerSpend: {
+ email: string;
+ spend: number;
+}[] = [];
+
+async function main() {
+ const customers = await prisma.customer.findMany({
+ where: {
+ projectId,
+ },
+ select: {
+ email: true,
+ externalId: true,
+ },
+ orderBy: {
+ createdAt: "asc",
+ },
+ });
+
+ Papa.parse(fs.createReadStream("xxx.csv", "utf-8"), {
+ header: true,
+ skipEmptyLines: true,
+ step: (result: {
+ data: {
+ email: string;
+ net_volume: string;
+ };
+ }) => {
+ customerSpend.push({
+ email: result.data.email,
+ spend: parseFloat(result.data.net_volume),
+ });
+ },
+ complete: () => {
+ console.table(customerSpend);
+
+ // overlap
+
+ const overlap = customers.filter((c) =>
+ customerSpend.some((cs) => cs.email === c.email),
+ );
+
+ console.table(overlap);
+ },
+ });
+}
+
+main();