@voyantjs/bookings 0.3.0 → 0.3.1
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/README.md +15 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/pricing-ref.d.ts +692 -0
- package/dist/pricing-ref.d.ts.map +1 -0
- package/dist/pricing-ref.js +49 -0
- package/dist/products-ref.d.ts +170 -0
- package/dist/products-ref.d.ts.map +1 -1
- package/dist/products-ref.js +10 -0
- package/dist/routes-public.d.ts +580 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +105 -0
- package/dist/routes-shared.d.ts +66 -0
- package/dist/routes-shared.d.ts.map +1 -0
- package/dist/routes-shared.js +10 -0
- package/dist/routes.d.ts +3 -43
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +1 -7
- package/dist/schema-operations.d.ts +166 -0
- package/dist/schema-operations.d.ts.map +1 -1
- package/dist/schema-operations.js +18 -1
- package/dist/schema-relations.d.ts +4 -0
- package/dist/schema-relations.d.ts.map +1 -1
- package/dist/schema-relations.js +8 -1
- package/dist/service-public.d.ts +709 -0
- package/dist/service-public.d.ts.map +1 -0
- package/dist/service-public.js +887 -0
- package/dist/validation-public.d.ts +901 -0
- package/dist/validation-public.d.ts.map +1 -0
- package/dist/validation-public.js +267 -0
- package/dist/validation-shared.d.ts +118 -0
- package/dist/validation-shared.d.ts.map +1 -0
- package/dist/validation-shared.js +102 -0
- package/dist/validation.d.ts +2 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +3 -90
- package/package.json +14 -5
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
|
+
import { boolean, integer, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
3
|
+
export const priceCatalogsRef = pgTable("price_catalogs", {
|
|
4
|
+
id: typeId("price_catalogs").primaryKey(),
|
|
5
|
+
code: text("code").notNull(),
|
|
6
|
+
name: text("name").notNull(),
|
|
7
|
+
currencyCode: text("currency_code"),
|
|
8
|
+
catalogType: text("catalog_type").notNull(),
|
|
9
|
+
isDefault: boolean("is_default").notNull().default(false),
|
|
10
|
+
active: boolean("active").notNull().default(true),
|
|
11
|
+
});
|
|
12
|
+
export const optionPriceRulesRef = pgTable("option_price_rules", {
|
|
13
|
+
id: typeId("option_price_rules").primaryKey(),
|
|
14
|
+
productId: text("product_id").notNull(),
|
|
15
|
+
optionId: text("option_id").notNull(),
|
|
16
|
+
priceCatalogId: typeIdRef("price_catalog_id").notNull(),
|
|
17
|
+
cancellationPolicyId: typeIdRef("cancellation_policy_id"),
|
|
18
|
+
name: text("name").notNull(),
|
|
19
|
+
description: text("description"),
|
|
20
|
+
pricingMode: text("pricing_mode").notNull(),
|
|
21
|
+
baseSellAmountCents: integer("base_sell_amount_cents"),
|
|
22
|
+
minPerBooking: integer("min_per_booking"),
|
|
23
|
+
maxPerBooking: integer("max_per_booking"),
|
|
24
|
+
isDefault: boolean("is_default").notNull().default(false),
|
|
25
|
+
active: boolean("active").notNull().default(true),
|
|
26
|
+
});
|
|
27
|
+
export const optionUnitPriceRulesRef = pgTable("option_unit_price_rules", {
|
|
28
|
+
id: typeId("option_unit_price_rules").primaryKey(),
|
|
29
|
+
optionPriceRuleId: typeIdRef("option_price_rule_id").notNull(),
|
|
30
|
+
optionId: text("option_id").notNull(),
|
|
31
|
+
unitId: text("unit_id").notNull(),
|
|
32
|
+
pricingCategoryId: typeIdRef("pricing_category_id"),
|
|
33
|
+
pricingMode: text("pricing_mode").notNull(),
|
|
34
|
+
sellAmountCents: integer("sell_amount_cents"),
|
|
35
|
+
minQuantity: integer("min_quantity"),
|
|
36
|
+
maxQuantity: integer("max_quantity"),
|
|
37
|
+
active: boolean("active").notNull().default(true),
|
|
38
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
39
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
40
|
+
});
|
|
41
|
+
export const optionUnitTiersRef = pgTable("option_unit_tiers", {
|
|
42
|
+
id: typeId("option_unit_tiers").primaryKey(),
|
|
43
|
+
optionUnitPriceRuleId: typeIdRef("option_unit_price_rule_id").notNull(),
|
|
44
|
+
minQuantity: integer("min_quantity").notNull(),
|
|
45
|
+
maxQuantity: integer("max_quantity"),
|
|
46
|
+
sellAmountCents: integer("sell_amount_cents"),
|
|
47
|
+
active: boolean("active").notNull().default(true),
|
|
48
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
49
|
+
});
|
package/dist/products-ref.d.ts
CHANGED
|
@@ -36,6 +36,23 @@ export declare const productsRef: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
36
36
|
identity: undefined;
|
|
37
37
|
generated: undefined;
|
|
38
38
|
}, {}, {}>;
|
|
39
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
+
name: "status";
|
|
41
|
+
tableName: "products";
|
|
42
|
+
dataType: "string";
|
|
43
|
+
columnType: "PgText";
|
|
44
|
+
data: string;
|
|
45
|
+
driverParam: string;
|
|
46
|
+
notNull: true;
|
|
47
|
+
hasDefault: false;
|
|
48
|
+
isPrimaryKey: false;
|
|
49
|
+
isAutoincrement: false;
|
|
50
|
+
hasRuntimeDefault: false;
|
|
51
|
+
enumValues: [string, ...string[]];
|
|
52
|
+
baseColumn: never;
|
|
53
|
+
identity: undefined;
|
|
54
|
+
generated: undefined;
|
|
55
|
+
}, {}, {}>;
|
|
39
56
|
description: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
57
|
name: "description";
|
|
41
58
|
tableName: "products";
|
|
@@ -53,6 +70,40 @@ export declare const productsRef: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
53
70
|
identity: undefined;
|
|
54
71
|
generated: undefined;
|
|
55
72
|
}, {}, {}>;
|
|
73
|
+
visibility: import("drizzle-orm/pg-core").PgColumn<{
|
|
74
|
+
name: "visibility";
|
|
75
|
+
tableName: "products";
|
|
76
|
+
dataType: "string";
|
|
77
|
+
columnType: "PgText";
|
|
78
|
+
data: string;
|
|
79
|
+
driverParam: string;
|
|
80
|
+
notNull: true;
|
|
81
|
+
hasDefault: false;
|
|
82
|
+
isPrimaryKey: false;
|
|
83
|
+
isAutoincrement: false;
|
|
84
|
+
hasRuntimeDefault: false;
|
|
85
|
+
enumValues: [string, ...string[]];
|
|
86
|
+
baseColumn: never;
|
|
87
|
+
identity: undefined;
|
|
88
|
+
generated: undefined;
|
|
89
|
+
}, {}, {}>;
|
|
90
|
+
activated: import("drizzle-orm/pg-core").PgColumn<{
|
|
91
|
+
name: "activated";
|
|
92
|
+
tableName: "products";
|
|
93
|
+
dataType: "boolean";
|
|
94
|
+
columnType: "PgBoolean";
|
|
95
|
+
data: boolean;
|
|
96
|
+
driverParam: boolean;
|
|
97
|
+
notNull: true;
|
|
98
|
+
hasDefault: true;
|
|
99
|
+
isPrimaryKey: false;
|
|
100
|
+
isAutoincrement: false;
|
|
101
|
+
hasRuntimeDefault: false;
|
|
102
|
+
enumValues: undefined;
|
|
103
|
+
baseColumn: never;
|
|
104
|
+
identity: undefined;
|
|
105
|
+
generated: undefined;
|
|
106
|
+
}, {}, {}>;
|
|
56
107
|
sellCurrency: import("drizzle-orm/pg-core").PgColumn<{
|
|
57
108
|
name: "sell_currency";
|
|
58
109
|
tableName: "products";
|
|
@@ -356,6 +407,23 @@ export declare const optionUnitsRef: import("drizzle-orm/pg-core").PgTableWithCo
|
|
|
356
407
|
identity: undefined;
|
|
357
408
|
generated: undefined;
|
|
358
409
|
}, {}, {}>;
|
|
410
|
+
code: import("drizzle-orm/pg-core").PgColumn<{
|
|
411
|
+
name: "code";
|
|
412
|
+
tableName: "option_units";
|
|
413
|
+
dataType: "string";
|
|
414
|
+
columnType: "PgText";
|
|
415
|
+
data: string;
|
|
416
|
+
driverParam: string;
|
|
417
|
+
notNull: false;
|
|
418
|
+
hasDefault: false;
|
|
419
|
+
isPrimaryKey: false;
|
|
420
|
+
isAutoincrement: false;
|
|
421
|
+
hasRuntimeDefault: false;
|
|
422
|
+
enumValues: [string, ...string[]];
|
|
423
|
+
baseColumn: never;
|
|
424
|
+
identity: undefined;
|
|
425
|
+
generated: undefined;
|
|
426
|
+
}, {}, {}>;
|
|
359
427
|
description: import("drizzle-orm/pg-core").PgColumn<{
|
|
360
428
|
name: "description";
|
|
361
429
|
tableName: "option_units";
|
|
@@ -407,6 +475,23 @@ export declare const optionUnitsRef: import("drizzle-orm/pg-core").PgTableWithCo
|
|
|
407
475
|
identity: undefined;
|
|
408
476
|
generated: undefined;
|
|
409
477
|
}, {}, {}>;
|
|
478
|
+
isHidden: import("drizzle-orm/pg-core").PgColumn<{
|
|
479
|
+
name: "is_hidden";
|
|
480
|
+
tableName: "option_units";
|
|
481
|
+
dataType: "boolean";
|
|
482
|
+
columnType: "PgBoolean";
|
|
483
|
+
data: boolean;
|
|
484
|
+
driverParam: boolean;
|
|
485
|
+
notNull: true;
|
|
486
|
+
hasDefault: true;
|
|
487
|
+
isPrimaryKey: false;
|
|
488
|
+
isAutoincrement: false;
|
|
489
|
+
hasRuntimeDefault: false;
|
|
490
|
+
enumValues: undefined;
|
|
491
|
+
baseColumn: never;
|
|
492
|
+
identity: undefined;
|
|
493
|
+
generated: undefined;
|
|
494
|
+
}, {}, {}>;
|
|
410
495
|
minQuantity: import("drizzle-orm/pg-core").PgColumn<{
|
|
411
496
|
name: "min_quantity";
|
|
412
497
|
tableName: "option_units";
|
|
@@ -424,6 +509,91 @@ export declare const optionUnitsRef: import("drizzle-orm/pg-core").PgTableWithCo
|
|
|
424
509
|
identity: undefined;
|
|
425
510
|
generated: undefined;
|
|
426
511
|
}, {}, {}>;
|
|
512
|
+
maxQuantity: import("drizzle-orm/pg-core").PgColumn<{
|
|
513
|
+
name: "max_quantity";
|
|
514
|
+
tableName: "option_units";
|
|
515
|
+
dataType: "number";
|
|
516
|
+
columnType: "PgInteger";
|
|
517
|
+
data: number;
|
|
518
|
+
driverParam: string | number;
|
|
519
|
+
notNull: false;
|
|
520
|
+
hasDefault: false;
|
|
521
|
+
isPrimaryKey: false;
|
|
522
|
+
isAutoincrement: false;
|
|
523
|
+
hasRuntimeDefault: false;
|
|
524
|
+
enumValues: undefined;
|
|
525
|
+
baseColumn: never;
|
|
526
|
+
identity: undefined;
|
|
527
|
+
generated: undefined;
|
|
528
|
+
}, {}, {}>;
|
|
529
|
+
minAge: import("drizzle-orm/pg-core").PgColumn<{
|
|
530
|
+
name: "min_age";
|
|
531
|
+
tableName: "option_units";
|
|
532
|
+
dataType: "number";
|
|
533
|
+
columnType: "PgInteger";
|
|
534
|
+
data: number;
|
|
535
|
+
driverParam: string | number;
|
|
536
|
+
notNull: false;
|
|
537
|
+
hasDefault: false;
|
|
538
|
+
isPrimaryKey: false;
|
|
539
|
+
isAutoincrement: false;
|
|
540
|
+
hasRuntimeDefault: false;
|
|
541
|
+
enumValues: undefined;
|
|
542
|
+
baseColumn: never;
|
|
543
|
+
identity: undefined;
|
|
544
|
+
generated: undefined;
|
|
545
|
+
}, {}, {}>;
|
|
546
|
+
maxAge: import("drizzle-orm/pg-core").PgColumn<{
|
|
547
|
+
name: "max_age";
|
|
548
|
+
tableName: "option_units";
|
|
549
|
+
dataType: "number";
|
|
550
|
+
columnType: "PgInteger";
|
|
551
|
+
data: number;
|
|
552
|
+
driverParam: string | number;
|
|
553
|
+
notNull: false;
|
|
554
|
+
hasDefault: false;
|
|
555
|
+
isPrimaryKey: false;
|
|
556
|
+
isAutoincrement: false;
|
|
557
|
+
hasRuntimeDefault: false;
|
|
558
|
+
enumValues: undefined;
|
|
559
|
+
baseColumn: never;
|
|
560
|
+
identity: undefined;
|
|
561
|
+
generated: undefined;
|
|
562
|
+
}, {}, {}>;
|
|
563
|
+
occupancyMin: import("drizzle-orm/pg-core").PgColumn<{
|
|
564
|
+
name: "occupancy_min";
|
|
565
|
+
tableName: "option_units";
|
|
566
|
+
dataType: "number";
|
|
567
|
+
columnType: "PgInteger";
|
|
568
|
+
data: number;
|
|
569
|
+
driverParam: string | number;
|
|
570
|
+
notNull: false;
|
|
571
|
+
hasDefault: false;
|
|
572
|
+
isPrimaryKey: false;
|
|
573
|
+
isAutoincrement: false;
|
|
574
|
+
hasRuntimeDefault: false;
|
|
575
|
+
enumValues: undefined;
|
|
576
|
+
baseColumn: never;
|
|
577
|
+
identity: undefined;
|
|
578
|
+
generated: undefined;
|
|
579
|
+
}, {}, {}>;
|
|
580
|
+
occupancyMax: import("drizzle-orm/pg-core").PgColumn<{
|
|
581
|
+
name: "occupancy_max";
|
|
582
|
+
tableName: "option_units";
|
|
583
|
+
dataType: "number";
|
|
584
|
+
columnType: "PgInteger";
|
|
585
|
+
data: number;
|
|
586
|
+
driverParam: string | number;
|
|
587
|
+
notNull: false;
|
|
588
|
+
hasDefault: false;
|
|
589
|
+
isPrimaryKey: false;
|
|
590
|
+
isAutoincrement: false;
|
|
591
|
+
hasRuntimeDefault: false;
|
|
592
|
+
enumValues: undefined;
|
|
593
|
+
baseColumn: never;
|
|
594
|
+
identity: undefined;
|
|
595
|
+
generated: undefined;
|
|
596
|
+
}, {}, {}>;
|
|
427
597
|
sortOrder: import("drizzle-orm/pg-core").PgColumn<{
|
|
428
598
|
name: "sort_order";
|
|
429
599
|
tableName: "option_units";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products-ref.d.ts","sourceRoot":"","sources":["../src/products-ref.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"products-ref.d.ts","sourceRoot":"","sources":["../src/products-ref.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMnC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQvC,CAAA"}
|
package/dist/products-ref.js
CHANGED
|
@@ -3,7 +3,10 @@ import { boolean, date, integer, pgTable, text, timestamp } from "drizzle-orm/pg
|
|
|
3
3
|
export const productsRef = pgTable("products", {
|
|
4
4
|
id: typeId("products").primaryKey(),
|
|
5
5
|
name: text("name").notNull(),
|
|
6
|
+
status: text("status").notNull(),
|
|
6
7
|
description: text("description"),
|
|
8
|
+
visibility: text("visibility").notNull(),
|
|
9
|
+
activated: boolean("activated").notNull().default(false),
|
|
7
10
|
sellCurrency: text("sell_currency").notNull(),
|
|
8
11
|
sellAmountCents: integer("sell_amount_cents"),
|
|
9
12
|
costAmountCents: integer("cost_amount_cents"),
|
|
@@ -25,10 +28,17 @@ export const optionUnitsRef = pgTable("option_units", {
|
|
|
25
28
|
id: typeId("option_units").primaryKey(),
|
|
26
29
|
optionId: typeIdRef("option_id").notNull(),
|
|
27
30
|
name: text("name").notNull(),
|
|
31
|
+
code: text("code"),
|
|
28
32
|
description: text("description"),
|
|
29
33
|
unitType: text("unit_type"),
|
|
30
34
|
isRequired: boolean("is_required").notNull().default(false),
|
|
35
|
+
isHidden: boolean("is_hidden").notNull().default(false),
|
|
31
36
|
minQuantity: integer("min_quantity"),
|
|
37
|
+
maxQuantity: integer("max_quantity"),
|
|
38
|
+
minAge: integer("min_age"),
|
|
39
|
+
maxAge: integer("max_age"),
|
|
40
|
+
occupancyMin: integer("occupancy_min"),
|
|
41
|
+
occupancyMax: integer("occupancy_max"),
|
|
32
42
|
sortOrder: integer("sort_order").notNull().default(0),
|
|
33
43
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
34
44
|
});
|