@floristcloud/api-lib 1.2.184 → 1.2.185
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/build/schemas/order/delivery-pricing-split-group.schema.js +12 -0
- package/build/schemas/order/delivery-pricing.schema.js +7 -2
- package/build/schemas/order/index.js +1 -0
- package/package.json +1 -1
- package/schemas/order/delivery-pricing-split-group.schema.ts +10 -0
- package/schemas/order/delivery-pricing.schema.ts +9 -2
- package/schemas/order/index.ts +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryPricingSplitGroupSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const money_schema_1 = require("../money.schema");
|
|
6
|
+
exports.DeliveryPricingSplitGroupSchema = zod_1.z.object({
|
|
7
|
+
deliveryDate: zod_1.z.string().nullable().describe('ISO arrival date for transit; null for the stock order.'),
|
|
8
|
+
isInTransit: zod_1.z.boolean(),
|
|
9
|
+
subtotal: money_schema_1.MoneySchema,
|
|
10
|
+
thresholdSubtotal: money_schema_1.MoneySchema.nullable(),
|
|
11
|
+
cost: money_schema_1.MoneySchema,
|
|
12
|
+
});
|
|
@@ -5,10 +5,15 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const money_schema_1 = require("../money.schema");
|
|
6
6
|
const delivery_pricing_tier_schema_1 = require("../settings/delivery-pricing-tier.schema");
|
|
7
7
|
const delivery_pricing_in_transit_mode_enum_1 = require("../../enum/delivery-pricing-in-transit-mode.enum");
|
|
8
|
+
const delivery_pricing_split_group_schema_1 = require("./delivery-pricing-split-group.schema");
|
|
8
9
|
exports.DeliveryPricingSchema = zod_1.z.object({
|
|
9
|
-
cost: money_schema_1.MoneySchema,
|
|
10
|
+
cost: money_schema_1.MoneySchema.describe('Delivery cost; when splitGroups is present, the sum of future order delivery costs.'),
|
|
10
11
|
inStockSubtotal: money_schema_1.MoneySchema,
|
|
11
|
-
thresholdSubtotal: money_schema_1.MoneySchema.nullable(),
|
|
12
|
+
thresholdSubtotal: money_schema_1.MoneySchema.nullable().describe('Threshold basis for this order, or only the stock group in a split preview; null without stock in a split preview or without applicable tiers.'),
|
|
13
|
+
splitGroups: zod_1.z
|
|
14
|
+
.array(delivery_pricing_split_group_schema_1.DeliveryPricingSplitGroupSchema)
|
|
15
|
+
.nullable()
|
|
16
|
+
.describe('Future orders for a SAME_RULES cart preview with multiple groups; null otherwise. All groups use the shared tiers.'),
|
|
12
17
|
isInTransit: zod_1.z.boolean(),
|
|
13
18
|
tiers: zod_1.z.array(delivery_pricing_tier_schema_1.DeliveryPricingTierSchema),
|
|
14
19
|
inTransitMode: zod_1.z.nativeEnum(delivery_pricing_in_transit_mode_enum_1.DeliveryPricingInTransitModeEnum),
|
|
@@ -29,6 +29,7 @@ __exportStar(require("./update-cart-delivery-request.schema"), exports);
|
|
|
29
29
|
__exportStar(require("./update-cart-request.schema"), exports);
|
|
30
30
|
__exportStar(require("./update-cart-response.schema"), exports);
|
|
31
31
|
__exportStar(require("./delivery-pricing.schema"), exports);
|
|
32
|
+
__exportStar(require("./delivery-pricing-split-group.schema"), exports);
|
|
32
33
|
__exportStar(require("./get-order-delivery-pricing-request.schema"), exports);
|
|
33
34
|
__exportStar(require("./get-order-delivery-pricing-response.schema"), exports);
|
|
34
35
|
__exportStar(require("./order-vat-transition-request.schema"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MoneySchema } from '../money.schema';
|
|
3
|
+
|
|
4
|
+
export const DeliveryPricingSplitGroupSchema = z.object({
|
|
5
|
+
deliveryDate: z.string().nullable().describe('ISO arrival date for transit; null for the stock order.'),
|
|
6
|
+
isInTransit: z.boolean(),
|
|
7
|
+
subtotal: MoneySchema,
|
|
8
|
+
thresholdSubtotal: MoneySchema.nullable(),
|
|
9
|
+
cost: MoneySchema,
|
|
10
|
+
});
|
|
@@ -2,11 +2,18 @@ import { z } from 'zod';
|
|
|
2
2
|
import { MoneySchema } from '../money.schema';
|
|
3
3
|
import { DeliveryPricingTierSchema } from '../settings/delivery-pricing-tier.schema';
|
|
4
4
|
import { DeliveryPricingInTransitModeEnum } from '../../enum/delivery-pricing-in-transit-mode.enum';
|
|
5
|
+
import { DeliveryPricingSplitGroupSchema } from './delivery-pricing-split-group.schema';
|
|
5
6
|
|
|
6
7
|
export const DeliveryPricingSchema = z.object({
|
|
7
|
-
cost: MoneySchema,
|
|
8
|
+
cost: MoneySchema.describe('Delivery cost; when splitGroups is present, the sum of future order delivery costs.'),
|
|
8
9
|
inStockSubtotal: MoneySchema,
|
|
9
|
-
thresholdSubtotal: MoneySchema.nullable()
|
|
10
|
+
thresholdSubtotal: MoneySchema.nullable().describe(
|
|
11
|
+
'Threshold basis for this order, or only the stock group in a split preview; null without stock in a split preview or without applicable tiers.',
|
|
12
|
+
),
|
|
13
|
+
splitGroups: z
|
|
14
|
+
.array(DeliveryPricingSplitGroupSchema)
|
|
15
|
+
.nullable()
|
|
16
|
+
.describe('Future orders for a SAME_RULES cart preview with multiple groups; null otherwise. All groups use the shared tiers.'),
|
|
10
17
|
isInTransit: z.boolean(),
|
|
11
18
|
tiers: z.array(DeliveryPricingTierSchema),
|
|
12
19
|
inTransitMode: z.nativeEnum(DeliveryPricingInTransitModeEnum),
|
package/schemas/order/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './update-cart-request.schema';
|
|
|
14
14
|
export * from './update-cart-response.schema';
|
|
15
15
|
|
|
16
16
|
export * from './delivery-pricing.schema';
|
|
17
|
+
export * from './delivery-pricing-split-group.schema';
|
|
17
18
|
export * from './get-order-delivery-pricing-request.schema';
|
|
18
19
|
export * from './get-order-delivery-pricing-response.schema';
|
|
19
20
|
|