@voyantjs/pricing 0.26.8 → 0.27.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/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/routes-rules.d.ts +172 -9
- package/dist/routes-rules.d.ts.map +1 -1
- package/dist/routes-rules.js +17 -1
- package/dist/schema-departure-overrides.d.ts +228 -0
- package/dist/schema-departure-overrides.d.ts.map +1 -0
- package/dist/schema-departure-overrides.js +36 -0
- package/dist/schema-relations.d.ts +4 -0
- package/dist/schema-relations.d.ts.map +1 -1
- package/dist/schema-relations.js +8 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -0
- package/dist/service-departure-overrides.d.ts +67 -0
- package/dist/service-departure-overrides.d.ts.map +1 -0
- package/dist/service-departure-overrides.js +54 -0
- package/dist/service-option-rules.d.ts +2 -2
- package/dist/service-public.d.ts.map +1 -1
- package/dist/service-public.js +78 -3
- package/dist/service-rule-resolver.d.ts +67 -0
- package/dist/service-rule-resolver.d.ts.map +1 -0
- package/dist/service-rule-resolver.js +200 -0
- package/dist/service-shared.d.ts +4 -1
- package/dist/service-shared.d.ts.map +1 -1
- package/dist/service-transfer-rules.d.ts +6 -6
- package/dist/service.d.ts +6 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +6 -0
- package/dist/validation-public.d.ts +2 -0
- package/dist/validation-public.d.ts.map +1 -1
- package/dist/validation-public.js +2 -0
- package/dist/validation.d.ts +47 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +20 -0
- package/package.json +9 -8
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export { publicPricingRoutes } from "./routes-public.js";
|
|
|
7
7
|
export { publicPricingService } from "./service-public.js";
|
|
8
8
|
export declare const pricingModule: Module;
|
|
9
9
|
export declare const pricingHonoModule: HonoModule;
|
|
10
|
-
export type { CancellationPolicy, CancellationPolicyRule, DropoffPriceRule, ExtraPriceRule, NewCancellationPolicy, NewCancellationPolicyRule, NewDropoffPriceRule, NewExtraPriceRule, NewOptionPriceRule, NewOptionStartTimeRule, NewOptionUnitPriceRule, NewOptionUnitTier, NewPickupPriceRule, NewPriceCatalog, NewPriceSchedule, NewPricingCategory, NewPricingCategoryDependency, OptionPriceRule, OptionStartTimeRule, OptionUnitPriceRule, OptionUnitTier, PickupPriceRule, PriceCatalog, PriceSchedule, PricingCategory, PricingCategoryDependency, } from "./schema.js";
|
|
11
|
-
export { addonPricingModeEnum, cancellationChargeTypeEnum, cancellationPolicies, cancellationPolicyRules, cancellationPolicyTypeEnum, dropoffPriceRules, extraPriceRules, optionPriceRules, optionPricingModeEnum, optionStartTimeRuleModeEnum, optionStartTimeRules, optionUnitPriceRules, optionUnitPricingModeEnum, optionUnitTiers, pickupPriceRules, priceAdjustmentTypeEnum, priceCatalogs, priceCatalogTypeEnum, priceSchedules, pricingCategories, pricingCategoryDependencies, pricingCategoryTypeEnum, pricingDependencyTypeEnum, } from "./schema.js";
|
|
12
|
-
export { addonPricingModeSchema, cancellationChargeTypeSchema, cancellationPolicyListQuerySchema, cancellationPolicyRuleListQuerySchema, cancellationPolicyTypeSchema, dropoffPriceRuleListQuerySchema, extraPriceRuleListQuerySchema, insertCancellationPolicyRuleSchema, insertCancellationPolicySchema, insertDropoffPriceRuleSchema, insertExtraPriceRuleSchema, insertOptionPriceRuleSchema, insertOptionStartTimeRuleSchema, insertOptionUnitPriceRuleSchema, insertOptionUnitTierSchema, insertPickupPriceRuleSchema, insertPriceCatalogSchema, insertPriceScheduleSchema, insertPricingCategoryDependencySchema, insertPricingCategorySchema, optionPriceRuleListQuerySchema, optionPricingModeSchema, optionStartTimeRuleListQuerySchema, optionStartTimeRuleModeSchema, optionUnitPriceRuleListQuerySchema, optionUnitPricingModeSchema, optionUnitTierListQuerySchema, pickupPriceRuleListQuerySchema, priceAdjustmentTypeSchema, priceCatalogListQuerySchema, priceCatalogTypeSchema, priceScheduleListQuerySchema, pricingCategoryDependencyListQuerySchema, pricingCategoryListQuerySchema, pricingCategoryTypeSchema, pricingDependencyTypeSchema, updateCancellationPolicyRuleSchema, updateCancellationPolicySchema, updateDropoffPriceRuleSchema, updateExtraPriceRuleSchema, updateOptionPriceRuleSchema, updateOptionStartTimeRuleSchema, updateOptionUnitPriceRuleSchema, updateOptionUnitTierSchema, updatePickupPriceRuleSchema, updatePriceCatalogSchema, updatePriceScheduleSchema, updatePricingCategoryDependencySchema, updatePricingCategorySchema, } from "./validation.js";
|
|
10
|
+
export type { CancellationPolicy, CancellationPolicyRule, DeparturePriceOverride, DropoffPriceRule, ExtraPriceRule, NewCancellationPolicy, NewCancellationPolicyRule, NewDeparturePriceOverride, NewDropoffPriceRule, NewExtraPriceRule, NewOptionPriceRule, NewOptionStartTimeRule, NewOptionUnitPriceRule, NewOptionUnitTier, NewPickupPriceRule, NewPriceCatalog, NewPriceSchedule, NewPricingCategory, NewPricingCategoryDependency, OptionPriceRule, OptionStartTimeRule, OptionUnitPriceRule, OptionUnitTier, PickupPriceRule, PriceCatalog, PriceSchedule, PricingCategory, PricingCategoryDependency, } from "./schema.js";
|
|
11
|
+
export { addonPricingModeEnum, cancellationChargeTypeEnum, cancellationPolicies, cancellationPolicyRules, cancellationPolicyTypeEnum, departurePriceOverrides, dropoffPriceRules, extraPriceRules, optionPriceRules, optionPricingModeEnum, optionStartTimeRuleModeEnum, optionStartTimeRules, optionUnitPriceRules, optionUnitPricingModeEnum, optionUnitTiers, pickupPriceRules, priceAdjustmentTypeEnum, priceCatalogs, priceCatalogTypeEnum, priceSchedules, pricingCategories, pricingCategoryDependencies, pricingCategoryTypeEnum, pricingDependencyTypeEnum, } from "./schema.js";
|
|
12
|
+
export { addonPricingModeSchema, cancellationChargeTypeSchema, cancellationPolicyListQuerySchema, cancellationPolicyRuleListQuerySchema, cancellationPolicyTypeSchema, departurePriceOverrideListQuerySchema, dropoffPriceRuleListQuerySchema, extraPriceRuleListQuerySchema, insertCancellationPolicyRuleSchema, insertCancellationPolicySchema, insertDeparturePriceOverrideSchema, insertDropoffPriceRuleSchema, insertExtraPriceRuleSchema, insertOptionPriceRuleSchema, insertOptionStartTimeRuleSchema, insertOptionUnitPriceRuleSchema, insertOptionUnitTierSchema, insertPickupPriceRuleSchema, insertPriceCatalogSchema, insertPriceScheduleSchema, insertPricingCategoryDependencySchema, insertPricingCategorySchema, optionPriceRuleListQuerySchema, optionPricingModeSchema, optionStartTimeRuleListQuerySchema, optionStartTimeRuleModeSchema, optionUnitPriceRuleListQuerySchema, optionUnitPricingModeSchema, optionUnitTierListQuerySchema, pickupPriceRuleListQuerySchema, priceAdjustmentTypeSchema, priceCatalogListQuerySchema, priceCatalogTypeSchema, priceScheduleListQuerySchema, pricingCategoryDependencyListQuerySchema, pricingCategoryListQuerySchema, pricingCategoryTypeSchema, pricingDependencyTypeSchema, updateCancellationPolicyRuleSchema, updateCancellationPolicySchema, updateDeparturePriceOverrideSchema, updateDropoffPriceRuleSchema, updateExtraPriceRuleSchema, updateOptionPriceRuleSchema, updateOptionStartTimeRuleSchema, updateOptionUnitPriceRuleSchema, updateOptionUnitTierSchema, updatePickupPriceRuleSchema, updatePriceCatalogSchema, updatePriceScheduleSchema, updatePricingCategoryDependencySchema, updatePricingCategorySchema, } from "./validation.js";
|
|
13
13
|
export { pricingService };
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAA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yBAAyB,EACzB,2BAA2B,EAC3B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,+BAA+B,EAC/B,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,qCAAqC,EACrC,2BAA2B,GAC5B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,6 @@ export const pricingHonoModule = {
|
|
|
12
12
|
publicRoutes: publicPricingRoutes,
|
|
13
13
|
routes: pricingRoutes,
|
|
14
14
|
};
|
|
15
|
-
export { addonPricingModeEnum, cancellationChargeTypeEnum, cancellationPolicies, cancellationPolicyRules, cancellationPolicyTypeEnum, dropoffPriceRules, extraPriceRules, optionPriceRules, optionPricingModeEnum, optionStartTimeRuleModeEnum, optionStartTimeRules, optionUnitPriceRules, optionUnitPricingModeEnum, optionUnitTiers, pickupPriceRules, priceAdjustmentTypeEnum, priceCatalogs, priceCatalogTypeEnum, priceSchedules, pricingCategories, pricingCategoryDependencies, pricingCategoryTypeEnum, pricingDependencyTypeEnum, } from "./schema.js";
|
|
16
|
-
export { addonPricingModeSchema, cancellationChargeTypeSchema, cancellationPolicyListQuerySchema, cancellationPolicyRuleListQuerySchema, cancellationPolicyTypeSchema, dropoffPriceRuleListQuerySchema, extraPriceRuleListQuerySchema, insertCancellationPolicyRuleSchema, insertCancellationPolicySchema, insertDropoffPriceRuleSchema, insertExtraPriceRuleSchema, insertOptionPriceRuleSchema, insertOptionStartTimeRuleSchema, insertOptionUnitPriceRuleSchema, insertOptionUnitTierSchema, insertPickupPriceRuleSchema, insertPriceCatalogSchema, insertPriceScheduleSchema, insertPricingCategoryDependencySchema, insertPricingCategorySchema, optionPriceRuleListQuerySchema, optionPricingModeSchema, optionStartTimeRuleListQuerySchema, optionStartTimeRuleModeSchema, optionUnitPriceRuleListQuerySchema, optionUnitPricingModeSchema, optionUnitTierListQuerySchema, pickupPriceRuleListQuerySchema, priceAdjustmentTypeSchema, priceCatalogListQuerySchema, priceCatalogTypeSchema, priceScheduleListQuerySchema, pricingCategoryDependencyListQuerySchema, pricingCategoryListQuerySchema, pricingCategoryTypeSchema, pricingDependencyTypeSchema, updateCancellationPolicyRuleSchema, updateCancellationPolicySchema, updateDropoffPriceRuleSchema, updateExtraPriceRuleSchema, updateOptionPriceRuleSchema, updateOptionStartTimeRuleSchema, updateOptionUnitPriceRuleSchema, updateOptionUnitTierSchema, updatePickupPriceRuleSchema, updatePriceCatalogSchema, updatePriceScheduleSchema, updatePricingCategoryDependencySchema, updatePricingCategorySchema, } from "./validation.js";
|
|
15
|
+
export { addonPricingModeEnum, cancellationChargeTypeEnum, cancellationPolicies, cancellationPolicyRules, cancellationPolicyTypeEnum, departurePriceOverrides, dropoffPriceRules, extraPriceRules, optionPriceRules, optionPricingModeEnum, optionStartTimeRuleModeEnum, optionStartTimeRules, optionUnitPriceRules, optionUnitPricingModeEnum, optionUnitTiers, pickupPriceRules, priceAdjustmentTypeEnum, priceCatalogs, priceCatalogTypeEnum, priceSchedules, pricingCategories, pricingCategoryDependencies, pricingCategoryTypeEnum, pricingDependencyTypeEnum, } from "./schema.js";
|
|
16
|
+
export { addonPricingModeSchema, cancellationChargeTypeSchema, cancellationPolicyListQuerySchema, cancellationPolicyRuleListQuerySchema, cancellationPolicyTypeSchema, departurePriceOverrideListQuerySchema, dropoffPriceRuleListQuerySchema, extraPriceRuleListQuerySchema, insertCancellationPolicyRuleSchema, insertCancellationPolicySchema, insertDeparturePriceOverrideSchema, insertDropoffPriceRuleSchema, insertExtraPriceRuleSchema, insertOptionPriceRuleSchema, insertOptionStartTimeRuleSchema, insertOptionUnitPriceRuleSchema, insertOptionUnitTierSchema, insertPickupPriceRuleSchema, insertPriceCatalogSchema, insertPriceScheduleSchema, insertPricingCategoryDependencySchema, insertPricingCategorySchema, optionPriceRuleListQuerySchema, optionPricingModeSchema, optionStartTimeRuleListQuerySchema, optionStartTimeRuleModeSchema, optionUnitPriceRuleListQuerySchema, optionUnitPricingModeSchema, optionUnitTierListQuerySchema, pickupPriceRuleListQuerySchema, priceAdjustmentTypeSchema, priceCatalogListQuerySchema, priceCatalogTypeSchema, priceScheduleListQuerySchema, pricingCategoryDependencyListQuerySchema, pricingCategoryListQuerySchema, pricingCategoryTypeSchema, pricingDependencyTypeSchema, updateCancellationPolicyRuleSchema, updateCancellationPolicySchema, updateDeparturePriceOverrideSchema, updateDropoffPriceRuleSchema, updateExtraPriceRuleSchema, updateOptionPriceRuleSchema, updateOptionStartTimeRuleSchema, updateOptionUnitPriceRuleSchema, updateOptionUnitTierSchema, updatePickupPriceRuleSchema, updatePriceCatalogSchema, updatePriceScheduleSchema, updatePricingCategoryDependencySchema, updatePricingCategorySchema, } from "./validation.js";
|
|
17
17
|
export { pricingService };
|
package/dist/routes-rules.d.ts
CHANGED
|
@@ -249,10 +249,10 @@ export declare const pricingRuleRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
249
249
|
unitId: string;
|
|
250
250
|
sortOrder: number;
|
|
251
251
|
pricingCategoryId: string | null;
|
|
252
|
-
pricingMode: "per_person" | "per_booking" | "free" | "on_request" | "per_unit" | "included";
|
|
253
|
-
optionPriceRuleId: string;
|
|
254
252
|
sellAmountCents: number | null;
|
|
255
253
|
costAmountCents: number | null;
|
|
254
|
+
pricingMode: "per_person" | "per_booking" | "free" | "on_request" | "per_unit" | "included";
|
|
255
|
+
optionPriceRuleId: string;
|
|
256
256
|
minQuantity: number | null;
|
|
257
257
|
maxQuantity: number | null;
|
|
258
258
|
} | null;
|
|
@@ -723,10 +723,10 @@ export declare const pricingRuleRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
723
723
|
active: boolean;
|
|
724
724
|
optionId: string;
|
|
725
725
|
sortOrder: number;
|
|
726
|
-
pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
|
|
727
|
-
optionPriceRuleId: string;
|
|
728
726
|
sellAmountCents: number | null;
|
|
729
727
|
costAmountCents: number | null;
|
|
728
|
+
pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
|
|
729
|
+
optionPriceRuleId: string;
|
|
730
730
|
pickupPointId: string;
|
|
731
731
|
} | null;
|
|
732
732
|
};
|
|
@@ -880,10 +880,10 @@ export declare const pricingRuleRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
880
880
|
active: boolean;
|
|
881
881
|
optionId: string;
|
|
882
882
|
sortOrder: number;
|
|
883
|
-
pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
|
|
884
|
-
optionPriceRuleId: string;
|
|
885
883
|
sellAmountCents: number | null;
|
|
886
884
|
costAmountCents: number | null;
|
|
885
|
+
pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
|
|
886
|
+
optionPriceRuleId: string;
|
|
887
887
|
facilityId: string | null;
|
|
888
888
|
dropoffCode: string | null;
|
|
889
889
|
dropoffName: string;
|
|
@@ -1048,10 +1048,10 @@ export declare const pricingRuleRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1048
1048
|
active: boolean;
|
|
1049
1049
|
optionId: string;
|
|
1050
1050
|
sortOrder: number;
|
|
1051
|
-
pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
|
|
1052
|
-
optionPriceRuleId: string;
|
|
1053
1051
|
sellAmountCents: number | null;
|
|
1054
1052
|
costAmountCents: number | null;
|
|
1053
|
+
pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
|
|
1054
|
+
optionPriceRuleId: string;
|
|
1055
1055
|
productExtraId: string | null;
|
|
1056
1056
|
optionExtraConfigId: string | null;
|
|
1057
1057
|
} | null;
|
|
@@ -1172,5 +1172,168 @@ export declare const pricingRuleRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1172
1172
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
1173
1173
|
};
|
|
1174
1174
|
};
|
|
1175
|
-
}
|
|
1175
|
+
} & {
|
|
1176
|
+
"/departure-price-overrides": {
|
|
1177
|
+
$get: {
|
|
1178
|
+
input: {};
|
|
1179
|
+
output: {
|
|
1180
|
+
data: {
|
|
1181
|
+
id: string;
|
|
1182
|
+
departureId: string;
|
|
1183
|
+
optionId: string;
|
|
1184
|
+
optionUnitId: string;
|
|
1185
|
+
priceCatalogId: string;
|
|
1186
|
+
sellAmountCents: number;
|
|
1187
|
+
costAmountCents: number | null;
|
|
1188
|
+
notes: string | null;
|
|
1189
|
+
active: boolean;
|
|
1190
|
+
metadata: {
|
|
1191
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
1192
|
+
} | null;
|
|
1193
|
+
createdAt: string;
|
|
1194
|
+
updatedAt: string;
|
|
1195
|
+
}[];
|
|
1196
|
+
total: number;
|
|
1197
|
+
limit: number;
|
|
1198
|
+
offset: number;
|
|
1199
|
+
};
|
|
1200
|
+
outputFormat: "json";
|
|
1201
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1204
|
+
} & {
|
|
1205
|
+
"/departure-price-overrides": {
|
|
1206
|
+
$post: {
|
|
1207
|
+
input: {};
|
|
1208
|
+
output: {
|
|
1209
|
+
data: {
|
|
1210
|
+
metadata: {
|
|
1211
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
1212
|
+
} | null;
|
|
1213
|
+
id: string;
|
|
1214
|
+
createdAt: string;
|
|
1215
|
+
updatedAt: string;
|
|
1216
|
+
notes: string | null;
|
|
1217
|
+
active: boolean;
|
|
1218
|
+
priceCatalogId: string;
|
|
1219
|
+
optionId: string;
|
|
1220
|
+
departureId: string;
|
|
1221
|
+
optionUnitId: string;
|
|
1222
|
+
sellAmountCents: number;
|
|
1223
|
+
costAmountCents: number | null;
|
|
1224
|
+
} | null;
|
|
1225
|
+
};
|
|
1226
|
+
outputFormat: "json";
|
|
1227
|
+
status: 201;
|
|
1228
|
+
};
|
|
1229
|
+
};
|
|
1230
|
+
} & {
|
|
1231
|
+
"/departure-price-overrides/:id": {
|
|
1232
|
+
$get: {
|
|
1233
|
+
input: {
|
|
1234
|
+
param: {
|
|
1235
|
+
id: string;
|
|
1236
|
+
};
|
|
1237
|
+
};
|
|
1238
|
+
output: {
|
|
1239
|
+
error: string;
|
|
1240
|
+
};
|
|
1241
|
+
outputFormat: "json";
|
|
1242
|
+
status: 404;
|
|
1243
|
+
} | {
|
|
1244
|
+
input: {
|
|
1245
|
+
param: {
|
|
1246
|
+
id: string;
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
output: {
|
|
1250
|
+
data: {
|
|
1251
|
+
id: string;
|
|
1252
|
+
departureId: string;
|
|
1253
|
+
optionId: string;
|
|
1254
|
+
optionUnitId: string;
|
|
1255
|
+
priceCatalogId: string;
|
|
1256
|
+
sellAmountCents: number;
|
|
1257
|
+
costAmountCents: number | null;
|
|
1258
|
+
notes: string | null;
|
|
1259
|
+
active: boolean;
|
|
1260
|
+
metadata: {
|
|
1261
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
1262
|
+
} | null;
|
|
1263
|
+
createdAt: string;
|
|
1264
|
+
updatedAt: string;
|
|
1265
|
+
};
|
|
1266
|
+
};
|
|
1267
|
+
outputFormat: "json";
|
|
1268
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
1269
|
+
};
|
|
1270
|
+
};
|
|
1271
|
+
} & {
|
|
1272
|
+
"/departure-price-overrides/:id": {
|
|
1273
|
+
$patch: {
|
|
1274
|
+
input: {
|
|
1275
|
+
param: {
|
|
1276
|
+
id: string;
|
|
1277
|
+
};
|
|
1278
|
+
};
|
|
1279
|
+
output: {
|
|
1280
|
+
error: string;
|
|
1281
|
+
};
|
|
1282
|
+
outputFormat: "json";
|
|
1283
|
+
status: 404;
|
|
1284
|
+
} | {
|
|
1285
|
+
input: {
|
|
1286
|
+
param: {
|
|
1287
|
+
id: string;
|
|
1288
|
+
};
|
|
1289
|
+
};
|
|
1290
|
+
output: {
|
|
1291
|
+
data: {
|
|
1292
|
+
id: string;
|
|
1293
|
+
departureId: string;
|
|
1294
|
+
optionId: string;
|
|
1295
|
+
optionUnitId: string;
|
|
1296
|
+
priceCatalogId: string;
|
|
1297
|
+
sellAmountCents: number;
|
|
1298
|
+
costAmountCents: number | null;
|
|
1299
|
+
notes: string | null;
|
|
1300
|
+
active: boolean;
|
|
1301
|
+
metadata: {
|
|
1302
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
1303
|
+
} | null;
|
|
1304
|
+
createdAt: string;
|
|
1305
|
+
updatedAt: string;
|
|
1306
|
+
};
|
|
1307
|
+
};
|
|
1308
|
+
outputFormat: "json";
|
|
1309
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
1310
|
+
};
|
|
1311
|
+
};
|
|
1312
|
+
} & {
|
|
1313
|
+
"/departure-price-overrides/:id": {
|
|
1314
|
+
$delete: {
|
|
1315
|
+
input: {
|
|
1316
|
+
param: {
|
|
1317
|
+
id: string;
|
|
1318
|
+
};
|
|
1319
|
+
};
|
|
1320
|
+
output: {
|
|
1321
|
+
error: string;
|
|
1322
|
+
};
|
|
1323
|
+
outputFormat: "json";
|
|
1324
|
+
status: 404;
|
|
1325
|
+
} | {
|
|
1326
|
+
input: {
|
|
1327
|
+
param: {
|
|
1328
|
+
id: string;
|
|
1329
|
+
};
|
|
1330
|
+
};
|
|
1331
|
+
output: {
|
|
1332
|
+
success: true;
|
|
1333
|
+
};
|
|
1334
|
+
outputFormat: "json";
|
|
1335
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
1336
|
+
};
|
|
1337
|
+
};
|
|
1338
|
+
}, "/", "/departure-price-overrides/:id">;
|
|
1176
1339
|
//# sourceMappingURL=routes-rules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-rules.d.ts","sourceRoot":"","sources":["../src/routes-rules.ts"],"names":[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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAwR1B,CAAA"}
|
package/dist/routes-rules.js
CHANGED
|
@@ -2,7 +2,7 @@ import { parseJsonBody, parseQuery } from "@voyantjs/hono";
|
|
|
2
2
|
import { Hono } from "hono";
|
|
3
3
|
import { notFound } from "./routes-shared.js";
|
|
4
4
|
import { pricingService } from "./service.js";
|
|
5
|
-
import { dropoffPriceRuleListQuerySchema, extraPriceRuleListQuerySchema, insertDropoffPriceRuleSchema, insertExtraPriceRuleSchema, insertOptionPriceRuleSchema, insertOptionStartTimeRuleSchema, insertOptionUnitPriceRuleSchema, insertOptionUnitTierSchema, insertPickupPriceRuleSchema, optionPriceRuleListQuerySchema, optionStartTimeRuleListQuerySchema, optionUnitPriceRuleListQuerySchema, optionUnitTierListQuerySchema, pickupPriceRuleListQuerySchema, updateDropoffPriceRuleSchema, updateExtraPriceRuleSchema, updateOptionPriceRuleSchema, updateOptionStartTimeRuleSchema, updateOptionUnitPriceRuleSchema, updateOptionUnitTierSchema, updatePickupPriceRuleSchema, } from "./validation.js";
|
|
5
|
+
import { departurePriceOverrideListQuerySchema, dropoffPriceRuleListQuerySchema, extraPriceRuleListQuerySchema, insertDeparturePriceOverrideSchema, insertDropoffPriceRuleSchema, insertExtraPriceRuleSchema, insertOptionPriceRuleSchema, insertOptionStartTimeRuleSchema, insertOptionUnitPriceRuleSchema, insertOptionUnitTierSchema, insertPickupPriceRuleSchema, optionPriceRuleListQuerySchema, optionStartTimeRuleListQuerySchema, optionUnitPriceRuleListQuerySchema, optionUnitTierListQuerySchema, pickupPriceRuleListQuerySchema, updateDeparturePriceOverrideSchema, updateDropoffPriceRuleSchema, updateExtraPriceRuleSchema, updateOptionPriceRuleSchema, updateOptionStartTimeRuleSchema, updateOptionUnitPriceRuleSchema, updateOptionUnitTierSchema, updatePickupPriceRuleSchema, } from "./validation.js";
|
|
6
6
|
export const pricingRuleRoutes = new Hono()
|
|
7
7
|
.get("/option-price-rules", async (c) => c.json(await pricingService.listOptionPriceRules(c.get("db"), await parseQuery(c, optionPriceRuleListQuerySchema))))
|
|
8
8
|
.post("/option-price-rules", async (c) => c.json({
|
|
@@ -115,4 +115,20 @@ export const pricingRuleRoutes = new Hono()
|
|
|
115
115
|
.delete("/extra-price-rules/:id", async (c) => {
|
|
116
116
|
const row = await pricingService.deleteExtraPriceRule(c.get("db"), c.req.param("id"));
|
|
117
117
|
return row ? c.json({ success: true }) : notFound(c, "Extra price rule not found");
|
|
118
|
+
})
|
|
119
|
+
.get("/departure-price-overrides", async (c) => c.json(await pricingService.listDeparturePriceOverrides(c.get("db"), await parseQuery(c, departurePriceOverrideListQuerySchema))))
|
|
120
|
+
.post("/departure-price-overrides", async (c) => c.json({
|
|
121
|
+
data: await pricingService.createDeparturePriceOverride(c.get("db"), await parseJsonBody(c, insertDeparturePriceOverrideSchema)),
|
|
122
|
+
}, 201))
|
|
123
|
+
.get("/departure-price-overrides/:id", async (c) => {
|
|
124
|
+
const row = await pricingService.getDeparturePriceOverrideById(c.get("db"), c.req.param("id"));
|
|
125
|
+
return row ? c.json({ data: row }) : notFound(c, "Departure price override not found");
|
|
126
|
+
})
|
|
127
|
+
.patch("/departure-price-overrides/:id", async (c) => {
|
|
128
|
+
const row = await pricingService.updateDeparturePriceOverride(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateDeparturePriceOverrideSchema));
|
|
129
|
+
return row ? c.json({ data: row }) : notFound(c, "Departure price override not found");
|
|
130
|
+
})
|
|
131
|
+
.delete("/departure-price-overrides/:id", async (c) => {
|
|
132
|
+
const row = await pricingService.deleteDeparturePriceOverride(c.get("db"), c.req.param("id"));
|
|
133
|
+
return row ? c.json({ success: true }) : notFound(c, "Departure price override not found");
|
|
118
134
|
});
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-departure price override.
|
|
3
|
+
*
|
|
4
|
+
* A single departure (availability slot) can opt out of the seasonal
|
|
5
|
+
* priceSchedule layer by setting an explicit per-unit price. Resolved at
|
|
6
|
+
* snapshot time before the option price rules: a unit with an active
|
|
7
|
+
* override on a given departure gets that override's amount; units without
|
|
8
|
+
* an override fall through to the schedule-matched rule.
|
|
9
|
+
*
|
|
10
|
+
* One row per (departure × unit × catalog). Operators wanting a flat
|
|
11
|
+
* whole-departure rate add one row per unit of the option.
|
|
12
|
+
*/
|
|
13
|
+
export declare const departurePriceOverrides: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
14
|
+
name: "departure_price_overrides";
|
|
15
|
+
schema: undefined;
|
|
16
|
+
columns: {
|
|
17
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
18
|
+
name: string;
|
|
19
|
+
tableName: "departure_price_overrides";
|
|
20
|
+
dataType: "string";
|
|
21
|
+
columnType: "PgText";
|
|
22
|
+
data: string;
|
|
23
|
+
driverParam: string;
|
|
24
|
+
notNull: true;
|
|
25
|
+
hasDefault: true;
|
|
26
|
+
isPrimaryKey: true;
|
|
27
|
+
isAutoincrement: false;
|
|
28
|
+
hasRuntimeDefault: true;
|
|
29
|
+
enumValues: [string, ...string[]];
|
|
30
|
+
baseColumn: never;
|
|
31
|
+
identity: undefined;
|
|
32
|
+
generated: undefined;
|
|
33
|
+
}, {}, {}>;
|
|
34
|
+
departureId: import("drizzle-orm/pg-core").PgColumn<{
|
|
35
|
+
name: "departure_id";
|
|
36
|
+
tableName: "departure_price_overrides";
|
|
37
|
+
dataType: "string";
|
|
38
|
+
columnType: "PgText";
|
|
39
|
+
data: string;
|
|
40
|
+
driverParam: string;
|
|
41
|
+
notNull: true;
|
|
42
|
+
hasDefault: false;
|
|
43
|
+
isPrimaryKey: false;
|
|
44
|
+
isAutoincrement: false;
|
|
45
|
+
hasRuntimeDefault: false;
|
|
46
|
+
enumValues: [string, ...string[]];
|
|
47
|
+
baseColumn: never;
|
|
48
|
+
identity: undefined;
|
|
49
|
+
generated: undefined;
|
|
50
|
+
}, {}, {}>;
|
|
51
|
+
optionId: import("drizzle-orm/pg-core").PgColumn<{
|
|
52
|
+
name: "option_id";
|
|
53
|
+
tableName: "departure_price_overrides";
|
|
54
|
+
dataType: "string";
|
|
55
|
+
columnType: "PgText";
|
|
56
|
+
data: string;
|
|
57
|
+
driverParam: string;
|
|
58
|
+
notNull: true;
|
|
59
|
+
hasDefault: false;
|
|
60
|
+
isPrimaryKey: false;
|
|
61
|
+
isAutoincrement: false;
|
|
62
|
+
hasRuntimeDefault: false;
|
|
63
|
+
enumValues: [string, ...string[]];
|
|
64
|
+
baseColumn: never;
|
|
65
|
+
identity: undefined;
|
|
66
|
+
generated: undefined;
|
|
67
|
+
}, {}, {}>;
|
|
68
|
+
optionUnitId: import("drizzle-orm/pg-core").PgColumn<{
|
|
69
|
+
name: "option_unit_id";
|
|
70
|
+
tableName: "departure_price_overrides";
|
|
71
|
+
dataType: "string";
|
|
72
|
+
columnType: "PgText";
|
|
73
|
+
data: string;
|
|
74
|
+
driverParam: string;
|
|
75
|
+
notNull: true;
|
|
76
|
+
hasDefault: false;
|
|
77
|
+
isPrimaryKey: false;
|
|
78
|
+
isAutoincrement: false;
|
|
79
|
+
hasRuntimeDefault: false;
|
|
80
|
+
enumValues: [string, ...string[]];
|
|
81
|
+
baseColumn: never;
|
|
82
|
+
identity: undefined;
|
|
83
|
+
generated: undefined;
|
|
84
|
+
}, {}, {}>;
|
|
85
|
+
priceCatalogId: import("drizzle-orm/pg-core").PgColumn<{
|
|
86
|
+
name: string;
|
|
87
|
+
tableName: "departure_price_overrides";
|
|
88
|
+
dataType: "string";
|
|
89
|
+
columnType: "PgText";
|
|
90
|
+
data: string;
|
|
91
|
+
driverParam: string;
|
|
92
|
+
notNull: true;
|
|
93
|
+
hasDefault: false;
|
|
94
|
+
isPrimaryKey: false;
|
|
95
|
+
isAutoincrement: false;
|
|
96
|
+
hasRuntimeDefault: false;
|
|
97
|
+
enumValues: [string, ...string[]];
|
|
98
|
+
baseColumn: never;
|
|
99
|
+
identity: undefined;
|
|
100
|
+
generated: undefined;
|
|
101
|
+
}, {}, {}>;
|
|
102
|
+
sellAmountCents: import("drizzle-orm/pg-core").PgColumn<{
|
|
103
|
+
name: "sell_amount_cents";
|
|
104
|
+
tableName: "departure_price_overrides";
|
|
105
|
+
dataType: "number";
|
|
106
|
+
columnType: "PgInteger";
|
|
107
|
+
data: number;
|
|
108
|
+
driverParam: string | number;
|
|
109
|
+
notNull: true;
|
|
110
|
+
hasDefault: false;
|
|
111
|
+
isPrimaryKey: false;
|
|
112
|
+
isAutoincrement: false;
|
|
113
|
+
hasRuntimeDefault: false;
|
|
114
|
+
enumValues: undefined;
|
|
115
|
+
baseColumn: never;
|
|
116
|
+
identity: undefined;
|
|
117
|
+
generated: undefined;
|
|
118
|
+
}, {}, {}>;
|
|
119
|
+
costAmountCents: import("drizzle-orm/pg-core").PgColumn<{
|
|
120
|
+
name: "cost_amount_cents";
|
|
121
|
+
tableName: "departure_price_overrides";
|
|
122
|
+
dataType: "number";
|
|
123
|
+
columnType: "PgInteger";
|
|
124
|
+
data: number;
|
|
125
|
+
driverParam: string | number;
|
|
126
|
+
notNull: false;
|
|
127
|
+
hasDefault: false;
|
|
128
|
+
isPrimaryKey: false;
|
|
129
|
+
isAutoincrement: false;
|
|
130
|
+
hasRuntimeDefault: false;
|
|
131
|
+
enumValues: undefined;
|
|
132
|
+
baseColumn: never;
|
|
133
|
+
identity: undefined;
|
|
134
|
+
generated: undefined;
|
|
135
|
+
}, {}, {}>;
|
|
136
|
+
notes: import("drizzle-orm/pg-core").PgColumn<{
|
|
137
|
+
name: "notes";
|
|
138
|
+
tableName: "departure_price_overrides";
|
|
139
|
+
dataType: "string";
|
|
140
|
+
columnType: "PgText";
|
|
141
|
+
data: string;
|
|
142
|
+
driverParam: string;
|
|
143
|
+
notNull: false;
|
|
144
|
+
hasDefault: false;
|
|
145
|
+
isPrimaryKey: false;
|
|
146
|
+
isAutoincrement: false;
|
|
147
|
+
hasRuntimeDefault: false;
|
|
148
|
+
enumValues: [string, ...string[]];
|
|
149
|
+
baseColumn: never;
|
|
150
|
+
identity: undefined;
|
|
151
|
+
generated: undefined;
|
|
152
|
+
}, {}, {}>;
|
|
153
|
+
active: import("drizzle-orm/pg-core").PgColumn<{
|
|
154
|
+
name: "active";
|
|
155
|
+
tableName: "departure_price_overrides";
|
|
156
|
+
dataType: "boolean";
|
|
157
|
+
columnType: "PgBoolean";
|
|
158
|
+
data: boolean;
|
|
159
|
+
driverParam: boolean;
|
|
160
|
+
notNull: true;
|
|
161
|
+
hasDefault: true;
|
|
162
|
+
isPrimaryKey: false;
|
|
163
|
+
isAutoincrement: false;
|
|
164
|
+
hasRuntimeDefault: false;
|
|
165
|
+
enumValues: undefined;
|
|
166
|
+
baseColumn: never;
|
|
167
|
+
identity: undefined;
|
|
168
|
+
generated: undefined;
|
|
169
|
+
}, {}, {}>;
|
|
170
|
+
metadata: import("drizzle-orm/pg-core").PgColumn<{
|
|
171
|
+
name: "metadata";
|
|
172
|
+
tableName: "departure_price_overrides";
|
|
173
|
+
dataType: "json";
|
|
174
|
+
columnType: "PgJsonb";
|
|
175
|
+
data: Record<string, unknown>;
|
|
176
|
+
driverParam: unknown;
|
|
177
|
+
notNull: false;
|
|
178
|
+
hasDefault: false;
|
|
179
|
+
isPrimaryKey: false;
|
|
180
|
+
isAutoincrement: false;
|
|
181
|
+
hasRuntimeDefault: false;
|
|
182
|
+
enumValues: undefined;
|
|
183
|
+
baseColumn: never;
|
|
184
|
+
identity: undefined;
|
|
185
|
+
generated: undefined;
|
|
186
|
+
}, {}, {
|
|
187
|
+
$type: Record<string, unknown>;
|
|
188
|
+
}>;
|
|
189
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
190
|
+
name: "created_at";
|
|
191
|
+
tableName: "departure_price_overrides";
|
|
192
|
+
dataType: "date";
|
|
193
|
+
columnType: "PgTimestamp";
|
|
194
|
+
data: Date;
|
|
195
|
+
driverParam: string;
|
|
196
|
+
notNull: true;
|
|
197
|
+
hasDefault: true;
|
|
198
|
+
isPrimaryKey: false;
|
|
199
|
+
isAutoincrement: false;
|
|
200
|
+
hasRuntimeDefault: false;
|
|
201
|
+
enumValues: undefined;
|
|
202
|
+
baseColumn: never;
|
|
203
|
+
identity: undefined;
|
|
204
|
+
generated: undefined;
|
|
205
|
+
}, {}, {}>;
|
|
206
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
207
|
+
name: "updated_at";
|
|
208
|
+
tableName: "departure_price_overrides";
|
|
209
|
+
dataType: "date";
|
|
210
|
+
columnType: "PgTimestamp";
|
|
211
|
+
data: Date;
|
|
212
|
+
driverParam: string;
|
|
213
|
+
notNull: true;
|
|
214
|
+
hasDefault: true;
|
|
215
|
+
isPrimaryKey: false;
|
|
216
|
+
isAutoincrement: false;
|
|
217
|
+
hasRuntimeDefault: false;
|
|
218
|
+
enumValues: undefined;
|
|
219
|
+
baseColumn: never;
|
|
220
|
+
identity: undefined;
|
|
221
|
+
generated: undefined;
|
|
222
|
+
}, {}, {}>;
|
|
223
|
+
};
|
|
224
|
+
dialect: "pg";
|
|
225
|
+
}>;
|
|
226
|
+
export type DeparturePriceOverride = typeof departurePriceOverrides.$inferSelect;
|
|
227
|
+
export type NewDeparturePriceOverride = typeof departurePriceOverrides.$inferInsert;
|
|
228
|
+
//# sourceMappingURL=schema-departure-overrides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-departure-overrides.d.ts","sourceRoot":"","sources":["../src/schema-departure-overrides.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BnC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,uBAAuB,CAAC,YAAY,CAAA;AAChF,MAAM,MAAM,yBAAyB,GAAG,OAAO,uBAAuB,CAAC,YAAY,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 } from "./schema-catalogs.js";
|
|
4
|
+
/**
|
|
5
|
+
* Per-departure price override.
|
|
6
|
+
*
|
|
7
|
+
* A single departure (availability slot) can opt out of the seasonal
|
|
8
|
+
* priceSchedule layer by setting an explicit per-unit price. Resolved at
|
|
9
|
+
* snapshot time before the option price rules: a unit with an active
|
|
10
|
+
* override on a given departure gets that override's amount; units without
|
|
11
|
+
* an override fall through to the schedule-matched rule.
|
|
12
|
+
*
|
|
13
|
+
* One row per (departure × unit × catalog). Operators wanting a flat
|
|
14
|
+
* whole-departure rate add one row per unit of the option.
|
|
15
|
+
*/
|
|
16
|
+
export const departurePriceOverrides = pgTable("departure_price_overrides", {
|
|
17
|
+
id: typeId("departure_price_overrides"),
|
|
18
|
+
departureId: text("departure_id").notNull(),
|
|
19
|
+
optionId: text("option_id").notNull(),
|
|
20
|
+
optionUnitId: text("option_unit_id").notNull(),
|
|
21
|
+
priceCatalogId: typeIdRef("price_catalog_id")
|
|
22
|
+
.notNull()
|
|
23
|
+
.references(() => priceCatalogs.id, { onDelete: "cascade" }),
|
|
24
|
+
sellAmountCents: integer("sell_amount_cents").notNull(),
|
|
25
|
+
costAmountCents: integer("cost_amount_cents"),
|
|
26
|
+
notes: text("notes"),
|
|
27
|
+
active: boolean("active").notNull().default(true),
|
|
28
|
+
metadata: jsonb("metadata").$type(),
|
|
29
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
30
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
31
|
+
}, (table) => [
|
|
32
|
+
uniqueIndex("uidx_departure_price_overrides_target").on(table.departureId, table.optionUnitId, table.priceCatalogId),
|
|
33
|
+
index("idx_departure_price_overrides_departure").on(table.departureId, table.active),
|
|
34
|
+
index("idx_departure_price_overrides_option").on(table.optionId, table.active),
|
|
35
|
+
index("idx_departure_price_overrides_catalog").on(table.priceCatalogId, table.active),
|
|
36
|
+
]);
|
|
@@ -17,6 +17,10 @@ export declare const cancellationPolicyRulesRelations: import("drizzle-orm").Rel
|
|
|
17
17
|
export declare const priceCatalogsRelations: import("drizzle-orm").Relations<"price_catalogs", {
|
|
18
18
|
schedules: import("drizzle-orm").Many<"price_schedules">;
|
|
19
19
|
optionPriceRules: import("drizzle-orm").Many<"option_price_rules">;
|
|
20
|
+
departureOverrides: import("drizzle-orm").Many<"departure_price_overrides">;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const departurePriceOverridesRelations: import("drizzle-orm").Relations<"departure_price_overrides", {
|
|
23
|
+
priceCatalog: import("drizzle-orm").One<"price_catalogs", true>;
|
|
20
24
|
}>;
|
|
21
25
|
export declare const priceSchedulesRelations: import("drizzle-orm").Relations<"price_schedules", {
|
|
22
26
|
priceCatalog: import("drizzle-orm").One<"price_catalogs", true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-relations.d.ts","sourceRoot":"","sources":["../src/schema-relations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-relations.d.ts","sourceRoot":"","sources":["../src/schema-relations.ts"],"names":[],"mappings":"AAeA,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;;;;EAIhC,CAAA;AAEH,eAAO,MAAM,gCAAgC;;EAK1C,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"}
|
package/dist/schema-relations.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { relations } from "drizzle-orm";
|
|
2
2
|
import { priceCatalogs, priceSchedules } from "./schema-catalogs.js";
|
|
3
3
|
import { pricingCategories, pricingCategoryDependencies } from "./schema-categories.js";
|
|
4
|
+
import { departurePriceOverrides } from "./schema-departure-overrides.js";
|
|
4
5
|
import { dropoffPriceRules, extraPriceRules, optionPriceRules, optionStartTimeRules, optionUnitPriceRules, optionUnitTiers, pickupPriceRules, } from "./schema-option-rules.js";
|
|
5
6
|
import { cancellationPolicies, cancellationPolicyRules } from "./schema-policies.js";
|
|
6
7
|
export const pricingCategoriesRelations = relations(pricingCategories, ({ many }) => ({
|
|
@@ -33,6 +34,13 @@ export const cancellationPolicyRulesRelations = relations(cancellationPolicyRule
|
|
|
33
34
|
export const priceCatalogsRelations = relations(priceCatalogs, ({ many }) => ({
|
|
34
35
|
schedules: many(priceSchedules),
|
|
35
36
|
optionPriceRules: many(optionPriceRules),
|
|
37
|
+
departureOverrides: many(departurePriceOverrides),
|
|
38
|
+
}));
|
|
39
|
+
export const departurePriceOverridesRelations = relations(departurePriceOverrides, ({ one }) => ({
|
|
40
|
+
priceCatalog: one(priceCatalogs, {
|
|
41
|
+
fields: [departurePriceOverrides.priceCatalogId],
|
|
42
|
+
references: [priceCatalogs.id],
|
|
43
|
+
}),
|
|
36
44
|
}));
|
|
37
45
|
export const priceSchedulesRelations = relations(priceSchedules, ({ one, many }) => ({
|
|
38
46
|
priceCatalog: one(priceCatalogs, {
|
package/dist/schema.d.ts
CHANGED
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA"}
|
package/dist/schema.js
CHANGED