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.

update schemas

Steven Tey96b8cf3e09f9
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index b380c4cbf7..bfd5e4b440 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -505,6 +505,12 @@ export const LinkSchema = z
.number()
.default(0)
.describe("[BETA]: The number of sales the short links has generated."),
+ saleAmount: z
+ .number()
+ .default(0)
+ .describe(
+ "[BETA]: The total dollar amount of sales the short links has generated (in cents).",
+ ),
createdAt: z
.string()
.describe("The date and time when the short link was created."),
diff --git a/apps/web/lib/zod/schemas/workspaces.ts b/apps/web/lib/zod/schemas/workspaces.ts
index 4c63233f5a..9ca96f64a5 100644
--- a/apps/web/lib/zod/schemas/workspaces.ts
+++ b/apps/web/lib/zod/schemas/workspaces.ts
@@ -30,8 +30,16 @@ export const WorkspaceSchema = z
usageLimit: z.number().describe("The usage limit of the workspace."),
linksUsage: z.number().describe("The links usage of the workspace."),
linksLimit: z.number().describe("The links limit of the workspace."),
- salesUsage: z.number().describe("The sales usage of the workspace."),
- salesLimit: z.number().describe("The sales limit of the workspace."),
+ salesUsage: z
+ .number()
+ .describe(
+ "The dollar amount of tracked revenue in the current billing cycle (in cents).",
+ ),
+ salesLimit: z
+ .number()
+ .describe(
+ "The limit of tracked revenue in the current billing cycle (in cents).",
+ ),
domainsLimit: z.number().describe("The domains limit of the workspace."),
tagsLimit: z.number().describe("The tags limit of the workspace."),
usersLimit: z.number().describe("The users limit of the workspace."),
diff --git a/apps/web/prisma/schema/link.prisma b/apps/web/prisma/schema/link.prisma
index ef591cecf1..02caa94430 100644
--- a/apps/web/prisma/schema/link.prisma
+++ b/apps/web/prisma/schema/link.prisma
@@ -48,8 +48,8 @@ model Link {
clicks Int @default(0) // number of clicks
lastClicked DateTime? // when the link was last clicked
leads Int @default(0)
- sales Int @default(0)
- saleAmount Int @default(0)
+ sales Int @default(0) // number of sales
+ saleAmount Int @default(0) // total dollar value of sales (in cents)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt