File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,14 @@ export const createPartnerCommission = async ({
274274 } ,
275275 include : {
276276 customer : true ,
277+ link : {
278+ select : {
279+ id : true ,
280+ shortLink : true ,
281+ domain : true ,
282+ key : true ,
283+ } ,
284+ } ,
277285 } ,
278286 } ) ;
279287
Original file line number Diff line number Diff line change 3535 "sales" : 1 ,
3636 "saleAmount" : 50000 ,
3737 "createdAt" : " 2025-07-16T10:48:01.739Z"
38+ },
39+ "link" : {
40+ "id" : " cm0lcuvtz000xcutmqw4a7wi3" ,
41+ "shortLink" : " https://dub.sh/track-test" ,
42+ "domain" : " dub.sh" ,
43+ "key" : " track-test"
3844 }
3945}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { DATE_RANGE_INTERVAL_PRESETS } from "@/lib/analytics/constants";
22import { CommissionStatus , CommissionType } from "@dub/prisma/client" ;
33import * as z from "zod/v4" ;
44import { CustomerSchema } from "./customers" ;
5+ import { LinkSchema } from "./links" ;
56import { getPaginationQuerySchema } from "./misc" ;
67import { EnrolledPartnerSchema , WebhookPartnerSchema } from "./partners" ;
78import { parseDateSchema } from "./utils" ;
@@ -44,6 +45,12 @@ export const CommissionEnrichedSchema = CommissionSchema.extend({
4445export const CommissionWebhookSchema = CommissionSchema . extend ( {
4546 partner : WebhookPartnerSchema ,
4647 customer : CustomerSchema . nullish ( ) , // customer can be null for click-based / custom commissions
48+ link : LinkSchema . pick ( {
49+ id : true ,
50+ shortLink : true ,
51+ domain : true ,
52+ key : true ,
53+ } ) . nullable ( ) ,
4754} ) ;
4855
4956export const COMMISSIONS_MAX_PAGE_SIZE = 100 ;
You can’t perform that action at this time.
0 commit comments