@pisell/pisellos 2.1.118 → 2.1.120
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/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/model/strategy/adapter/index.d.ts +4 -0
- package/dist/model/strategy/adapter/index.js +4 -1
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +59 -0
- package/dist/model/strategy/adapter/itemRule/adapter.js +439 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.js +169 -0
- package/dist/model/strategy/adapter/itemRule/examples.d.ts +64 -0
- package/dist/model/strategy/adapter/itemRule/examples.js +315 -0
- package/dist/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/dist/model/strategy/adapter/itemRule/index.js +5 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts +206 -0
- package/dist/model/strategy/adapter/itemRule/type.js +101 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +66 -0
- package/dist/model/strategy/adapter/promotion/adapter.js +271 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +1206 -0
- package/dist/model/strategy/adapter/promotion/examples.d.ts +138 -0
- package/dist/model/strategy/adapter/promotion/examples.js +166 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +4 -0
- package/dist/model/strategy/adapter/promotion/index.js +0 -0
- package/dist/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/dist/model/strategy/adapter/promotion/type.js +209 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -1
- package/dist/model/strategy/engine.d.ts +106 -0
- package/dist/model/strategy/engine.js +611 -0
- package/dist/model/strategy/index.d.ts +2 -93
- package/dist/model/strategy/index.js +6 -549
- package/dist/modules/Cart/types.d.ts +0 -2
- package/dist/modules/Cart/utils/cartProduct.js +25 -56
- package/dist/modules/Discount/types.d.ts +0 -18
- package/dist/modules/OpenData/index.d.ts +23 -0
- package/dist/modules/OpenData/index.js +167 -0
- package/dist/modules/OpenData/types.d.ts +73 -0
- package/dist/modules/OpenData/types.js +1 -0
- package/dist/modules/OpenData/utils.d.ts +2 -0
- package/dist/modules/OpenData/utils.js +75 -0
- package/dist/modules/Order/index.d.ts +58 -1
- package/dist/modules/Order/index.js +780 -29
- package/dist/modules/Order/types.d.ts +144 -12
- package/dist/modules/Order/utils.d.ts +25 -0
- package/dist/modules/Order/utils.js +225 -1
- package/dist/modules/Payment/index.d.ts +1 -2
- package/dist/modules/Payment/index.js +7 -10
- package/dist/modules/Payment/utils.js +0 -3
- package/dist/modules/Payment/walletpass.d.ts +0 -23
- package/dist/modules/Payment/walletpass.js +95 -191
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +2 -1
- package/dist/modules/Quotation/index.d.ts +48 -0
- package/dist/modules/Quotation/index.js +245 -0
- package/dist/modules/Quotation/types.d.ts +42 -0
- package/dist/modules/Quotation/types.js +1 -0
- package/dist/modules/Rules/index.d.ts +5 -9
- package/dist/modules/Rules/index.js +164 -673
- package/dist/modules/Rules/types.d.ts +0 -2
- package/dist/modules/SalesSummary/index.d.ts +63 -0
- package/dist/modules/SalesSummary/index.js +174 -0
- package/dist/modules/SalesSummary/types.d.ts +59 -0
- package/dist/modules/SalesSummary/types.js +1 -0
- package/dist/modules/SalesSummary/utils.d.ts +30 -0
- package/dist/modules/SalesSummary/utils.js +513 -0
- package/dist/modules/ScanOrderLogger/index.d.ts +21 -0
- package/dist/modules/ScanOrderLogger/index.js +161 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.js +95 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
- package/dist/modules/ScanOrderLogger/types.d.ts +46 -0
- package/dist/modules/ScanOrderLogger/types.js +1 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +11 -18
- package/dist/modules/Summary/types.d.ts +0 -2
- package/dist/modules/Summary/utils.d.ts +3 -9
- package/dist/modules/Summary/utils.js +4 -25
- package/dist/modules/index.d.ts +4 -0
- package/dist/modules/index.js +5 -1
- package/dist/plugins/window.d.ts +0 -2
- package/dist/solution/BookingByStep/index.d.ts +1 -2
- package/dist/solution/BookingByStep/index.js +44 -42
- package/dist/solution/BookingByStep/types.d.ts +3 -1
- package/dist/solution/BookingByStep/types.js +5 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/Checkout/index.js +0 -2
- package/dist/solution/ScanOrder/index.d.ts +90 -0
- package/dist/solution/ScanOrder/index.js +1853 -0
- package/dist/solution/ScanOrder/types.d.ts +210 -0
- package/dist/solution/ScanOrder/types.js +16 -0
- package/dist/solution/ScanOrder/utils.d.ts +93 -0
- package/dist/solution/ScanOrder/utils.js +397 -0
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +7 -23
- package/dist/solution/ShopDiscount/types.d.ts +0 -1
- package/dist/solution/ShopDiscount/types.js +1 -2
- package/dist/solution/ShopDiscount/utils.js +12 -26
- package/dist/solution/VenueBooking/index.d.ts +158 -0
- package/dist/solution/VenueBooking/index.js +2873 -0
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/dist/solution/VenueBooking/types.d.ts +130 -0
- package/dist/solution/VenueBooking/types.js +21 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +10 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +102 -0
- package/dist/solution/VenueBooking/utils/resource.d.ts +4 -0
- package/dist/solution/VenueBooking/utils/resource.js +94 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +29 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +204 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/dist/solution/VenueBooking/utils/timeSlot.js +256 -0
- package/dist/solution/VenueBooking/utils.d.ts +1 -0
- package/dist/solution/VenueBooking/utils.js +1 -0
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/model/strategy/adapter/index.d.ts +4 -0
- package/lib/model/strategy/adapter/index.js +12 -0
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +59 -0
- package/lib/model/strategy/adapter/itemRule/adapter.js +338 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.js +124 -0
- package/lib/model/strategy/adapter/itemRule/examples.d.ts +64 -0
- package/lib/model/strategy/adapter/itemRule/examples.js +269 -0
- package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/lib/model/strategy/adapter/itemRule/index.js +58 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +206 -0
- package/lib/model/strategy/adapter/itemRule/type.js +46 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +66 -0
- package/lib/model/strategy/adapter/promotion/adapter.js +217 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +844 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +138 -0
- package/lib/model/strategy/adapter/promotion/examples.js +192 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/lib/model/strategy/adapter/promotion/type.js +51 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -1
- package/lib/model/strategy/engine.d.ts +106 -0
- package/lib/model/strategy/engine.js +450 -0
- package/lib/model/strategy/index.d.ts +2 -93
- package/lib/model/strategy/index.js +6 -381
- package/lib/modules/Cart/types.d.ts +0 -2
- package/lib/modules/Cart/utils/cartProduct.js +12 -39
- package/lib/modules/Discount/types.d.ts +0 -18
- package/lib/modules/OpenData/index.d.ts +23 -0
- package/lib/modules/OpenData/index.js +116 -0
- package/lib/modules/OpenData/types.d.ts +73 -0
- package/lib/modules/OpenData/types.js +17 -0
- package/lib/modules/OpenData/utils.d.ts +2 -0
- package/lib/modules/OpenData/utils.js +111 -0
- package/lib/modules/Order/index.d.ts +58 -1
- package/lib/modules/Order/index.js +423 -1
- package/lib/modules/Order/types.d.ts +144 -12
- package/lib/modules/Order/utils.d.ts +25 -0
- package/lib/modules/Order/utils.js +229 -0
- package/lib/modules/Payment/index.d.ts +1 -2
- package/lib/modules/Payment/index.js +0 -1
- package/lib/modules/Payment/utils.js +0 -3
- package/lib/modules/Payment/walletpass.d.ts +0 -23
- package/lib/modules/Payment/walletpass.js +17 -94
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +2 -1
- package/lib/modules/Quotation/index.d.ts +48 -0
- package/lib/modules/Quotation/index.js +149 -0
- package/lib/modules/Quotation/types.d.ts +42 -0
- package/lib/modules/Quotation/types.js +17 -0
- package/lib/modules/Rules/index.d.ts +5 -9
- package/lib/modules/Rules/index.js +286 -778
- package/lib/modules/Rules/types.d.ts +0 -2
- package/lib/modules/SalesSummary/index.d.ts +63 -0
- package/lib/modules/SalesSummary/index.js +105 -0
- package/lib/modules/SalesSummary/types.d.ts +59 -0
- package/lib/modules/SalesSummary/types.js +17 -0
- package/lib/modules/SalesSummary/utils.d.ts +30 -0
- package/lib/modules/SalesSummary/utils.js +452 -0
- package/lib/modules/ScanOrderLogger/index.d.ts +21 -0
- package/lib/modules/ScanOrderLogger/index.js +135 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.js +82 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
- package/lib/modules/ScanOrderLogger/types.d.ts +46 -0
- package/lib/modules/ScanOrderLogger/types.js +17 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +9 -11
- package/lib/modules/Summary/types.d.ts +0 -2
- package/lib/modules/Summary/utils.d.ts +3 -9
- package/lib/modules/Summary/utils.js +4 -19
- package/lib/modules/index.d.ts +4 -0
- package/lib/modules/index.js +9 -1
- package/lib/plugins/window.d.ts +0 -2
- package/lib/solution/BookingByStep/index.d.ts +1 -2
- package/lib/solution/BookingByStep/index.js +4 -2
- package/lib/solution/BookingByStep/types.d.ts +3 -1
- package/lib/solution/BookingByStep/types.js +10 -0
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/Checkout/index.js +0 -2
- package/lib/solution/ScanOrder/index.d.ts +90 -0
- package/lib/solution/ScanOrder/index.js +1071 -0
- package/lib/solution/ScanOrder/types.d.ts +210 -0
- package/lib/solution/ScanOrder/types.js +36 -0
- package/lib/solution/ScanOrder/utils.d.ts +93 -0
- package/lib/solution/ScanOrder/utils.js +359 -0
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +8 -22
- package/lib/solution/ShopDiscount/types.d.ts +0 -1
- package/lib/solution/ShopDiscount/utils.js +6 -10
- package/lib/solution/VenueBooking/index.d.ts +158 -0
- package/lib/solution/VenueBooking/index.js +1545 -0
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/lib/solution/VenueBooking/types.d.ts +130 -0
- package/lib/solution/VenueBooking/types.js +44 -0
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +10 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +101 -0
- package/lib/solution/VenueBooking/utils/resource.d.ts +4 -0
- package/lib/solution/VenueBooking/utils/resource.js +80 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +29 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +209 -0
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/lib/solution/VenueBooking/utils/timeSlot.js +200 -0
- package/lib/solution/VenueBooking/utils.d.ts +1 -0
- package/lib/solution/VenueBooking/utils.js +69 -0
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/modules/Quotation/index.ts
|
|
20
|
+
var Quotation_exports = {};
|
|
21
|
+
__export(Quotation_exports, {
|
|
22
|
+
QuotationModule: () => QuotationModule
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Quotation_exports);
|
|
25
|
+
var import_BaseModule = require("../BaseModule");
|
|
26
|
+
var import_getDateIsInSchedule = require("../Schedule/getDateIsInSchedule");
|
|
27
|
+
var QuotationModule = class extends import_BaseModule.BaseModule {
|
|
28
|
+
constructor(name, version) {
|
|
29
|
+
super(name, version);
|
|
30
|
+
this.defaultName = "quotation";
|
|
31
|
+
this.defaultVersion = "1.0.0";
|
|
32
|
+
this.store = { list: [] };
|
|
33
|
+
}
|
|
34
|
+
async initialize(core, options) {
|
|
35
|
+
this.core = core;
|
|
36
|
+
this.request = core.getPlugin("request");
|
|
37
|
+
if (!this.request)
|
|
38
|
+
throw new Error("QuotationModule 需要 request 插件支持");
|
|
39
|
+
this.store = { list: [] };
|
|
40
|
+
}
|
|
41
|
+
async loadQuotations(params) {
|
|
42
|
+
var _a;
|
|
43
|
+
const query = {};
|
|
44
|
+
if (params == null ? void 0 : params.channel)
|
|
45
|
+
query.channel = params.channel;
|
|
46
|
+
const res = await this.request.get(
|
|
47
|
+
"/quotation/available",
|
|
48
|
+
query,
|
|
49
|
+
{ useCache: false }
|
|
50
|
+
);
|
|
51
|
+
const list = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || (res == null ? void 0 : res.list) || [];
|
|
52
|
+
list.sort((a, b) => a.sort - b.sort);
|
|
53
|
+
this.store.list = list;
|
|
54
|
+
}
|
|
55
|
+
getQuotationList() {
|
|
56
|
+
return this.store.list;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
60
|
+
* Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
|
|
61
|
+
*
|
|
62
|
+
* Priority: iterates quotations already sorted by `sort` ascending (lowest = highest priority).
|
|
63
|
+
* First matching quotation whose schedule covers `datetime` and whose product_data contains
|
|
64
|
+
* the requested productId wins.
|
|
65
|
+
*/
|
|
66
|
+
getPriceForProduct(params) {
|
|
67
|
+
const { productId, variantId, datetime } = params;
|
|
68
|
+
for (const quotation of this.store.list) {
|
|
69
|
+
if (!this.isQuotationActiveAt(quotation, datetime))
|
|
70
|
+
continue;
|
|
71
|
+
const match = this.findProductData(quotation.product_data, productId, variantId);
|
|
72
|
+
if (!match)
|
|
73
|
+
continue;
|
|
74
|
+
if (match.value === 0)
|
|
75
|
+
continue;
|
|
76
|
+
return String(match.value);
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
getQuotationShelfId(params) {
|
|
81
|
+
const { productId, variantId, datetime } = params;
|
|
82
|
+
for (const quotation of this.store.list) {
|
|
83
|
+
if (!this.isQuotationActiveAt(quotation, datetime))
|
|
84
|
+
continue;
|
|
85
|
+
const match = this.findProductData(quotation.product_data, productId, variantId);
|
|
86
|
+
if (!match || match.value === 0)
|
|
87
|
+
continue;
|
|
88
|
+
return quotation.id;
|
|
89
|
+
}
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Batch pre-compute quotation prices for a set of products across multiple time points.
|
|
94
|
+
* Key format: `${productId}:${timePoint}`
|
|
95
|
+
* This avoids repeated schedule matching when the same product appears in multiple resource rows.
|
|
96
|
+
*/
|
|
97
|
+
buildProductPriceMap(params) {
|
|
98
|
+
const map = /* @__PURE__ */ new Map();
|
|
99
|
+
if (!this.store.list.length)
|
|
100
|
+
return map;
|
|
101
|
+
for (const productId of params.productIds) {
|
|
102
|
+
for (const timePoint of params.timePoints) {
|
|
103
|
+
const key = `${productId}:${timePoint}`;
|
|
104
|
+
const price = this.getPriceForProduct({ productId, datetime: timePoint });
|
|
105
|
+
if (price !== null) {
|
|
106
|
+
map.set(key, price);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return map;
|
|
111
|
+
}
|
|
112
|
+
setScheduleResolver(resolver) {
|
|
113
|
+
this.scheduleResolver = resolver;
|
|
114
|
+
}
|
|
115
|
+
isQuotationActiveAt(quotation, datetime) {
|
|
116
|
+
var _a;
|
|
117
|
+
if (!((_a = quotation.schedule) == null ? void 0 : _a.length))
|
|
118
|
+
return false;
|
|
119
|
+
const scheduleItems = quotation.schedule.map((s) => {
|
|
120
|
+
var _a2;
|
|
121
|
+
const full = (_a2 = this.scheduleResolver) == null ? void 0 : _a2.call(this, s.id);
|
|
122
|
+
if (full)
|
|
123
|
+
return full;
|
|
124
|
+
return {
|
|
125
|
+
...s,
|
|
126
|
+
repeat_type: s.repeat_type || "none",
|
|
127
|
+
repeat_rule: s.repeat_rule || null,
|
|
128
|
+
time_slot: s.time_slot || []
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
return (0, import_getDateIsInSchedule.getDateIsInSchedule)(datetime, scheduleItems);
|
|
132
|
+
}
|
|
133
|
+
findProductData(productData, productId, variantId) {
|
|
134
|
+
if (variantId && variantId !== 0) {
|
|
135
|
+
const variantMatch = productData.find(
|
|
136
|
+
(p) => p.product_id === productId && p.variant_id === variantId
|
|
137
|
+
);
|
|
138
|
+
if (variantMatch)
|
|
139
|
+
return variantMatch;
|
|
140
|
+
}
|
|
141
|
+
return productData.find(
|
|
142
|
+
(p) => p.product_id === productId && p.variant_id === 0
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
147
|
+
0 && (module.exports = {
|
|
148
|
+
QuotationModule
|
|
149
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface QuotationProductData {
|
|
2
|
+
id: number;
|
|
3
|
+
shelf_id: number;
|
|
4
|
+
product_id: number;
|
|
5
|
+
variant_id: number;
|
|
6
|
+
type: string;
|
|
7
|
+
value: number;
|
|
8
|
+
}
|
|
9
|
+
export interface QuotationSchedule {
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
type: 'standard' | 'time-slots' | 'designation';
|
|
13
|
+
start_time: string;
|
|
14
|
+
end_time: string;
|
|
15
|
+
is_all: number;
|
|
16
|
+
repeat_type?: string;
|
|
17
|
+
repeat_rule?: any;
|
|
18
|
+
designation?: any;
|
|
19
|
+
time_slot?: Array<{
|
|
20
|
+
start_time: string;
|
|
21
|
+
end_time: string;
|
|
22
|
+
}>;
|
|
23
|
+
pivot?: Record<string, any>;
|
|
24
|
+
}
|
|
25
|
+
export interface QuotationItem {
|
|
26
|
+
id: number;
|
|
27
|
+
shop_id: number;
|
|
28
|
+
shelf_type_id?: number;
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
status: string;
|
|
32
|
+
sort: number;
|
|
33
|
+
channel: string[];
|
|
34
|
+
created_at?: string;
|
|
35
|
+
updated_at?: string;
|
|
36
|
+
deleted_at?: string | null;
|
|
37
|
+
schedule: QuotationSchedule[];
|
|
38
|
+
product_data: QuotationProductData[];
|
|
39
|
+
}
|
|
40
|
+
export interface QuotationState {
|
|
41
|
+
list: QuotationItem[];
|
|
42
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/modules/Quotation/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
3
|
import { Rules, RulesModuleAPI, DiscountResult, UnavailableReason } from './types';
|
|
4
|
-
import { Discount } from
|
|
5
|
-
import {
|
|
4
|
+
import { Discount } from "../Discount/types";
|
|
5
|
+
import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
|
|
6
6
|
export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
|
|
7
7
|
protected defaultName: string;
|
|
8
8
|
protected defaultVersion: string;
|
|
9
9
|
private store;
|
|
10
|
-
window: WindowPlugin;
|
|
11
10
|
private hooks;
|
|
12
11
|
constructor(name?: string, version?: string);
|
|
13
12
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
14
13
|
setRulesList(rulesList: Rules[]): Promise<void>;
|
|
15
14
|
getRulesList(): Rules[];
|
|
16
15
|
private checkHolderMatch;
|
|
17
|
-
|
|
18
|
-
isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, orderTotalAmount, holders, isFormSubject, }: {
|
|
16
|
+
isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, holders, isFormSubject, }: {
|
|
19
17
|
oldDiscountList: Discount[];
|
|
20
18
|
newDiscountList: Discount[];
|
|
21
19
|
productList: any[];
|
|
22
20
|
holders: {
|
|
23
21
|
form_record_id: number;
|
|
24
22
|
}[];
|
|
25
|
-
orderTotalAmount: number;
|
|
26
23
|
isFormSubject: boolean;
|
|
27
24
|
}): {
|
|
28
25
|
isAvailable: boolean;
|
|
@@ -32,18 +29,17 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
32
29
|
};
|
|
33
30
|
filterDiscountListByType(discountList: Discount[], type: string): Discount[];
|
|
34
31
|
private getUnavailableReason;
|
|
35
|
-
calcDiscount({ discountList, productList, holders, isFormSubject,
|
|
32
|
+
calcDiscount({ discountList, productList, holders, isFormSubject, }: {
|
|
36
33
|
discountList: Discount[];
|
|
37
34
|
productList: any[];
|
|
38
35
|
holders: {
|
|
39
36
|
form_record_id: number;
|
|
40
37
|
}[];
|
|
41
38
|
isFormSubject: boolean;
|
|
42
|
-
orderTotalAmount: number;
|
|
43
39
|
}, options?: {
|
|
44
40
|
isSelected?: boolean;
|
|
45
41
|
discountId?: number;
|
|
46
|
-
selectedList?:
|
|
42
|
+
selectedList?: SetDiscountSelectedParams[];
|
|
47
43
|
scan?: boolean;
|
|
48
44
|
}): DiscountResult;
|
|
49
45
|
/**
|