@voyantjs/legal 0.96.0 → 0.97.0
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/contracts/service.d.ts +2 -2
- package/dist/contracts/validation.d.ts +1 -398
- package/dist/contracts/validation.d.ts.map +1 -1
- package/dist/contracts/validation.js +1 -236
- package/dist/policies/validation.d.ts +1 -257
- package/dist/policies/validation.d.ts.map +1 -1
- package/dist/policies/validation.js +1 -138
- package/package.json +11 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { allocateContractNumber, ContractTemplateSyntaxError, isContractTemplateSyntaxError, mergeContractNumberIntoVariables, renderTemplate, validateContractTemplateBody, validateTemplateVariables } from "./service-shared.js";
|
|
2
2
|
export { allocateContractNumber, ContractTemplateSyntaxError, isContractTemplateSyntaxError, mergeContractNumberIntoVariables, renderTemplate, validateContractTemplateBody, validateTemplateVariables, };
|
|
3
3
|
export declare const contractsService: {
|
|
4
|
-
generateContractDocument(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, contractId: string, input: import("
|
|
4
|
+
generateContractDocument(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, contractId: string, input: import("@voyantjs/legal-contracts/contracts/validation").GenerateContractDocumentInput, runtime: import("./service-documents.js").ContractDocumentRuntimeOptions, options?: {
|
|
5
5
|
regenerated?: boolean;
|
|
6
6
|
forceRerender?: boolean;
|
|
7
7
|
}): Promise<{
|
|
@@ -9,7 +9,7 @@ export declare const contractsService: {
|
|
|
9
9
|
} | ({
|
|
10
10
|
status: "generated";
|
|
11
11
|
} & import("./service-documents.js").GeneratedContractDocumentRecord)>;
|
|
12
|
-
regenerateContractDocument(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, contractId: string, input: import("
|
|
12
|
+
regenerateContractDocument(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, contractId: string, input: import("@voyantjs/legal-contracts/contracts/validation").GenerateContractDocumentInput, runtime: import("./service-documents.js").ContractDocumentRuntimeOptions): Promise<{
|
|
13
13
|
status: "not_found" | "not_draft" | "render_unavailable" | "generator_failed";
|
|
14
14
|
} | ({
|
|
15
15
|
status: "generated";
|
|
@@ -1,399 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const contractScopeSchema: z.ZodEnum<{
|
|
3
|
-
customer: "customer";
|
|
4
|
-
partner: "partner";
|
|
5
|
-
supplier: "supplier";
|
|
6
|
-
other: "other";
|
|
7
|
-
channel: "channel";
|
|
8
|
-
}>;
|
|
9
|
-
export declare const contractStatusSchema: z.ZodEnum<{
|
|
10
|
-
executed: "executed";
|
|
11
|
-
void: "void";
|
|
12
|
-
expired: "expired";
|
|
13
|
-
draft: "draft";
|
|
14
|
-
sent: "sent";
|
|
15
|
-
issued: "issued";
|
|
16
|
-
signed: "signed";
|
|
17
|
-
}>;
|
|
18
|
-
export declare const contractStageHistoryEntrySchema: z.ZodObject<{
|
|
19
|
-
stage: z.ZodEnum<{
|
|
20
|
-
executed: "executed";
|
|
21
|
-
void: "void";
|
|
22
|
-
expired: "expired";
|
|
23
|
-
draft: "draft";
|
|
24
|
-
sent: "sent";
|
|
25
|
-
issued: "issued";
|
|
26
|
-
signed: "signed";
|
|
27
|
-
}>;
|
|
28
|
-
previousStage: z.ZodNullable<z.ZodEnum<{
|
|
29
|
-
executed: "executed";
|
|
30
|
-
void: "void";
|
|
31
|
-
expired: "expired";
|
|
32
|
-
draft: "draft";
|
|
33
|
-
sent: "sent";
|
|
34
|
-
issued: "issued";
|
|
35
|
-
signed: "signed";
|
|
36
|
-
}>>;
|
|
37
|
-
transition: z.ZodEnum<{
|
|
38
|
-
executed: "executed";
|
|
39
|
-
sent: "sent";
|
|
40
|
-
issued: "issued";
|
|
41
|
-
signed: "signed";
|
|
42
|
-
created: "created";
|
|
43
|
-
voided: "voided";
|
|
44
|
-
}>;
|
|
45
|
-
enteredAt: z.ZodString;
|
|
46
|
-
actorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
-
}, z.core.$strip>;
|
|
48
|
-
export declare const contractSignatureMethodSchema: z.ZodEnum<{
|
|
49
|
-
other: "other";
|
|
50
|
-
manual: "manual";
|
|
51
|
-
electronic: "electronic";
|
|
52
|
-
docusign: "docusign";
|
|
53
|
-
}>;
|
|
54
|
-
export declare const contractNumberResetStrategySchema: z.ZodEnum<{
|
|
55
|
-
never: "never";
|
|
56
|
-
annual: "annual";
|
|
57
|
-
monthly: "monthly";
|
|
58
|
-
}>;
|
|
59
|
-
export declare const contractBodyFormatSchema: z.ZodEnum<{
|
|
60
|
-
markdown: "markdown";
|
|
61
|
-
html: "html";
|
|
62
|
-
lexical_json: "lexical_json";
|
|
63
|
-
}>;
|
|
64
|
-
export declare const insertContractTemplateSchema: z.ZodObject<{
|
|
65
|
-
name: z.ZodString;
|
|
66
|
-
slug: z.ZodString;
|
|
67
|
-
scope: z.ZodEnum<{
|
|
68
|
-
customer: "customer";
|
|
69
|
-
partner: "partner";
|
|
70
|
-
supplier: "supplier";
|
|
71
|
-
other: "other";
|
|
72
|
-
channel: "channel";
|
|
73
|
-
}>;
|
|
74
|
-
language: z.ZodDefault<z.ZodString>;
|
|
75
|
-
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
76
|
-
body: z.ZodString;
|
|
77
|
-
variableSchema: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
78
|
-
channelId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
79
|
-
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
81
|
-
}, z.core.$strip>;
|
|
82
|
-
export declare const updateContractTemplateSchema: z.ZodObject<{
|
|
83
|
-
name: z.ZodOptional<z.ZodString>;
|
|
84
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
85
|
-
scope: z.ZodOptional<z.ZodEnum<{
|
|
86
|
-
customer: "customer";
|
|
87
|
-
partner: "partner";
|
|
88
|
-
supplier: "supplier";
|
|
89
|
-
other: "other";
|
|
90
|
-
channel: "channel";
|
|
91
|
-
}>>;
|
|
92
|
-
language: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
93
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
94
|
-
body: z.ZodOptional<z.ZodString>;
|
|
95
|
-
variableSchema: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
96
|
-
channelId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
97
|
-
isDefault: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
98
|
-
active: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
99
|
-
}, z.core.$strip>;
|
|
100
|
-
export declare const contractTemplateListQuerySchema: z.ZodObject<{
|
|
101
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
102
|
-
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
103
|
-
scope: z.ZodOptional<z.ZodEnum<{
|
|
104
|
-
customer: "customer";
|
|
105
|
-
partner: "partner";
|
|
106
|
-
supplier: "supplier";
|
|
107
|
-
other: "other";
|
|
108
|
-
channel: "channel";
|
|
109
|
-
}>>;
|
|
110
|
-
language: z.ZodOptional<z.ZodString>;
|
|
111
|
-
channelId: z.ZodOptional<z.ZodString>;
|
|
112
|
-
active: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
113
|
-
0: "0";
|
|
114
|
-
true: "true";
|
|
115
|
-
false: "false";
|
|
116
|
-
1: "1";
|
|
117
|
-
}>, z.ZodTransform<boolean, "0" | "true" | "false" | "1">>>;
|
|
118
|
-
search: z.ZodOptional<z.ZodString>;
|
|
119
|
-
}, z.core.$strip>;
|
|
120
|
-
export declare const contractTemplateDefaultQuerySchema: z.ZodObject<{
|
|
121
|
-
scope: z.ZodDefault<z.ZodEnum<{
|
|
122
|
-
customer: "customer";
|
|
123
|
-
partner: "partner";
|
|
124
|
-
supplier: "supplier";
|
|
125
|
-
other: "other";
|
|
126
|
-
channel: "channel";
|
|
127
|
-
}>>;
|
|
128
|
-
channelId: z.ZodOptional<z.ZodString>;
|
|
129
|
-
language: z.ZodOptional<z.ZodString>;
|
|
130
|
-
fallbackLanguages: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[], string | undefined>>;
|
|
131
|
-
}, z.core.$strip>;
|
|
132
|
-
export declare const insertContractTemplateVersionSchema: z.ZodObject<{
|
|
133
|
-
body: z.ZodString;
|
|
134
|
-
variableSchema: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
135
|
-
changelog: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
136
|
-
createdBy: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
137
|
-
}, z.core.$strip>;
|
|
138
|
-
export declare const insertContractNumberSeriesSchema: z.ZodObject<{
|
|
139
|
-
name: z.ZodString;
|
|
140
|
-
prefix: z.ZodString;
|
|
141
|
-
separator: z.ZodDefault<z.ZodString>;
|
|
142
|
-
padLength: z.ZodDefault<z.ZodNumber>;
|
|
143
|
-
resetStrategy: z.ZodDefault<z.ZodEnum<{
|
|
144
|
-
never: "never";
|
|
145
|
-
annual: "annual";
|
|
146
|
-
monthly: "monthly";
|
|
147
|
-
}>>;
|
|
148
|
-
scope: z.ZodDefault<z.ZodEnum<{
|
|
149
|
-
customer: "customer";
|
|
150
|
-
partner: "partner";
|
|
151
|
-
supplier: "supplier";
|
|
152
|
-
other: "other";
|
|
153
|
-
channel: "channel";
|
|
154
|
-
}>>;
|
|
155
|
-
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
156
|
-
externalProvider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
157
|
-
externalConfigKey: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
158
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
159
|
-
}, z.core.$strip>;
|
|
160
|
-
export declare const updateContractNumberSeriesSchema: z.ZodObject<{
|
|
161
|
-
name: z.ZodOptional<z.ZodString>;
|
|
162
|
-
prefix: z.ZodOptional<z.ZodString>;
|
|
163
|
-
separator: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
164
|
-
padLength: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
165
|
-
resetStrategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
166
|
-
never: "never";
|
|
167
|
-
annual: "annual";
|
|
168
|
-
monthly: "monthly";
|
|
169
|
-
}>>>;
|
|
170
|
-
scope: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
171
|
-
customer: "customer";
|
|
172
|
-
partner: "partner";
|
|
173
|
-
supplier: "supplier";
|
|
174
|
-
other: "other";
|
|
175
|
-
channel: "channel";
|
|
176
|
-
}>>>;
|
|
177
|
-
isDefault: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
178
|
-
externalProvider: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
179
|
-
externalConfigKey: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
180
|
-
active: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
181
|
-
}, z.core.$strip>;
|
|
182
|
-
export declare const contractNumberSeriesListQuerySchema: z.ZodObject<{
|
|
183
|
-
scope: z.ZodOptional<z.ZodEnum<{
|
|
184
|
-
customer: "customer";
|
|
185
|
-
partner: "partner";
|
|
186
|
-
supplier: "supplier";
|
|
187
|
-
other: "other";
|
|
188
|
-
channel: "channel";
|
|
189
|
-
}>>;
|
|
190
|
-
active: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
191
|
-
0: "0";
|
|
192
|
-
true: "true";
|
|
193
|
-
false: "false";
|
|
194
|
-
1: "1";
|
|
195
|
-
}>, z.ZodTransform<boolean, "0" | "true" | "false" | "1">>>;
|
|
196
|
-
}, z.core.$strip>;
|
|
197
|
-
export declare const insertContractSchema: z.ZodObject<{
|
|
198
|
-
contractNumber: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
199
|
-
scope: z.ZodEnum<{
|
|
200
|
-
customer: "customer";
|
|
201
|
-
partner: "partner";
|
|
202
|
-
supplier: "supplier";
|
|
203
|
-
other: "other";
|
|
204
|
-
channel: "channel";
|
|
205
|
-
}>;
|
|
206
|
-
status: z.ZodDefault<z.ZodEnum<{
|
|
207
|
-
executed: "executed";
|
|
208
|
-
void: "void";
|
|
209
|
-
expired: "expired";
|
|
210
|
-
draft: "draft";
|
|
211
|
-
sent: "sent";
|
|
212
|
-
issued: "issued";
|
|
213
|
-
signed: "signed";
|
|
214
|
-
}>>;
|
|
215
|
-
title: z.ZodString;
|
|
216
|
-
templateVersionId: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
217
|
-
seriesId: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
218
|
-
personId: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
219
|
-
organizationId: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
220
|
-
supplierId: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
221
|
-
channelId: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
222
|
-
bookingId: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
223
|
-
orderId: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
224
|
-
expiresAt: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>;
|
|
225
|
-
language: z.ZodDefault<z.ZodString>;
|
|
226
|
-
variables: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
227
|
-
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
228
|
-
}, z.core.$strip>;
|
|
229
|
-
export declare const updateContractSchema: z.ZodObject<{
|
|
230
|
-
metadata: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
231
|
-
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
232
|
-
scope: z.ZodOptional<z.ZodEnum<{
|
|
233
|
-
customer: "customer";
|
|
234
|
-
partner: "partner";
|
|
235
|
-
supplier: "supplier";
|
|
236
|
-
other: "other";
|
|
237
|
-
channel: "channel";
|
|
238
|
-
}>>;
|
|
239
|
-
organizationId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
240
|
-
bookingId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
241
|
-
title: z.ZodOptional<z.ZodString>;
|
|
242
|
-
personId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
243
|
-
supplierId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
244
|
-
channelId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
245
|
-
contractNumber: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
246
|
-
templateVersionId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
247
|
-
seriesId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
248
|
-
orderId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodString]>>>>;
|
|
249
|
-
variables: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
250
|
-
language: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
251
|
-
}, z.core.$strip>;
|
|
252
|
-
export declare const contractListQuerySchema: z.ZodObject<{
|
|
253
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
254
|
-
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
255
|
-
scope: z.ZodOptional<z.ZodEnum<{
|
|
256
|
-
customer: "customer";
|
|
257
|
-
partner: "partner";
|
|
258
|
-
supplier: "supplier";
|
|
259
|
-
other: "other";
|
|
260
|
-
channel: "channel";
|
|
261
|
-
}>>;
|
|
262
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
263
|
-
executed: "executed";
|
|
264
|
-
void: "void";
|
|
265
|
-
expired: "expired";
|
|
266
|
-
draft: "draft";
|
|
267
|
-
sent: "sent";
|
|
268
|
-
issued: "issued";
|
|
269
|
-
signed: "signed";
|
|
270
|
-
}>>;
|
|
271
|
-
personId: z.ZodOptional<z.ZodString>;
|
|
272
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
273
|
-
supplierId: z.ZodOptional<z.ZodString>;
|
|
274
|
-
bookingId: z.ZodOptional<z.ZodString>;
|
|
275
|
-
orderId: z.ZodOptional<z.ZodString>;
|
|
276
|
-
search: z.ZodOptional<z.ZodString>;
|
|
277
|
-
}, z.core.$strip>;
|
|
278
|
-
export declare const renderTemplateInputSchema: z.ZodObject<{
|
|
279
|
-
variables: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
280
|
-
body: z.ZodOptional<z.ZodString>;
|
|
281
|
-
}, z.core.$strip>;
|
|
282
|
-
export declare const publicRenderTemplatePreviewInputSchema: z.ZodObject<{
|
|
283
|
-
variables: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
284
|
-
}, z.core.$strip>;
|
|
285
|
-
export declare const generateContractDocumentInputSchema: z.ZodObject<{
|
|
286
|
-
kind: z.ZodDefault<z.ZodString>;
|
|
287
|
-
replaceExisting: z.ZodDefault<z.ZodBoolean>;
|
|
288
|
-
issueIfDraft: z.ZodDefault<z.ZodBoolean>;
|
|
289
|
-
publicDelivery: z.ZodDefault<z.ZodBoolean>;
|
|
290
|
-
publicDeliveryTtlSeconds: z.ZodOptional<z.ZodNumber>;
|
|
291
|
-
}, z.core.$strip>;
|
|
292
|
-
export declare const generateContractForBookingInputSchema: z.ZodObject<{
|
|
293
|
-
scope: z.ZodDefault<z.ZodEnum<{
|
|
294
|
-
customer: "customer";
|
|
295
|
-
partner: "partner";
|
|
296
|
-
supplier: "supplier";
|
|
297
|
-
other: "other";
|
|
298
|
-
channel: "channel";
|
|
299
|
-
}>>;
|
|
300
|
-
language: z.ZodOptional<z.ZodString>;
|
|
301
|
-
channelId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
302
|
-
fallbackLanguages: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
303
|
-
requireNumberSeries: z.ZodDefault<z.ZodBoolean>;
|
|
304
|
-
publicDelivery: z.ZodDefault<z.ZodBoolean>;
|
|
305
|
-
publicDeliveryTtlSeconds: z.ZodOptional<z.ZodNumber>;
|
|
306
|
-
}, z.core.$strip>;
|
|
307
|
-
export type GenerateContractForBookingInput = z.infer<typeof generateContractForBookingInputSchema>;
|
|
308
|
-
/**
|
|
309
|
-
* Optional customization the operator typed in the Send-contract dialog.
|
|
310
|
-
* All fields nullable — the route falls through to defaults (recipient
|
|
311
|
-
* from the linked person record, subject + message resolved by the
|
|
312
|
-
* notification subscriber's contract-sent template) when omitted.
|
|
313
|
-
*/
|
|
314
|
-
export declare const sendContractInputSchema: z.ZodObject<{
|
|
315
|
-
recipientEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
316
|
-
subject: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
317
|
-
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
318
|
-
}, z.core.$strip>;
|
|
319
|
-
export type SendContractInput = z.infer<typeof sendContractInputSchema>;
|
|
320
|
-
export declare const generatedContractDocumentAttachmentSchema: z.ZodObject<{
|
|
321
|
-
id: z.ZodString;
|
|
322
|
-
contractId: z.ZodString;
|
|
323
|
-
kind: z.ZodString;
|
|
324
|
-
name: z.ZodString;
|
|
325
|
-
mimeType: z.ZodNullable<z.ZodString>;
|
|
326
|
-
fileSize: z.ZodNullable<z.ZodNumber>;
|
|
327
|
-
storageKey: z.ZodNullable<z.ZodString>;
|
|
328
|
-
checksum: z.ZodNullable<z.ZodString>;
|
|
329
|
-
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
330
|
-
createdAt: z.ZodString;
|
|
331
|
-
}, z.core.$strip>;
|
|
332
|
-
export declare const generatedContractDocumentResultSchema: z.ZodObject<{
|
|
333
|
-
contractId: z.ZodString;
|
|
334
|
-
contractStatus: z.ZodEnum<{
|
|
335
|
-
executed: "executed";
|
|
336
|
-
void: "void";
|
|
337
|
-
expired: "expired";
|
|
338
|
-
draft: "draft";
|
|
339
|
-
sent: "sent";
|
|
340
|
-
issued: "issued";
|
|
341
|
-
signed: "signed";
|
|
342
|
-
}>;
|
|
343
|
-
renderedBodyFormat: z.ZodEnum<{
|
|
344
|
-
markdown: "markdown";
|
|
345
|
-
html: "html";
|
|
346
|
-
lexical_json: "lexical_json";
|
|
347
|
-
}>;
|
|
348
|
-
renderedBody: z.ZodString;
|
|
349
|
-
attachment: z.ZodObject<{
|
|
350
|
-
id: z.ZodString;
|
|
351
|
-
contractId: z.ZodString;
|
|
352
|
-
kind: z.ZodString;
|
|
353
|
-
name: z.ZodString;
|
|
354
|
-
mimeType: z.ZodNullable<z.ZodString>;
|
|
355
|
-
fileSize: z.ZodNullable<z.ZodNumber>;
|
|
356
|
-
storageKey: z.ZodNullable<z.ZodString>;
|
|
357
|
-
checksum: z.ZodNullable<z.ZodString>;
|
|
358
|
-
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
359
|
-
createdAt: z.ZodString;
|
|
360
|
-
}, z.core.$strip>;
|
|
361
|
-
}, z.core.$strip>;
|
|
362
|
-
export declare const insertContractSignatureSchema: z.ZodObject<{
|
|
363
|
-
signerName: z.ZodString;
|
|
364
|
-
signerEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
365
|
-
signerRole: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
366
|
-
personId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
367
|
-
method: z.ZodDefault<z.ZodEnum<{
|
|
368
|
-
other: "other";
|
|
369
|
-
manual: "manual";
|
|
370
|
-
electronic: "electronic";
|
|
371
|
-
docusign: "docusign";
|
|
372
|
-
}>>;
|
|
373
|
-
provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
374
|
-
externalReference: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
375
|
-
signatureData: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
376
|
-
ipAddress: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
377
|
-
userAgent: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
378
|
-
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
379
|
-
}, z.core.$strip>;
|
|
380
|
-
export declare const insertContractAttachmentSchema: z.ZodObject<{
|
|
381
|
-
kind: z.ZodDefault<z.ZodString>;
|
|
382
|
-
name: z.ZodString;
|
|
383
|
-
mimeType: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
384
|
-
fileSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
385
|
-
storageKey: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
386
|
-
checksum: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
387
|
-
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
388
|
-
}, z.core.$strip>;
|
|
389
|
-
export declare const updateContractAttachmentSchema: z.ZodObject<{
|
|
390
|
-
kind: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
391
|
-
name: z.ZodOptional<z.ZodString>;
|
|
392
|
-
mimeType: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
393
|
-
fileSize: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
394
|
-
storageKey: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
395
|
-
checksum: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
396
|
-
metadata: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
397
|
-
}, z.core.$strip>;
|
|
398
|
-
export type GenerateContractDocumentInput = z.infer<typeof generateContractDocumentInputSchema>;
|
|
1
|
+
export * from "@voyantjs/legal-contracts/contracts/validation";
|
|
399
2
|
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/contracts/validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/contracts/validation.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAA"}
|
|
@@ -1,236 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { validateStructuredTemplateSyntax } from "@voyantjs/utils/template-renderer";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
export const contractScopeSchema = z.enum(["customer", "supplier", "partner", "channel", "other"]);
|
|
5
|
-
export const contractStatusSchema = z.enum([
|
|
6
|
-
"draft",
|
|
7
|
-
"issued",
|
|
8
|
-
"sent",
|
|
9
|
-
"signed",
|
|
10
|
-
"executed",
|
|
11
|
-
"expired",
|
|
12
|
-
"void",
|
|
13
|
-
]);
|
|
14
|
-
export const contractStageHistoryEntrySchema = z.object({
|
|
15
|
-
stage: contractStatusSchema,
|
|
16
|
-
previousStage: contractStatusSchema.nullable(),
|
|
17
|
-
transition: z.enum(["created", "issued", "sent", "signed", "executed", "voided"]),
|
|
18
|
-
enteredAt: z.string(),
|
|
19
|
-
actorId: z.string().nullable().optional(),
|
|
20
|
-
});
|
|
21
|
-
export const contractSignatureMethodSchema = z.enum(["manual", "electronic", "docusign", "other"]);
|
|
22
|
-
export const contractNumberResetStrategySchema = z.enum(["never", "annual", "monthly"]);
|
|
23
|
-
export const contractBodyFormatSchema = z.enum(["markdown", "html", "lexical_json"]);
|
|
24
|
-
const paginationSchema = z.object({
|
|
25
|
-
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
26
|
-
offset: z.coerce.number().int().min(0).default(0),
|
|
27
|
-
});
|
|
28
|
-
function optionalNullableString(schema = z.string()) {
|
|
29
|
-
return z
|
|
30
|
-
.union([z.literal("").transform(() => undefined), schema])
|
|
31
|
-
.optional()
|
|
32
|
-
.nullable();
|
|
33
|
-
}
|
|
34
|
-
const contractTemplateBodySchema = z
|
|
35
|
-
.string()
|
|
36
|
-
.min(1)
|
|
37
|
-
.superRefine((body, ctx) => {
|
|
38
|
-
for (const issue of validateStructuredTemplateSyntax(body, "html")) {
|
|
39
|
-
ctx.addIssue({
|
|
40
|
-
code: "custom",
|
|
41
|
-
message: `invalid Liquid syntax: ${issue.message}`,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
// ---------- contract templates ----------
|
|
46
|
-
const contractTemplateCoreSchema = z.object({
|
|
47
|
-
name: z.string().min(1).max(255),
|
|
48
|
-
slug: z
|
|
49
|
-
.string()
|
|
50
|
-
.min(1)
|
|
51
|
-
.max(100)
|
|
52
|
-
.regex(/^[a-z0-9-]+$/, "slug must be kebab-case"),
|
|
53
|
-
scope: contractScopeSchema,
|
|
54
|
-
language: z.string().min(2).max(10).default("en"),
|
|
55
|
-
description: z.string().max(2000).optional().nullable(),
|
|
56
|
-
body: contractTemplateBodySchema,
|
|
57
|
-
variableSchema: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
58
|
-
channelId: z.string().optional().nullable(),
|
|
59
|
-
isDefault: z.boolean().default(false),
|
|
60
|
-
active: z.boolean().default(true),
|
|
61
|
-
});
|
|
62
|
-
export const insertContractTemplateSchema = contractTemplateCoreSchema;
|
|
63
|
-
export const updateContractTemplateSchema = contractTemplateCoreSchema.partial();
|
|
64
|
-
export const contractTemplateListQuerySchema = paginationSchema.extend({
|
|
65
|
-
scope: contractScopeSchema.optional(),
|
|
66
|
-
language: z.string().optional(),
|
|
67
|
-
channelId: z.string().optional(),
|
|
68
|
-
active: booleanQueryParam.optional(),
|
|
69
|
-
search: z.string().optional(),
|
|
70
|
-
});
|
|
71
|
-
export const contractTemplateDefaultQuerySchema = z.object({
|
|
72
|
-
scope: contractScopeSchema.default("customer"),
|
|
73
|
-
channelId: z.string().optional(),
|
|
74
|
-
language: z.string().min(2).max(10).optional(),
|
|
75
|
-
fallbackLanguages: z
|
|
76
|
-
.string()
|
|
77
|
-
.optional()
|
|
78
|
-
.transform((value) => value
|
|
79
|
-
? value
|
|
80
|
-
.split(",")
|
|
81
|
-
.map((item) => item.trim())
|
|
82
|
-
.filter(Boolean)
|
|
83
|
-
: []),
|
|
84
|
-
});
|
|
85
|
-
// ---------- contract template versions ----------
|
|
86
|
-
export const insertContractTemplateVersionSchema = z.object({
|
|
87
|
-
body: contractTemplateBodySchema,
|
|
88
|
-
variableSchema: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
89
|
-
changelog: z.string().max(2000).optional().nullable(),
|
|
90
|
-
createdBy: z.string().max(255).optional().nullable(),
|
|
91
|
-
});
|
|
92
|
-
// ---------- contract number series ----------
|
|
93
|
-
const contractNumberSeriesCoreSchema = z.object({
|
|
94
|
-
name: z.string().min(1).max(255),
|
|
95
|
-
prefix: z.string().min(1).max(20),
|
|
96
|
-
separator: z.string().max(5).default(""),
|
|
97
|
-
padLength: z.number().int().min(0).max(12).default(4),
|
|
98
|
-
resetStrategy: contractNumberResetStrategySchema.default("never"),
|
|
99
|
-
scope: contractScopeSchema.default("customer"),
|
|
100
|
-
isDefault: z.boolean().default(false),
|
|
101
|
-
externalProvider: z.string().min(1).max(100).optional().nullable(),
|
|
102
|
-
externalConfigKey: z.string().min(1).max(100).optional().nullable(),
|
|
103
|
-
active: z.boolean().default(true),
|
|
104
|
-
});
|
|
105
|
-
export const insertContractNumberSeriesSchema = contractNumberSeriesCoreSchema;
|
|
106
|
-
export const updateContractNumberSeriesSchema = contractNumberSeriesCoreSchema.partial();
|
|
107
|
-
export const contractNumberSeriesListQuerySchema = z.object({
|
|
108
|
-
scope: contractScopeSchema.optional(),
|
|
109
|
-
active: booleanQueryParam.optional(),
|
|
110
|
-
});
|
|
111
|
-
// ---------- contracts ----------
|
|
112
|
-
const contractCoreSchema = z.object({
|
|
113
|
-
contractNumber: optionalNullableString(z.string().trim().min(1).max(100)),
|
|
114
|
-
scope: contractScopeSchema,
|
|
115
|
-
status: contractStatusSchema.default("draft"),
|
|
116
|
-
title: z.string().min(1).max(500),
|
|
117
|
-
templateVersionId: optionalNullableString(),
|
|
118
|
-
seriesId: optionalNullableString(),
|
|
119
|
-
personId: optionalNullableString(),
|
|
120
|
-
organizationId: optionalNullableString(),
|
|
121
|
-
supplierId: optionalNullableString(),
|
|
122
|
-
channelId: optionalNullableString(),
|
|
123
|
-
bookingId: optionalNullableString(),
|
|
124
|
-
orderId: optionalNullableString(),
|
|
125
|
-
expiresAt: optionalNullableString(),
|
|
126
|
-
language: z.string().min(2).max(10).default("en"),
|
|
127
|
-
variables: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
128
|
-
metadata: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
129
|
-
});
|
|
130
|
-
export const insertContractSchema = contractCoreSchema;
|
|
131
|
-
export const updateContractSchema = contractCoreSchema
|
|
132
|
-
.omit({ status: true, language: true })
|
|
133
|
-
.extend({
|
|
134
|
-
language: z.string().min(2).max(10).optional(),
|
|
135
|
-
})
|
|
136
|
-
.partial();
|
|
137
|
-
export const contractListQuerySchema = paginationSchema.extend({
|
|
138
|
-
scope: contractScopeSchema.optional(),
|
|
139
|
-
status: contractStatusSchema.optional(),
|
|
140
|
-
personId: z.string().optional(),
|
|
141
|
-
organizationId: z.string().optional(),
|
|
142
|
-
supplierId: z.string().optional(),
|
|
143
|
-
bookingId: z.string().optional(),
|
|
144
|
-
orderId: z.string().optional(),
|
|
145
|
-
search: z.string().optional(),
|
|
146
|
-
});
|
|
147
|
-
export const renderTemplateInputSchema = z.object({
|
|
148
|
-
variables: z.record(z.string(), z.unknown()),
|
|
149
|
-
body: z.string().optional(),
|
|
150
|
-
});
|
|
151
|
-
export const publicRenderTemplatePreviewInputSchema = z.object({
|
|
152
|
-
variables: z.record(z.string(), z.unknown()),
|
|
153
|
-
});
|
|
154
|
-
export const generateContractDocumentInputSchema = z.object({
|
|
155
|
-
kind: z.string().min(1).max(50).default("document"),
|
|
156
|
-
replaceExisting: z.boolean().default(true),
|
|
157
|
-
issueIfDraft: z.boolean().default(true),
|
|
158
|
-
publicDelivery: z.boolean().default(false),
|
|
159
|
-
publicDeliveryTtlSeconds: z
|
|
160
|
-
.number()
|
|
161
|
-
.int()
|
|
162
|
-
.min(1)
|
|
163
|
-
.max(30 * 24 * 60 * 60)
|
|
164
|
-
.optional(),
|
|
165
|
-
});
|
|
166
|
-
export const generateContractForBookingInputSchema = z.object({
|
|
167
|
-
scope: contractScopeSchema.default("customer"),
|
|
168
|
-
language: z.string().min(2).max(10).optional(),
|
|
169
|
-
channelId: z.string().optional().nullable(),
|
|
170
|
-
fallbackLanguages: z.array(z.string().min(2).max(10)).optional().default([]),
|
|
171
|
-
requireNumberSeries: z.boolean().default(true),
|
|
172
|
-
publicDelivery: z.boolean().default(false),
|
|
173
|
-
publicDeliveryTtlSeconds: z
|
|
174
|
-
.number()
|
|
175
|
-
.int()
|
|
176
|
-
.min(1)
|
|
177
|
-
.max(30 * 24 * 60 * 60)
|
|
178
|
-
.optional(),
|
|
179
|
-
});
|
|
180
|
-
/**
|
|
181
|
-
* Optional customization the operator typed in the Send-contract dialog.
|
|
182
|
-
* All fields nullable — the route falls through to defaults (recipient
|
|
183
|
-
* from the linked person record, subject + message resolved by the
|
|
184
|
-
* notification subscriber's contract-sent template) when omitted.
|
|
185
|
-
*/
|
|
186
|
-
export const sendContractInputSchema = z.object({
|
|
187
|
-
recipientEmail: z.string().email().optional().nullable(),
|
|
188
|
-
subject: z.string().max(500).optional().nullable(),
|
|
189
|
-
message: z.string().max(10_000).optional().nullable(),
|
|
190
|
-
});
|
|
191
|
-
export const generatedContractDocumentAttachmentSchema = z.object({
|
|
192
|
-
id: z.string(),
|
|
193
|
-
contractId: z.string(),
|
|
194
|
-
kind: z.string(),
|
|
195
|
-
name: z.string(),
|
|
196
|
-
mimeType: z.string().nullable(),
|
|
197
|
-
fileSize: z.number().int().nullable(),
|
|
198
|
-
storageKey: z.string().nullable(),
|
|
199
|
-
checksum: z.string().nullable(),
|
|
200
|
-
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
201
|
-
createdAt: z.string(),
|
|
202
|
-
});
|
|
203
|
-
export const generatedContractDocumentResultSchema = z.object({
|
|
204
|
-
contractId: z.string(),
|
|
205
|
-
contractStatus: contractStatusSchema,
|
|
206
|
-
renderedBodyFormat: contractBodyFormatSchema,
|
|
207
|
-
renderedBody: z.string(),
|
|
208
|
-
attachment: generatedContractDocumentAttachmentSchema,
|
|
209
|
-
});
|
|
210
|
-
// ---------- contract signatures ----------
|
|
211
|
-
const contractSignatureCoreSchema = z.object({
|
|
212
|
-
signerName: z.string().min(1).max(255),
|
|
213
|
-
signerEmail: z.string().email().optional().nullable(),
|
|
214
|
-
signerRole: z.string().max(255).optional().nullable(),
|
|
215
|
-
personId: z.string().optional().nullable(),
|
|
216
|
-
method: contractSignatureMethodSchema.default("manual"),
|
|
217
|
-
provider: z.string().max(255).optional().nullable(),
|
|
218
|
-
externalReference: z.string().max(255).optional().nullable(),
|
|
219
|
-
signatureData: z.string().optional().nullable(),
|
|
220
|
-
ipAddress: z.string().max(64).optional().nullable(),
|
|
221
|
-
userAgent: z.string().max(500).optional().nullable(),
|
|
222
|
-
metadata: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
223
|
-
});
|
|
224
|
-
export const insertContractSignatureSchema = contractSignatureCoreSchema;
|
|
225
|
-
// ---------- contract attachments ----------
|
|
226
|
-
const contractAttachmentCoreSchema = z.object({
|
|
227
|
-
kind: z.string().min(1).max(50).default("appendix"),
|
|
228
|
-
name: z.string().min(1).max(255),
|
|
229
|
-
mimeType: z.string().max(255).optional().nullable(),
|
|
230
|
-
fileSize: z.number().int().min(0).optional().nullable(),
|
|
231
|
-
storageKey: z.string().max(1000).optional().nullable(),
|
|
232
|
-
checksum: z.string().max(255).optional().nullable(),
|
|
233
|
-
metadata: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
234
|
-
});
|
|
235
|
-
export const insertContractAttachmentSchema = contractAttachmentCoreSchema;
|
|
236
|
-
export const updateContractAttachmentSchema = contractAttachmentCoreSchema.partial();
|
|
1
|
+
export * from "@voyantjs/legal-contracts/contracts/validation";
|
|
@@ -1,258 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const policyKindSchema: z.ZodEnum<{
|
|
3
|
-
other: "other";
|
|
4
|
-
refund: "refund";
|
|
5
|
-
payment: "payment";
|
|
6
|
-
cancellation: "cancellation";
|
|
7
|
-
terms_and_conditions: "terms_and_conditions";
|
|
8
|
-
privacy: "privacy";
|
|
9
|
-
commission: "commission";
|
|
10
|
-
guarantee: "guarantee";
|
|
11
|
-
}>;
|
|
12
|
-
export declare const policyVersionStatusSchema: z.ZodEnum<{
|
|
13
|
-
draft: "draft";
|
|
14
|
-
published: "published";
|
|
15
|
-
retired: "retired";
|
|
16
|
-
}>;
|
|
17
|
-
export declare const policyRuleTypeSchema: z.ZodEnum<{
|
|
18
|
-
custom: "custom";
|
|
19
|
-
window: "window";
|
|
20
|
-
percentage: "percentage";
|
|
21
|
-
flat_amount: "flat_amount";
|
|
22
|
-
date_range: "date_range";
|
|
23
|
-
}>;
|
|
24
|
-
export declare const policyRefundTypeSchema: z.ZodEnum<{
|
|
25
|
-
none: "none";
|
|
26
|
-
cash: "cash";
|
|
27
|
-
credit: "credit";
|
|
28
|
-
cash_or_credit: "cash_or_credit";
|
|
29
|
-
}>;
|
|
30
|
-
export declare const policyAssignmentScopeSchema: z.ZodEnum<{
|
|
31
|
-
supplier: "supplier";
|
|
32
|
-
organization: "organization";
|
|
33
|
-
channel: "channel";
|
|
34
|
-
product: "product";
|
|
35
|
-
market: "market";
|
|
36
|
-
global: "global";
|
|
37
|
-
}>;
|
|
38
|
-
export declare const policyAcceptanceMethodSchema: z.ZodEnum<{
|
|
39
|
-
signature: "signature";
|
|
40
|
-
implicit: "implicit";
|
|
41
|
-
explicit_checkbox: "explicit_checkbox";
|
|
42
|
-
}>;
|
|
43
|
-
export declare const insertPolicySchema: z.ZodObject<{
|
|
44
|
-
kind: z.ZodEnum<{
|
|
45
|
-
other: "other";
|
|
46
|
-
refund: "refund";
|
|
47
|
-
payment: "payment";
|
|
48
|
-
cancellation: "cancellation";
|
|
49
|
-
terms_and_conditions: "terms_and_conditions";
|
|
50
|
-
privacy: "privacy";
|
|
51
|
-
commission: "commission";
|
|
52
|
-
guarantee: "guarantee";
|
|
53
|
-
}>;
|
|
54
|
-
name: z.ZodString;
|
|
55
|
-
slug: z.ZodString;
|
|
56
|
-
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
57
|
-
language: z.ZodDefault<z.ZodString>;
|
|
58
|
-
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
59
|
-
}, z.core.$strip>;
|
|
60
|
-
export declare const updatePolicySchema: z.ZodObject<{
|
|
61
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
62
|
-
other: "other";
|
|
63
|
-
refund: "refund";
|
|
64
|
-
payment: "payment";
|
|
65
|
-
cancellation: "cancellation";
|
|
66
|
-
terms_and_conditions: "terms_and_conditions";
|
|
67
|
-
privacy: "privacy";
|
|
68
|
-
commission: "commission";
|
|
69
|
-
guarantee: "guarantee";
|
|
70
|
-
}>>;
|
|
71
|
-
name: z.ZodOptional<z.ZodString>;
|
|
72
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
73
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
74
|
-
language: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
75
|
-
metadata: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
76
|
-
}, z.core.$strip>;
|
|
77
|
-
export declare const policyListQuerySchema: z.ZodObject<{
|
|
78
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
79
|
-
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
80
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
81
|
-
other: "other";
|
|
82
|
-
refund: "refund";
|
|
83
|
-
payment: "payment";
|
|
84
|
-
cancellation: "cancellation";
|
|
85
|
-
terms_and_conditions: "terms_and_conditions";
|
|
86
|
-
privacy: "privacy";
|
|
87
|
-
commission: "commission";
|
|
88
|
-
guarantee: "guarantee";
|
|
89
|
-
}>>;
|
|
90
|
-
language: z.ZodOptional<z.ZodString>;
|
|
91
|
-
search: z.ZodOptional<z.ZodString>;
|
|
92
|
-
}, z.core.$strip>;
|
|
93
|
-
export declare const insertPolicyVersionSchema: z.ZodObject<{
|
|
94
|
-
title: z.ZodString;
|
|
95
|
-
body: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
96
|
-
publishedBy: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
97
|
-
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
98
|
-
}, z.core.$strip>;
|
|
99
|
-
export declare const updatePolicyVersionSchema: z.ZodObject<{
|
|
100
|
-
title: z.ZodOptional<z.ZodString>;
|
|
101
|
-
body: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
102
|
-
publishedBy: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
103
|
-
metadata: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
104
|
-
}, z.core.$strip>;
|
|
105
|
-
export declare const insertPolicyRuleSchema: z.ZodObject<{
|
|
106
|
-
ruleType: z.ZodEnum<{
|
|
107
|
-
custom: "custom";
|
|
108
|
-
window: "window";
|
|
109
|
-
percentage: "percentage";
|
|
110
|
-
flat_amount: "flat_amount";
|
|
111
|
-
date_range: "date_range";
|
|
112
|
-
}>;
|
|
113
|
-
label: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
114
|
-
daysBeforeDeparture: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
115
|
-
refundPercent: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
116
|
-
refundType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
117
|
-
none: "none";
|
|
118
|
-
cash: "cash";
|
|
119
|
-
credit: "credit";
|
|
120
|
-
cash_or_credit: "cash_or_credit";
|
|
121
|
-
}>>>;
|
|
122
|
-
flatAmountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
123
|
-
currency: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
124
|
-
validFrom: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
125
|
-
validTo: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
126
|
-
conditions: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
127
|
-
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
128
|
-
}, z.core.$strip>;
|
|
129
|
-
export declare const updatePolicyRuleSchema: z.ZodObject<{
|
|
130
|
-
ruleType: z.ZodOptional<z.ZodEnum<{
|
|
131
|
-
custom: "custom";
|
|
132
|
-
window: "window";
|
|
133
|
-
percentage: "percentage";
|
|
134
|
-
flat_amount: "flat_amount";
|
|
135
|
-
date_range: "date_range";
|
|
136
|
-
}>>;
|
|
137
|
-
label: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
138
|
-
daysBeforeDeparture: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
139
|
-
refundPercent: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
140
|
-
refundType: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
141
|
-
none: "none";
|
|
142
|
-
cash: "cash";
|
|
143
|
-
credit: "credit";
|
|
144
|
-
cash_or_credit: "cash_or_credit";
|
|
145
|
-
}>>>>;
|
|
146
|
-
flatAmountCents: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
147
|
-
currency: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
148
|
-
validFrom: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
149
|
-
validTo: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
150
|
-
conditions: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
151
|
-
sortOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
152
|
-
}, z.core.$strip>;
|
|
153
|
-
export declare const insertPolicyAssignmentSchema: z.ZodObject<{
|
|
154
|
-
policyId: z.ZodString;
|
|
155
|
-
scope: z.ZodEnum<{
|
|
156
|
-
supplier: "supplier";
|
|
157
|
-
organization: "organization";
|
|
158
|
-
channel: "channel";
|
|
159
|
-
product: "product";
|
|
160
|
-
market: "market";
|
|
161
|
-
global: "global";
|
|
162
|
-
}>;
|
|
163
|
-
productId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
164
|
-
channelId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
165
|
-
supplierId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
166
|
-
marketId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
167
|
-
organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
168
|
-
validFrom: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
169
|
-
validTo: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
170
|
-
priority: z.ZodDefault<z.ZodNumber>;
|
|
171
|
-
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
172
|
-
}, z.core.$strip>;
|
|
173
|
-
export declare const updatePolicyAssignmentSchema: z.ZodObject<{
|
|
174
|
-
policyId: z.ZodOptional<z.ZodString>;
|
|
175
|
-
scope: z.ZodOptional<z.ZodEnum<{
|
|
176
|
-
supplier: "supplier";
|
|
177
|
-
organization: "organization";
|
|
178
|
-
channel: "channel";
|
|
179
|
-
product: "product";
|
|
180
|
-
market: "market";
|
|
181
|
-
global: "global";
|
|
182
|
-
}>>;
|
|
183
|
-
productId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
184
|
-
channelId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
185
|
-
supplierId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
186
|
-
marketId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
187
|
-
organizationId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
188
|
-
validFrom: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
189
|
-
validTo: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
190
|
-
priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
191
|
-
metadata: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
192
|
-
}, z.core.$strip>;
|
|
193
|
-
export declare const policyAssignmentListQuerySchema: z.ZodObject<{
|
|
194
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
195
|
-
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
196
|
-
policyId: z.ZodOptional<z.ZodString>;
|
|
197
|
-
scope: z.ZodOptional<z.ZodEnum<{
|
|
198
|
-
supplier: "supplier";
|
|
199
|
-
organization: "organization";
|
|
200
|
-
channel: "channel";
|
|
201
|
-
product: "product";
|
|
202
|
-
market: "market";
|
|
203
|
-
global: "global";
|
|
204
|
-
}>>;
|
|
205
|
-
productId: z.ZodOptional<z.ZodString>;
|
|
206
|
-
channelId: z.ZodOptional<z.ZodString>;
|
|
207
|
-
supplierId: z.ZodOptional<z.ZodString>;
|
|
208
|
-
marketId: z.ZodOptional<z.ZodString>;
|
|
209
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
210
|
-
}, z.core.$strip>;
|
|
211
|
-
export declare const insertPolicyAcceptanceSchema: z.ZodObject<{
|
|
212
|
-
policyVersionId: z.ZodString;
|
|
213
|
-
personId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
214
|
-
bookingId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
215
|
-
orderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
216
|
-
offerId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
217
|
-
acceptedBy: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
218
|
-
method: z.ZodDefault<z.ZodEnum<{
|
|
219
|
-
signature: "signature";
|
|
220
|
-
implicit: "implicit";
|
|
221
|
-
explicit_checkbox: "explicit_checkbox";
|
|
222
|
-
}>>;
|
|
223
|
-
ipAddress: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
224
|
-
userAgent: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
225
|
-
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
226
|
-
}, z.core.$strip>;
|
|
227
|
-
export declare const policyAcceptanceListQuerySchema: z.ZodObject<{
|
|
228
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
229
|
-
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
230
|
-
policyVersionId: z.ZodOptional<z.ZodString>;
|
|
231
|
-
personId: z.ZodOptional<z.ZodString>;
|
|
232
|
-
bookingId: z.ZodOptional<z.ZodString>;
|
|
233
|
-
orderId: z.ZodOptional<z.ZodString>;
|
|
234
|
-
}, z.core.$strip>;
|
|
235
|
-
export declare const evaluateCancellationInputSchema: z.ZodObject<{
|
|
236
|
-
daysBeforeDeparture: z.ZodNumber;
|
|
237
|
-
totalCents: z.ZodNumber;
|
|
238
|
-
currency: z.ZodOptional<z.ZodString>;
|
|
239
|
-
}, z.core.$strip>;
|
|
240
|
-
export declare const resolvePolicyInputSchema: z.ZodObject<{
|
|
241
|
-
kind: z.ZodEnum<{
|
|
242
|
-
other: "other";
|
|
243
|
-
refund: "refund";
|
|
244
|
-
payment: "payment";
|
|
245
|
-
cancellation: "cancellation";
|
|
246
|
-
terms_and_conditions: "terms_and_conditions";
|
|
247
|
-
privacy: "privacy";
|
|
248
|
-
commission: "commission";
|
|
249
|
-
guarantee: "guarantee";
|
|
250
|
-
}>;
|
|
251
|
-
productId: z.ZodOptional<z.ZodString>;
|
|
252
|
-
channelId: z.ZodOptional<z.ZodString>;
|
|
253
|
-
supplierId: z.ZodOptional<z.ZodString>;
|
|
254
|
-
marketId: z.ZodOptional<z.ZodString>;
|
|
255
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
256
|
-
at: z.ZodOptional<z.ZodString>;
|
|
257
|
-
}, z.core.$strip>;
|
|
1
|
+
export * from "@voyantjs/legal-contracts/policies/validation";
|
|
258
2
|
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/policies/validation.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/policies/validation.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAA"}
|
|
@@ -1,138 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export const policyKindSchema = z.enum([
|
|
3
|
-
"cancellation",
|
|
4
|
-
"payment",
|
|
5
|
-
"terms_and_conditions",
|
|
6
|
-
"privacy",
|
|
7
|
-
"refund",
|
|
8
|
-
"commission",
|
|
9
|
-
"guarantee",
|
|
10
|
-
"other",
|
|
11
|
-
]);
|
|
12
|
-
export const policyVersionStatusSchema = z.enum(["draft", "published", "retired"]);
|
|
13
|
-
export const policyRuleTypeSchema = z.enum([
|
|
14
|
-
"window",
|
|
15
|
-
"percentage",
|
|
16
|
-
"flat_amount",
|
|
17
|
-
"date_range",
|
|
18
|
-
"custom",
|
|
19
|
-
]);
|
|
20
|
-
export const policyRefundTypeSchema = z.enum(["cash", "credit", "cash_or_credit", "none"]);
|
|
21
|
-
export const policyAssignmentScopeSchema = z.enum([
|
|
22
|
-
"product",
|
|
23
|
-
"channel",
|
|
24
|
-
"supplier",
|
|
25
|
-
"market",
|
|
26
|
-
"organization",
|
|
27
|
-
"global",
|
|
28
|
-
]);
|
|
29
|
-
export const policyAcceptanceMethodSchema = z.enum(["implicit", "explicit_checkbox", "signature"]);
|
|
30
|
-
const paginationSchema = z.object({
|
|
31
|
-
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
32
|
-
offset: z.coerce.number().int().min(0).default(0),
|
|
33
|
-
});
|
|
34
|
-
// ---------- policies ----------
|
|
35
|
-
const policyCoreSchema = z.object({
|
|
36
|
-
kind: policyKindSchema,
|
|
37
|
-
name: z.string().min(1).max(255),
|
|
38
|
-
slug: z
|
|
39
|
-
.string()
|
|
40
|
-
.min(1)
|
|
41
|
-
.max(100)
|
|
42
|
-
.regex(/^[a-z0-9-]+$/, "slug must be kebab-case"),
|
|
43
|
-
description: z.string().max(2000).optional().nullable(),
|
|
44
|
-
language: z.string().min(2).max(10).default("en"),
|
|
45
|
-
metadata: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
46
|
-
});
|
|
47
|
-
export const insertPolicySchema = policyCoreSchema;
|
|
48
|
-
export const updatePolicySchema = policyCoreSchema.partial();
|
|
49
|
-
export const policyListQuerySchema = paginationSchema.extend({
|
|
50
|
-
kind: policyKindSchema.optional(),
|
|
51
|
-
language: z.string().optional(),
|
|
52
|
-
search: z.string().optional(),
|
|
53
|
-
});
|
|
54
|
-
// ---------- policy_versions ----------
|
|
55
|
-
const policyVersionCoreSchema = z.object({
|
|
56
|
-
title: z.string().min(1).max(500),
|
|
57
|
-
body: z.string().optional().nullable(),
|
|
58
|
-
publishedBy: z.string().max(255).optional().nullable(),
|
|
59
|
-
metadata: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
60
|
-
});
|
|
61
|
-
export const insertPolicyVersionSchema = policyVersionCoreSchema;
|
|
62
|
-
export const updatePolicyVersionSchema = policyVersionCoreSchema.partial();
|
|
63
|
-
// ---------- policy_rules ----------
|
|
64
|
-
const policyRuleCoreSchema = z.object({
|
|
65
|
-
ruleType: policyRuleTypeSchema,
|
|
66
|
-
label: z.string().max(255).optional().nullable(),
|
|
67
|
-
daysBeforeDeparture: z.number().int().optional().nullable(),
|
|
68
|
-
refundPercent: z.number().int().min(0).max(10000).optional().nullable(),
|
|
69
|
-
refundType: policyRefundTypeSchema.optional().nullable(),
|
|
70
|
-
flatAmountCents: z.number().int().optional().nullable(),
|
|
71
|
-
currency: z.string().max(10).optional().nullable(),
|
|
72
|
-
validFrom: z.string().optional().nullable(),
|
|
73
|
-
validTo: z.string().optional().nullable(),
|
|
74
|
-
conditions: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
75
|
-
sortOrder: z.number().int().default(0),
|
|
76
|
-
});
|
|
77
|
-
export const insertPolicyRuleSchema = policyRuleCoreSchema;
|
|
78
|
-
export const updatePolicyRuleSchema = policyRuleCoreSchema.partial();
|
|
79
|
-
// ---------- policy_assignments ----------
|
|
80
|
-
const policyAssignmentCoreSchema = z.object({
|
|
81
|
-
policyId: z.string(),
|
|
82
|
-
scope: policyAssignmentScopeSchema,
|
|
83
|
-
productId: z.string().optional().nullable(),
|
|
84
|
-
channelId: z.string().optional().nullable(),
|
|
85
|
-
supplierId: z.string().optional().nullable(),
|
|
86
|
-
marketId: z.string().optional().nullable(),
|
|
87
|
-
organizationId: z.string().optional().nullable(),
|
|
88
|
-
validFrom: z.string().optional().nullable(),
|
|
89
|
-
validTo: z.string().optional().nullable(),
|
|
90
|
-
priority: z.number().int().default(0),
|
|
91
|
-
metadata: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
92
|
-
});
|
|
93
|
-
export const insertPolicyAssignmentSchema = policyAssignmentCoreSchema;
|
|
94
|
-
export const updatePolicyAssignmentSchema = policyAssignmentCoreSchema.partial();
|
|
95
|
-
export const policyAssignmentListQuerySchema = paginationSchema.extend({
|
|
96
|
-
policyId: z.string().optional(),
|
|
97
|
-
scope: policyAssignmentScopeSchema.optional(),
|
|
98
|
-
productId: z.string().optional(),
|
|
99
|
-
channelId: z.string().optional(),
|
|
100
|
-
supplierId: z.string().optional(),
|
|
101
|
-
marketId: z.string().optional(),
|
|
102
|
-
organizationId: z.string().optional(),
|
|
103
|
-
});
|
|
104
|
-
// ---------- policy_acceptances ----------
|
|
105
|
-
const policyAcceptanceCoreSchema = z.object({
|
|
106
|
-
policyVersionId: z.string(),
|
|
107
|
-
personId: z.string().optional().nullable(),
|
|
108
|
-
bookingId: z.string().optional().nullable(),
|
|
109
|
-
orderId: z.string().optional().nullable(),
|
|
110
|
-
offerId: z.string().optional().nullable(),
|
|
111
|
-
acceptedBy: z.string().max(255).optional().nullable(),
|
|
112
|
-
method: policyAcceptanceMethodSchema.default("implicit"),
|
|
113
|
-
ipAddress: z.string().max(64).optional().nullable(),
|
|
114
|
-
userAgent: z.string().max(500).optional().nullable(),
|
|
115
|
-
metadata: z.record(z.string(), z.unknown()).optional().nullable(),
|
|
116
|
-
});
|
|
117
|
-
export const insertPolicyAcceptanceSchema = policyAcceptanceCoreSchema;
|
|
118
|
-
export const policyAcceptanceListQuerySchema = paginationSchema.extend({
|
|
119
|
-
policyVersionId: z.string().optional(),
|
|
120
|
-
personId: z.string().optional(),
|
|
121
|
-
bookingId: z.string().optional(),
|
|
122
|
-
orderId: z.string().optional(),
|
|
123
|
-
});
|
|
124
|
-
// ---------- evaluation ----------
|
|
125
|
-
export const evaluateCancellationInputSchema = z.object({
|
|
126
|
-
daysBeforeDeparture: z.number().int(),
|
|
127
|
-
totalCents: z.number().int().min(0),
|
|
128
|
-
currency: z.string().max(10).optional(),
|
|
129
|
-
});
|
|
130
|
-
export const resolvePolicyInputSchema = z.object({
|
|
131
|
-
kind: policyKindSchema,
|
|
132
|
-
productId: z.string().optional(),
|
|
133
|
-
channelId: z.string().optional(),
|
|
134
|
-
supplierId: z.string().optional(),
|
|
135
|
-
marketId: z.string().optional(),
|
|
136
|
-
organizationId: z.string().optional(),
|
|
137
|
-
at: z.string().optional(), // ISO date for validFrom/validTo filtering
|
|
138
|
-
});
|
|
1
|
+
export * from "@voyantjs/legal-contracts/policies/validation";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/legal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -59,15 +59,16 @@
|
|
|
59
59
|
"drizzle-orm": "^0.45.2",
|
|
60
60
|
"hono": "^4.12.10",
|
|
61
61
|
"zod": "^4.3.6",
|
|
62
|
-
"@voyantjs/bookings": "0.
|
|
63
|
-
"@voyantjs/core": "0.
|
|
64
|
-
"@voyantjs/crm": "0.
|
|
65
|
-
"@voyantjs/db": "0.
|
|
66
|
-
"@voyantjs/finance": "0.
|
|
67
|
-
"@voyantjs/hono": "0.
|
|
68
|
-
"@voyantjs/
|
|
69
|
-
"@voyantjs/
|
|
70
|
-
"@voyantjs/
|
|
62
|
+
"@voyantjs/bookings": "0.97.0",
|
|
63
|
+
"@voyantjs/core": "0.97.0",
|
|
64
|
+
"@voyantjs/crm": "0.97.0",
|
|
65
|
+
"@voyantjs/db": "0.97.0",
|
|
66
|
+
"@voyantjs/finance": "0.97.0",
|
|
67
|
+
"@voyantjs/hono": "0.97.0",
|
|
68
|
+
"@voyantjs/legal-contracts": "0.97.0",
|
|
69
|
+
"@voyantjs/storage": "0.97.0",
|
|
70
|
+
"@voyantjs/suppliers": "0.97.0",
|
|
71
|
+
"@voyantjs/utils": "0.97.0"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
74
|
"typescript": "^6.0.2",
|