@voyantjs/suppliers 0.19.0 → 0.21.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/routes.d.ts +9 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/schema.d.ts +34 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +17 -0
- package/dist/service-core.d.ts +8 -0
- package/dist/service-core.d.ts.map +1 -1
- package/dist/service-operations.d.ts +1 -1
- package/dist/validation.d.ts +45 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +19 -0
- package/package.json +6 -6
package/dist/routes.d.ts
CHANGED
|
@@ -40,7 +40,9 @@ export declare const supplierRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
40
40
|
description: string | null;
|
|
41
41
|
defaultCurrency: string | null;
|
|
42
42
|
paymentTermsDays: number | null;
|
|
43
|
+
reservationTimeoutMinutes: number | null;
|
|
43
44
|
primaryFacilityId: string | null;
|
|
45
|
+
customerPaymentPolicy: import("hono/utils/types").JSONValue;
|
|
44
46
|
tags: string[] | null;
|
|
45
47
|
createdAt: string;
|
|
46
48
|
updatedAt: string;
|
|
@@ -299,7 +301,9 @@ export declare const supplierRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
299
301
|
description: string | null;
|
|
300
302
|
defaultCurrency: string | null;
|
|
301
303
|
paymentTermsDays: number | null;
|
|
304
|
+
reservationTimeoutMinutes: number | null;
|
|
302
305
|
primaryFacilityId: string | null;
|
|
306
|
+
customerPaymentPolicy: import("hono/utils/types").JSONValue;
|
|
303
307
|
tags: string[] | null;
|
|
304
308
|
createdAt: string;
|
|
305
309
|
updatedAt: string;
|
|
@@ -343,7 +347,9 @@ export declare const supplierRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
343
347
|
tags: string[] | null;
|
|
344
348
|
defaultCurrency: string | null;
|
|
345
349
|
paymentTermsDays: number | null;
|
|
350
|
+
reservationTimeoutMinutes: number | null;
|
|
346
351
|
primaryFacilityId: string | null;
|
|
352
|
+
customerPaymentPolicy: import("hono/utils/types").JSONValue;
|
|
347
353
|
};
|
|
348
354
|
};
|
|
349
355
|
outputFormat: "json";
|
|
@@ -387,7 +393,9 @@ export declare const supplierRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
387
393
|
description: string | null;
|
|
388
394
|
defaultCurrency: string | null;
|
|
389
395
|
paymentTermsDays: number | null;
|
|
396
|
+
reservationTimeoutMinutes: number | null;
|
|
390
397
|
primaryFacilityId: string | null;
|
|
398
|
+
customerPaymentPolicy: import("hono/utils/types").JSONValue;
|
|
391
399
|
tags: string[] | null;
|
|
392
400
|
createdAt: string;
|
|
393
401
|
updatedAt: string;
|
|
@@ -708,11 +716,11 @@ export declare const supplierRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
708
716
|
updatedAt: string;
|
|
709
717
|
description: string | null;
|
|
710
718
|
active: boolean;
|
|
719
|
+
capacity: number | null;
|
|
711
720
|
tags: string[] | null;
|
|
712
721
|
facilityId: string | null;
|
|
713
722
|
supplierId: string;
|
|
714
723
|
serviceType: "other" | "transfer" | "guide" | "experience" | "accommodation" | "meal";
|
|
715
|
-
capacity: number | null;
|
|
716
724
|
};
|
|
717
725
|
};
|
|
718
726
|
outputFormat: "json";
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAqBjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAMD,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA+ZvB,CAAA;AAEJ,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAA"}
|
package/dist/schema.d.ts
CHANGED
|
@@ -126,6 +126,23 @@ export declare const suppliers: import("drizzle-orm/pg-core").PgTableWithColumns
|
|
|
126
126
|
identity: undefined;
|
|
127
127
|
generated: undefined;
|
|
128
128
|
}, {}, {}>;
|
|
129
|
+
reservationTimeoutMinutes: import("drizzle-orm/pg-core").PgColumn<{
|
|
130
|
+
name: "reservation_timeout_minutes";
|
|
131
|
+
tableName: "suppliers";
|
|
132
|
+
dataType: "number";
|
|
133
|
+
columnType: "PgInteger";
|
|
134
|
+
data: number;
|
|
135
|
+
driverParam: string | number;
|
|
136
|
+
notNull: false;
|
|
137
|
+
hasDefault: false;
|
|
138
|
+
isPrimaryKey: false;
|
|
139
|
+
isAutoincrement: false;
|
|
140
|
+
hasRuntimeDefault: false;
|
|
141
|
+
enumValues: undefined;
|
|
142
|
+
baseColumn: never;
|
|
143
|
+
identity: undefined;
|
|
144
|
+
generated: undefined;
|
|
145
|
+
}, {}, {}>;
|
|
129
146
|
primaryFacilityId: import("drizzle-orm/pg-core").PgColumn<{
|
|
130
147
|
name: string;
|
|
131
148
|
tableName: "suppliers";
|
|
@@ -143,6 +160,23 @@ export declare const suppliers: import("drizzle-orm/pg-core").PgTableWithColumns
|
|
|
143
160
|
identity: undefined;
|
|
144
161
|
generated: undefined;
|
|
145
162
|
}, {}, {}>;
|
|
163
|
+
customerPaymentPolicy: import("drizzle-orm/pg-core").PgColumn<{
|
|
164
|
+
name: "customer_payment_policy";
|
|
165
|
+
tableName: "suppliers";
|
|
166
|
+
dataType: "json";
|
|
167
|
+
columnType: "PgJsonb";
|
|
168
|
+
data: unknown;
|
|
169
|
+
driverParam: unknown;
|
|
170
|
+
notNull: false;
|
|
171
|
+
hasDefault: false;
|
|
172
|
+
isPrimaryKey: false;
|
|
173
|
+
isAutoincrement: false;
|
|
174
|
+
hasRuntimeDefault: false;
|
|
175
|
+
enumValues: undefined;
|
|
176
|
+
baseColumn: never;
|
|
177
|
+
identity: undefined;
|
|
178
|
+
generated: undefined;
|
|
179
|
+
}, {}, {}>;
|
|
146
180
|
tags: import("drizzle-orm/pg-core").PgColumn<{
|
|
147
181
|
name: "tags";
|
|
148
182
|
tableName: "suppliers";
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,gBAAgB,sHAQ3B,CAAA;AAEF,eAAO,MAAM,kBAAkB,yEAA+D,CAAA;AAE9F,eAAO,MAAM,eAAe,6GAO1B,CAAA;AAEF,eAAO,MAAM,YAAY,uGAMvB,CAAA;AAEF,eAAO,MAAM,0BAA0B,sFAKrC,CAAA;AAIF,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,gBAAgB,sHAQ3B,CAAA;AAEF,eAAO,MAAM,kBAAkB,yEAA+D,CAAA;AAE9F,eAAO,MAAM,eAAe,6GAO1B,CAAA;AAEF,eAAO,MAAM,YAAY,uGAMvB,CAAA;AAEF,eAAO,MAAM,0BAA0B,sFAKrC,CAAA;AAIF,eAAO,MAAM,SAA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A;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,iBAAiB,CAAC,YAAY,CAAA;AACpE,MAAM,MAAM,mBAAmB,GAAG,OAAO,iBAAiB,CAAC,YAAY,CAAA;AAIvE,eAAO,MAAM,kBAAkB;;;;;;;EAa5B,CAAA;AAEH,eAAO,MAAM,qCAAqC;;EAQjD,CAAA;AAED,eAAO,MAAM,yBAAyB;;;;EAOnC,CAAA;AAEH,eAAO,MAAM,sBAAsB;;EAKhC,CAAA;AAEH,eAAO,MAAM,sBAAsB;;EAEhC,CAAA;AAEH,eAAO,MAAM,6BAA6B;;EAKvC,CAAA;AAEH,eAAO,MAAM,0BAA0B;;EAKpC,CAAA"}
|
package/dist/schema.js
CHANGED
|
@@ -43,9 +43,26 @@ export const suppliers = pgTable("suppliers", {
|
|
|
43
43
|
// Defaults
|
|
44
44
|
defaultCurrency: text("default_currency"),
|
|
45
45
|
paymentTermsDays: integer("payment_terms_days"),
|
|
46
|
+
reservationTimeoutMinutes: integer("reservation_timeout_minutes"),
|
|
46
47
|
primaryFacilityId: typeIdRef("primary_facility_id").references(() => facilities.id, {
|
|
47
48
|
onDelete: "set null",
|
|
48
49
|
}),
|
|
50
|
+
/**
|
|
51
|
+
* Customer-facing payment policy override. When set, sourced
|
|
52
|
+
* bookings against this supplier inherit these terms instead of
|
|
53
|
+
* the deployment's default policy. Shape mirrors `PaymentPolicy`
|
|
54
|
+
* from `@voyantjs/finance` (jsonb so the shape can evolve
|
|
55
|
+
* without per-field column adds).
|
|
56
|
+
*
|
|
57
|
+
* `null` means "inherit from operator default" — most suppliers
|
|
58
|
+
* leave this empty unless they impose their own deposit / balance
|
|
59
|
+
* window.
|
|
60
|
+
*
|
|
61
|
+
* Distinct from `paymentTermsDays` above, which governs when the
|
|
62
|
+
* operator pays the supplier (Net 14 / Net 30) — the inverse
|
|
63
|
+
* cash-flow direction.
|
|
64
|
+
*/
|
|
65
|
+
customerPaymentPolicy: jsonb("customer_payment_policy"),
|
|
49
66
|
// Metadata
|
|
50
67
|
tags: jsonb("tags").$type().default([]),
|
|
51
68
|
// Timestamps
|
package/dist/service-core.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ export declare function listSuppliers(db: PostgresJsDatabase, query: SupplierLis
|
|
|
9
9
|
description: string | null;
|
|
10
10
|
defaultCurrency: string | null;
|
|
11
11
|
paymentTermsDays: number | null;
|
|
12
|
+
reservationTimeoutMinutes: number | null;
|
|
12
13
|
primaryFacilityId: string | null;
|
|
14
|
+
customerPaymentPolicy: unknown;
|
|
13
15
|
tags: string[] | null;
|
|
14
16
|
createdAt: Date;
|
|
15
17
|
updatedAt: Date;
|
|
@@ -26,7 +28,9 @@ export declare function getSupplierById(db: PostgresJsDatabase, id: string): Pro
|
|
|
26
28
|
description: string | null;
|
|
27
29
|
defaultCurrency: string | null;
|
|
28
30
|
paymentTermsDays: number | null;
|
|
31
|
+
reservationTimeoutMinutes: number | null;
|
|
29
32
|
primaryFacilityId: string | null;
|
|
33
|
+
customerPaymentPolicy: unknown;
|
|
30
34
|
tags: string[] | null;
|
|
31
35
|
createdAt: Date;
|
|
32
36
|
updatedAt: Date;
|
|
@@ -51,7 +55,9 @@ export declare function createSupplier(db: PostgresJsDatabase, data: CreateSuppl
|
|
|
51
55
|
tags: string[] | null;
|
|
52
56
|
defaultCurrency: string | null;
|
|
53
57
|
paymentTermsDays: number | null;
|
|
58
|
+
reservationTimeoutMinutes: number | null;
|
|
54
59
|
primaryFacilityId: string | null;
|
|
60
|
+
customerPaymentPolicy: unknown;
|
|
55
61
|
}>;
|
|
56
62
|
export declare function updateSupplier(db: PostgresJsDatabase, id: string, data: UpdateSupplierInput): Promise<{
|
|
57
63
|
email: string | null;
|
|
@@ -70,7 +76,9 @@ export declare function updateSupplier(db: PostgresJsDatabase, id: string, data:
|
|
|
70
76
|
description: string | null;
|
|
71
77
|
defaultCurrency: string | null;
|
|
72
78
|
paymentTermsDays: number | null;
|
|
79
|
+
reservationTimeoutMinutes: number | null;
|
|
73
80
|
primaryFacilityId: string | null;
|
|
81
|
+
customerPaymentPolicy: unknown;
|
|
74
82
|
tags: string[] | null;
|
|
75
83
|
createdAt: Date;
|
|
76
84
|
updatedAt: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-core.d.ts","sourceRoot":"","sources":["../src/service-core.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,qBAAqB,CAAA;AAG5B,wBAAsB,aAAa,CAAC,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,iBAAiB
|
|
1
|
+
{"version":3,"file":"service-core.d.ts","sourceRoot":"","sources":["../src/service-core.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,qBAAqB,CAAA;AAG5B,wBAAsB,aAAa,CAAC,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;GA2DnF;AAED,wBAAsB,eAAe,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;kEAQvE;AAED,wBAAsB,cAAc,CAAC,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;GA2CrF;AAED,wBAAsB,cAAc,CAClC,EAAE,EAAE,kBAAkB,EACtB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;UAqD1B;AAED,wBAAsB,cAAc,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM;;UAMtE"}
|
|
@@ -436,11 +436,11 @@ export declare function createService(db: PostgresJsDatabase, supplierId: string
|
|
|
436
436
|
updatedAt: Date;
|
|
437
437
|
description: string | null;
|
|
438
438
|
active: boolean;
|
|
439
|
+
capacity: number | null;
|
|
439
440
|
tags: string[] | null;
|
|
440
441
|
facilityId: string | null;
|
|
441
442
|
supplierId: string;
|
|
442
443
|
serviceType: "other" | "transfer" | "guide" | "experience" | "accommodation" | "meal";
|
|
443
|
-
capacity: number | null;
|
|
444
444
|
} | null>;
|
|
445
445
|
export declare function updateService(db: PostgresJsDatabase, serviceId: string, data: UpdateServiceInput): Promise<{
|
|
446
446
|
id: string;
|
package/dist/validation.d.ts
CHANGED
|
@@ -28,6 +28,21 @@ export declare const insertSupplierSchema: z.ZodObject<{
|
|
|
28
28
|
contactEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
29
29
|
contactPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
30
30
|
paymentTermsDays: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
31
|
+
reservationTimeoutMinutes: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
32
|
+
customerPaymentPolicy: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
33
|
+
deposit: z.ZodObject<{
|
|
34
|
+
kind: z.ZodEnum<{
|
|
35
|
+
none: "none";
|
|
36
|
+
percent: "percent";
|
|
37
|
+
fixed_cents: "fixed_cents";
|
|
38
|
+
}>;
|
|
39
|
+
percent: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
amountCents: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
minDaysBeforeDepartureForDeposit: z.ZodNumber;
|
|
43
|
+
balanceDueDaysBeforeDeparture: z.ZodNumber;
|
|
44
|
+
balanceDueMinDaysFromNow: z.ZodNumber;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
31
46
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
32
47
|
}, z.core.$strip>;
|
|
33
48
|
export declare const updateSupplierSchema: z.ZodObject<{
|
|
@@ -59,6 +74,21 @@ export declare const updateSupplierSchema: z.ZodObject<{
|
|
|
59
74
|
contactEmail: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
60
75
|
contactPhone: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
61
76
|
paymentTermsDays: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
77
|
+
reservationTimeoutMinutes: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
78
|
+
customerPaymentPolicy: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
79
|
+
deposit: z.ZodObject<{
|
|
80
|
+
kind: z.ZodEnum<{
|
|
81
|
+
none: "none";
|
|
82
|
+
percent: "percent";
|
|
83
|
+
fixed_cents: "fixed_cents";
|
|
84
|
+
}>;
|
|
85
|
+
percent: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
amountCents: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
minDaysBeforeDepartureForDeposit: z.ZodNumber;
|
|
89
|
+
balanceDueDaysBeforeDeparture: z.ZodNumber;
|
|
90
|
+
balanceDueMinDaysFromNow: z.ZodNumber;
|
|
91
|
+
}, z.core.$strip>>>>;
|
|
62
92
|
tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
63
93
|
}, z.core.$strip>;
|
|
64
94
|
export declare const selectSupplierSchema: z.ZodObject<{
|
|
@@ -90,6 +120,21 @@ export declare const selectSupplierSchema: z.ZodObject<{
|
|
|
90
120
|
contactEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
91
121
|
contactPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
92
122
|
paymentTermsDays: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
123
|
+
reservationTimeoutMinutes: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
124
|
+
customerPaymentPolicy: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
125
|
+
deposit: z.ZodObject<{
|
|
126
|
+
kind: z.ZodEnum<{
|
|
127
|
+
none: "none";
|
|
128
|
+
percent: "percent";
|
|
129
|
+
fixed_cents: "fixed_cents";
|
|
130
|
+
}>;
|
|
131
|
+
percent: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
amountCents: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
minDaysBeforeDepartureForDeposit: z.ZodNumber;
|
|
135
|
+
balanceDueDaysBeforeDeparture: z.ZodNumber;
|
|
136
|
+
balanceDueMinDaysFromNow: z.ZodNumber;
|
|
137
|
+
}, z.core.$strip>>>;
|
|
93
138
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
94
139
|
id: z.ZodString;
|
|
95
140
|
createdAt: z.ZodCoercedDate<unknown>;
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAoEvB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAqB,CAAA;AACtD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA+B,CAAA;AAChE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI/B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;iBAOl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vehicle", "flat"]);
|
|
22
22
|
// ---------- suppliers ----------
|
|
23
|
+
const depositRuleSchema = z.object({
|
|
24
|
+
kind: z.enum(["none", "percent", "fixed_cents"]),
|
|
25
|
+
percent: z.number().min(0).max(100).optional(),
|
|
26
|
+
amountCents: z.number().int().min(0).optional(),
|
|
27
|
+
});
|
|
28
|
+
const customerPaymentPolicySchema = z.object({
|
|
29
|
+
deposit: depositRuleSchema,
|
|
30
|
+
minDaysBeforeDepartureForDeposit: z.number().int().min(0),
|
|
31
|
+
balanceDueDaysBeforeDeparture: z.number().int().min(0),
|
|
32
|
+
balanceDueMinDaysFromNow: z.number().int().min(0),
|
|
33
|
+
});
|
|
23
34
|
const supplierCoreSchema = z.object({
|
|
24
35
|
name: z.string().min(1).max(255),
|
|
25
36
|
type: supplierTypeSchema,
|
|
@@ -37,6 +48,14 @@ const supplierCoreSchema = z.object({
|
|
|
37
48
|
contactEmail: z.string().email().optional().nullable(),
|
|
38
49
|
contactPhone: z.string().optional().nullable(),
|
|
39
50
|
paymentTermsDays: z.number().int().positive().optional().nullable(),
|
|
51
|
+
reservationTimeoutMinutes: z
|
|
52
|
+
.number()
|
|
53
|
+
.int()
|
|
54
|
+
.min(0)
|
|
55
|
+
.max(24 * 60)
|
|
56
|
+
.optional()
|
|
57
|
+
.nullable(),
|
|
58
|
+
customerPaymentPolicy: customerPaymentPolicySchema.optional().nullable(),
|
|
40
59
|
tags: z.array(z.string()).default([]),
|
|
41
60
|
});
|
|
42
61
|
export const insertSupplierSchema = supplierCoreSchema;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/suppliers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"drizzle-orm": "^0.45.2",
|
|
30
30
|
"hono": "^4.12.10",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@voyantjs/core": "0.
|
|
33
|
-
"@voyantjs/db": "0.
|
|
34
|
-
"@voyantjs/facilities": "0.
|
|
35
|
-
"@voyantjs/hono": "0.
|
|
36
|
-
"@voyantjs/identity": "0.
|
|
32
|
+
"@voyantjs/core": "0.21.0",
|
|
33
|
+
"@voyantjs/db": "0.21.0",
|
|
34
|
+
"@voyantjs/facilities": "0.21.0",
|
|
35
|
+
"@voyantjs/hono": "0.21.0",
|
|
36
|
+
"@voyantjs/identity": "0.21.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"typescript": "^6.0.2",
|