@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-relations.d.ts","sourceRoot":"","sources":["../src/schema-relations.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,0BAA0B;;;;EAIpC,CAAA;AAEH,eAAO,MAAM,oCAAoC;;;EAchD,CAAA;AAED,eAAO,MAAM,6BAA6B;;;EAGvC,CAAA;AAEH,eAAO,MAAM,gCAAgC;;EAK1C,CAAA;AAEH,eAAO,MAAM,sBAAsB;;;EAGhC,CAAA;AAEH,eAAO,MAAM,uBAAuB;;;EAMjC,CAAA;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;EAkBnC,CAAA;AAEH,eAAO,MAAM,6BAA6B;;;;EAUvC,CAAA;AAEH,eAAO,MAAM,6BAA6B;;EAKvC,CAAA;AAEH,eAAO,MAAM,wBAAwB;;EAKlC,CAAA;AAEH,eAAO,MAAM,yBAAyB;;EAKnC,CAAA;AAEH,eAAO,MAAM,0BAA0B;;EAKpC,CAAA;AAEH,eAAO,MAAM,wBAAwB;;EAKlC,CAAA"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { relations } from "drizzle-orm";
|
|
2
|
+
import { priceCatalogs, priceSchedules } from "./schema-catalogs";
|
|
3
|
+
import { pricingCategories, pricingCategoryDependencies } from "./schema-categories";
|
|
4
|
+
import { dropoffPriceRules, extraPriceRules, optionPriceRules, optionStartTimeRules, optionUnitPriceRules, optionUnitTiers, pickupPriceRules, } from "./schema-option-rules";
|
|
5
|
+
import { cancellationPolicies, cancellationPolicyRules } from "./schema-policies";
|
|
6
|
+
export const pricingCategoriesRelations = relations(pricingCategories, ({ many }) => ({
|
|
7
|
+
childDependencies: many(pricingCategoryDependencies, { relationName: "pricingCategoryChild" }),
|
|
8
|
+
masterDependencies: many(pricingCategoryDependencies, { relationName: "pricingCategoryMaster" }),
|
|
9
|
+
unitPriceRules: many(optionUnitPriceRules),
|
|
10
|
+
}));
|
|
11
|
+
export const pricingCategoryDependenciesRelations = relations(pricingCategoryDependencies, ({ one }) => ({
|
|
12
|
+
pricingCategory: one(pricingCategories, {
|
|
13
|
+
relationName: "pricingCategoryChild",
|
|
14
|
+
fields: [pricingCategoryDependencies.pricingCategoryId],
|
|
15
|
+
references: [pricingCategories.id],
|
|
16
|
+
}),
|
|
17
|
+
masterPricingCategory: one(pricingCategories, {
|
|
18
|
+
relationName: "pricingCategoryMaster",
|
|
19
|
+
fields: [pricingCategoryDependencies.masterPricingCategoryId],
|
|
20
|
+
references: [pricingCategories.id],
|
|
21
|
+
}),
|
|
22
|
+
}));
|
|
23
|
+
export const cancellationPoliciesRelations = relations(cancellationPolicies, ({ many }) => ({
|
|
24
|
+
rules: many(cancellationPolicyRules),
|
|
25
|
+
optionPriceRules: many(optionPriceRules),
|
|
26
|
+
}));
|
|
27
|
+
export const cancellationPolicyRulesRelations = relations(cancellationPolicyRules, ({ one }) => ({
|
|
28
|
+
cancellationPolicy: one(cancellationPolicies, {
|
|
29
|
+
fields: [cancellationPolicyRules.cancellationPolicyId],
|
|
30
|
+
references: [cancellationPolicies.id],
|
|
31
|
+
}),
|
|
32
|
+
}));
|
|
33
|
+
export const priceCatalogsRelations = relations(priceCatalogs, ({ many }) => ({
|
|
34
|
+
schedules: many(priceSchedules),
|
|
35
|
+
optionPriceRules: many(optionPriceRules),
|
|
36
|
+
}));
|
|
37
|
+
export const priceSchedulesRelations = relations(priceSchedules, ({ one, many }) => ({
|
|
38
|
+
priceCatalog: one(priceCatalogs, {
|
|
39
|
+
fields: [priceSchedules.priceCatalogId],
|
|
40
|
+
references: [priceCatalogs.id],
|
|
41
|
+
}),
|
|
42
|
+
optionPriceRules: many(optionPriceRules),
|
|
43
|
+
}));
|
|
44
|
+
export const optionPriceRulesRelations = relations(optionPriceRules, ({ one, many }) => ({
|
|
45
|
+
priceCatalog: one(priceCatalogs, {
|
|
46
|
+
fields: [optionPriceRules.priceCatalogId],
|
|
47
|
+
references: [priceCatalogs.id],
|
|
48
|
+
}),
|
|
49
|
+
priceSchedule: one(priceSchedules, {
|
|
50
|
+
fields: [optionPriceRules.priceScheduleId],
|
|
51
|
+
references: [priceSchedules.id],
|
|
52
|
+
}),
|
|
53
|
+
cancellationPolicy: one(cancellationPolicies, {
|
|
54
|
+
fields: [optionPriceRules.cancellationPolicyId],
|
|
55
|
+
references: [cancellationPolicies.id],
|
|
56
|
+
}),
|
|
57
|
+
unitRules: many(optionUnitPriceRules),
|
|
58
|
+
startTimeRules: many(optionStartTimeRules),
|
|
59
|
+
pickupRules: many(pickupPriceRules),
|
|
60
|
+
dropoffRules: many(dropoffPriceRules),
|
|
61
|
+
extraRules: many(extraPriceRules),
|
|
62
|
+
}));
|
|
63
|
+
export const optionUnitPriceRulesRelations = relations(optionUnitPriceRules, ({ one, many }) => ({
|
|
64
|
+
optionPriceRule: one(optionPriceRules, {
|
|
65
|
+
fields: [optionUnitPriceRules.optionPriceRuleId],
|
|
66
|
+
references: [optionPriceRules.id],
|
|
67
|
+
}),
|
|
68
|
+
pricingCategory: one(pricingCategories, {
|
|
69
|
+
fields: [optionUnitPriceRules.pricingCategoryId],
|
|
70
|
+
references: [pricingCategories.id],
|
|
71
|
+
}),
|
|
72
|
+
tiers: many(optionUnitTiers),
|
|
73
|
+
}));
|
|
74
|
+
export const optionStartTimeRulesRelations = relations(optionStartTimeRules, ({ one }) => ({
|
|
75
|
+
optionPriceRule: one(optionPriceRules, {
|
|
76
|
+
fields: [optionStartTimeRules.optionPriceRuleId],
|
|
77
|
+
references: [optionPriceRules.id],
|
|
78
|
+
}),
|
|
79
|
+
}));
|
|
80
|
+
export const optionUnitTiersRelations = relations(optionUnitTiers, ({ one }) => ({
|
|
81
|
+
optionUnitPriceRule: one(optionUnitPriceRules, {
|
|
82
|
+
fields: [optionUnitTiers.optionUnitPriceRuleId],
|
|
83
|
+
references: [optionUnitPriceRules.id],
|
|
84
|
+
}),
|
|
85
|
+
}));
|
|
86
|
+
export const pickupPriceRulesRelations = relations(pickupPriceRules, ({ one }) => ({
|
|
87
|
+
optionPriceRule: one(optionPriceRules, {
|
|
88
|
+
fields: [pickupPriceRules.optionPriceRuleId],
|
|
89
|
+
references: [optionPriceRules.id],
|
|
90
|
+
}),
|
|
91
|
+
}));
|
|
92
|
+
export const dropoffPriceRulesRelations = relations(dropoffPriceRules, ({ one }) => ({
|
|
93
|
+
optionPriceRule: one(optionPriceRules, {
|
|
94
|
+
fields: [dropoffPriceRules.optionPriceRuleId],
|
|
95
|
+
references: [optionPriceRules.id],
|
|
96
|
+
}),
|
|
97
|
+
}));
|
|
98
|
+
export const extraPriceRulesRelations = relations(extraPriceRules, ({ one }) => ({
|
|
99
|
+
optionPriceRule: one(optionPriceRules, {
|
|
100
|
+
fields: [extraPriceRules.optionPriceRuleId],
|
|
101
|
+
references: [optionPriceRules.id],
|
|
102
|
+
}),
|
|
103
|
+
}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const pricingCategoryTypeEnum: import("drizzle-orm/pg-core").PgEnum<["adult", "child", "infant", "senior", "group", "room", "vehicle", "service", "other"]>;
|
|
2
|
+
export declare const pricingDependencyTypeEnum: import("drizzle-orm/pg-core").PgEnum<["requires", "limits_per_master", "limits_sum", "excludes"]>;
|
|
3
|
+
export declare const cancellationPolicyTypeEnum: import("drizzle-orm/pg-core").PgEnum<["simple", "advanced", "non_refundable", "custom"]>;
|
|
4
|
+
export declare const cancellationChargeTypeEnum: import("drizzle-orm/pg-core").PgEnum<["none", "amount", "percentage"]>;
|
|
5
|
+
export declare const priceCatalogTypeEnum: import("drizzle-orm/pg-core").PgEnum<["public", "contract", "net", "gross", "promo", "internal", "other"]>;
|
|
6
|
+
export declare const optionPricingModeEnum: import("drizzle-orm/pg-core").PgEnum<["per_person", "per_booking", "starting_from", "free", "on_request"]>;
|
|
7
|
+
export declare const optionUnitPricingModeEnum: import("drizzle-orm/pg-core").PgEnum<["per_unit", "per_person", "per_booking", "included", "free", "on_request"]>;
|
|
8
|
+
export declare const optionStartTimeRuleModeEnum: import("drizzle-orm/pg-core").PgEnum<["included", "excluded", "override", "adjustment"]>;
|
|
9
|
+
export declare const priceAdjustmentTypeEnum: import("drizzle-orm/pg-core").PgEnum<["fixed", "percentage"]>;
|
|
10
|
+
export declare const addonPricingModeEnum: import("drizzle-orm/pg-core").PgEnum<["included", "per_person", "per_booking", "on_request", "unavailable"]>;
|
|
11
|
+
//# sourceMappingURL=schema-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-shared.d.ts","sourceRoot":"","sources":["../src/schema-shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,8HAUlC,CAAA;AAEF,eAAO,MAAM,yBAAyB,mGAKpC,CAAA;AAEF,eAAO,MAAM,0BAA0B,0FAKrC,CAAA;AAEF,eAAO,MAAM,0BAA0B,wEAIrC,CAAA;AAEF,eAAO,MAAM,oBAAoB,4GAQ/B,CAAA;AAEF,eAAO,MAAM,qBAAqB,4GAMhC,CAAA;AAEF,eAAO,MAAM,yBAAyB,mHAOpC,CAAA;AAEF,eAAO,MAAM,2BAA2B,0FAKtC,CAAA;AAEF,eAAO,MAAM,uBAAuB,+DAA2D,CAAA;AAE/F,eAAO,MAAM,oBAAoB,8GAM/B,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { pgEnum } from "drizzle-orm/pg-core";
|
|
2
|
+
export const pricingCategoryTypeEnum = pgEnum("pricing_category_type", [
|
|
3
|
+
"adult",
|
|
4
|
+
"child",
|
|
5
|
+
"infant",
|
|
6
|
+
"senior",
|
|
7
|
+
"group",
|
|
8
|
+
"room",
|
|
9
|
+
"vehicle",
|
|
10
|
+
"service",
|
|
11
|
+
"other",
|
|
12
|
+
]);
|
|
13
|
+
export const pricingDependencyTypeEnum = pgEnum("pricing_dependency_type", [
|
|
14
|
+
"requires",
|
|
15
|
+
"limits_per_master",
|
|
16
|
+
"limits_sum",
|
|
17
|
+
"excludes",
|
|
18
|
+
]);
|
|
19
|
+
export const cancellationPolicyTypeEnum = pgEnum("cancellation_policy_type", [
|
|
20
|
+
"simple",
|
|
21
|
+
"advanced",
|
|
22
|
+
"non_refundable",
|
|
23
|
+
"custom",
|
|
24
|
+
]);
|
|
25
|
+
export const cancellationChargeTypeEnum = pgEnum("cancellation_charge_type", [
|
|
26
|
+
"none",
|
|
27
|
+
"amount",
|
|
28
|
+
"percentage",
|
|
29
|
+
]);
|
|
30
|
+
export const priceCatalogTypeEnum = pgEnum("price_catalog_type", [
|
|
31
|
+
"public",
|
|
32
|
+
"contract",
|
|
33
|
+
"net",
|
|
34
|
+
"gross",
|
|
35
|
+
"promo",
|
|
36
|
+
"internal",
|
|
37
|
+
"other",
|
|
38
|
+
]);
|
|
39
|
+
export const optionPricingModeEnum = pgEnum("option_pricing_mode", [
|
|
40
|
+
"per_person",
|
|
41
|
+
"per_booking",
|
|
42
|
+
"starting_from",
|
|
43
|
+
"free",
|
|
44
|
+
"on_request",
|
|
45
|
+
]);
|
|
46
|
+
export const optionUnitPricingModeEnum = pgEnum("option_unit_pricing_mode", [
|
|
47
|
+
"per_unit",
|
|
48
|
+
"per_person",
|
|
49
|
+
"per_booking",
|
|
50
|
+
"included",
|
|
51
|
+
"free",
|
|
52
|
+
"on_request",
|
|
53
|
+
]);
|
|
54
|
+
export const optionStartTimeRuleModeEnum = pgEnum("option_start_time_rule_mode", [
|
|
55
|
+
"included",
|
|
56
|
+
"excluded",
|
|
57
|
+
"override",
|
|
58
|
+
"adjustment",
|
|
59
|
+
]);
|
|
60
|
+
export const priceAdjustmentTypeEnum = pgEnum("price_adjustment_type", ["fixed", "percentage"]);
|
|
61
|
+
export const addonPricingModeEnum = pgEnum("addon_pricing_mode", [
|
|
62
|
+
"included",
|
|
63
|
+
"per_person",
|
|
64
|
+
"per_booking",
|
|
65
|
+
"on_request",
|
|
66
|
+
"unavailable",
|
|
67
|
+
]);
|