@the-inkwell/shared 0.2.257 → 0.2.259

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,7 @@ export * from './positionsToSkills';
24
24
  export * from './positionsToTags';
25
25
  export * from './referrals';
26
26
  export * from './referralsToMessages';
27
+ export * from './referralPayouts';
27
28
  export * from './senders';
28
29
  export * from './sendgrid';
29
30
  export * from './settings';
@@ -40,6 +40,7 @@ __exportStar(require("./positionsToSkills"), exports);
40
40
  __exportStar(require("./positionsToTags"), exports);
41
41
  __exportStar(require("./referrals"), exports);
42
42
  __exportStar(require("./referralsToMessages"), exports);
43
+ __exportStar(require("./referralPayouts"), exports);
43
44
  __exportStar(require("./senders"), exports);
44
45
  __exportStar(require("./sendgrid"), exports);
45
46
  __exportStar(require("./settings"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/admin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,8CAA2B;AAC3B,gDAA6B;AAC7B,4CAAyB;AACzB,8CAA2B;AAC3B,+CAA4B;AAC5B,+CAA4B;AAC5B,gDAA6B;AAC7B,0CAAuB;AACvB,iDAA8B;AAC9B,8CAA2B;AAC3B,4CAAyB;AACzB,6CAA0B;AAC1B,0CAAuB;AACvB,6CAA0B;AAC1B,4CAAyB;AACzB,yDAAsC;AACtC,sDAAmC;AACnC,gEAA6C;AAC7C,oDAAiC;AACjC,kDAA+B;AAC/B,8CAA2B;AAC3B,sDAAmC;AACnC,oDAAiC;AACjC,8CAA2B;AAC3B,wDAAqC;AACrC,4CAAyB;AACzB,6CAA0B;AAC1B,6CAA0B;AAC1B,2CAAwB;AACxB,yCAAsB;AACtB,wDAAqC;AACrC,uDAAoC;AACpC,4CAAyB","sourcesContent":["export * from './actions'\nexport * from './campaigns'\nexport * from './candidacies'\nexport * from './clients'\nexport * from './dashboard'\nexport * from './educations'\nexport * from './embeddings'\nexport * from './experiences'\nexport * from './files'\nexport * from './jobFunctions'\nexport * from './locations'\nexport * from './matches'\nexport * from './messages'\nexport * from './notes'\nexport * from './partners'\nexport * from './persons'\nexport * from './personsToBestPersons'\nexport * from './personsToNetworks'\nexport * from './personsToProfessionalEvents'\nexport * from './personsToSkills'\nexport * from './personsToTags'\nexport * from './positions'\nexport * from './positionsToSkills'\nexport * from './positionsToTags'\nexport * from './referrals'\nexport * from './referralsToMessages'\nexport * from './senders'\nexport * from './sendgrid'\nexport * from './settings'\nexport * from './skills'\nexport * from './tags'\nexport * from './websiteLandingPages'\nexport * from './websiteStaticPages'\nexport * from './flodesk'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/admin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,8CAA2B;AAC3B,gDAA6B;AAC7B,4CAAyB;AACzB,8CAA2B;AAC3B,+CAA4B;AAC5B,+CAA4B;AAC5B,gDAA6B;AAC7B,0CAAuB;AACvB,iDAA8B;AAC9B,8CAA2B;AAC3B,4CAAyB;AACzB,6CAA0B;AAC1B,0CAAuB;AACvB,6CAA0B;AAC1B,4CAAyB;AACzB,yDAAsC;AACtC,sDAAmC;AACnC,gEAA6C;AAC7C,oDAAiC;AACjC,kDAA+B;AAC/B,8CAA2B;AAC3B,sDAAmC;AACnC,oDAAiC;AACjC,8CAA2B;AAC3B,wDAAqC;AACrC,oDAAiC;AACjC,4CAAyB;AACzB,6CAA0B;AAC1B,6CAA0B;AAC1B,2CAAwB;AACxB,yCAAsB;AACtB,wDAAqC;AACrC,uDAAoC;AACpC,4CAAyB","sourcesContent":["export * from './actions'\nexport * from './campaigns'\nexport * from './candidacies'\nexport * from './clients'\nexport * from './dashboard'\nexport * from './educations'\nexport * from './embeddings'\nexport * from './experiences'\nexport * from './files'\nexport * from './jobFunctions'\nexport * from './locations'\nexport * from './matches'\nexport * from './messages'\nexport * from './notes'\nexport * from './partners'\nexport * from './persons'\nexport * from './personsToBestPersons'\nexport * from './personsToNetworks'\nexport * from './personsToProfessionalEvents'\nexport * from './personsToSkills'\nexport * from './personsToTags'\nexport * from './positions'\nexport * from './positionsToSkills'\nexport * from './positionsToTags'\nexport * from './referrals'\nexport * from './referralsToMessages'\nexport * from './referralPayouts'\nexport * from './senders'\nexport * from './sendgrid'\nexport * from './settings'\nexport * from './skills'\nexport * from './tags'\nexport * from './websiteLandingPages'\nexport * from './websiteStaticPages'\nexport * from './flodesk'\n"]}
@@ -0,0 +1,321 @@
1
+ import { type ListResponse } from '../../../utils';
2
+ import { z } from 'zod/v4';
3
+ export declare const AdminReferralPayoutCreateSchema: import("drizzle-zod").BuildSchema<"insert", {
4
+ id: import("drizzle-orm/pg-core").PgColumn<{
5
+ name: "id";
6
+ tableName: "referral_payouts";
7
+ dataType: "string";
8
+ columnType: "PgUUID";
9
+ data: string;
10
+ driverParam: string;
11
+ notNull: true;
12
+ hasDefault: true;
13
+ isPrimaryKey: true;
14
+ isAutoincrement: false;
15
+ hasRuntimeDefault: false;
16
+ enumValues: undefined;
17
+ baseColumn: never;
18
+ identity: undefined;
19
+ generated: undefined;
20
+ }, {}, {}>;
21
+ referralId: import("drizzle-orm/pg-core").PgColumn<{
22
+ name: "referralId";
23
+ tableName: "referral_payouts";
24
+ dataType: "string";
25
+ columnType: "PgUUID";
26
+ data: string;
27
+ driverParam: string;
28
+ notNull: false;
29
+ hasDefault: false;
30
+ isPrimaryKey: false;
31
+ isAutoincrement: false;
32
+ hasRuntimeDefault: false;
33
+ enumValues: undefined;
34
+ baseColumn: never;
35
+ identity: undefined;
36
+ generated: undefined;
37
+ }, {}, {}>;
38
+ paidAt: import("drizzle-orm/pg-core").PgColumn<{
39
+ name: "paidAt";
40
+ tableName: "referral_payouts";
41
+ dataType: "date";
42
+ columnType: "PgTimestamp";
43
+ data: Date;
44
+ driverParam: string;
45
+ notNull: false;
46
+ hasDefault: false;
47
+ isPrimaryKey: false;
48
+ isAutoincrement: false;
49
+ hasRuntimeDefault: false;
50
+ enumValues: undefined;
51
+ baseColumn: never;
52
+ identity: undefined;
53
+ generated: undefined;
54
+ }, {}, {}>;
55
+ amount: import("drizzle-orm/pg-core").PgColumn<{
56
+ name: "amount";
57
+ tableName: "referral_payouts";
58
+ dataType: "number";
59
+ columnType: "PgInteger";
60
+ data: number;
61
+ driverParam: string | number;
62
+ notNull: false;
63
+ hasDefault: false;
64
+ isPrimaryKey: false;
65
+ isAutoincrement: false;
66
+ hasRuntimeDefault: false;
67
+ enumValues: undefined;
68
+ baseColumn: never;
69
+ identity: undefined;
70
+ generated: undefined;
71
+ }, {}, {}>;
72
+ reason: import("drizzle-orm/pg-core").PgColumn<{
73
+ name: "reason";
74
+ tableName: "referral_payouts";
75
+ dataType: "string";
76
+ columnType: "PgEnumColumn";
77
+ data: "INTERVIEW" | "PLACEMENT";
78
+ driverParam: string;
79
+ notNull: false;
80
+ hasDefault: false;
81
+ isPrimaryKey: false;
82
+ isAutoincrement: false;
83
+ hasRuntimeDefault: false;
84
+ enumValues: ["INTERVIEW" | "PLACEMENT"];
85
+ baseColumn: never;
86
+ identity: undefined;
87
+ generated: undefined;
88
+ }, {}, {}>;
89
+ }, undefined, undefined>;
90
+ export declare const AdminReferralPayoutSelectSchema: import("drizzle-zod").BuildSchema<"select", {
91
+ id: import("drizzle-orm/pg-core").PgColumn<{
92
+ name: "id";
93
+ tableName: "referral_payouts";
94
+ dataType: "string";
95
+ columnType: "PgUUID";
96
+ data: string;
97
+ driverParam: string;
98
+ notNull: true;
99
+ hasDefault: true;
100
+ isPrimaryKey: true;
101
+ isAutoincrement: false;
102
+ hasRuntimeDefault: false;
103
+ enumValues: undefined;
104
+ baseColumn: never;
105
+ identity: undefined;
106
+ generated: undefined;
107
+ }, {}, {}>;
108
+ referralId: import("drizzle-orm/pg-core").PgColumn<{
109
+ name: "referralId";
110
+ tableName: "referral_payouts";
111
+ dataType: "string";
112
+ columnType: "PgUUID";
113
+ data: string;
114
+ driverParam: string;
115
+ notNull: false;
116
+ hasDefault: false;
117
+ isPrimaryKey: false;
118
+ isAutoincrement: false;
119
+ hasRuntimeDefault: false;
120
+ enumValues: undefined;
121
+ baseColumn: never;
122
+ identity: undefined;
123
+ generated: undefined;
124
+ }, {}, {}>;
125
+ paidAt: import("drizzle-orm/pg-core").PgColumn<{
126
+ name: "paidAt";
127
+ tableName: "referral_payouts";
128
+ dataType: "date";
129
+ columnType: "PgTimestamp";
130
+ data: Date;
131
+ driverParam: string;
132
+ notNull: false;
133
+ hasDefault: false;
134
+ isPrimaryKey: false;
135
+ isAutoincrement: false;
136
+ hasRuntimeDefault: false;
137
+ enumValues: undefined;
138
+ baseColumn: never;
139
+ identity: undefined;
140
+ generated: undefined;
141
+ }, {}, {}>;
142
+ amount: import("drizzle-orm/pg-core").PgColumn<{
143
+ name: "amount";
144
+ tableName: "referral_payouts";
145
+ dataType: "number";
146
+ columnType: "PgInteger";
147
+ data: number;
148
+ driverParam: string | number;
149
+ notNull: false;
150
+ hasDefault: false;
151
+ isPrimaryKey: false;
152
+ isAutoincrement: false;
153
+ hasRuntimeDefault: false;
154
+ enumValues: undefined;
155
+ baseColumn: never;
156
+ identity: undefined;
157
+ generated: undefined;
158
+ }, {}, {}>;
159
+ reason: import("drizzle-orm/pg-core").PgColumn<{
160
+ name: "reason";
161
+ tableName: "referral_payouts";
162
+ dataType: "string";
163
+ columnType: "PgEnumColumn";
164
+ data: "INTERVIEW" | "PLACEMENT";
165
+ driverParam: string;
166
+ notNull: false;
167
+ hasDefault: false;
168
+ isPrimaryKey: false;
169
+ isAutoincrement: false;
170
+ hasRuntimeDefault: false;
171
+ enumValues: ["INTERVIEW" | "PLACEMENT"];
172
+ baseColumn: never;
173
+ identity: undefined;
174
+ generated: undefined;
175
+ }, {}, {}>;
176
+ }, undefined, undefined>;
177
+ export declare const AdminReferralPayoutUpdateSchema: import("drizzle-zod").BuildSchema<"update", {
178
+ id: import("drizzle-orm/pg-core").PgColumn<{
179
+ name: "id";
180
+ tableName: "referral_payouts";
181
+ dataType: "string";
182
+ columnType: "PgUUID";
183
+ data: string;
184
+ driverParam: string;
185
+ notNull: true;
186
+ hasDefault: true;
187
+ isPrimaryKey: true;
188
+ isAutoincrement: false;
189
+ hasRuntimeDefault: false;
190
+ enumValues: undefined;
191
+ baseColumn: never;
192
+ identity: undefined;
193
+ generated: undefined;
194
+ }, {}, {}>;
195
+ referralId: import("drizzle-orm/pg-core").PgColumn<{
196
+ name: "referralId";
197
+ tableName: "referral_payouts";
198
+ dataType: "string";
199
+ columnType: "PgUUID";
200
+ data: string;
201
+ driverParam: string;
202
+ notNull: false;
203
+ hasDefault: false;
204
+ isPrimaryKey: false;
205
+ isAutoincrement: false;
206
+ hasRuntimeDefault: false;
207
+ enumValues: undefined;
208
+ baseColumn: never;
209
+ identity: undefined;
210
+ generated: undefined;
211
+ }, {}, {}>;
212
+ paidAt: import("drizzle-orm/pg-core").PgColumn<{
213
+ name: "paidAt";
214
+ tableName: "referral_payouts";
215
+ dataType: "date";
216
+ columnType: "PgTimestamp";
217
+ data: Date;
218
+ driverParam: string;
219
+ notNull: false;
220
+ hasDefault: false;
221
+ isPrimaryKey: false;
222
+ isAutoincrement: false;
223
+ hasRuntimeDefault: false;
224
+ enumValues: undefined;
225
+ baseColumn: never;
226
+ identity: undefined;
227
+ generated: undefined;
228
+ }, {}, {}>;
229
+ amount: import("drizzle-orm/pg-core").PgColumn<{
230
+ name: "amount";
231
+ tableName: "referral_payouts";
232
+ dataType: "number";
233
+ columnType: "PgInteger";
234
+ data: number;
235
+ driverParam: string | number;
236
+ notNull: false;
237
+ hasDefault: false;
238
+ isPrimaryKey: false;
239
+ isAutoincrement: false;
240
+ hasRuntimeDefault: false;
241
+ enumValues: undefined;
242
+ baseColumn: never;
243
+ identity: undefined;
244
+ generated: undefined;
245
+ }, {}, {}>;
246
+ reason: import("drizzle-orm/pg-core").PgColumn<{
247
+ name: "reason";
248
+ tableName: "referral_payouts";
249
+ dataType: "string";
250
+ columnType: "PgEnumColumn";
251
+ data: "INTERVIEW" | "PLACEMENT";
252
+ driverParam: string;
253
+ notNull: false;
254
+ hasDefault: false;
255
+ isPrimaryKey: false;
256
+ isAutoincrement: false;
257
+ hasRuntimeDefault: false;
258
+ enumValues: ["INTERVIEW" | "PLACEMENT"];
259
+ baseColumn: never;
260
+ identity: undefined;
261
+ generated: undefined;
262
+ }, {}, {}>;
263
+ }, undefined, undefined>;
264
+ export declare const AdminReferralPayoutParamsSchema: z.ZodObject<{
265
+ referralId: z.ZodNullable<z.ZodUUID>;
266
+ reason: z.ZodNullable<z.ZodEnum<{
267
+ INTERVIEW: "INTERVIEW";
268
+ PLACEMENT: "PLACEMENT";
269
+ }>>;
270
+ paidAt: z.ZodNullable<z.ZodDate>;
271
+ amount: z.ZodNullable<z.ZodInt>;
272
+ }, {
273
+ out: {};
274
+ in: {};
275
+ }>;
276
+ export declare const AdminReferralPayoutListQuerySchema: z.ZodObject<{
277
+ limit: z.ZodOptional<z.ZodNumber>;
278
+ offset: z.ZodOptional<z.ZodNumber>;
279
+ sort: z.ZodOptional<z.ZodObject<{
280
+ field: z.ZodString;
281
+ direction: z.ZodEnum<{
282
+ asc: "asc";
283
+ desc: "desc";
284
+ }>;
285
+ }, z.core.$strip>>;
286
+ filter: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
287
+ }, z.core.$strip>;
288
+ export declare const AdminReferralPayoutUpdateParamsSchema: z.ZodObject<{
289
+ referralId: z.ZodNullable<z.ZodUUID>;
290
+ reason: z.ZodNullable<z.ZodEnum<{
291
+ INTERVIEW: "INTERVIEW";
292
+ PLACEMENT: "PLACEMENT";
293
+ }>>;
294
+ paidAt: z.ZodNullable<z.ZodDate>;
295
+ amount: z.ZodNullable<z.ZodInt>;
296
+ }, {
297
+ out: {};
298
+ in: {};
299
+ }>;
300
+ export declare const AdminReferralPayoutDeleteParamsSchema: z.ZodObject<{
301
+ referralId: z.ZodNullable<z.ZodUUID>;
302
+ reason: z.ZodNullable<z.ZodEnum<{
303
+ INTERVIEW: "INTERVIEW";
304
+ PLACEMENT: "PLACEMENT";
305
+ }>>;
306
+ paidAt: z.ZodNullable<z.ZodDate>;
307
+ amount: z.ZodNullable<z.ZodInt>;
308
+ }, {
309
+ out: {};
310
+ in: {};
311
+ }>;
312
+ type AdminReferralPayout = z.infer<typeof AdminReferralPayoutSelectSchema>;
313
+ export type AdminReferralPayoutParams = z.infer<typeof AdminReferralPayoutParamsSchema>;
314
+ export type AdminReferralPayoutResult = AdminReferralPayout;
315
+ export type AdminReferralPayoutListQuery = z.infer<typeof AdminReferralPayoutListQuerySchema>;
316
+ export type AdminReferralPayoutListResult = ListResponse<z.infer<typeof AdminReferralPayoutSelectSchema>>;
317
+ export type AdminReferralPayoutCreateInput = z.infer<typeof AdminReferralPayoutCreateSchema>;
318
+ export type AdminReferralPayoutUpdateParams = z.infer<typeof AdminReferralPayoutUpdateParamsSchema>;
319
+ export type AdminReferralPayoutUpdateInput = Partial<AdminReferralPayout>;
320
+ export type AdminReferralPayoutDeleteParams = z.infer<typeof AdminReferralPayoutDeleteParamsSchema>;
321
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminReferralPayoutDeleteParamsSchema = exports.AdminReferralPayoutUpdateParamsSchema = exports.AdminReferralPayoutListQuerySchema = exports.AdminReferralPayoutParamsSchema = exports.AdminReferralPayoutUpdateSchema = exports.AdminReferralPayoutSelectSchema = exports.AdminReferralPayoutCreateSchema = void 0;
4
+ const drizzle_zod_1 = require("drizzle-zod");
5
+ const core_1 = require("../../core");
6
+ const utils_1 = require("../../../utils");
7
+ const defaultParams = {
8
+ referralId: true,
9
+ amount: true,
10
+ paidAt: true,
11
+ reason: true
12
+ };
13
+ //// validators
14
+ exports.AdminReferralPayoutCreateSchema = (0, drizzle_zod_1.createInsertSchema)(core_1.referralPayout);
15
+ exports.AdminReferralPayoutSelectSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.referralPayout);
16
+ exports.AdminReferralPayoutUpdateSchema = (0, drizzle_zod_1.createUpdateSchema)(core_1.referralPayout);
17
+ exports.AdminReferralPayoutParamsSchema = exports.AdminReferralPayoutSelectSchema.pick(defaultParams);
18
+ exports.AdminReferralPayoutListQuerySchema = utils_1.ListQuerySchema;
19
+ exports.AdminReferralPayoutUpdateParamsSchema = exports.AdminReferralPayoutParamsSchema.pick(defaultParams);
20
+ exports.AdminReferralPayoutDeleteParamsSchema = exports.AdminReferralPayoutParamsSchema.pick(defaultParams);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/admin/referralPayouts/index.ts"],"names":[],"mappings":";;;AAAA,6CAIoB;AACpB,qCAA2C;AAC3C,0CAAmE;AAGnE,MAAM,aAAa,GAAG;IACpB,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;CACJ,CAAA;AAEV,eAAe;AAEF,QAAA,+BAA+B,GAC1C,IAAA,gCAAkB,EAAC,qBAAc,CAAC,CAAA;AACvB,QAAA,+BAA+B,GAC1C,IAAA,gCAAkB,EAAC,qBAAc,CAAC,CAAA;AACvB,QAAA,+BAA+B,GAC1C,IAAA,gCAAkB,EAAC,qBAAc,CAAC,CAAA;AAEvB,QAAA,+BAA+B,GAC1C,uCAA+B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;AACxC,QAAA,kCAAkC,GAAG,uBAAe,CAAA;AACpD,QAAA,qCAAqC,GAChD,uCAA+B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;AACxC,QAAA,qCAAqC,GAChD,uCAA+B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA","sourcesContent":["import {\n createInsertSchema,\n createSelectSchema,\n createUpdateSchema\n} from 'drizzle-zod'\nimport { referralPayout } from '../../core'\nimport { ListQuerySchema, type ListResponse } from '../../../utils'\nimport { z } from 'zod/v4'\n\nconst defaultParams = {\n referralId: true,\n amount: true,\n paidAt: true,\n reason: true\n} as const\n\n//// validators\n\nexport const AdminReferralPayoutCreateSchema =\n createInsertSchema(referralPayout)\nexport const AdminReferralPayoutSelectSchema =\n createSelectSchema(referralPayout)\nexport const AdminReferralPayoutUpdateSchema =\n createUpdateSchema(referralPayout)\n\nexport const AdminReferralPayoutParamsSchema =\n AdminReferralPayoutSelectSchema.pick(defaultParams)\nexport const AdminReferralPayoutListQuerySchema = ListQuerySchema\nexport const AdminReferralPayoutUpdateParamsSchema =\n AdminReferralPayoutParamsSchema.pick(defaultParams)\nexport const AdminReferralPayoutDeleteParamsSchema =\n AdminReferralPayoutParamsSchema.pick(defaultParams)\n\n//// types\n\ntype AdminReferralPayout = z.infer<typeof AdminReferralPayoutSelectSchema>\n\n// detail\nexport type AdminReferralPayoutParams = z.infer<\n typeof AdminReferralPayoutParamsSchema\n>\nexport type AdminReferralPayoutResult = AdminReferralPayout\n\n// list\nexport type AdminReferralPayoutListQuery = z.infer<\n typeof AdminReferralPayoutListQuerySchema\n>\nexport type AdminReferralPayoutListResult = ListResponse<\n z.infer<typeof AdminReferralPayoutSelectSchema>\n>\n\n// create\nexport type AdminReferralPayoutCreateInput = z.infer<\n typeof AdminReferralPayoutCreateSchema\n>\n\n// update\nexport type AdminReferralPayoutUpdateParams = z.infer<\n typeof AdminReferralPayoutUpdateParamsSchema\n>\nexport type AdminReferralPayoutUpdateInput = Partial<AdminReferralPayout>\n\n// delete\nexport type AdminReferralPayoutDeleteParams = z.infer<\n typeof AdminReferralPayoutDeleteParamsSchema\n>\n"]}
@@ -188,6 +188,23 @@ export declare const AdminReferralCreateSchema: import("drizzle-zod").BuildSchem
188
188
  identity: undefined;
189
189
  generated: undefined;
190
190
  }, {}, {}>;
191
+ relationship: import("drizzle-orm/pg-core").PgColumn<{
192
+ name: "relationship";
193
+ tableName: "referrals";
194
+ dataType: "string";
195
+ columnType: "PgText";
196
+ data: string;
197
+ driverParam: string;
198
+ notNull: false;
199
+ hasDefault: false;
200
+ isPrimaryKey: false;
201
+ isAutoincrement: false;
202
+ hasRuntimeDefault: false;
203
+ enumValues: [string, ...string[]];
204
+ baseColumn: never;
205
+ identity: undefined;
206
+ generated: undefined;
207
+ }, {}, {}>;
191
208
  deletedAt: import("drizzle-orm/pg-core").PgColumn<{
192
209
  name: "deletedAt";
193
210
  tableName: "referrals";
@@ -272,6 +289,7 @@ export declare const AdminReferralSelectSchema: z.ZodObject<{
272
289
  campaignId: z.ZodNullable<z.ZodUUID>;
273
290
  positionId: z.ZodNullable<z.ZodUUID>;
274
291
  reason: z.ZodNullable<z.ZodString>;
292
+ relationship: z.ZodNullable<z.ZodString>;
275
293
  deletedAt: z.ZodNullable<z.ZodDate>;
276
294
  createdAt: z.ZodDate;
277
295
  updatedAt: z.ZodDate;
@@ -356,6 +374,18 @@ export declare const AdminReferralSelectSchema: z.ZodObject<{
356
374
  out: {};
357
375
  in: {};
358
376
  }>>>;
377
+ payouts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
378
+ id: z.ZodUUID;
379
+ reason: z.ZodNullable<z.ZodEnum<{
380
+ INTERVIEW: "INTERVIEW";
381
+ PLACEMENT: "PLACEMENT";
382
+ }>>;
383
+ paidAt: z.ZodNullable<z.ZodDate>;
384
+ amount: z.ZodNullable<z.ZodInt>;
385
+ }, {
386
+ out: {};
387
+ in: {};
388
+ }>>>>;
359
389
  }, {
360
390
  out: {};
361
391
  in: {};
@@ -548,6 +578,23 @@ export declare const AdminReferralUpdateSchema: import("drizzle-zod").BuildSchem
548
578
  identity: undefined;
549
579
  generated: undefined;
550
580
  }, {}, {}>;
581
+ relationship: import("drizzle-orm/pg-core").PgColumn<{
582
+ name: "relationship";
583
+ tableName: "referrals";
584
+ dataType: "string";
585
+ columnType: "PgText";
586
+ data: string;
587
+ driverParam: string;
588
+ notNull: false;
589
+ hasDefault: false;
590
+ isPrimaryKey: false;
591
+ isAutoincrement: false;
592
+ hasRuntimeDefault: false;
593
+ enumValues: [string, ...string[]];
594
+ baseColumn: never;
595
+ identity: undefined;
596
+ generated: undefined;
597
+ }, {}, {}>;
551
598
  deletedAt: import("drizzle-orm/pg-core").PgColumn<{
552
599
  name: "deletedAt";
553
600
  tableName: "referrals";
@@ -4,6 +4,7 @@ exports.AdminReferralDeleteParamsSchema = exports.AdminReferralUpdateParamsSchem
4
4
  const drizzle_zod_1 = require("drizzle-zod");
5
5
  const core_1 = require("../../core");
6
6
  const utils_1 = require("../../../utils");
7
+ const v4_1 = require("zod/v4");
7
8
  //// validators
8
9
  exports.AdminReferralCreateSchema = (0, drizzle_zod_1.createInsertSchema)(core_1.referral);
9
10
  exports.AdminReferralPersonSelectSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
@@ -56,6 +57,15 @@ exports.AdminReferralSelectSchema = (0, drizzle_zod_1.createSelectSchema)(core_1
56
57
  .nullable()
57
58
  .optional()
58
59
  })
60
+ .nullable()
61
+ .optional(),
62
+ payouts: v4_1.z
63
+ .array((0, drizzle_zod_1.createSelectSchema)(core_1.referralPayout).pick({
64
+ id: true,
65
+ amount: true,
66
+ paidAt: true,
67
+ reason: true
68
+ }))
59
69
  .nullable()
60
70
  .optional()
61
71
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/admin/referrals/index.ts"],"names":[],"mappings":";;;AAAA,6CAIoB;AACpB,qCAA0E;AAC1E,0CAAmE;AAGnE,eAAe;AAEF,QAAA,yBAAyB,GAAG,IAAA,gCAAkB,EAAC,eAAQ,CAAC,CAAA;AACxD,QAAA,+BAA+B,GAAG,IAAA,gCAAkB,EAAC,aAAM,CAAC,CAAC,IAAI,CAAC;IAC7E,EAAE,EAAE,IAAI;IACR,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI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AAExD,QAAA,yBAAyB,GAAG,iCAAyB,CAAC,IAAI,CAAC;IACtE,EAAE,EAAE,IAAI;CACT,CAAC,CAAA;AACW,QAAA,4BAA4B,GAAG,uBAAe,CAAC,MAAM,CAAC;IACjE,MAAM,EAAE,iCAAyB,CAAC,IAAI,CAAC;QACrC,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;KACjB,CAAC;SACC,OAAO,EAAE;SACT,QAAQ,EAAE;CACd,CAAC,CAAA;AAEW,QAAA,+BAA+B,GAAG,iCAAyB,CAAA;AAC3D,QAAA,+BAA+B,GAAG,iCAAyB,CAAA","sourcesContent":["import {\n createInsertSchema,\n createSelectSchema,\n createUpdateSchema\n} from 'drizzle-zod'\nimport { campaign, candidacy, client, person, referral } from '../../core'\nimport { ListQuerySchema, type ListResponse } from '../../../utils'\nimport { z } from 'zod/v4'\n\n//// validators\n\nexport const AdminReferralCreateSchema = createInsertSchema(referral)\nexport const AdminReferralPersonSelectSchema = createSelectSchema(person).pick({\n id: true,\n firstName: true,\n lastName: true,\n fullName: true,\n photoUri: true,\n email: true\n})\nexport const AdminReferralSelectSchema = createSelectSchema(referral).extend({\n referrer: AdminReferralPersonSelectSchema.optional(),\n candidacy: createSelectSchema(candidacy)\n .pick({\n id: true,\n stage: true\n })\n .extend({\n person: AdminReferralPersonSelectSchema.optional()\n })\n .nullable()\n .optional(),\n client: createSelectSchema(client)\n .pick({\n id: true,\n name: true,\n isLead: true\n })\n .nullable()\n .optional(),\n clientPerson: AdminReferralPersonSelectSchema.nullable().optional(),\n campaign: createSelectSchema(campaign)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n .optional(),\n position: createSelectSchema(campaign)\n .pick({\n id: true,\n name: true\n })\n .extend({\n client: createSelectSchema(client)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n .optional()\n })\n .nullable()\n .optional()\n})\nexport const AdminReferralUpdateSchema = createUpdateSchema(referral)\n\nexport const AdminReferralParamsSchema = AdminReferralSelectSchema.pick({\n id: true\n})\nexport const AdminReferralListQuerySchema = ListQuerySchema.extend({\n filter: AdminReferralSelectSchema.pick({\n referrerId: true,\n clientId: true,\n positionId: true\n })\n .partial()\n .optional()\n})\n\nexport const AdminReferralUpdateParamsSchema = AdminReferralParamsSchema\nexport const AdminReferralDeleteParamsSchema = AdminReferralParamsSchema\n\n//// types\n\ntype AdminReferral = z.infer<typeof AdminReferralSelectSchema>\n\n// detail\nexport type AdminReferralParams = z.infer<typeof AdminReferralParamsSchema>\nexport type AdminReferralResult = AdminReferral\n\n// list\nexport type AdminReferralListQuery = z.infer<\n typeof AdminReferralListQuerySchema\n>\nexport type AdminReferralListResult = ListResponse<\n z.infer<typeof AdminReferralSelectSchema>\n>\n\n// create\nexport type AdminReferralCreateInput = z.infer<typeof AdminReferralCreateSchema>\nexport type AdminReferralCreateResult = Pick<AdminReferral, 'id'>\n\n// update\nexport type AdminReferralUpdateParams = z.infer<\n typeof AdminReferralUpdateParamsSchema\n>\nexport type AdminReferralUpdateInput = Partial<AdminReferral>\n\n// delete\nexport type AdminReferralDeleteParams = z.infer<\n typeof AdminReferralDeleteParamsSchema\n>\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/admin/referrals/index.ts"],"names":[],"mappings":";;;AAAA,6CAIoB;AACpB,qCAOmB;AACnB,0CAAmE;AACnE,+BAA0B;AAE1B,eAAe;AAEF,QAAA,yBAAyB,GAAG,IAAA,gCAAkB,EAAC,eAAQ,CAAC,CAAA;AACxD,QAAA,+BAA+B,GAAG,IAAA,gCAAkB,EAAC,aAAM,CAAC,CAAC,IAAI,CAAC;IAC7E,EAAE,EAAE,IAAI;IACR,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;CACZ,CAAC,CAAA;AACW,QAAA,yBAAyB,GAAG,IAAA,gCAAkB,EAA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MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACb,CAAC,CACH;SACA,QAAQ,EAAE;SACV,QAAQ,EAAE;CACd,CAAC,CAAA;AACW,QAAA,yBAAyB,GAAG,IAAA,gCAAkB,EAAC,eAAQ,CAAC,CAAA;AAExD,QAAA,yBAAyB,GAAG,iCAAyB,CAAC,IAAI,CAAC;IACtE,EAAE,EAAE,IAAI;CACT,CAAC,CAAA;AACW,QAAA,4BAA4B,GAAG,uBAAe,CAAC,MAAM,CAAC;IACjE,MAAM,EAAE,iCAAyB,CAAC,IAAI,CAAC;QACrC,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;KACjB,CAAC;SACC,OAAO,EAAE;SACT,QAAQ,EAAE;CACd,CAAC,CAAA;AAEW,QAAA,+BAA+B,GAAG,iCAAyB,CAAA;AAC3D,QAAA,+BAA+B,GAAG,iCAAyB,CAAA","sourcesContent":["import {\n createInsertSchema,\n createSelectSchema,\n createUpdateSchema\n} from 'drizzle-zod'\nimport {\n campaign,\n candidacy,\n client,\n person,\n referral,\n referralPayout\n} from '../../core'\nimport { ListQuerySchema, type ListResponse } from '../../../utils'\nimport { z } from 'zod/v4'\n\n//// validators\n\nexport const AdminReferralCreateSchema = createInsertSchema(referral)\nexport const AdminReferralPersonSelectSchema = createSelectSchema(person).pick({\n id: true,\n firstName: true,\n lastName: true,\n fullName: true,\n photoUri: true,\n email: true\n})\nexport const AdminReferralSelectSchema = createSelectSchema(referral).extend({\n referrer: AdminReferralPersonSelectSchema.optional(),\n candidacy: createSelectSchema(candidacy)\n .pick({\n id: true,\n stage: true\n })\n .extend({\n person: AdminReferralPersonSelectSchema.optional()\n })\n .nullable()\n .optional(),\n client: createSelectSchema(client)\n .pick({\n id: true,\n name: true,\n isLead: true\n })\n .nullable()\n .optional(),\n clientPerson: AdminReferralPersonSelectSchema.nullable().optional(),\n campaign: createSelectSchema(campaign)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n .optional(),\n position: createSelectSchema(campaign)\n .pick({\n id: true,\n name: true\n })\n .extend({\n client: createSelectSchema(client)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n .optional()\n })\n .nullable()\n .optional(),\n payouts: z\n .array(\n createSelectSchema(referralPayout).pick({\n id: true,\n amount: true,\n paidAt: true,\n reason: true\n })\n )\n .nullable()\n .optional()\n})\nexport const AdminReferralUpdateSchema = createUpdateSchema(referral)\n\nexport const AdminReferralParamsSchema = AdminReferralSelectSchema.pick({\n id: true\n})\nexport const AdminReferralListQuerySchema = ListQuerySchema.extend({\n filter: AdminReferralSelectSchema.pick({\n referrerId: true,\n clientId: true,\n positionId: true\n })\n .partial()\n .optional()\n})\n\nexport const AdminReferralUpdateParamsSchema = AdminReferralParamsSchema\nexport const AdminReferralDeleteParamsSchema = AdminReferralParamsSchema\n\n//// types\n\ntype AdminReferral = z.infer<typeof AdminReferralSelectSchema>\n\n// detail\nexport type AdminReferralParams = z.infer<typeof AdminReferralParamsSchema>\nexport type AdminReferralResult = AdminReferral\n\n// list\nexport type AdminReferralListQuery = z.infer<\n typeof AdminReferralListQuerySchema\n>\nexport type AdminReferralListResult = ListResponse<\n z.infer<typeof AdminReferralSelectSchema>\n>\n\n// create\nexport type AdminReferralCreateInput = z.infer<typeof AdminReferralCreateSchema>\nexport type AdminReferralCreateResult = Pick<AdminReferral, 'id'>\n\n// update\nexport type AdminReferralUpdateParams = z.infer<\n typeof AdminReferralUpdateParamsSchema\n>\nexport type AdminReferralUpdateInput = Partial<AdminReferral>\n\n// delete\nexport type AdminReferralDeleteParams = z.infer<\n typeof AdminReferralDeleteParamsSchema\n>\n"]}
@@ -6305,6 +6305,23 @@ export declare const referral: import("drizzle-orm/pg-core").PgTableWithColumns<
6305
6305
  identity: undefined;
6306
6306
  generated: undefined;
6307
6307
  }, {}, {}>;
6308
+ relationship: import("drizzle-orm/pg-core").PgColumn<{
6309
+ name: "relationship";
6310
+ tableName: "referrals";
6311
+ dataType: "string";
6312
+ columnType: "PgText";
6313
+ data: string;
6314
+ driverParam: string;
6315
+ notNull: false;
6316
+ hasDefault: false;
6317
+ isPrimaryKey: false;
6318
+ isAutoincrement: false;
6319
+ hasRuntimeDefault: false;
6320
+ enumValues: [string, ...string[]];
6321
+ baseColumn: never;
6322
+ identity: undefined;
6323
+ generated: undefined;
6324
+ }, {}, {}>;
6308
6325
  deletedAt: import("drizzle-orm/pg-core").PgColumn<{
6309
6326
  name: "deletedAt";
6310
6327
  tableName: "referrals";
@@ -1122,6 +1122,7 @@ exports.referral = (0, pg_core_1.pgTable)('referrals', {
1122
1122
  campaignId: (0, pg_core_1.uuid)(),
1123
1123
  positionId: (0, pg_core_1.uuid)(),
1124
1124
  reason: (0, pg_core_1.text)(),
1125
+ relationship: (0, pg_core_1.text)(),
1125
1126
  deletedAt: (0, pg_core_1.timestamp)({ precision: 3, mode: 'date', withTimezone: true }),
1126
1127
  createdAt: (0, pg_core_1.timestamp)({ precision: 3, mode: 'date', withTimezone: true })
1127
1128
  .defaultNow()