The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
small fixes
Steven Tey5b5af2e74363
diff --git a/apps/web/lib/openapi/customers/get-customer.ts b/apps/web/lib/openapi/customers/get-customer.tsindex 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.tsindex 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.tsindex 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 WORKasync function main() {diff --git a/apps/web/scripts/backfill-missing-sales.ts b/apps/web/scripts/backfill-missing-sales.tsnew file mode 100644index 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();