@trusted-solutions/sdit.models 0.18.0-alpha.2 → 0.18.0-alpha.20

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.
@@ -0,0 +1,7 @@
1
+ export declare const clientEndpoints: {
2
+ KshopOnline: {
3
+ dev: string;
4
+ qa: string;
5
+ prod: string;
6
+ };
7
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clientEndpoints = void 0;
4
+ exports.clientEndpoints = {
5
+ KshopOnline: {
6
+ dev: 'http://localhost:4200',
7
+ qa: 'https://kshop-online-qa.trusted-sol.com',
8
+ prod: 'https://kshop-online.trusted-sol.com',
9
+ }
10
+ };
11
+ //# sourceMappingURL=client-endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-endpoints.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/constants/client-endpoints.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;IAC7B,WAAW,EAAE;QACX,GAAG,EAAE,uBAAuB;QAC5B,EAAE,EAAE,yCAAyC;QAC7C,IAAI,EAAE,sCAAsC;KAC7C;CACF,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './industry';
2
2
  export * from './district-zip.taiwan';
3
+ export * from './client-endpoints';
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./industry"), exports);
5
5
  tslib_1.__exportStar(require("./district-zip.taiwan"), exports);
6
+ tslib_1.__exportStar(require("./client-endpoints"), exports);
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/constants/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,gEAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/constants/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,gEAAsC;AACtC,6DAAmC"}
@@ -42,7 +42,8 @@ export declare enum ErrorType {
42
42
  FilterExpressionException = "FilterExpressionException",
43
43
  AkitaUnsupportedException = "AkitaUnsupportedException",
44
44
  ResponseLengthException = "ResponseLengthException",
45
- InconsistentStateException = "InconsistentStateException"
45
+ InconsistentStateException = "InconsistentStateException",
46
+ SOOrderException = "SOOrderException"
46
47
  }
47
48
  export declare enum ErrorMessage {
48
49
  BadRequest = "\u8ACB\u6C42\u932F\u8AA4",
@@ -102,5 +103,7 @@ export declare enum ErrorMessage {
102
103
  ShiftClosingPaymentDetailInconsistencyException = "\u907A\u6F0F\u6216\u6709\u91CD\u8907\u7684\u5C0F\u7D50\u4ED8\u6B3E\u660E\u7D30\uFF01",
103
104
  BetweenValueException = "\u4F7F\u7528\u4ECB\u65BC\u904B\u7B97\u5B50\uFF0C\u524D\u503C\u9700\u5C0F\u65BC\u5F8C\u503C\uFF01",
104
105
  AkitaUnsupportedException = "\u7576\u524D\u64CD\u4F5C\u4E0D\u652F\u63F4\u67F4\u72AC\u529F\u80FD\uFF0C\u8ACB\u4F7F\u7528\u9078\u9805\u7E5E\u904E\u7260\uFF01",
105
- ResponseLengthException = "\u56DE\u61C9\u503C\u7684\u6578\u91CF\u8207\u9810\u671F\u4E0D\u7B26\uFF01"
106
+ ResponseLengthException = "\u56DE\u61C9\u503C\u7684\u6578\u91CF\u8207\u9810\u671F\u4E0D\u7B26\uFF01",
107
+ InconsistentStateException = "\u8A02\u55AE\u72C0\u614B\u5DF2\u904E\u671F\uFF0C\u8ACB\u91CD\u65B0\u8F09\u5165\u518D\u8A66\u4E00\u6B21",
108
+ SOOrderException = "\u8A02\u55AE\u932F\u8AA4"
106
109
  }
@@ -63,6 +63,7 @@ var ErrorType;
63
63
  ErrorType["ResponseLengthException"] = "ResponseLengthException";
64
64
  // online orders
65
65
  ErrorType["InconsistentStateException"] = "InconsistentStateException";
66
+ ErrorType["SOOrderException"] = "SOOrderException";
66
67
  })(ErrorType = exports.ErrorType || (exports.ErrorType = {}));
67
68
  var ErrorMessage;
68
69
  (function (ErrorMessage) {
@@ -138,5 +139,8 @@ var ErrorMessage;
138
139
  // data service
139
140
  ErrorMessage["AkitaUnsupportedException"] = "\u7576\u524D\u64CD\u4F5C\u4E0D\u652F\u63F4\u67F4\u72AC\u529F\u80FD\uFF0C\u8ACB\u4F7F\u7528\u9078\u9805\u7E5E\u904E\u7260\uFF01";
140
141
  ErrorMessage["ResponseLengthException"] = "\u56DE\u61C9\u503C\u7684\u6578\u91CF\u8207\u9810\u671F\u4E0D\u7B26\uFF01";
142
+ // online orders
143
+ ErrorMessage["InconsistentStateException"] = "\u8A02\u55AE\u72C0\u614B\u5DF2\u904E\u671F\uFF0C\u8ACB\u91CD\u65B0\u8F09\u5165\u518D\u8A66\u4E00\u6B21";
144
+ ErrorMessage["SOOrderException"] = "\u8A02\u55AE\u932F\u8AA4";
141
145
  })(ErrorMessage = exports.ErrorMessage || (exports.ErrorMessage = {}));
142
146
  //# sourceMappingURL=error-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-type.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/enums/error-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,SA4EX;AA5ED,WAAY,SAAS;IACjB,UAAU;IACV,sCAAyB,CAAA;IACzB,wDAA2C,CAAA;IAC3C,4DAA+C,CAAA;IAC/C,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,8DAAiD,CAAA;IACjD,wEAA2D,CAAA;IAE3D,MAAM;IACN,kCAAqB,CAAA;IAErB,UAAU;IACV,oEAAuD,CAAA;IACvD,sEAAyD,CAAA;IAEzD,QAAQ;IACR,gFAAmE,CAAA;IACnE,8DAAiD,CAAA;IACjD,gEAAmD,CAAA;IACnD,oEAAuD,CAAA;IACvD,4DAA+C,CAAA;IAC/C,oEAAuD,CAAA;IACvD,0EAA6D,CA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GAAuC,CAAA;IACvC,gGAAmC,CAAA;IACnC,4HAA2C,CAAA;IAC3C,iHAA0C,CAAA;IAC1C,wFAAqC,CAAA;IACrC,+MAA6D,CAAA;IAE7D,OAAO;IACP,6JAAwD,CAAA;IAExD,UAAU;IACV,oHAAkD,CAAA;IAElD,QAAQ;IACR,wGAA2C,CAAA;IAC3C,mFAAqC,CAAA;IACrC,wGAA2C,CAAA;IAC3C,6GAA2C,CAAA;IAC3C,+FAAuC,CAAA;IAEvC,QAAQ;IACR,kHAAgD,CAAA;IAEhD,UAAU;IACV,4FAAoC,CAAA;IAEpC,UAAU;IACV,2FAAwC,CAAA;IACxC,8FAA2C,CAAA;IAC3C,mNAAsE,CAAA;IACtE,4PAAuE,CAAA;IACvE,sFAAmC,CAAA;IACnC,qGAA6C,CAAA;IAC7C,0IAAoD,CAAA;IACpD,yIAA8C,CAAA;IAC9C,+KAA2D,CAAA;IAE3D,WAAW;IACX,kFAAoC,CAAA;IAEpC,WAAW;IACX,oIAA8C,CAAA;IAC9C,uJAAuD,CAAA;IACvD,+GAAmC,CAAA;IACnC,qIAAqC,CAAA;IACrC,sIAAqD,CAAA;IACrD,+JAA0D,CAAA;IAC1D,gJAAqD,CAAA;IACrD,sPAA2E,CAAA;IAC3E,qQAA2E,CAAA;IAE3E,UAAU;IACV,oHAA6C,CAAA;IAC7C,oHAA6C,CAAA;IAC7C,wJAAkE,CAAA;IAElE,WAAW;IACX,0IAA0C,CAAA;IAE1C,eAAe;IACf,4KAAmD,CAAA;IACnD,oHAAwC,CAAA;AAC5C,CAAC,EAvFW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAuFvB"}
1
+ {"version":3,"file":"error-type.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/enums/error-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,SA6EX;AA7ED,WAAY,SAAS;IACjB,UAAU;IACV,sCAAyB,CAAA;IACzB,wDAA2C,CAAA;IAC3C,4DAA+C,CAAA;IAC/C,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,CAAA;IAE1C,eAAe;IACf,4KAAmD,CAAA;IACnD,oHAAwC,CAAA;IAExC,gBAAgB;IAChB,qJAAgD,CAAA;IAChD,6DAAyB,CAAA;AAC7B,CAAC,EA3FW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA2FvB"}
@@ -3,5 +3,6 @@ export declare enum RealTimeSwitchType {
3
3
  ProductAttributeSoldOut = "ProductAttributeSoldOut",
4
4
  ServeTypeDisableDineIn = "ServeTypeDisableDineIn",
5
5
  ServeTypeDisableTakeout = "ServeTypeDisableTakeout",
6
- DisableKiosk = "DisableKiosk"
6
+ DisableKiosk = "DisableKiosk",
7
+ OnlineOrderUntilOpen = "OnlineOrderUntilOpen"
7
8
  }
@@ -8,5 +8,6 @@ var RealTimeSwitchType;
8
8
  RealTimeSwitchType["ServeTypeDisableDineIn"] = "ServeTypeDisableDineIn";
9
9
  RealTimeSwitchType["ServeTypeDisableTakeout"] = "ServeTypeDisableTakeout";
10
10
  RealTimeSwitchType["DisableKiosk"] = "DisableKiosk";
11
+ RealTimeSwitchType["OnlineOrderUntilOpen"] = "OnlineOrderUntilOpen";
11
12
  })(RealTimeSwitchType = exports.RealTimeSwitchType || (exports.RealTimeSwitchType = {}));
12
13
  //# sourceMappingURL=real-time-switch-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"real-time-switch-type.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/enums/real-time-switch-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAE5B,uDAAiC,CAAA;IACjC,yEAAmD,CAAA;IACnD,uEAAiD,CAAA;IACjD,yEAAmD,CAAA;IACnD,mDAA6B,CAAA;AAC/B,CAAC,EAPW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAO7B"}
1
+ {"version":3,"file":"real-time-switch-type.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/enums/real-time-switch-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,uDAAiC,CAAA;IACjC,yEAAmD,CAAA;IACnD,uEAAiD,CAAA;IACjD,yEAAmD,CAAA;IACnD,mDAA6B,CAAA;IAC7B,mEAA6C,CAAA;AAC/C,CAAC,EAPW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAO7B"}
package/lambda/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './request';
3
3
  export * from './response';
4
4
  export * from './online-integration';
5
5
  export * from './online-ordering';
6
+ export * from './line-notify';
package/lambda/index.js CHANGED
@@ -6,4 +6,5 @@ tslib_1.__exportStar(require("./request"), exports);
6
6
  tslib_1.__exportStar(require("./response"), exports);
7
7
  tslib_1.__exportStar(require("./online-integration"), exports);
8
8
  tslib_1.__exportStar(require("./online-ordering"), exports);
9
+ tslib_1.__exportStar(require("./line-notify"), exports);
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/lambda/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,oDAA0B;AAC1B,qDAA2B;AAG3B,+DAAqC;AACrC,4DAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/lambda/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,oDAA0B;AAC1B,qDAA2B;AAG3B,+DAAqC;AACrC,4DAAkC;AAElC,wDAA8B"}
@@ -62,10 +62,11 @@ export interface SOGetStoreInfoResponse {
62
62
  */
63
63
  buyerIdInputHidden: boolean;
64
64
  /**
65
- * 線上店是否營業中可接單
66
- * @Default false
65
+ * 線上店到untilOpen之後可接單
66
+ * 設Infinity為永久停業
67
+ * @Default null
67
68
  */
68
- isOpen: boolean;
69
+ untilOpen: number;
69
70
  /**
70
71
  * 是否使用線上點餐
71
72
  * @Default false
@@ -111,7 +112,7 @@ export interface SOValidateMutationRequest {
111
112
  traceId: string;
112
113
  /**
113
114
  * 預計取餐時間 timestamp ms
114
- * 不給值 = 盡快
115
+ * 不給值 = 盡快
115
116
  */
116
117
  expectedPickupAt?: number;
117
118
  cart: SOValidateCart;
@@ -123,7 +124,7 @@ export interface SOValidateMutationResponse {
123
124
  storeId: string;
124
125
  traceId: string;
125
126
  /**
126
- * 小計
127
+ * 小計
127
128
  */
128
129
  subtotal: number;
129
130
  /**
@@ -134,10 +135,6 @@ export interface SOValidateMutationResponse {
134
135
  * 總折扣金額
135
136
  */
136
137
  totalDiscountAmount: number;
137
- /**
138
- * 稅額
139
- */
140
- taxAmount: number;
141
138
  /**
142
139
  * 結帳金額
143
140
  */
@@ -150,6 +147,10 @@ export interface SOSendOrderRequest {
150
147
  serveType: ServeType;
151
148
  eater: SOEater;
152
149
  cart: SOValidateCart;
150
+ /**
151
+ * 是否為現場付款
152
+ * 選擇現場付款的訂單,會馬上成立無法再改付款方式。
153
+ */
153
154
  isOnSitePayment: boolean;
154
155
  /**
155
156
  * 包裝、免洗餐具
@@ -157,7 +158,7 @@ export interface SOSendOrderRequest {
157
158
  includeDisposableItems: boolean;
158
159
  /**
159
160
  * 預計取餐時間 timestamp ms
160
- * 不給值 = 盡快
161
+ * 不給值 = 盡快
161
162
  */
162
163
  expectedPickupAt?: number;
163
164
  }
@@ -178,6 +179,18 @@ export interface SOGetPaymentUrlRequest {
178
179
  storeId: string;
179
180
  /** online Order Id */
180
181
  id: string;
182
+ /**
183
+ * 以MyPay為例
184
+ * 可在產生付款網址時,決定returnUrl
185
+ * 若不填寫,則以MyPay特約店家後台設定的為主
186
+ */
187
+ successReturnUrl?: string;
188
+ /**
189
+ * 以MyPay為例
190
+ * 可在產生付款網址時,決定returnUrl
191
+ * 若不填寫,則以MyPay特約店家後台設定的為主
192
+ */
193
+ failureReturnUrl?: string;
181
194
  }
182
195
  export interface SOGetPaymentUrlResponse {
183
196
  payUrl: string;
@@ -186,13 +199,13 @@ export interface SOGetPaymentUrlResponse {
186
199
  /*******************************/
187
200
  export interface SOCancelOrderRequest {
188
201
  storeId: string;
189
- /** POS Order Id */
190
- orderId: string;
202
+ /** online order id */
203
+ id: string;
191
204
  }
192
205
  export interface SOCancelOrderResponse {
193
206
  storeId: string;
194
- /** POS Order Id */
195
- orderId: string;
207
+ /** online order id */
208
+ id: string;
196
209
  state: SOOrderState;
197
210
  }
198
211
  /*******************************/
@@ -1,24 +1,33 @@
1
- import { RealTimeSwitchType } from "../../enums/real-time-switch-type";
2
- export declare type RealTimeSwitchRequest = ProductRealTimeSwitchRequest | ProductAttributeRealTimeSwitchRequest | DisableDineInRealTimeSwitchRequest | DisableTakeoutRealTimeSwitchRequest | DisableKioskRealTimeSwitchRequest;
1
+ import { RealTimeSwitchType } from '../../enums/real-time-switch-type';
2
+ export declare type RealTimeSwitchRequest = ProductRealTimeSwitchRequest | ProductAttributeRealTimeSwitchRequest | DisableDineInRealTimeSwitchRequest | DisableTakeoutRealTimeSwitchRequest | DisableKioskRealTimeSwitchRequest | OnlineOrderUntilOpenSwitchRequest;
3
3
  export interface BaseRealTimeSwitchRequest {
4
4
  storeId: string;
5
5
  type: RealTimeSwitchType;
6
- value: boolean;
6
+ value: boolean | number;
7
7
  }
8
8
  export interface ProductRealTimeSwitchRequest extends BaseRealTimeSwitchRequest {
9
9
  type: RealTimeSwitchType.ProductSoldOut;
10
10
  productId: string;
11
+ value: boolean;
11
12
  }
12
13
  export interface ProductAttributeRealTimeSwitchRequest extends BaseRealTimeSwitchRequest {
13
14
  type: RealTimeSwitchType.ProductAttributeSoldOut;
14
15
  productAttributeId: string;
16
+ value: boolean;
15
17
  }
16
18
  export interface DisableDineInRealTimeSwitchRequest extends BaseRealTimeSwitchRequest {
17
19
  type: RealTimeSwitchType.ServeTypeDisableDineIn;
20
+ value: boolean;
18
21
  }
19
22
  export interface DisableTakeoutRealTimeSwitchRequest extends BaseRealTimeSwitchRequest {
20
23
  type: RealTimeSwitchType.ServeTypeDisableTakeout;
24
+ value: boolean;
21
25
  }
22
26
  export interface DisableKioskRealTimeSwitchRequest extends BaseRealTimeSwitchRequest {
23
27
  type: RealTimeSwitchType.DisableKiosk;
28
+ value: boolean;
29
+ }
30
+ export interface OnlineOrderUntilOpenSwitchRequest extends BaseRealTimeSwitchRequest {
31
+ type: RealTimeSwitchType.OnlineOrderUntilOpen;
32
+ value: number;
24
33
  }
@@ -21,6 +21,7 @@ export interface GetStoresRequest extends Filterable, CursorPaginationEnabled, W
21
21
  }
22
22
  export interface GetStoreByIdRequest {
23
23
  storeId: string;
24
+ skipGetRelatedProperty?: boolean;
24
25
  blockVersion?: BlockVersion;
25
26
  }
26
27
  export interface UpdateStoreRequest {
package/models/menu.d.ts CHANGED
@@ -37,6 +37,11 @@ export interface Product {
37
37
  attributeIds: string[];
38
38
  tax: Tax;
39
39
  sort: number;
40
+ /**
41
+ * @readonly
42
+ * 是否售完。
43
+ * 使用 lambda func `realTimeSwitch` 來更新此 property
44
+ */
40
45
  soldOut: boolean;
41
46
  externals?: External[];
42
47
  discountModules?: ItemDiscountModule[];
@@ -51,6 +56,11 @@ export interface ProductAttribute {
51
56
  additionalAmount: number;
52
57
  sort: number;
53
58
  storeTemplateId?: string;
59
+ /**
60
+ * @readonly
61
+ * 是否售完。
62
+ * 使用 lambda func `realTimeSwitch` 來更新此 property
63
+ */
54
64
  soldOut?: boolean;
55
65
  disableOnline?: boolean;
56
66
  disableKiosk?: boolean;
@@ -60,6 +70,9 @@ export interface ProductAttributeCategory {
60
70
  name: string;
61
71
  nameLang?: Language[];
62
72
  sort: number;
73
+ /**
74
+ * @deprecated 改由 `quantity` 判斷
75
+ */
63
76
  multiSelect?: boolean;
64
77
  quantity?: Quantity;
65
78
  storeTemplateId?: string;
@@ -24,6 +24,7 @@ export declare enum OOReasonCode {
24
24
  OUT_OF_ITEMS = "OUT_OF_ITEMS",
25
25
  CUSTOMER_CALLED_TO_CANCEL = "CUSTOMER_CALLED_TO_CANCEL",
26
26
  CANNOT_COMPLETE_CUSTOMER_NOTE = "CANNOT_COMPLETE_CUSTOMER_NOTE",
27
+ PAYMENT_EXPIRED = "PAYMENT_EXPIRED",
27
28
  OTHER = "OTHER"
28
29
  }
29
30
  export declare enum OMEntityType {
@@ -31,6 +31,7 @@ var OOReasonCode;
31
31
  OOReasonCode["OUT_OF_ITEMS"] = "OUT_OF_ITEMS";
32
32
  OOReasonCode["CUSTOMER_CALLED_TO_CANCEL"] = "CUSTOMER_CALLED_TO_CANCEL";
33
33
  OOReasonCode["CANNOT_COMPLETE_CUSTOMER_NOTE"] = "CANNOT_COMPLETE_CUSTOMER_NOTE";
34
+ OOReasonCode["PAYMENT_EXPIRED"] = "PAYMENT_EXPIRED";
34
35
  OOReasonCode["OTHER"] = "OTHER";
35
36
  })(OOReasonCode = exports.OOReasonCode || (exports.OOReasonCode = {}));
36
37
  var OMEntityType;
@@ -1 +1 @@
1
- {"version":3,"file":"online-integration.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/online-integration.ts"],"names":[],"mappings":";;;AAEA,IAAY,6BAIX;AAJD,WAAY,6BAA6B;IACvC,wDAAuB,CAAA;IACvB,kEAAiC,CAAA;IACjC,oDAAmB,CAAA;AACrB,CAAC,EAJW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAIxC;AAID,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,2DAAQ,CAAA;IACR,2DAAQ,CAAA;IACR,+EAAkB,CAAA;AACpB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAGD,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,mEAAuC,CAAA;AACzC,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAED,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,+CAAyB,CAAA;IACzB,mCAAa,CAAA;AACf,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAED,IAAY,YAOX;AAPD,WAAY,YAAY;IACtB,2DAA2C,CAAA;IAC3C,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,uEAAuD,CAAA;IACvD,+EAA+D,CAAA;IAC/D,+BAAe,CAAA;AACjB,CAAC,EAPW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAOvB;AAID,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iDAAiC,CAAA;AACnC,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
1
+ {"version":3,"file":"online-integration.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/online-integration.ts"],"names":[],"mappings":";;;AAEA,IAAY,6BAIX;AAJD,WAAY,6BAA6B;IACvC,wDAAuB,CAAA;IACvB,kEAAiC,CAAA;IACjC,oDAAmB,CAAA;AACrB,CAAC,EAJW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAIxC;AAID,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,2DAAQ,CAAA;IACR,2DAAQ,CAAA;IACR,+EAAkB,CAAA;AACpB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAGD,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,mEAAuC,CAAA;AACzC,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAED,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,+CAAyB,CAAA;IACzB,mCAAa,CAAA;AACf,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAED,IAAY,YAQX;AARD,WAAY,YAAY;IACtB,2DAA2C,CAAA;IAC3C,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,uEAAuD,CAAA;IACvD,+EAA+D,CAAA;IAC/D,mDAAmC,CAAA;IACnC,+BAAe,CAAA;AACjB,CAAC,EARW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAQvB;AAID,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iDAAiC,CAAA;AACnC,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
@@ -9,9 +9,17 @@ export interface SOOrderError {
9
9
  unavailableCartItems?: SOUnavailableCartItem[];
10
10
  }
11
11
  export declare enum SOOrderErrorType {
12
+ /** 未啟用菜單 */
13
+ menuNotEnabled = "menuNotEnabled",
14
+ /** 菜單超出販售時間 */
15
+ menuOutOfServiceTime = "menuOutOfServiceTime",
16
+ /** 品項售完 */
12
17
  itemSoldOut = "itemSoldOut",
18
+ /** 品項金額改變 */
13
19
  amountChanged = "amountChanged",
20
+ /** 不開放點餐 */
14
21
  storeNotOpening = "storeNotOpening",
22
+ /** 未啟用線上點餐功能 */
15
23
  storeNotEnabled = "storeNotEnabled"
16
24
  }
17
25
  export interface SOPaymentMethod {
@@ -54,7 +62,8 @@ export interface SOEater {
54
62
  }
55
63
  export declare enum SOOperateParty {
56
64
  store = "store",
57
- buyer = "buyer"
65
+ buyer = "buyer",
66
+ system = "system"
58
67
  }
59
68
  export interface SOCart {
60
69
  items: SOCartItem[];
@@ -110,6 +119,8 @@ export interface SOOrder {
110
119
  actualPaymentMethod?: SOPaymentMethod;
111
120
  /** 消費者付款時間 undefined為未付款 */
112
121
  paidAt?: number;
122
+ /** 訂單被取消或拒絕後,已付款的退款時間 undefined 為未退款 */
123
+ refundedAt?: number;
113
124
  }
114
125
  export interface SOUnavailableCartItem {
115
126
  menuItemType: 'product' | 'attribute';
@@ -129,6 +140,8 @@ export interface SOValidateCart {
129
140
  export interface SOValidateCartItem {
130
141
  /** 前端決定 cart item Id (timestamp ms) */
131
142
  id: string;
143
+ /** 此品項由哪一個菜單id加入購物車 */
144
+ menuId: string;
132
145
  productCategoryId: string;
133
146
  productId: string;
134
147
  /** 原單價 */
@@ -194,7 +207,6 @@ export interface SOPublicProductAttributeCategory {
194
207
  id: string;
195
208
  name: MultiLanguageText;
196
209
  sort: number;
197
- multiSelect?: boolean;
198
210
  quantity?: Quantity;
199
211
  storeTemplateId?: string;
200
212
  }
@@ -3,15 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SOOrderState = exports.SOUnavailableCartItemReasonCode = exports.SOOperateParty = exports.SOOrderErrorType = void 0;
4
4
  var SOOrderErrorType;
5
5
  (function (SOOrderErrorType) {
6
+ /** 未啟用菜單 */
7
+ SOOrderErrorType["menuNotEnabled"] = "menuNotEnabled";
8
+ /** 菜單超出販售時間 */
9
+ SOOrderErrorType["menuOutOfServiceTime"] = "menuOutOfServiceTime";
10
+ /** 品項售完 */
6
11
  SOOrderErrorType["itemSoldOut"] = "itemSoldOut";
12
+ /** 品項金額改變 */
7
13
  SOOrderErrorType["amountChanged"] = "amountChanged";
14
+ /** 不開放點餐 */
8
15
  SOOrderErrorType["storeNotOpening"] = "storeNotOpening";
16
+ /** 未啟用線上點餐功能 */
9
17
  SOOrderErrorType["storeNotEnabled"] = "storeNotEnabled";
10
18
  })(SOOrderErrorType = exports.SOOrderErrorType || (exports.SOOrderErrorType = {}));
11
19
  var SOOperateParty;
12
20
  (function (SOOperateParty) {
13
21
  SOOperateParty["store"] = "store";
14
22
  SOOperateParty["buyer"] = "buyer";
23
+ SOOperateParty["system"] = "system";
15
24
  })(SOOperateParty = exports.SOOperateParty || (exports.SOOperateParty = {}));
16
25
  var SOUnavailableCartItemReasonCode;
17
26
  (function (SOUnavailableCartItemReasonCode) {
@@ -1 +1 @@
1
- {"version":3,"file":"online-ordering.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/online-ordering.ts"],"names":[],"mappings":";;;AAeA,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+CAA2B,CAAA;IAC3B,mDAA+B,CAAA;IAC/B,uDAAmC,CAAA;IACnC,uDAAmC,CAAA;AACrC,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AAgDD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAkFD,IAAY,+BAGX;AAHD,WAAY,+BAA+B;IACzC,sDAAmB,CAAA;IACnB,kEAA+B,CAAA;AACjC,CAAC,EAHW,+BAA+B,GAA/B,uCAA+B,KAA/B,uCAA+B,QAG1C;AA4BD,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;AACvB,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB"}
1
+ {"version":3,"file":"online-ordering.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/online-ordering.ts"],"names":[],"mappings":";;;AAeA,IAAY,gBAaX;AAbD,WAAY,gBAAgB;IAC1B,YAAY;IACZ,qDAAiC,CAAA;IACjC,eAAe;IACf,iEAA6C,CAAA;IAC7C,WAAW;IACX,+CAA2B,CAAA;IAC3B,aAAa;IACb,mDAA+B,CAAA;IAC/B,YAAY;IACZ,uDAAmC,CAAA;IACnC,gBAAgB;IAChB,uDAAmC,CAAA;AACrC,CAAC,EAbW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAa3B;AAgDD,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;AAmFD,IAAY,+BAGX;AAHD,WAAY,+BAA+B;IACzC,sDAAmB,CAAA;IACnB,kEAA+B,CAAA;AACjC,CAAC,EAHW,+BAA+B,GAA/B,uCAA+B,KAA/B,uCAA+B,QAG1C;AA8BD,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;AACvB,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB"}
package/models/order.d.ts CHANGED
@@ -7,7 +7,7 @@ import { InvoiceConfig, Tax } from './invoice-config';
7
7
  import { InvoiceCarrierType } from './../enums/invoice-carrier-type';
8
8
  import { OrderStatus } from '../enums/order-status';
9
9
  import { DiscountModuleTypeEnum, OrderSourceType, CloseType, OrderItemPaidStatus, OrderItemStatus } from '../enums';
10
- import { Receipt } from './receipt';
10
+ import { Receipt, Transaction } from './receipt';
11
11
  import { Customer } from './customer';
12
12
  import { Operator } from './store';
13
13
  import { OnlinePlatformType, OOReasonCode, OnlineOrderMappingWarningCode } from './online-integration';
@@ -111,8 +111,12 @@ export interface Order {
111
111
  expectedPickupAt?: number;
112
112
  /** 訂單取消方 */
113
113
  canceledByParty?: SOOperateParty;
114
- /** 消費者是否選擇線上付款 */
115
- isOnSitePayment?: boolean;
114
+ /**
115
+ * 線上點餐、UberEats等等外送平台,線上成功收款後的
116
+ * Transaction會暫時存在這個Property,待POS接單後,
117
+ * 再將這個Transaction包成Receipt
118
+ */
119
+ externalPayment?: Transaction;
116
120
  }
117
121
  export interface OrderItem {
118
122
  id?: string;
package/models/store.d.ts CHANGED
@@ -40,6 +40,9 @@ export interface Store {
40
40
  */
41
41
  kioskPaymentConfigs?: PaymentConfig[];
42
42
  /**
43
+ * @readonly
44
+ * 使用 lambda func `realTimeSwitch` 來更新此 property
45
+ *
43
46
  * if value is undefined, default value regarding as a
44
47
  * ```
45
48
  * {
@@ -60,6 +63,10 @@ export interface Store {
60
63
  * ```
61
64
  */
62
65
  customerConfig?: CustomerConfig;
66
+ /**
67
+ * @readonly
68
+ * 使用 lambda func `realTimeSwitch` 來更新此 property
69
+ */
63
70
  kioskDisabled?: boolean;
64
71
  flowConfig?: FlowConfig;
65
72
  multiplePaymentConfigs?: MultiplePaymentConfig[];
@@ -123,9 +130,11 @@ export interface Store {
123
130
  */
124
131
  onlineBuyerIdInputHidden?: boolean;
125
132
  /**
126
- * 線上店是否營業中可接單
133
+ * 暫時停止營業直到onlineUntilOpen (時間戳記)
134
+ * 設Infinity為永久停業; null的話,看openingHours判斷是否營業中
135
+ * 使用 lambda func `realTimeSwitch` 來更新此 property
127
136
  */
128
- onlineIsOpen?: boolean;
137
+ onlineUntilOpen?: number;
129
138
  /**
130
139
  * 是否使用線上點餐
131
140
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trusted-solutions/sdit.models",
3
- "version": "0.18.0-alpha.2",
3
+ "version": "0.18.0-alpha.20",
4
4
  "description": "TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.",
5
5
  "main": "index.js",
6
6
  "scripts": {