@trusted-solutions/sdit.models 0.15.0-alpha.0 → 0.16.0-alpha.2

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.
@@ -5,7 +5,7 @@ export declare enum OrderStatus {
5
5
  preparing = "preparing",
6
6
  /** 廚房出餐完成 */
7
7
  completed = "completed",
8
- /** 送餐完成 */
8
+ /** 出餐完成 */
9
9
  confirmed = "confirmed",
10
10
  /** 已刪除 */
11
11
  deleted = "deleted",
@@ -9,7 +9,7 @@ var OrderStatus;
9
9
  OrderStatus["preparing"] = "preparing";
10
10
  /** 廚房出餐完成 */
11
11
  OrderStatus["completed"] = "completed";
12
- /** 送餐完成 */
12
+ /** 出餐完成 */
13
13
  OrderStatus["confirmed"] = "confirmed";
14
14
  /** 已刪除 */
15
15
  OrderStatus["deleted"] = "deleted";
@@ -23,5 +23,6 @@ export declare enum PaymentServiceProvider {
23
23
  ncccVX520 = "ncccVX520",
24
24
  /** MyPay PayPage 線上金流 */
25
25
  MyPayPayPage = "MyPayPayPage",
26
- none = "none"
26
+ none = "none",
27
+ mix = "mix"
27
28
  }
@@ -28,5 +28,6 @@ var PaymentServiceProvider;
28
28
  /** MyPay PayPage 線上金流 */
29
29
  PaymentServiceProvider["MyPayPayPage"] = "MyPayPayPage";
30
30
  PaymentServiceProvider["none"] = "none";
31
+ PaymentServiceProvider["mix"] = "mix";
31
32
  })(PaymentServiceProvider = exports.PaymentServiceProvider || (exports.PaymentServiceProvider = {}));
32
33
  //# sourceMappingURL=payment-service-provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payment-service-provider.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/enums/payment-service-provider.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBA6BX;AA7BD,WAAY,sBAAsB;IAChC,YAAY;IACZ,+CAAqB,CAAA;IACrB,gBAAgB;IAChB,2CAAiB,CAAA;IACjB,eAAe;IACf,2CAAiB,CAAA;IACjB,eAAe;IACf,6CAAmB,CAAA;IACnB,aAAa;IACb,+CAAqB,CAAA;IACrB,WAAW;IACX,6CAAmB,CAAA;IACnB,wBAAwB;IACxB,qEAA2C,CAAA;IAC3C,oBAAoB;IACpB,uEAA6C,CAAA;IAE7C,oBAAoB;IACpB,6CAAmB,CAAA;IACnB,uBAAuB;IACvB,+CAAqB,CAAA;IACrB,kCAAkC;IAClC,iDAAuB,CAAA;IAEvB,yBAAyB;IACzB,uDAA6B,CAAA;IAE7B,uCAAa,CAAA;AACf,CAAC,EA7BW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QA6BjC"}
1
+ {"version":3,"file":"payment-service-provider.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/enums/payment-service-provider.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBA8BX;AA9BD,WAAY,sBAAsB;IAChC,YAAY;IACZ,+CAAqB,CAAA;IACrB,gBAAgB;IAChB,2CAAiB,CAAA;IACjB,eAAe;IACf,2CAAiB,CAAA;IACjB,eAAe;IACf,6CAAmB,CAAA;IACnB,aAAa;IACb,+CAAqB,CAAA;IACrB,WAAW;IACX,6CAAmB,CAAA;IACnB,wBAAwB;IACxB,qEAA2C,CAAA;IAC3C,oBAAoB;IACpB,uEAA6C,CAAA;IAE7C,oBAAoB;IACpB,6CAAmB,CAAA;IACnB,uBAAuB;IACvB,+CAAqB,CAAA;IACrB,kCAAkC;IAClC,iDAAuB,CAAA;IAEvB,yBAAyB;IACzB,uDAA6B,CAAA;IAE7B,uCAAa,CAAA;IACb,qCAAW,CAAA;AACb,CAAC,EA9BW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QA8BjC"}
@@ -145,7 +145,7 @@ export interface SOSendOrderRequest {
145
145
  serveType: ServeType;
146
146
  eater: SOEater;
147
147
  cart: SOValidateCart;
148
- expectedPaymentMethod: SOPaymentMethod;
148
+ isOnSitePayment: boolean;
149
149
  /**
150
150
  * 包裝、免洗餐具
151
151
  */
@@ -165,6 +165,17 @@ export interface SOSendOrderResponse {
165
165
  state: SOOrderState;
166
166
  /** 消費者識別用 id的末五碼 == Order.serialNumber */
167
167
  displayId: string;
168
+ isOnSitePayment: boolean;
169
+ }
170
+ /*******************************/
171
+ /*******************************/
172
+ export interface SOGetPaymentUrlRequest {
173
+ storeId: string;
174
+ /** online Order Id */
175
+ id: string;
176
+ }
177
+ export interface SOGetPaymentUrlResponse {
178
+ payUrl: string;
168
179
  }
169
180
  /*******************************/
170
181
  /*******************************/
@@ -1,7 +1,7 @@
1
- import { PaymentServiceProvider, PaymentType, ReceiptStatusType, CloseType } from "../../enums";
2
- import { CursorPaginationEnabled, Filterable, QueryOptions } from "./common";
3
- import { ClosingSalesProductDetail, Expenditure, Operator, Order } from "../../models";
4
- import { SummarizeClosingResponse } from "../response";
1
+ import { PaymentServiceProvider, PaymentType, ReceiptStatusType, CloseType } from '../../enums';
2
+ import { CursorPaginationEnabled, Filterable, QueryOptions } from './common';
3
+ import { ClosingSalesProductDetail, Expenditure, Operator, Order, Transaction } from '../../models';
4
+ import { SummarizeClosingResponse } from '../response';
5
5
  export interface AggregateShiftClosingRequest {
6
6
  storeId: string;
7
7
  accountId: string;
@@ -10,6 +10,7 @@ export interface AggregateShiftClosingRequest {
10
10
  paymentServiceProvider: PaymentServiceProvider;
11
11
  paymentType: PaymentType;
12
12
  customName?: string;
13
+ mixPayments?: Transaction[];
13
14
  amount: number;
14
15
  order: Order;
15
16
  voidedInvoiceNumber?: string;
@@ -104,8 +104,8 @@ export interface SOOrder {
104
104
  canceledReasonCode?: OOReasonCode;
105
105
  /** 店家方取消理由 */
106
106
  canceledReason?: string;
107
- /** 消費者預計付款方式 */
108
- expectedPaymentMethod: SOPaymentMethod;
107
+ /** 消費者是否選擇線上付款 */
108
+ isOnSitePayment: boolean;
109
109
  /** 消費者實際付款方式 */
110
110
  actualPaymentMethod?: SOPaymentMethod;
111
111
  /** 消費者付款時間 undefined為未付款 */
@@ -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;AAiFD,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,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"}
package/models/order.d.ts CHANGED
@@ -7,11 +7,12 @@ 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, Transaction } from './receipt';
10
+ import { Receipt } from './receipt';
11
11
  import { Customer } from './customer';
12
12
  import { Operator } from './store';
13
13
  import { OnlinePlatformType, OOReasonCode, OnlineOrderMappingWarningCode } from './online-integration';
14
- import { SOEater, SOOperateParty, SOPaymentMethod } from './online-ordering';
14
+ import { SOEater, SOOperateParty } from './online-ordering';
15
+ import { DiscountMethod } from './discount-module';
15
16
  export interface Order {
16
17
  id?: string;
17
18
  source: OrderSourceType;
@@ -51,13 +52,9 @@ export interface Order {
51
52
  /** Use attachPayment method to add this info */
52
53
  /** @Deprecated */
53
54
  payment?: OrderPayment;
54
- /** 混合支付細項 */
55
- mixPayments?: Transaction[];
56
55
  /** Use issueInvoice method to add this info */
57
56
  /** @Deprecated */
58
57
  invoice?: OrderInvoice;
59
- /** 混合支付細項 */
60
- mixRefunds?: Transaction[];
61
58
  /** Created by attachPayment method */
62
59
  /** @Deprecated */
63
60
  receipt?: OrderReceipt;
@@ -73,7 +70,7 @@ export interface Order {
73
70
  preparingAt?: number;
74
71
  /** 廚房出餐時間 */
75
72
  completedAt?: number;
76
- /** 送餐時間 */
73
+ /** 出餐時間 */
77
74
  confirmedAt?: number;
78
75
  /** POS刪除時間 */
79
76
  deletedAt?: number;
@@ -114,8 +111,8 @@ export interface Order {
114
111
  expectedPickupAt?: number;
115
112
  /** 訂單取消方 */
116
113
  canceledByParty?: SOOperateParty;
117
- /** 消費者預計付款方式 */
118
- expectedPaymentMethod?: SOPaymentMethod;
114
+ /** 消費者是否選擇線上付款 */
115
+ isOnSitePayment: boolean;
119
116
  }
120
117
  export interface OrderItem {
121
118
  id?: string;
@@ -125,14 +122,25 @@ export interface OrderItem {
125
122
  /** amount of single product */
126
123
  productAmount: number;
127
124
  productTax: Tax;
128
- /** (attrs + product amount) * quantity */
125
+ attributes: OrderItemAttr[];
126
+ /**
127
+ * 經由註記調整價格後的一個品項金額
128
+ * 原價 `productAmount` + 註記總價 `Sum(attribute.additionalAmount)`
129
+ */
129
130
  subtotal?: number;
130
- /** sigma(discount.discountReferences.orderItemId === id)) */
131
+ /**
132
+ * 一個品項的手動折扣方式
133
+ */
134
+ manualDiscountMethod?: DiscountMethod;
135
+ /**
136
+ * 一個品項的折扣金額,為`subtotal`與`discountMethod`計算後結果
137
+ */
131
138
  discountAmount?: number;
132
- /** (subtotal - discountAmount) */
133
- amount: number;
134
139
  quantity: number;
135
- attributes: OrderItemAttr[];
140
+ /**
141
+ * (`subtotal` - `discountAmount`) * `quantity`
142
+ */
143
+ amount: number;
136
144
  status?: OrderItemStatus;
137
145
  /** 所屬第x次出單的品項,初始為undefined,第一次出單為0,每出單一次+1 */
138
146
  round?: number;
@@ -144,7 +152,7 @@ export interface OrderItem {
144
152
  preparingAt?: number;
145
153
  /** 廚房出餐時間 */
146
154
  completedAt?: number;
147
- /** 送餐時間 */
155
+ /** 出餐時間 */
148
156
  confirmedAt?: number;
149
157
  /** POS刪除時間 */
150
158
  deletedAt?: number;
@@ -161,7 +169,8 @@ export interface OrderItemChangelog {
161
169
  amount?: number;
162
170
  attributes?: OrderItemAttr[];
163
171
  note?: string;
164
- discountRefs?: DiscountReference[];
172
+ manualDiscountMethod?: DiscountMethod;
173
+ discountAmount?: number;
165
174
  modifiedBy?: Operator;
166
175
  }
167
176
  export interface OrderItemAttr {
@@ -247,13 +256,13 @@ export interface ShiftClosingResult {
247
256
  currentVoidedCount: number;
248
257
  /** 本期收據 作廢金額 */
249
258
  currentVoidedAmount: number;
250
- /** 本期收據 作廢收據號碼或發票號碼 */
259
+ /** 本期收據 作廢收據編號或發票號碼 */
251
260
  currentVoidedInvoiceNumbers: string[];
252
261
  /** 非本期收據 作廢數 */
253
262
  nonCurrentVoidedCount: number;
254
263
  /** 非本期收據 作廢金額 */
255
264
  nonCurrentVoidedAmount: number;
256
- /** 非本期收據 作廢收據號碼或發票號碼 */
265
+ /** 非本期收據 作廢收據編號或發票號碼 */
257
266
  nonCurrentVoidedInvoiceNumbers: string[];
258
267
  }
259
268
  export interface ClosingResult {
@@ -274,13 +283,13 @@ export interface ClosingResult {
274
283
  currentVoidedCount: number;
275
284
  /** 本期收據 作廢金額 */
276
285
  currentVoidedAmount: number;
277
- /** 本期收據 作廢收據號碼或發票號碼 */
286
+ /** 本期收據 作廢收據編號或發票號碼 */
278
287
  currentVoidedInvoiceNumbers: string[];
279
288
  /** 非本期收據 作廢數 */
280
289
  nonCurrentVoidedCount: number;
281
290
  /** 非本期收據 作廢金額 */
282
291
  nonCurrentVoidedAmount: number;
283
- /** 非本期收據 作廢收據號碼或發票號碼 */
292
+ /** 非本期收據 作廢收據編號或發票號碼 */
284
293
  nonCurrentVoidedInvoiceNumbers: string[];
285
294
  /** 註銷品項數量 */
286
295
  cancelledSalesCount?: number;
@@ -9,6 +9,7 @@ export interface BasePaymentConfig {
9
9
  provider: PaymentServiceProvider;
10
10
  type: PaymentType;
11
11
  disableInventory?: boolean;
12
+ name?: string;
12
13
  }
13
14
  export interface EasyCardConfig extends BasePaymentConfig {
14
15
  provider: PaymentServiceProvider.easyCard;
@@ -50,6 +50,8 @@ export interface Transaction {
50
50
  detail: any;
51
51
  operator?: Operator;
52
52
  note?: string;
53
- /** for mix only */
53
+ /** for sub transaction only (parent is mix) */
54
54
  amount?: number;
55
+ cashActualAmount?: number;
56
+ cashReturnAmount?: number;
55
57
  }
package/models/store.d.ts CHANGED
@@ -164,7 +164,7 @@ export interface FlowConfig {
164
164
  export interface OrderStatusAlert {
165
165
  /** 出單後,狀態設定為confirmed(適合餐點已經事先做好的店) */
166
166
  autoConfirm: boolean;
167
- /** 結帳後自動出店(單子消失在pos上) */
167
+ /** 結帳後自動完成訂單(單子消失在pos上) */
168
168
  autoLeave: boolean;
169
169
  /** Kiosk接單後POS自動接受 */
170
170
  autoAccept: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trusted-solutions/sdit.models",
3
- "version": "0.15.0-alpha.0",
3
+ "version": "0.16.0-alpha.2",
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": {