@pisell/pisellos 2.3.175 → 2.3.177
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/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/modules/OpenData/utils.d.ts +1 -1
- package/dist/modules/OpenData/utils.js +3 -2
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Order/utils.js +1 -0
- package/dist/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
- package/dist/shared/receipt/customerInvoiceLanguages.js +5 -3
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/modules/OpenData/utils.d.ts +1 -1
- package/lib/modules/OpenData/utils.js +3 -2
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/utils.js +1 -0
- package/lib/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
- package/lib/shared/receipt/customerInvoiceLanguages.js +5 -3
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// 导出评估器
|
|
2
|
+
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
+
|
|
4
|
+
// 导出适配器
|
|
5
|
+
export { PromotionAdapter } from "./adapter";
|
|
6
|
+
export { default } from "./adapter";
|
|
7
|
+
|
|
8
|
+
// 导出策略配置示例常量
|
|
9
|
+
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
|
|
@@ -3,7 +3,7 @@ export declare function getDefaultInvoiceLayoutConfig(): InvoiceLayoutConfig;
|
|
|
3
3
|
export declare function getDefaultInvoiceTemplateSettings(): InvoiceTemplateSettings;
|
|
4
4
|
/**
|
|
5
5
|
* 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
|
|
6
|
-
*
|
|
6
|
+
* 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
|
|
7
7
|
*/
|
|
8
8
|
export declare function resolveInvoiceReceiptLocales(settings?: InvoiceTemplateSettings | null): string[];
|
|
9
9
|
/**
|
|
@@ -51,12 +51,13 @@ var INVOICE_RECEIPT_LOCALE_MAPPING = {
|
|
|
51
51
|
zh_hk: ['zh_HK'],
|
|
52
52
|
ja: ['ja'],
|
|
53
53
|
pt: ['pt'],
|
|
54
|
-
cn_en: ['en', 'zh_CN']
|
|
54
|
+
cn_en: ['en', 'zh_CN'],
|
|
55
|
+
ja_en: ['ja', 'en']
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
|
|
59
|
-
*
|
|
60
|
+
* 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
|
|
60
61
|
*/
|
|
61
62
|
export function resolveInvoiceReceiptLocales(settings) {
|
|
62
63
|
if (typeof (settings === null || settings === void 0 ? void 0 : settings.template) !== 'string' || settings.template.trim().length === 0 || settings.template.trim().toUpperCase() === 'DEFAULT' || !isRecord(settings.language)) {
|
|
@@ -595,7 +595,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
595
595
|
generateIdempotencyToken(): string;
|
|
596
596
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
597
597
|
createOrder(params: CommitOrderParams['query']): {
|
|
598
|
-
type: "
|
|
598
|
+
type: "virtual" | "appointment_booking";
|
|
599
599
|
platform: string;
|
|
600
600
|
sales_channel: string;
|
|
601
601
|
order_sales_channel: string;
|
|
@@ -1102,6 +1102,7 @@ function normalizeSubmitPlatform(platform) {
|
|
|
1102
1102
|
var lower = value.toLowerCase();
|
|
1103
1103
|
if (lower === 'pc') return 'PC';
|
|
1104
1104
|
if (lower === 'h5') return 'H5';
|
|
1105
|
+
if (lower === 'webpos') return 'pos';
|
|
1105
1106
|
return value;
|
|
1106
1107
|
}
|
|
1107
1108
|
function normalizeSubmitProductionCode(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type CustomerInvoiceLanguageCode = 'en' | 'zh_CN' | 'zh_HK' | 'ja' | 'pt' | 'cn_en';
|
|
1
|
+
export type CustomerInvoiceLanguageCode = 'en' | 'zh_CN' | 'zh_HK' | 'ja' | 'pt' | 'cn_en' | 'ja_en';
|
|
2
2
|
export interface CustomerInvoiceLanguageOption {
|
|
3
3
|
code: CustomerInvoiceLanguageCode;
|
|
4
4
|
locales: string[];
|
|
@@ -25,15 +25,17 @@ var aliases = {
|
|
|
25
25
|
pt_br: 'pt',
|
|
26
26
|
pt_pt: 'pt',
|
|
27
27
|
cn_en: 'cn_en',
|
|
28
|
-
en_cn: 'cn_en'
|
|
28
|
+
en_cn: 'cn_en',
|
|
29
|
+
ja_en: 'ja_en'
|
|
29
30
|
};
|
|
30
31
|
export function normalizeCustomerInvoiceLanguage(value) {
|
|
31
32
|
return aliases[value.trim().toLowerCase().replace(/-/g, '_')];
|
|
32
33
|
}
|
|
33
34
|
function option(code) {
|
|
35
|
+
var locales = code === 'cn_en' ? ['en', 'zh_CN'] : code === 'ja_en' ? ['ja', 'en'] : [code];
|
|
34
36
|
return {
|
|
35
37
|
code: code,
|
|
36
|
-
locales:
|
|
38
|
+
locales: locales
|
|
37
39
|
};
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -55,6 +57,6 @@ export function resolveCustomerInvoiceLanguages(language, pageLocale) {
|
|
|
55
57
|
var normalized = normalizeCustomerInvoiceLanguage(pageLocale);
|
|
56
58
|
// A page locale is a single language, never a bilingual printer mode.
|
|
57
59
|
var requested = pageLocale.toLowerCase().replace(/_/g, '-');
|
|
58
|
-
var fallback = normalized && normalized !== 'cn_en' ? normalized : requested.startsWith('zh-tw') || requested.startsWith('zh-hk') ? 'zh_HK' : requested.startsWith('zh') ? 'zh_CN' : requested.startsWith('ja') ? 'ja' : requested.startsWith('pt') ? 'pt' : 'en';
|
|
60
|
+
var fallback = normalized && normalized !== 'cn_en' && normalized !== 'ja_en' ? normalized : requested.startsWith('zh-tw') || requested.startsWith('zh-hk') ? 'zh_HK' : requested.startsWith('zh') ? 'zh_CN' : requested.startsWith('ja') ? 'ja' : requested.startsWith('pt') ? 'pt' : 'en';
|
|
59
61
|
return [option(fallback)];
|
|
60
62
|
}
|
|
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
328
328
|
date: string;
|
|
329
329
|
status: string;
|
|
330
330
|
week: string;
|
|
331
|
-
weekNum: 0 |
|
|
331
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
332
332
|
}[]>;
|
|
333
333
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
334
334
|
private getScheduleDataByIds;
|
|
@@ -366,7 +366,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
366
366
|
* 获取当前的客户搜索条件
|
|
367
367
|
* @returns 当前搜索条件
|
|
368
368
|
*/
|
|
369
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
369
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
370
370
|
/**
|
|
371
371
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
372
372
|
* @returns 客户状态
|
|
@@ -1,46 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _examples.BUY_X_GET_Y_FREE_STRATEGY;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _examples.ITEM_REWARD_STRATEGY;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "PromotionAdapter", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _adapter.PromotionAdapter;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "PromotionEvaluator", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _evaluator.PromotionEvaluator;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "default", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _adapter.default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
var _evaluator = require("./evaluator");
|
|
43
|
-
var _adapter = _interopRequireWildcard(require("./adapter"));
|
|
44
|
-
var _examples = require("./examples");
|
|
45
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
46
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
1
|
+
"use strict";
|
|
@@ -3,7 +3,7 @@ export declare function getDefaultInvoiceLayoutConfig(): InvoiceLayoutConfig;
|
|
|
3
3
|
export declare function getDefaultInvoiceTemplateSettings(): InvoiceTemplateSettings;
|
|
4
4
|
/**
|
|
5
5
|
* 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
|
|
6
|
-
*
|
|
6
|
+
* 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
|
|
7
7
|
*/
|
|
8
8
|
export declare function resolveInvoiceReceiptLocales(settings?: InvoiceTemplateSettings | null): string[];
|
|
9
9
|
/**
|
|
@@ -51,12 +51,13 @@ const INVOICE_RECEIPT_LOCALE_MAPPING = {
|
|
|
51
51
|
zh_hk: ['zh_HK'],
|
|
52
52
|
ja: ['ja'],
|
|
53
53
|
pt: ['pt'],
|
|
54
|
-
cn_en: ['en', 'zh_CN']
|
|
54
|
+
cn_en: ['en', 'zh_CN'],
|
|
55
|
+
ja_en: ['ja', 'en']
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
|
|
59
|
-
*
|
|
60
|
+
* 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
|
|
60
61
|
*/
|
|
61
62
|
function resolveInvoiceReceiptLocales(settings) {
|
|
62
63
|
if (typeof settings?.template !== 'string' || settings.template.trim().length === 0 || settings.template.trim().toUpperCase() === 'DEFAULT' || !isRecord(settings.language)) {
|
|
@@ -595,7 +595,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
595
595
|
generateIdempotencyToken(): string;
|
|
596
596
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
597
597
|
createOrder(params: CommitOrderParams['query']): {
|
|
598
|
-
type: "
|
|
598
|
+
type: "virtual" | "appointment_booking";
|
|
599
599
|
platform: string;
|
|
600
600
|
sales_channel: string;
|
|
601
601
|
order_sales_channel: string;
|
|
@@ -1124,6 +1124,7 @@ function normalizeSubmitPlatform(platform) {
|
|
|
1124
1124
|
const lower = value.toLowerCase();
|
|
1125
1125
|
if (lower === 'pc') return 'PC';
|
|
1126
1126
|
if (lower === 'h5') return 'H5';
|
|
1127
|
+
if (lower === 'webpos') return 'pos';
|
|
1127
1128
|
return value;
|
|
1128
1129
|
}
|
|
1129
1130
|
function normalizeSubmitProductionCode(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type CustomerInvoiceLanguageCode = 'en' | 'zh_CN' | 'zh_HK' | 'ja' | 'pt' | 'cn_en';
|
|
1
|
+
export type CustomerInvoiceLanguageCode = 'en' | 'zh_CN' | 'zh_HK' | 'ja' | 'pt' | 'cn_en' | 'ja_en';
|
|
2
2
|
export interface CustomerInvoiceLanguageOption {
|
|
3
3
|
code: CustomerInvoiceLanguageCode;
|
|
4
4
|
locales: string[];
|
|
@@ -26,15 +26,17 @@ const aliases = {
|
|
|
26
26
|
pt_br: 'pt',
|
|
27
27
|
pt_pt: 'pt',
|
|
28
28
|
cn_en: 'cn_en',
|
|
29
|
-
en_cn: 'cn_en'
|
|
29
|
+
en_cn: 'cn_en',
|
|
30
|
+
ja_en: 'ja_en'
|
|
30
31
|
};
|
|
31
32
|
function normalizeCustomerInvoiceLanguage(value) {
|
|
32
33
|
return aliases[value.trim().toLowerCase().replace(/-/g, '_')];
|
|
33
34
|
}
|
|
34
35
|
function option(code) {
|
|
36
|
+
const locales = code === 'cn_en' ? ['en', 'zh_CN'] : code === 'ja_en' ? ['ja', 'en'] : [code];
|
|
35
37
|
return {
|
|
36
38
|
code,
|
|
37
|
-
locales
|
|
39
|
+
locales
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -53,6 +55,6 @@ function resolveCustomerInvoiceLanguages(language, pageLocale) {
|
|
|
53
55
|
const normalized = normalizeCustomerInvoiceLanguage(pageLocale);
|
|
54
56
|
// A page locale is a single language, never a bilingual printer mode.
|
|
55
57
|
const requested = pageLocale.toLowerCase().replace(/_/g, '-');
|
|
56
|
-
const fallback = normalized && normalized !== 'cn_en' ? normalized : requested.startsWith('zh-tw') || requested.startsWith('zh-hk') ? 'zh_HK' : requested.startsWith('zh') ? 'zh_CN' : requested.startsWith('ja') ? 'ja' : requested.startsWith('pt') ? 'pt' : 'en';
|
|
58
|
+
const fallback = normalized && normalized !== 'cn_en' && normalized !== 'ja_en' ? normalized : requested.startsWith('zh-tw') || requested.startsWith('zh-hk') ? 'zh_HK' : requested.startsWith('zh') ? 'zh_CN' : requested.startsWith('ja') ? 'ja' : requested.startsWith('pt') ? 'pt' : 'en';
|
|
57
59
|
return [option(fallback)];
|
|
58
60
|
}
|
|
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
328
328
|
date: string;
|
|
329
329
|
status: string;
|
|
330
330
|
week: string;
|
|
331
|
-
weekNum: 0 |
|
|
331
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
332
332
|
}[]>;
|
|
333
333
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
334
334
|
private getScheduleDataByIds;
|
|
@@ -366,7 +366,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
366
366
|
* 获取当前的客户搜索条件
|
|
367
367
|
* @returns 当前搜索条件
|
|
368
368
|
*/
|
|
369
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
369
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
370
370
|
/**
|
|
371
371
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
372
372
|
* @returns 客户状态
|