@voyantjs/pricing 0.2.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/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/routes-core.d.ts +981 -0
- package/dist/routes-core.d.ts.map +1 -0
- package/dist/routes-core.js +101 -0
- package/dist/routes-public.d.ts +136 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +13 -0
- package/dist/routes-rules.d.ts +1176 -0
- package/dist/routes-rules.d.ts.map +1 -0
- package/dist/routes-rules.js +117 -0
- package/dist/routes-shared.d.ts +12 -0
- package/dist/routes-shared.d.ts.map +1 -0
- package/dist/routes-shared.js +3 -0
- package/dist/routes.d.ts +5 -2160
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +5 -354
- package/dist/schema-catalogs.d.ts +467 -0
- package/dist/schema-catalogs.d.ts.map +1 -0
- package/dist/schema-catalogs.js +44 -0
- package/dist/schema-categories.d.ts +497 -0
- package/dist/schema-categories.d.ts.map +1 -0
- package/dist/schema-categories.js +50 -0
- package/dist/schema-option-rules.d.ts +1770 -0
- package/dist/schema-option-rules.d.ts.map +1 -0
- package/dist/schema-option-rules.js +174 -0
- package/dist/schema-policies.d.ts +395 -0
- package/dist/schema-policies.d.ts.map +1 -0
- package/dist/schema-policies.js +38 -0
- package/dist/schema-relations.d.ts +55 -0
- package/dist/schema-relations.d.ts.map +1 -0
- package/dist/schema-relations.js +103 -0
- package/dist/schema-shared.d.ts +11 -0
- package/dist/schema-shared.d.ts.map +1 -0
- package/dist/schema-shared.js +67 -0
- package/dist/schema.d.ts +6 -3189
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +6 -458
- package/dist/service-catalogs.d.ts +139 -0
- package/dist/service-catalogs.d.ts.map +1 -0
- package/dist/service-catalogs.js +89 -0
- package/dist/service-categories.d.ts +147 -0
- package/dist/service-categories.d.ts.map +1 -0
- package/dist/service-categories.js +105 -0
- package/dist/service-option-rules.d.ts +307 -0
- package/dist/service-option-rules.d.ts.map +1 -0
- package/dist/service-option-rules.js +188 -0
- package/dist/service-policies.d.ts +123 -0
- package/dist/service-policies.d.ts.map +1 -0
- package/dist/service-policies.js +95 -0
- package/dist/service-public.d.ts +89 -0
- package/dist/service-public.d.ts.map +1 -0
- package/dist/service-public.js +355 -0
- package/dist/service-shared.d.ts +50 -0
- package/dist/service-shared.d.ts.map +1 -0
- package/dist/service-shared.js +4 -0
- package/dist/service-transfer-rules.d.ts +211 -0
- package/dist/service-transfer-rules.d.ts.map +1 -0
- package/dist/service-transfer-rules.js +139 -0
- package/dist/service.d.ts +70 -955
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +70 -595
- package/dist/validation-public.d.ts +410 -0
- package/dist/validation-public.d.ts.map +1 -0
- package/dist/validation-public.js +109 -0
- package/dist/validation-shared.d.ts +71 -0
- package/dist/validation-shared.d.ts.map +1 -0
- package/dist/validation-shared.js +63 -0
- package/dist/validation.d.ts +4 -69
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +5 -62
- package/package.json +16 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-option-rules.d.ts","sourceRoot":"","sources":["../src/schema-option-rules.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
|
+
import { boolean, index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, } from "drizzle-orm/pg-core";
|
|
3
|
+
import { priceCatalogs, priceSchedules } from "./schema-catalogs";
|
|
4
|
+
import { pricingCategories } from "./schema-categories";
|
|
5
|
+
import { cancellationPolicies } from "./schema-policies";
|
|
6
|
+
import { addonPricingModeEnum, optionPricingModeEnum, optionStartTimeRuleModeEnum, optionUnitPricingModeEnum, priceAdjustmentTypeEnum, } from "./schema-shared";
|
|
7
|
+
export const optionPriceRules = pgTable("option_price_rules", {
|
|
8
|
+
id: typeId("option_price_rules"),
|
|
9
|
+
productId: text("product_id").notNull(),
|
|
10
|
+
optionId: text("option_id").notNull(),
|
|
11
|
+
priceCatalogId: typeIdRef("price_catalog_id")
|
|
12
|
+
.notNull()
|
|
13
|
+
.references(() => priceCatalogs.id, { onDelete: "cascade" }),
|
|
14
|
+
priceScheduleId: typeIdRef("price_schedule_id").references(() => priceSchedules.id, {
|
|
15
|
+
onDelete: "set null",
|
|
16
|
+
}),
|
|
17
|
+
cancellationPolicyId: typeIdRef("cancellation_policy_id").references(() => cancellationPolicies.id, { onDelete: "set null" }),
|
|
18
|
+
code: text("code"),
|
|
19
|
+
name: text("name").notNull(),
|
|
20
|
+
description: text("description"),
|
|
21
|
+
pricingMode: optionPricingModeEnum("pricing_mode").notNull().default("per_person"),
|
|
22
|
+
baseSellAmountCents: integer("base_sell_amount_cents"),
|
|
23
|
+
baseCostAmountCents: integer("base_cost_amount_cents"),
|
|
24
|
+
minPerBooking: integer("min_per_booking"),
|
|
25
|
+
maxPerBooking: integer("max_per_booking"),
|
|
26
|
+
allPricingCategories: boolean("all_pricing_categories").notNull().default(true),
|
|
27
|
+
isDefault: boolean("is_default").notNull().default(false),
|
|
28
|
+
active: boolean("active").notNull().default(true),
|
|
29
|
+
notes: text("notes"),
|
|
30
|
+
metadata: jsonb("metadata").$type(),
|
|
31
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
32
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
33
|
+
}, (table) => [
|
|
34
|
+
index("idx_option_price_rules_product").on(table.productId),
|
|
35
|
+
index("idx_option_price_rules_option").on(table.optionId),
|
|
36
|
+
index("idx_option_price_rules_catalog").on(table.priceCatalogId),
|
|
37
|
+
index("idx_option_price_rules_schedule").on(table.priceScheduleId),
|
|
38
|
+
index("idx_option_price_rules_policy").on(table.cancellationPolicyId),
|
|
39
|
+
index("idx_option_price_rules_active").on(table.active),
|
|
40
|
+
uniqueIndex("uidx_option_price_rules_option_code").on(table.optionId, table.code),
|
|
41
|
+
]);
|
|
42
|
+
export const optionUnitPriceRules = pgTable("option_unit_price_rules", {
|
|
43
|
+
id: typeId("option_unit_price_rules"),
|
|
44
|
+
optionPriceRuleId: typeIdRef("option_price_rule_id")
|
|
45
|
+
.notNull()
|
|
46
|
+
.references(() => optionPriceRules.id, { onDelete: "cascade" }),
|
|
47
|
+
optionId: text("option_id").notNull(),
|
|
48
|
+
unitId: text("unit_id").notNull(),
|
|
49
|
+
pricingCategoryId: typeIdRef("pricing_category_id").references(() => pricingCategories.id, {
|
|
50
|
+
onDelete: "set null",
|
|
51
|
+
}),
|
|
52
|
+
pricingMode: optionUnitPricingModeEnum("pricing_mode").notNull().default("per_unit"),
|
|
53
|
+
sellAmountCents: integer("sell_amount_cents"),
|
|
54
|
+
costAmountCents: integer("cost_amount_cents"),
|
|
55
|
+
minQuantity: integer("min_quantity"),
|
|
56
|
+
maxQuantity: integer("max_quantity"),
|
|
57
|
+
active: boolean("active").notNull().default(true),
|
|
58
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
59
|
+
notes: text("notes"),
|
|
60
|
+
metadata: jsonb("metadata").$type(),
|
|
61
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
62
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
63
|
+
}, (table) => [
|
|
64
|
+
index("idx_option_unit_price_rules_rule").on(table.optionPriceRuleId),
|
|
65
|
+
index("idx_option_unit_price_rules_option").on(table.optionId),
|
|
66
|
+
index("idx_option_unit_price_rules_unit").on(table.unitId),
|
|
67
|
+
index("idx_option_unit_price_rules_category").on(table.pricingCategoryId),
|
|
68
|
+
index("idx_option_unit_price_rules_active").on(table.active),
|
|
69
|
+
]);
|
|
70
|
+
export const optionStartTimeRules = pgTable("option_start_time_rules", {
|
|
71
|
+
id: typeId("option_start_time_rules"),
|
|
72
|
+
optionPriceRuleId: typeIdRef("option_price_rule_id")
|
|
73
|
+
.notNull()
|
|
74
|
+
.references(() => optionPriceRules.id, { onDelete: "cascade" }),
|
|
75
|
+
optionId: text("option_id").notNull(),
|
|
76
|
+
startTimeId: text("start_time_id").notNull(),
|
|
77
|
+
ruleMode: optionStartTimeRuleModeEnum("rule_mode").notNull().default("included"),
|
|
78
|
+
adjustmentType: priceAdjustmentTypeEnum("adjustment_type"),
|
|
79
|
+
sellAdjustmentCents: integer("sell_adjustment_cents"),
|
|
80
|
+
costAdjustmentCents: integer("cost_adjustment_cents"),
|
|
81
|
+
adjustmentBasisPoints: integer("adjustment_basis_points"),
|
|
82
|
+
active: boolean("active").notNull().default(true),
|
|
83
|
+
notes: text("notes"),
|
|
84
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
85
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
86
|
+
}, (table) => [
|
|
87
|
+
index("idx_option_start_time_rules_rule").on(table.optionPriceRuleId),
|
|
88
|
+
index("idx_option_start_time_rules_option").on(table.optionId),
|
|
89
|
+
index("idx_option_start_time_rules_start_time").on(table.startTimeId),
|
|
90
|
+
uniqueIndex("uidx_option_start_time_rules_rule_start_time").on(table.optionPriceRuleId, table.startTimeId),
|
|
91
|
+
]);
|
|
92
|
+
export const optionUnitTiers = pgTable("option_unit_tiers", {
|
|
93
|
+
id: typeId("option_unit_tiers"),
|
|
94
|
+
optionUnitPriceRuleId: typeIdRef("option_unit_price_rule_id")
|
|
95
|
+
.notNull()
|
|
96
|
+
.references(() => optionUnitPriceRules.id, { onDelete: "cascade" }),
|
|
97
|
+
minQuantity: integer("min_quantity").notNull(),
|
|
98
|
+
maxQuantity: integer("max_quantity"),
|
|
99
|
+
sellAmountCents: integer("sell_amount_cents"),
|
|
100
|
+
costAmountCents: integer("cost_amount_cents"),
|
|
101
|
+
active: boolean("active").notNull().default(true),
|
|
102
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
103
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
104
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
105
|
+
}, (table) => [
|
|
106
|
+
index("idx_option_unit_tiers_rule").on(table.optionUnitPriceRuleId),
|
|
107
|
+
index("idx_option_unit_tiers_active").on(table.active),
|
|
108
|
+
]);
|
|
109
|
+
export const pickupPriceRules = pgTable("pickup_price_rules", {
|
|
110
|
+
id: typeId("pickup_price_rules"),
|
|
111
|
+
optionPriceRuleId: typeIdRef("option_price_rule_id")
|
|
112
|
+
.notNull()
|
|
113
|
+
.references(() => optionPriceRules.id, { onDelete: "cascade" }),
|
|
114
|
+
optionId: text("option_id").notNull(),
|
|
115
|
+
pickupPointId: text("pickup_point_id").notNull(),
|
|
116
|
+
pricingMode: addonPricingModeEnum("pricing_mode").notNull().default("included"),
|
|
117
|
+
sellAmountCents: integer("sell_amount_cents"),
|
|
118
|
+
costAmountCents: integer("cost_amount_cents"),
|
|
119
|
+
active: boolean("active").notNull().default(true),
|
|
120
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
121
|
+
notes: text("notes"),
|
|
122
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
123
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
124
|
+
}, (table) => [
|
|
125
|
+
index("idx_pickup_price_rules_rule").on(table.optionPriceRuleId),
|
|
126
|
+
index("idx_pickup_price_rules_option").on(table.optionId),
|
|
127
|
+
index("idx_pickup_price_rules_pickup").on(table.pickupPointId),
|
|
128
|
+
uniqueIndex("uidx_pickup_price_rules_rule_pickup").on(table.optionPriceRuleId, table.pickupPointId),
|
|
129
|
+
]);
|
|
130
|
+
export const dropoffPriceRules = pgTable("dropoff_price_rules", {
|
|
131
|
+
id: typeId("dropoff_price_rules"),
|
|
132
|
+
optionPriceRuleId: typeIdRef("option_price_rule_id")
|
|
133
|
+
.notNull()
|
|
134
|
+
.references(() => optionPriceRules.id, { onDelete: "cascade" }),
|
|
135
|
+
optionId: text("option_id").notNull(),
|
|
136
|
+
facilityId: text("facility_id"),
|
|
137
|
+
dropoffCode: text("dropoff_code"),
|
|
138
|
+
dropoffName: text("dropoff_name").notNull(),
|
|
139
|
+
pricingMode: addonPricingModeEnum("pricing_mode").notNull().default("included"),
|
|
140
|
+
sellAmountCents: integer("sell_amount_cents"),
|
|
141
|
+
costAmountCents: integer("cost_amount_cents"),
|
|
142
|
+
active: boolean("active").notNull().default(true),
|
|
143
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
144
|
+
notes: text("notes"),
|
|
145
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
146
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
147
|
+
}, (table) => [
|
|
148
|
+
index("idx_dropoff_price_rules_rule").on(table.optionPriceRuleId),
|
|
149
|
+
index("idx_dropoff_price_rules_option").on(table.optionId),
|
|
150
|
+
index("idx_dropoff_price_rules_facility").on(table.facilityId),
|
|
151
|
+
]);
|
|
152
|
+
export const extraPriceRules = pgTable("extra_price_rules", {
|
|
153
|
+
id: typeId("extra_price_rules"),
|
|
154
|
+
optionPriceRuleId: typeIdRef("option_price_rule_id")
|
|
155
|
+
.notNull()
|
|
156
|
+
.references(() => optionPriceRules.id, { onDelete: "cascade" }),
|
|
157
|
+
optionId: text("option_id").notNull(),
|
|
158
|
+
productExtraId: text("product_extra_id"),
|
|
159
|
+
optionExtraConfigId: text("option_extra_config_id"),
|
|
160
|
+
pricingMode: addonPricingModeEnum("pricing_mode").notNull().default("included"),
|
|
161
|
+
sellAmountCents: integer("sell_amount_cents"),
|
|
162
|
+
costAmountCents: integer("cost_amount_cents"),
|
|
163
|
+
active: boolean("active").notNull().default(true),
|
|
164
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
165
|
+
notes: text("notes"),
|
|
166
|
+
metadata: jsonb("metadata").$type(),
|
|
167
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
168
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
169
|
+
}, (table) => [
|
|
170
|
+
index("idx_extra_price_rules_rule").on(table.optionPriceRuleId),
|
|
171
|
+
index("idx_extra_price_rules_option").on(table.optionId),
|
|
172
|
+
index("idx_extra_price_rules_product_extra").on(table.productExtraId),
|
|
173
|
+
index("idx_extra_price_rules_option_extra_config").on(table.optionExtraConfigId),
|
|
174
|
+
]);
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
export declare const cancellationPolicies: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
+
name: "cancellation_policies";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
+
name: string;
|
|
7
|
+
tableName: "cancellation_policies";
|
|
8
|
+
dataType: "string";
|
|
9
|
+
columnType: "PgText";
|
|
10
|
+
data: string;
|
|
11
|
+
driverParam: string;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: true;
|
|
14
|
+
isPrimaryKey: true;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: true;
|
|
17
|
+
enumValues: [string, ...string[]];
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
code: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
+
name: "code";
|
|
24
|
+
tableName: "cancellation_policies";
|
|
25
|
+
dataType: "string";
|
|
26
|
+
columnType: "PgText";
|
|
27
|
+
data: string;
|
|
28
|
+
driverParam: string;
|
|
29
|
+
notNull: false;
|
|
30
|
+
hasDefault: false;
|
|
31
|
+
isPrimaryKey: false;
|
|
32
|
+
isAutoincrement: false;
|
|
33
|
+
hasRuntimeDefault: false;
|
|
34
|
+
enumValues: [string, ...string[]];
|
|
35
|
+
baseColumn: never;
|
|
36
|
+
identity: undefined;
|
|
37
|
+
generated: undefined;
|
|
38
|
+
}, {}, {}>;
|
|
39
|
+
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
+
name: "name";
|
|
41
|
+
tableName: "cancellation_policies";
|
|
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
|
+
}, {}, {}>;
|
|
56
|
+
policyType: import("drizzle-orm/pg-core").PgColumn<{
|
|
57
|
+
name: "policy_type";
|
|
58
|
+
tableName: "cancellation_policies";
|
|
59
|
+
dataType: "string";
|
|
60
|
+
columnType: "PgEnumColumn";
|
|
61
|
+
data: "simple" | "advanced" | "non_refundable" | "custom";
|
|
62
|
+
driverParam: string;
|
|
63
|
+
notNull: true;
|
|
64
|
+
hasDefault: true;
|
|
65
|
+
isPrimaryKey: false;
|
|
66
|
+
isAutoincrement: false;
|
|
67
|
+
hasRuntimeDefault: false;
|
|
68
|
+
enumValues: ["simple", "advanced", "non_refundable", "custom"];
|
|
69
|
+
baseColumn: never;
|
|
70
|
+
identity: undefined;
|
|
71
|
+
generated: undefined;
|
|
72
|
+
}, {}, {}>;
|
|
73
|
+
simpleCutoffHours: import("drizzle-orm/pg-core").PgColumn<{
|
|
74
|
+
name: "simple_cutoff_hours";
|
|
75
|
+
tableName: "cancellation_policies";
|
|
76
|
+
dataType: "number";
|
|
77
|
+
columnType: "PgInteger";
|
|
78
|
+
data: number;
|
|
79
|
+
driverParam: string | number;
|
|
80
|
+
notNull: false;
|
|
81
|
+
hasDefault: false;
|
|
82
|
+
isPrimaryKey: false;
|
|
83
|
+
isAutoincrement: false;
|
|
84
|
+
hasRuntimeDefault: false;
|
|
85
|
+
enumValues: undefined;
|
|
86
|
+
baseColumn: never;
|
|
87
|
+
identity: undefined;
|
|
88
|
+
generated: undefined;
|
|
89
|
+
}, {}, {}>;
|
|
90
|
+
isDefault: import("drizzle-orm/pg-core").PgColumn<{
|
|
91
|
+
name: "is_default";
|
|
92
|
+
tableName: "cancellation_policies";
|
|
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
|
+
}, {}, {}>;
|
|
107
|
+
active: import("drizzle-orm/pg-core").PgColumn<{
|
|
108
|
+
name: "active";
|
|
109
|
+
tableName: "cancellation_policies";
|
|
110
|
+
dataType: "boolean";
|
|
111
|
+
columnType: "PgBoolean";
|
|
112
|
+
data: boolean;
|
|
113
|
+
driverParam: boolean;
|
|
114
|
+
notNull: true;
|
|
115
|
+
hasDefault: true;
|
|
116
|
+
isPrimaryKey: false;
|
|
117
|
+
isAutoincrement: false;
|
|
118
|
+
hasRuntimeDefault: false;
|
|
119
|
+
enumValues: undefined;
|
|
120
|
+
baseColumn: never;
|
|
121
|
+
identity: undefined;
|
|
122
|
+
generated: undefined;
|
|
123
|
+
}, {}, {}>;
|
|
124
|
+
notes: import("drizzle-orm/pg-core").PgColumn<{
|
|
125
|
+
name: "notes";
|
|
126
|
+
tableName: "cancellation_policies";
|
|
127
|
+
dataType: "string";
|
|
128
|
+
columnType: "PgText";
|
|
129
|
+
data: string;
|
|
130
|
+
driverParam: string;
|
|
131
|
+
notNull: false;
|
|
132
|
+
hasDefault: false;
|
|
133
|
+
isPrimaryKey: false;
|
|
134
|
+
isAutoincrement: false;
|
|
135
|
+
hasRuntimeDefault: false;
|
|
136
|
+
enumValues: [string, ...string[]];
|
|
137
|
+
baseColumn: never;
|
|
138
|
+
identity: undefined;
|
|
139
|
+
generated: undefined;
|
|
140
|
+
}, {}, {}>;
|
|
141
|
+
metadata: import("drizzle-orm/pg-core").PgColumn<{
|
|
142
|
+
name: "metadata";
|
|
143
|
+
tableName: "cancellation_policies";
|
|
144
|
+
dataType: "json";
|
|
145
|
+
columnType: "PgJsonb";
|
|
146
|
+
data: Record<string, unknown>;
|
|
147
|
+
driverParam: unknown;
|
|
148
|
+
notNull: false;
|
|
149
|
+
hasDefault: false;
|
|
150
|
+
isPrimaryKey: false;
|
|
151
|
+
isAutoincrement: false;
|
|
152
|
+
hasRuntimeDefault: false;
|
|
153
|
+
enumValues: undefined;
|
|
154
|
+
baseColumn: never;
|
|
155
|
+
identity: undefined;
|
|
156
|
+
generated: undefined;
|
|
157
|
+
}, {}, {
|
|
158
|
+
$type: Record<string, unknown>;
|
|
159
|
+
}>;
|
|
160
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
161
|
+
name: "created_at";
|
|
162
|
+
tableName: "cancellation_policies";
|
|
163
|
+
dataType: "date";
|
|
164
|
+
columnType: "PgTimestamp";
|
|
165
|
+
data: Date;
|
|
166
|
+
driverParam: string;
|
|
167
|
+
notNull: true;
|
|
168
|
+
hasDefault: true;
|
|
169
|
+
isPrimaryKey: false;
|
|
170
|
+
isAutoincrement: false;
|
|
171
|
+
hasRuntimeDefault: false;
|
|
172
|
+
enumValues: undefined;
|
|
173
|
+
baseColumn: never;
|
|
174
|
+
identity: undefined;
|
|
175
|
+
generated: undefined;
|
|
176
|
+
}, {}, {}>;
|
|
177
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
178
|
+
name: "updated_at";
|
|
179
|
+
tableName: "cancellation_policies";
|
|
180
|
+
dataType: "date";
|
|
181
|
+
columnType: "PgTimestamp";
|
|
182
|
+
data: Date;
|
|
183
|
+
driverParam: string;
|
|
184
|
+
notNull: true;
|
|
185
|
+
hasDefault: true;
|
|
186
|
+
isPrimaryKey: false;
|
|
187
|
+
isAutoincrement: false;
|
|
188
|
+
hasRuntimeDefault: false;
|
|
189
|
+
enumValues: undefined;
|
|
190
|
+
baseColumn: never;
|
|
191
|
+
identity: undefined;
|
|
192
|
+
generated: undefined;
|
|
193
|
+
}, {}, {}>;
|
|
194
|
+
};
|
|
195
|
+
dialect: "pg";
|
|
196
|
+
}>;
|
|
197
|
+
export declare const cancellationPolicyRules: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
198
|
+
name: "cancellation_policy_rules";
|
|
199
|
+
schema: undefined;
|
|
200
|
+
columns: {
|
|
201
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
202
|
+
name: string;
|
|
203
|
+
tableName: "cancellation_policy_rules";
|
|
204
|
+
dataType: "string";
|
|
205
|
+
columnType: "PgText";
|
|
206
|
+
data: string;
|
|
207
|
+
driverParam: string;
|
|
208
|
+
notNull: true;
|
|
209
|
+
hasDefault: true;
|
|
210
|
+
isPrimaryKey: true;
|
|
211
|
+
isAutoincrement: false;
|
|
212
|
+
hasRuntimeDefault: true;
|
|
213
|
+
enumValues: [string, ...string[]];
|
|
214
|
+
baseColumn: never;
|
|
215
|
+
identity: undefined;
|
|
216
|
+
generated: undefined;
|
|
217
|
+
}, {}, {}>;
|
|
218
|
+
cancellationPolicyId: import("drizzle-orm/pg-core").PgColumn<{
|
|
219
|
+
name: string;
|
|
220
|
+
tableName: "cancellation_policy_rules";
|
|
221
|
+
dataType: "string";
|
|
222
|
+
columnType: "PgText";
|
|
223
|
+
data: string;
|
|
224
|
+
driverParam: string;
|
|
225
|
+
notNull: true;
|
|
226
|
+
hasDefault: false;
|
|
227
|
+
isPrimaryKey: false;
|
|
228
|
+
isAutoincrement: false;
|
|
229
|
+
hasRuntimeDefault: false;
|
|
230
|
+
enumValues: [string, ...string[]];
|
|
231
|
+
baseColumn: never;
|
|
232
|
+
identity: undefined;
|
|
233
|
+
generated: undefined;
|
|
234
|
+
}, {}, {}>;
|
|
235
|
+
sortOrder: import("drizzle-orm/pg-core").PgColumn<{
|
|
236
|
+
name: "sort_order";
|
|
237
|
+
tableName: "cancellation_policy_rules";
|
|
238
|
+
dataType: "number";
|
|
239
|
+
columnType: "PgInteger";
|
|
240
|
+
data: number;
|
|
241
|
+
driverParam: string | number;
|
|
242
|
+
notNull: true;
|
|
243
|
+
hasDefault: true;
|
|
244
|
+
isPrimaryKey: false;
|
|
245
|
+
isAutoincrement: false;
|
|
246
|
+
hasRuntimeDefault: false;
|
|
247
|
+
enumValues: undefined;
|
|
248
|
+
baseColumn: never;
|
|
249
|
+
identity: undefined;
|
|
250
|
+
generated: undefined;
|
|
251
|
+
}, {}, {}>;
|
|
252
|
+
cutoffMinutesBefore: import("drizzle-orm/pg-core").PgColumn<{
|
|
253
|
+
name: "cutoff_minutes_before";
|
|
254
|
+
tableName: "cancellation_policy_rules";
|
|
255
|
+
dataType: "number";
|
|
256
|
+
columnType: "PgInteger";
|
|
257
|
+
data: number;
|
|
258
|
+
driverParam: string | number;
|
|
259
|
+
notNull: false;
|
|
260
|
+
hasDefault: false;
|
|
261
|
+
isPrimaryKey: false;
|
|
262
|
+
isAutoincrement: false;
|
|
263
|
+
hasRuntimeDefault: false;
|
|
264
|
+
enumValues: undefined;
|
|
265
|
+
baseColumn: never;
|
|
266
|
+
identity: undefined;
|
|
267
|
+
generated: undefined;
|
|
268
|
+
}, {}, {}>;
|
|
269
|
+
chargeType: import("drizzle-orm/pg-core").PgColumn<{
|
|
270
|
+
name: "charge_type";
|
|
271
|
+
tableName: "cancellation_policy_rules";
|
|
272
|
+
dataType: "string";
|
|
273
|
+
columnType: "PgEnumColumn";
|
|
274
|
+
data: "none" | "amount" | "percentage";
|
|
275
|
+
driverParam: string;
|
|
276
|
+
notNull: true;
|
|
277
|
+
hasDefault: true;
|
|
278
|
+
isPrimaryKey: false;
|
|
279
|
+
isAutoincrement: false;
|
|
280
|
+
hasRuntimeDefault: false;
|
|
281
|
+
enumValues: ["none", "amount", "percentage"];
|
|
282
|
+
baseColumn: never;
|
|
283
|
+
identity: undefined;
|
|
284
|
+
generated: undefined;
|
|
285
|
+
}, {}, {}>;
|
|
286
|
+
chargeAmountCents: import("drizzle-orm/pg-core").PgColumn<{
|
|
287
|
+
name: "charge_amount_cents";
|
|
288
|
+
tableName: "cancellation_policy_rules";
|
|
289
|
+
dataType: "number";
|
|
290
|
+
columnType: "PgInteger";
|
|
291
|
+
data: number;
|
|
292
|
+
driverParam: string | number;
|
|
293
|
+
notNull: false;
|
|
294
|
+
hasDefault: false;
|
|
295
|
+
isPrimaryKey: false;
|
|
296
|
+
isAutoincrement: false;
|
|
297
|
+
hasRuntimeDefault: false;
|
|
298
|
+
enumValues: undefined;
|
|
299
|
+
baseColumn: never;
|
|
300
|
+
identity: undefined;
|
|
301
|
+
generated: undefined;
|
|
302
|
+
}, {}, {}>;
|
|
303
|
+
chargePercentBasisPoints: import("drizzle-orm/pg-core").PgColumn<{
|
|
304
|
+
name: "charge_percent_basis_points";
|
|
305
|
+
tableName: "cancellation_policy_rules";
|
|
306
|
+
dataType: "number";
|
|
307
|
+
columnType: "PgInteger";
|
|
308
|
+
data: number;
|
|
309
|
+
driverParam: string | number;
|
|
310
|
+
notNull: false;
|
|
311
|
+
hasDefault: false;
|
|
312
|
+
isPrimaryKey: false;
|
|
313
|
+
isAutoincrement: false;
|
|
314
|
+
hasRuntimeDefault: false;
|
|
315
|
+
enumValues: undefined;
|
|
316
|
+
baseColumn: never;
|
|
317
|
+
identity: undefined;
|
|
318
|
+
generated: undefined;
|
|
319
|
+
}, {}, {}>;
|
|
320
|
+
active: import("drizzle-orm/pg-core").PgColumn<{
|
|
321
|
+
name: "active";
|
|
322
|
+
tableName: "cancellation_policy_rules";
|
|
323
|
+
dataType: "boolean";
|
|
324
|
+
columnType: "PgBoolean";
|
|
325
|
+
data: boolean;
|
|
326
|
+
driverParam: boolean;
|
|
327
|
+
notNull: true;
|
|
328
|
+
hasDefault: true;
|
|
329
|
+
isPrimaryKey: false;
|
|
330
|
+
isAutoincrement: false;
|
|
331
|
+
hasRuntimeDefault: false;
|
|
332
|
+
enumValues: undefined;
|
|
333
|
+
baseColumn: never;
|
|
334
|
+
identity: undefined;
|
|
335
|
+
generated: undefined;
|
|
336
|
+
}, {}, {}>;
|
|
337
|
+
notes: import("drizzle-orm/pg-core").PgColumn<{
|
|
338
|
+
name: "notes";
|
|
339
|
+
tableName: "cancellation_policy_rules";
|
|
340
|
+
dataType: "string";
|
|
341
|
+
columnType: "PgText";
|
|
342
|
+
data: string;
|
|
343
|
+
driverParam: string;
|
|
344
|
+
notNull: false;
|
|
345
|
+
hasDefault: false;
|
|
346
|
+
isPrimaryKey: false;
|
|
347
|
+
isAutoincrement: false;
|
|
348
|
+
hasRuntimeDefault: false;
|
|
349
|
+
enumValues: [string, ...string[]];
|
|
350
|
+
baseColumn: never;
|
|
351
|
+
identity: undefined;
|
|
352
|
+
generated: undefined;
|
|
353
|
+
}, {}, {}>;
|
|
354
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
355
|
+
name: "created_at";
|
|
356
|
+
tableName: "cancellation_policy_rules";
|
|
357
|
+
dataType: "date";
|
|
358
|
+
columnType: "PgTimestamp";
|
|
359
|
+
data: Date;
|
|
360
|
+
driverParam: string;
|
|
361
|
+
notNull: true;
|
|
362
|
+
hasDefault: true;
|
|
363
|
+
isPrimaryKey: false;
|
|
364
|
+
isAutoincrement: false;
|
|
365
|
+
hasRuntimeDefault: false;
|
|
366
|
+
enumValues: undefined;
|
|
367
|
+
baseColumn: never;
|
|
368
|
+
identity: undefined;
|
|
369
|
+
generated: undefined;
|
|
370
|
+
}, {}, {}>;
|
|
371
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
372
|
+
name: "updated_at";
|
|
373
|
+
tableName: "cancellation_policy_rules";
|
|
374
|
+
dataType: "date";
|
|
375
|
+
columnType: "PgTimestamp";
|
|
376
|
+
data: Date;
|
|
377
|
+
driverParam: string;
|
|
378
|
+
notNull: true;
|
|
379
|
+
hasDefault: true;
|
|
380
|
+
isPrimaryKey: false;
|
|
381
|
+
isAutoincrement: false;
|
|
382
|
+
hasRuntimeDefault: false;
|
|
383
|
+
enumValues: undefined;
|
|
384
|
+
baseColumn: never;
|
|
385
|
+
identity: undefined;
|
|
386
|
+
generated: undefined;
|
|
387
|
+
}, {}, {}>;
|
|
388
|
+
};
|
|
389
|
+
dialect: "pg";
|
|
390
|
+
}>;
|
|
391
|
+
export type CancellationPolicy = typeof cancellationPolicies.$inferSelect;
|
|
392
|
+
export type NewCancellationPolicy = typeof cancellationPolicies.$inferInsert;
|
|
393
|
+
export type CancellationPolicyRule = typeof cancellationPolicyRules.$inferSelect;
|
|
394
|
+
export type NewCancellationPolicyRule = typeof cancellationPolicyRules.$inferInsert;
|
|
395
|
+
//# sourceMappingURL=schema-policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-policies.d.ts","sourceRoot":"","sources":["../src/schema-policies.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBhC,CAAA;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBnC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,oBAAoB,CAAC,YAAY,CAAA;AACzE,MAAM,MAAM,qBAAqB,GAAG,OAAO,oBAAoB,CAAC,YAAY,CAAA;AAC5E,MAAM,MAAM,sBAAsB,GAAG,OAAO,uBAAuB,CAAC,YAAY,CAAA;AAChF,MAAM,MAAM,yBAAyB,GAAG,OAAO,uBAAuB,CAAC,YAAY,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
|
+
import { boolean, index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, } from "drizzle-orm/pg-core";
|
|
3
|
+
import { cancellationChargeTypeEnum, cancellationPolicyTypeEnum } from "./schema-shared";
|
|
4
|
+
export const cancellationPolicies = pgTable("cancellation_policies", {
|
|
5
|
+
id: typeId("cancellation_policies"),
|
|
6
|
+
code: text("code"),
|
|
7
|
+
name: text("name").notNull(),
|
|
8
|
+
policyType: cancellationPolicyTypeEnum("policy_type").notNull().default("custom"),
|
|
9
|
+
simpleCutoffHours: integer("simple_cutoff_hours"),
|
|
10
|
+
isDefault: boolean("is_default").notNull().default(false),
|
|
11
|
+
active: boolean("active").notNull().default(true),
|
|
12
|
+
notes: text("notes"),
|
|
13
|
+
metadata: jsonb("metadata").$type(),
|
|
14
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
15
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
16
|
+
}, (table) => [
|
|
17
|
+
index("idx_cancellation_policies_active").on(table.active),
|
|
18
|
+
index("idx_cancellation_policies_default").on(table.isDefault),
|
|
19
|
+
uniqueIndex("uidx_cancellation_policies_code").on(table.code),
|
|
20
|
+
]);
|
|
21
|
+
export const cancellationPolicyRules = pgTable("cancellation_policy_rules", {
|
|
22
|
+
id: typeId("cancellation_policy_rules"),
|
|
23
|
+
cancellationPolicyId: typeIdRef("cancellation_policy_id")
|
|
24
|
+
.notNull()
|
|
25
|
+
.references(() => cancellationPolicies.id, { onDelete: "cascade" }),
|
|
26
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
27
|
+
cutoffMinutesBefore: integer("cutoff_minutes_before"),
|
|
28
|
+
chargeType: cancellationChargeTypeEnum("charge_type").notNull().default("none"),
|
|
29
|
+
chargeAmountCents: integer("charge_amount_cents"),
|
|
30
|
+
chargePercentBasisPoints: integer("charge_percent_basis_points"),
|
|
31
|
+
active: boolean("active").notNull().default(true),
|
|
32
|
+
notes: text("notes"),
|
|
33
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
34
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
35
|
+
}, (table) => [
|
|
36
|
+
index("idx_cancellation_policy_rules_policy").on(table.cancellationPolicyId),
|
|
37
|
+
index("idx_cancellation_policy_rules_active").on(table.active),
|
|
38
|
+
]);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const pricingCategoriesRelations: import("drizzle-orm").Relations<"pricing_categories", {
|
|
2
|
+
childDependencies: import("drizzle-orm").Many<"pricing_category_dependencies">;
|
|
3
|
+
masterDependencies: import("drizzle-orm").Many<"pricing_category_dependencies">;
|
|
4
|
+
unitPriceRules: import("drizzle-orm").Many<"option_unit_price_rules">;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const pricingCategoryDependenciesRelations: import("drizzle-orm").Relations<"pricing_category_dependencies", {
|
|
7
|
+
pricingCategory: import("drizzle-orm").One<"pricing_categories", true>;
|
|
8
|
+
masterPricingCategory: import("drizzle-orm").One<"pricing_categories", true>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const cancellationPoliciesRelations: import("drizzle-orm").Relations<"cancellation_policies", {
|
|
11
|
+
rules: import("drizzle-orm").Many<"cancellation_policy_rules">;
|
|
12
|
+
optionPriceRules: import("drizzle-orm").Many<"option_price_rules">;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const cancellationPolicyRulesRelations: import("drizzle-orm").Relations<"cancellation_policy_rules", {
|
|
15
|
+
cancellationPolicy: import("drizzle-orm").One<"cancellation_policies", true>;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const priceCatalogsRelations: import("drizzle-orm").Relations<"price_catalogs", {
|
|
18
|
+
schedules: import("drizzle-orm").Many<"price_schedules">;
|
|
19
|
+
optionPriceRules: import("drizzle-orm").Many<"option_price_rules">;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const priceSchedulesRelations: import("drizzle-orm").Relations<"price_schedules", {
|
|
22
|
+
priceCatalog: import("drizzle-orm").One<"price_catalogs", true>;
|
|
23
|
+
optionPriceRules: import("drizzle-orm").Many<"option_price_rules">;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const optionPriceRulesRelations: import("drizzle-orm").Relations<"option_price_rules", {
|
|
26
|
+
priceCatalog: import("drizzle-orm").One<"price_catalogs", true>;
|
|
27
|
+
priceSchedule: import("drizzle-orm").One<"price_schedules", false>;
|
|
28
|
+
cancellationPolicy: import("drizzle-orm").One<"cancellation_policies", false>;
|
|
29
|
+
unitRules: import("drizzle-orm").Many<"option_unit_price_rules">;
|
|
30
|
+
startTimeRules: import("drizzle-orm").Many<"option_start_time_rules">;
|
|
31
|
+
pickupRules: import("drizzle-orm").Many<"pickup_price_rules">;
|
|
32
|
+
dropoffRules: import("drizzle-orm").Many<"dropoff_price_rules">;
|
|
33
|
+
extraRules: import("drizzle-orm").Many<"extra_price_rules">;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const optionUnitPriceRulesRelations: import("drizzle-orm").Relations<"option_unit_price_rules", {
|
|
36
|
+
optionPriceRule: import("drizzle-orm").One<"option_price_rules", true>;
|
|
37
|
+
pricingCategory: import("drizzle-orm").One<"pricing_categories", false>;
|
|
38
|
+
tiers: import("drizzle-orm").Many<"option_unit_tiers">;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const optionStartTimeRulesRelations: import("drizzle-orm").Relations<"option_start_time_rules", {
|
|
41
|
+
optionPriceRule: import("drizzle-orm").One<"option_price_rules", true>;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const optionUnitTiersRelations: import("drizzle-orm").Relations<"option_unit_tiers", {
|
|
44
|
+
optionUnitPriceRule: import("drizzle-orm").One<"option_unit_price_rules", true>;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const pickupPriceRulesRelations: import("drizzle-orm").Relations<"pickup_price_rules", {
|
|
47
|
+
optionPriceRule: import("drizzle-orm").One<"option_price_rules", true>;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const dropoffPriceRulesRelations: import("drizzle-orm").Relations<"dropoff_price_rules", {
|
|
50
|
+
optionPriceRule: import("drizzle-orm").One<"option_price_rules", true>;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const extraPriceRulesRelations: import("drizzle-orm").Relations<"extra_price_rules", {
|
|
53
|
+
optionPriceRule: import("drizzle-orm").One<"option_price_rules", true>;
|
|
54
|
+
}>;
|
|
55
|
+
//# sourceMappingURL=schema-relations.d.ts.map
|