@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.
- package/dist/schema/admin/index.d.ts +1 -0
- package/dist/schema/admin/index.js +1 -0
- package/dist/schema/admin/index.js.map +1 -1
- package/dist/schema/admin/referralPayouts/index.d.ts +321 -0
- package/dist/schema/admin/referralPayouts/index.js +21 -0
- package/dist/schema/admin/referralPayouts/index.js.map +1 -0
- package/dist/schema/admin/referrals/index.d.ts +47 -0
- package/dist/schema/admin/referrals/index.js +10 -0
- package/dist/schema/admin/referrals/index.js.map +1 -1
- package/dist/schema/core.d.ts +17 -0
- package/dist/schema/core.js +1 -0
- package/dist/schema/core.js.map +1 -1
- package/dist/schema/public/account/index.d.ts +72 -0
- package/dist/schema/public/account/index.js +88 -0
- package/dist/schema/public/account/index.js.map +1 -0
- package/dist/schema/public/refer/index.d.ts +6 -0
- package/dist/schema/public/refer/index.js +16 -8
- package/dist/schema/public/refer/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { ListResponse } from '../../../utils';
|
|
3
|
+
export declare const PublicAccountSelectSchema: z.ZodObject<{
|
|
4
|
+
email: z.ZodString;
|
|
5
|
+
idNano: z.ZodString;
|
|
6
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
7
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
8
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
9
|
+
}, {
|
|
10
|
+
out: {};
|
|
11
|
+
in: {};
|
|
12
|
+
}>;
|
|
13
|
+
export declare const PublicAccountUpdateSchema: z.ZodObject<{
|
|
14
|
+
email: z.ZodEmail;
|
|
15
|
+
firstName: z.ZodString;
|
|
16
|
+
lastName: z.ZodString;
|
|
17
|
+
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export declare const PublicAccountReferralSelectSchema: z.ZodObject<{
|
|
20
|
+
person: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
wasHired: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
23
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
client: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
hasHired: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
client: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
}, {
|
|
33
|
+
out: {};
|
|
34
|
+
in: {};
|
|
35
|
+
}>>;
|
|
36
|
+
candidacy: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
person: z.ZodObject<{
|
|
38
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
39
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
stage: z.ZodString;
|
|
42
|
+
}, z.core.$strict>>;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
}, z.core.$strict>>;
|
|
45
|
+
createdAt: z.ZodDate;
|
|
46
|
+
referralType: z.ZodNullable<z.ZodEnum<{
|
|
47
|
+
CLIENT: "CLIENT";
|
|
48
|
+
PERSON: "PERSON";
|
|
49
|
+
CANDIDACY: "CANDIDACY";
|
|
50
|
+
}>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export declare const PublicAccountApplicationSelectSchema: z.ZodObject<{
|
|
53
|
+
client: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
}, {
|
|
56
|
+
out: {};
|
|
57
|
+
in: {};
|
|
58
|
+
}>>;
|
|
59
|
+
position: z.ZodObject<{
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
}, {
|
|
62
|
+
out: {};
|
|
63
|
+
in: {};
|
|
64
|
+
}>;
|
|
65
|
+
candidacy: {
|
|
66
|
+
stage: z.ZodString;
|
|
67
|
+
};
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export type PublicAccountResult = z.infer<typeof PublicAccountSelectSchema>;
|
|
70
|
+
export type PublicAccountUpdateInput = z.infer<typeof PublicAccountUpdateSchema>;
|
|
71
|
+
export type PublicAccountReferralListResult = ListResponse<z.infer<typeof PublicAccountReferralSelectSchema>>;
|
|
72
|
+
export type PublicAccountApplicationListResult = ListResponse<z.infer<typeof PublicAccountApplicationSelectSchema>>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicAccountApplicationSelectSchema = exports.PublicAccountReferralSelectSchema = exports.PublicAccountUpdateSchema = exports.PublicAccountSelectSchema = void 0;
|
|
4
|
+
const drizzle_zod_1 = require("drizzle-zod");
|
|
5
|
+
const core_1 = require("../../core");
|
|
6
|
+
const v4_1 = require("zod/v4");
|
|
7
|
+
const utils_1 = require("../../../utils");
|
|
8
|
+
//// validators
|
|
9
|
+
exports.PublicAccountSelectSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
|
|
10
|
+
idNano: true,
|
|
11
|
+
firstName: true,
|
|
12
|
+
lastName: true,
|
|
13
|
+
email: true,
|
|
14
|
+
phone: true
|
|
15
|
+
});
|
|
16
|
+
exports.PublicAccountUpdateSchema = v4_1.z.strictObject({
|
|
17
|
+
...(0, drizzle_zod_1.createUpdateSchema)(core_1.person, {
|
|
18
|
+
firstName: utils_1.PersonFirstNameSchema,
|
|
19
|
+
lastName: utils_1.PersonLastNameSchema,
|
|
20
|
+
phone: utils_1.OptionalPhoneSchema,
|
|
21
|
+
email: utils_1.EmailSchema
|
|
22
|
+
}).pick({
|
|
23
|
+
firstName: true,
|
|
24
|
+
lastName: true,
|
|
25
|
+
phone: true,
|
|
26
|
+
email: true
|
|
27
|
+
}).shape
|
|
28
|
+
});
|
|
29
|
+
exports.PublicAccountReferralSelectSchema = v4_1.z.strictObject({
|
|
30
|
+
...(0, drizzle_zod_1.createSelectSchema)(core_1.referral).pick({
|
|
31
|
+
referralType: true,
|
|
32
|
+
createdAt: true
|
|
33
|
+
}).shape,
|
|
34
|
+
person: v4_1.z
|
|
35
|
+
.strictObject({
|
|
36
|
+
...(0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
|
|
37
|
+
firstName: true,
|
|
38
|
+
lastName: true
|
|
39
|
+
}).shape,
|
|
40
|
+
wasHired: v4_1.z.boolean().optional()
|
|
41
|
+
})
|
|
42
|
+
.optional(),
|
|
43
|
+
client: v4_1.z
|
|
44
|
+
.strictObject({
|
|
45
|
+
...(0, drizzle_zod_1.createSelectSchema)(core_1.client).pick({
|
|
46
|
+
name: true
|
|
47
|
+
}).shape,
|
|
48
|
+
hasHired: v4_1.z.boolean().optional()
|
|
49
|
+
})
|
|
50
|
+
.optional(),
|
|
51
|
+
position: v4_1.z
|
|
52
|
+
.strictObject({
|
|
53
|
+
...(0, drizzle_zod_1.createSelectSchema)(core_1.position).pick({
|
|
54
|
+
name: true
|
|
55
|
+
}).shape,
|
|
56
|
+
client: (0, drizzle_zod_1.createSelectSchema)(core_1.client)
|
|
57
|
+
.pick({
|
|
58
|
+
name: true
|
|
59
|
+
})
|
|
60
|
+
.optional(),
|
|
61
|
+
candidacy: v4_1.z
|
|
62
|
+
.strictObject({
|
|
63
|
+
person: v4_1.z.strictObject({
|
|
64
|
+
...(0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
|
|
65
|
+
firstName: true,
|
|
66
|
+
lastName: true
|
|
67
|
+
}).shape
|
|
68
|
+
}),
|
|
69
|
+
stage: v4_1.z.string()
|
|
70
|
+
})
|
|
71
|
+
.optional()
|
|
72
|
+
})
|
|
73
|
+
.optional()
|
|
74
|
+
});
|
|
75
|
+
exports.PublicAccountApplicationSelectSchema = v4_1.z.strictObject({
|
|
76
|
+
client: (0, drizzle_zod_1.createSelectSchema)(core_1.client)
|
|
77
|
+
.pick({
|
|
78
|
+
name: true
|
|
79
|
+
})
|
|
80
|
+
.optional(),
|
|
81
|
+
position: (0, drizzle_zod_1.createSelectSchema)(core_1.position).pick({
|
|
82
|
+
name: true
|
|
83
|
+
}),
|
|
84
|
+
candidacy: {
|
|
85
|
+
stage: v4_1.z.string()
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/public/account/index.ts"],"names":[],"mappings":";;;AAAA,6CAAoE;AACpE,qCAA+D;AAC/D,+BAA0B;AAC1B,0CAMuB;AAEvB,eAAe;AAEF,QAAA,yBAAyB,GAAG,IAAA,gCAAkB,EAAC,aAAM,CAAC,CAAC,IAAI,CAAC;IACvE,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACZ,CAAC,CAAA;AAEW,QAAA,yBAAyB,GAAG,MAAC,CAAC,YAAY,CAAC;IACtD,GAAG,IAAA,gCAAkB,EAAC,aAAM,EAAE;QAC5B,SAAS,EAAE,6BAAqB;QAChC,QAAQ,EAAE,4BAAoB;QAC9B,KAAK,EAAE,2BAAmB;QAC1B,KAAK,EAAE,mBAAW;KACnB,CAAC,CAAC,IAAI,CAAC;QACN,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC,KAAK;CACT,CAAC,CAAA;AAEW,QAAA,iCAAiC,GAAG,MAAC,CAAC,YAAY,CAAC;IAC9D,GAAG,IAAA,gCAAkB,EAAC,eAAQ,CAAC,C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oC,GAAG,MAAC,CAAC,YAAY,CAAC;IACjE,MAAM,EAAE,IAAA,gCAAkB,EAAC,aAAM,CAAC;SAC/B,IAAI,CAAC;QACJ,IAAI,EAAE,IAAI;KACX,CAAC;SACD,QAAQ,EAAE;IACb,QAAQ,EAAE,IAAA,gCAAkB,EAAC,eAAQ,CAAC,CAAC,IAAI,CAAC;QAC1C,IAAI,EAAE,IAAI;KACX,CAAC;IACF,SAAS,EAAE;QACT,KAAK,EAAE,MAAC,CAAC,MAAM,EAAE;KAClB;CACF,CAAC,CAAA","sourcesContent":["import { createSelectSchema, createUpdateSchema } from 'drizzle-zod'\nimport { client, person, position, referral } from '../../core'\nimport { z } from 'zod/v4'\nimport {\n EmailSchema,\n ListResponse,\n OptionalPhoneSchema,\n PersonFirstNameSchema,\n PersonLastNameSchema\n} from '../../../utils'\n\n//// validators\n\nexport const PublicAccountSelectSchema = createSelectSchema(person).pick({\n idNano: true,\n firstName: true,\n lastName: true,\n email: true,\n phone: true\n})\n\nexport const PublicAccountUpdateSchema = z.strictObject({\n ...createUpdateSchema(person, {\n firstName: PersonFirstNameSchema,\n lastName: PersonLastNameSchema,\n phone: OptionalPhoneSchema,\n email: EmailSchema\n }).pick({\n firstName: true,\n lastName: true,\n phone: true,\n email: true\n }).shape\n})\n\nexport const PublicAccountReferralSelectSchema = z.strictObject({\n ...createSelectSchema(referral).pick({\n referralType: true,\n createdAt: true\n }).shape,\n person: z\n .strictObject({\n ...createSelectSchema(person).pick({\n firstName: true,\n lastName: true\n }).shape,\n wasHired: z.boolean().optional()\n })\n .optional(),\n client: z\n .strictObject({\n ...createSelectSchema(client).pick({\n name: true\n }).shape,\n hasHired: z.boolean().optional()\n })\n .optional(),\n position: z\n .strictObject({\n ...createSelectSchema(position).pick({\n name: true\n }).shape,\n client: createSelectSchema(client)\n .pick({\n name: true\n })\n .optional(),\n candidacy: z\n .strictObject({\n person: z.strictObject({\n ...createSelectSchema(person).pick({\n firstName: true,\n lastName: true\n }).shape\n }),\n stage: z.string()\n })\n .optional()\n })\n .optional()\n})\n\nexport const PublicAccountApplicationSelectSchema = z.strictObject({\n client: createSelectSchema(client)\n .pick({\n name: true\n })\n .optional(),\n position: createSelectSchema(position).pick({\n name: true\n }),\n candidacy: {\n stage: z.string()\n }\n})\n\n//// types\n\nexport type PublicAccountResult = z.infer<typeof PublicAccountSelectSchema>\n\nexport type PublicAccountUpdateInput = z.infer<typeof PublicAccountUpdateSchema>\n\nexport type PublicAccountReferralListResult = ListResponse<\n z.infer<typeof PublicAccountReferralSelectSchema>\n>\n\nexport type PublicAccountApplicationListResult = ListResponse<\n z.infer<typeof PublicAccountApplicationSelectSchema>\n>\n"]}
|
|
@@ -13,6 +13,7 @@ export declare const PublicReferClientSignedInCreateSchema: z.ZodObject<{
|
|
|
13
13
|
}, z.core.$strict>;
|
|
14
14
|
campaignIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
15
15
|
reason: z.ZodString;
|
|
16
|
+
relationship: z.ZodString;
|
|
16
17
|
}, z.core.$strict>;
|
|
17
18
|
export declare const PublicReferClientSignedOutCreateSchema: z.ZodObject<{
|
|
18
19
|
referrer: z.ZodObject<{
|
|
@@ -37,6 +38,7 @@ export declare const PublicReferClientSignedOutCreateSchema: z.ZodObject<{
|
|
|
37
38
|
affiliateIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
38
39
|
campaignIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
39
40
|
reason: z.ZodString;
|
|
41
|
+
relationship: z.ZodString;
|
|
40
42
|
}, z.core.$strict>;
|
|
41
43
|
export declare const PublicReferCandidacySignedInCreateSchema: z.ZodObject<{
|
|
42
44
|
referred: z.ZodObject<{
|
|
@@ -48,6 +50,7 @@ export declare const PublicReferCandidacySignedInCreateSchema: z.ZodObject<{
|
|
|
48
50
|
}, z.core.$strict>;
|
|
49
51
|
campaignIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
50
52
|
reason: z.ZodString;
|
|
53
|
+
relationship: z.ZodString;
|
|
51
54
|
}, z.core.$strict>;
|
|
52
55
|
export declare const PublicReferCandidacySignedOutCreateSchema: z.ZodObject<{
|
|
53
56
|
referrer: z.ZodObject<{
|
|
@@ -68,6 +71,7 @@ export declare const PublicReferCandidacySignedOutCreateSchema: z.ZodObject<{
|
|
|
68
71
|
affiliateIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
69
72
|
campaignIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
70
73
|
reason: z.ZodString;
|
|
74
|
+
relationship: z.ZodString;
|
|
71
75
|
}, z.core.$strict>;
|
|
72
76
|
export declare const PublicReferCandidacyPositionSignedInCreateSchema: z.ZodObject<{
|
|
73
77
|
positionIdNano: z.ZodString;
|
|
@@ -80,6 +84,7 @@ export declare const PublicReferCandidacyPositionSignedInCreateSchema: z.ZodObje
|
|
|
80
84
|
}, z.core.$strict>;
|
|
81
85
|
campaignIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
82
86
|
reason: z.ZodString;
|
|
87
|
+
relationship: z.ZodString;
|
|
83
88
|
}, z.core.$strict>;
|
|
84
89
|
export declare const PublicReferCandidacyPositionSignedOutCreateSchema: z.ZodObject<{
|
|
85
90
|
positionIdNano: z.ZodString;
|
|
@@ -101,6 +106,7 @@ export declare const PublicReferCandidacyPositionSignedOutCreateSchema: z.ZodObj
|
|
|
101
106
|
affiliateIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
102
107
|
campaignIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
103
108
|
reason: z.ZodString;
|
|
109
|
+
relationship: z.ZodString;
|
|
104
110
|
}, z.core.$strict>;
|
|
105
111
|
export declare const PublicReferCreateResultSchema: z.ZodObject<{
|
|
106
112
|
referralId: z.ZodUUID;
|
|
@@ -29,9 +29,11 @@ const ReferredPersonSchema = PersonSchema.omit({
|
|
|
29
29
|
const ReferrerPersonSchema = PersonSchema;
|
|
30
30
|
const ReferralSchema = v4_1.z.strictObject({
|
|
31
31
|
...(0, drizzle_zod_1.createInsertSchema)(core_1.referral, {
|
|
32
|
-
reason: v4_1.z.string().min(1, 'Reason is required')
|
|
32
|
+
reason: v4_1.z.string().min(1, 'Reason is required'),
|
|
33
|
+
relationship: v4_1.z.string().min(1, 'Relationship is required')
|
|
33
34
|
}).pick({
|
|
34
|
-
reason: true
|
|
35
|
+
reason: true,
|
|
36
|
+
relationship: true
|
|
35
37
|
}).shape
|
|
36
38
|
});
|
|
37
39
|
const ClientSchema = v4_1.z.strictObject({
|
|
@@ -47,7 +49,8 @@ exports.PublicReferClientSignedInCreateSchema = v4_1.z.strictObject({
|
|
|
47
49
|
contact: ReferredPersonSchema,
|
|
48
50
|
company: ClientSchema,
|
|
49
51
|
campaignIdNano: utils_1.OptionalStringSchema,
|
|
50
|
-
reason: ReferralSchema.shape.reason
|
|
52
|
+
reason: ReferralSchema.shape.reason,
|
|
53
|
+
relationship: ReferralSchema.shape.relationship
|
|
51
54
|
});
|
|
52
55
|
exports.PublicReferClientSignedOutCreateSchema = v4_1.z.strictObject({
|
|
53
56
|
referrer: ReferrerPersonSchema,
|
|
@@ -55,25 +58,29 @@ exports.PublicReferClientSignedOutCreateSchema = v4_1.z.strictObject({
|
|
|
55
58
|
company: ClientSchema,
|
|
56
59
|
affiliateIdNano: utils_1.OptionalStringSchema,
|
|
57
60
|
campaignIdNano: utils_1.OptionalStringSchema,
|
|
58
|
-
reason: ReferralSchema.shape.reason
|
|
61
|
+
reason: ReferralSchema.shape.reason,
|
|
62
|
+
relationship: ReferralSchema.shape.relationship
|
|
59
63
|
});
|
|
60
64
|
exports.PublicReferCandidacySignedInCreateSchema = v4_1.z.strictObject({
|
|
61
65
|
referred: ReferredPersonSchema,
|
|
62
66
|
campaignIdNano: utils_1.OptionalStringSchema,
|
|
63
|
-
reason: ReferralSchema.shape.reason
|
|
67
|
+
reason: ReferralSchema.shape.reason,
|
|
68
|
+
relationship: ReferralSchema.shape.relationship
|
|
64
69
|
});
|
|
65
70
|
exports.PublicReferCandidacySignedOutCreateSchema = v4_1.z.strictObject({
|
|
66
71
|
referrer: ReferrerPersonSchema,
|
|
67
72
|
referred: ReferredPersonSchema,
|
|
68
73
|
affiliateIdNano: utils_1.OptionalStringSchema,
|
|
69
74
|
campaignIdNano: utils_1.OptionalStringSchema,
|
|
70
|
-
reason: ReferralSchema.shape.reason
|
|
75
|
+
reason: ReferralSchema.shape.reason,
|
|
76
|
+
relationship: ReferralSchema.shape.relationship
|
|
71
77
|
});
|
|
72
78
|
exports.PublicReferCandidacyPositionSignedInCreateSchema = v4_1.z.strictObject({
|
|
73
79
|
positionIdNano: v4_1.z.string(),
|
|
74
80
|
referred: ReferredPersonSchema,
|
|
75
81
|
campaignIdNano: utils_1.OptionalStringSchema,
|
|
76
|
-
reason: ReferralSchema.shape.reason
|
|
82
|
+
reason: ReferralSchema.shape.reason,
|
|
83
|
+
relationship: ReferralSchema.shape.relationship
|
|
77
84
|
});
|
|
78
85
|
exports.PublicReferCandidacyPositionSignedOutCreateSchema = v4_1.z.strictObject({
|
|
79
86
|
positionIdNano: v4_1.z.string(),
|
|
@@ -81,7 +88,8 @@ exports.PublicReferCandidacyPositionSignedOutCreateSchema = v4_1.z.strictObject(
|
|
|
81
88
|
referred: ReferredPersonSchema,
|
|
82
89
|
affiliateIdNano: utils_1.OptionalStringSchema,
|
|
83
90
|
campaignIdNano: utils_1.OptionalStringSchema,
|
|
84
|
-
reason: ReferralSchema.shape.reason
|
|
91
|
+
reason: ReferralSchema.shape.reason,
|
|
92
|
+
relationship: ReferralSchema.shape.relationship
|
|
85
93
|
});
|
|
86
94
|
exports.PublicReferCreateResultSchema = v4_1.z.strictObject({
|
|
87
95
|
referralId: v4_1.z.uuid()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/public/refer/index.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAChD,+BAA0B;AAC1B,qCAAqD;AACrD,0CAQuB;AAEvB,eAAe;AAEf,MAAM,YAAY,GAAG,MAAC,CAAC,YAAY,CAAC;IAClC,GAAG,IAAA,gCAAkB,EAAC,aAAM,EAAE;QAC5B,SAAS,EAAE,6BAAqB;QAChC,QAAQ,EAAE,4BAAoB;QAC9B,KAAK,EAAE,2BAAmB;QAC1B,KAAK,EAAE,mBAAW;QAClB,WAAW,EAAE,yBAAiB;QAC9B,iBAAiB,EAAE,+BAAuB;KAC3C,CAAC,CAAC,IAAI,CAAC;QACN,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,IAAI;QACjB,iBAAiB,EAAE,IAAI;KACxB,CAAC,CAAC,KAAK;CACT,CAAC,CAAA;AAEF,MAAM,oBAAoB,GAAG,YAAY,CAAC,IAAI,CAAC;IAC7C,iBAAiB,EAAE,IAAI;CACxB,CAAC,CAAA;AAEF,MAAM,oBAAoB,GAAG,YAAY,CAAA;AAEzC,MAAM,cAAc,GAAG,MAAC,CAAC,YAAY,CAAC;IACpC,GAAG,IAAA,gCAAkB,EAAC,eAAQ,EAAE;QAC9B,MAAM,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/public/refer/index.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAChD,+BAA0B;AAC1B,qCAAqD;AACrD,0CAQuB;AAEvB,eAAe;AAEf,MAAM,YAAY,GAAG,MAAC,CAAC,YAAY,CAAC;IAClC,GAAG,IAAA,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AAoB;IACpC,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,MAAM;IACnC,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC,YAAY;CAChD,CAAC,CAAA;AAEW,QAAA,iDAAiD,GAAG,MAAC,CAAC,YAAY,CAC7E;IACE,cAAc,EAAE,MAAC,CAAC,MAAM,EAAE;IAC1B,QAAQ,EAAE,oBAAoB;IAC9B,QAAQ,EAAE,oBAAoB;IAC9B,eAAe,EAAE,4BAAoB;IACrC,cAAc,EAAE,4BAAoB;IACpC,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,MAAM;IACnC,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC,YAAY;CAChD,CACF,CAAA;AAEY,QAAA,6BAA6B,GAAG,MAAC,CAAC,YAAY,CAAC;IAC1D,UAAU,EAAE,MAAC,CAAC,IAAI,EAAE;CACrB,CAAC,CAAA;AAEW,QAAA,gCAAgC,GAAG,MAAC,CAAC,YAAY,CAAC;IAC7D,UAAU,EAAE,MAAC,CAAC,IAAI,EAAE;IACpB,OAAO,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,qBAAqB,CAAC;CAClD,CAAC,CAAA","sourcesContent":["import { createInsertSchema } from 'drizzle-zod'\nimport { z } from 'zod/v4'\nimport { client, person, referral } from '../../core'\nimport {\n DiscoveredThroughSchema,\n EmailSchema,\n LinkedInUrlSchema,\n OptionalPhoneSchema,\n OptionalStringSchema,\n PersonFirstNameSchema,\n PersonLastNameSchema\n} from '../../../utils'\n\n//// validators\n\nconst PersonSchema = z.strictObject({\n ...createInsertSchema(person, {\n firstName: PersonFirstNameSchema,\n lastName: PersonLastNameSchema,\n phone: OptionalPhoneSchema,\n email: EmailSchema,\n linkedInUrl: LinkedInUrlSchema,\n discoveredThrough: DiscoveredThroughSchema\n }).pick({\n firstName: true,\n lastName: true,\n email: true,\n phone: true,\n linkedInUrl: true,\n discoveredThrough: true\n }).shape\n})\n\nconst ReferredPersonSchema = PersonSchema.omit({\n discoveredThrough: true\n})\n\nconst ReferrerPersonSchema = PersonSchema\n\nconst ReferralSchema = z.strictObject({\n ...createInsertSchema(referral, {\n reason: z.string().min(1, 'Reason is required'),\n relationship: z.string().min(1, 'Relationship is required')\n }).pick({\n reason: true,\n relationship: true\n }).shape\n})\n\nconst ClientSchema = z.strictObject({\n ...createInsertSchema(client, {\n name: z.string().min(1, 'Company name is required'),\n websiteUrl: z.url('Invalid URL')\n }).pick({\n name: true,\n websiteUrl: true\n }).shape\n})\n\nexport const PublicReferClientSignedInCreateSchema = z.strictObject({\n contact: ReferredPersonSchema,\n company: ClientSchema,\n campaignIdNano: OptionalStringSchema,\n reason: ReferralSchema.shape.reason,\n relationship: ReferralSchema.shape.relationship\n})\n\nexport const PublicReferClientSignedOutCreateSchema = z.strictObject({\n referrer: ReferrerPersonSchema,\n contact: ReferredPersonSchema,\n company: ClientSchema,\n affiliateIdNano: OptionalStringSchema,\n campaignIdNano: OptionalStringSchema,\n reason: ReferralSchema.shape.reason,\n relationship: ReferralSchema.shape.relationship\n})\n\nexport const PublicReferCandidacySignedInCreateSchema = z.strictObject({\n referred: ReferredPersonSchema,\n campaignIdNano: OptionalStringSchema,\n reason: ReferralSchema.shape.reason,\n relationship: ReferralSchema.shape.relationship\n})\n\nexport const PublicReferCandidacySignedOutCreateSchema = z.strictObject({\n referrer: ReferrerPersonSchema,\n referred: ReferredPersonSchema,\n affiliateIdNano: OptionalStringSchema,\n campaignIdNano: OptionalStringSchema,\n reason: ReferralSchema.shape.reason,\n relationship: ReferralSchema.shape.relationship\n})\n\nexport const PublicReferCandidacyPositionSignedInCreateSchema = z.strictObject({\n positionIdNano: z.string(),\n referred: ReferredPersonSchema,\n campaignIdNano: OptionalStringSchema,\n reason: ReferralSchema.shape.reason,\n relationship: ReferralSchema.shape.relationship\n})\n\nexport const PublicReferCandidacyPositionSignedOutCreateSchema = z.strictObject(\n {\n positionIdNano: z.string(),\n referrer: ReferrerPersonSchema,\n referred: ReferredPersonSchema,\n affiliateIdNano: OptionalStringSchema,\n campaignIdNano: OptionalStringSchema,\n reason: ReferralSchema.shape.reason,\n relationship: ReferralSchema.shape.relationship\n }\n)\n\nexport const PublicReferCreateResultSchema = z.strictObject({\n referralId: z.uuid()\n})\n\nexport const PublicReferWarmIntroCreateSchema = z.strictObject({\n referralId: z.uuid(),\n message: z.string().min(1, 'Message is required')\n})\n\n//// types\n\n// referral\n\nexport type PublicReferClientSignedInCreateInput = z.infer<\n typeof PublicReferClientSignedInCreateSchema\n>\nexport type PublicReferClientSignedOutCreateInput = z.infer<\n typeof PublicReferClientSignedOutCreateSchema\n>\nexport type PublicReferCandidacySignedInCreateInput = z.infer<\n typeof PublicReferCandidacySignedInCreateSchema\n>\nexport type PublicReferCandidacySignedOutCreateInput = z.infer<\n typeof PublicReferCandidacySignedOutCreateSchema\n>\nexport type PublicReferCandidacyPositionSignedInCreateInput = z.infer<\n typeof PublicReferCandidacyPositionSignedInCreateSchema\n>\nexport type PublicReferCandidacyPositionSignedOutCreateInput = z.infer<\n typeof PublicReferCandidacyPositionSignedOutCreateSchema\n>\n\nexport type PublicReferCreateResult = z.infer<\n typeof PublicReferCreateResultSchema\n>\n\n// warm intro\n\nexport type PublicReferWarmIntroCreateInput = z.infer<\n typeof PublicReferWarmIntroCreateSchema\n>\n"]}
|