@trusted-solutions/sdit.models 0.65.1-alpha.1 → 0.65.2-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.
|
@@ -405,6 +405,8 @@ export interface SOSendOrderRequest {
|
|
|
405
405
|
expectedPickupAt?: number;
|
|
406
406
|
/** 外送地址 serveType === deliveryByStore 時有效 */
|
|
407
407
|
deliveryAddress?: Address;
|
|
408
|
+
/** 外送地址經緯度,格式固定為 [longitude, latitude];serveType === deliveryByStore 時建議送出 */
|
|
409
|
+
deliveryAddressLonLat?: number[];
|
|
408
410
|
/** 內用桌ID serveType === dineIn 時有效 */
|
|
409
411
|
tableId?: string;
|
|
410
412
|
/** 折抵點數 */
|
|
@@ -94,6 +94,106 @@ export interface SOCart {
|
|
|
94
94
|
items: SOCartItem[];
|
|
95
95
|
notes?: string;
|
|
96
96
|
}
|
|
97
|
+
export interface SODeliveryTask {
|
|
98
|
+
/** 外送服務商 */
|
|
99
|
+
provider: DeliveryProvider;
|
|
100
|
+
/** 後端標準化後的外送狀態 */
|
|
101
|
+
normalizedStatus?: DeliveryTaskStatus;
|
|
102
|
+
/** 此物流狀態發生時間,timestamp ms */
|
|
103
|
+
statusAt?: number;
|
|
104
|
+
/** 第三方提供的追蹤連結 */
|
|
105
|
+
trackUrl?: string;
|
|
106
|
+
/** 司機資訊 */
|
|
107
|
+
courier?: {
|
|
108
|
+
name?: string;
|
|
109
|
+
phone?: string;
|
|
110
|
+
};
|
|
111
|
+
/** 後端最後更新 deliveryTask 的時間,timestamp ms */
|
|
112
|
+
updatedAt?: number;
|
|
113
|
+
/** 配送狀態異常提示 */
|
|
114
|
+
statusIssue?: DeliveryTaskStatusIssue;
|
|
115
|
+
}
|
|
116
|
+
export declare enum DeliveryProvider {
|
|
117
|
+
METE = "METE"
|
|
118
|
+
}
|
|
119
|
+
export declare enum DeliveryTaskStatus {
|
|
120
|
+
/** 等待司機接單 */
|
|
121
|
+
D100 = "D100",
|
|
122
|
+
/** 司機接單 */
|
|
123
|
+
D200 = "D200",
|
|
124
|
+
/** 取貨完成 */
|
|
125
|
+
D300 = "D300",
|
|
126
|
+
/** 貨品送達 */
|
|
127
|
+
D400 = "D400",
|
|
128
|
+
/** 托運方取消訂單 */
|
|
129
|
+
D500 = "D500",
|
|
130
|
+
/** 店家方取消託運單 */
|
|
131
|
+
D501 = "D501"
|
|
132
|
+
}
|
|
133
|
+
export interface DeliveryTaskStatusIssue {
|
|
134
|
+
/** 狀態異常代碼,前端可依 code 決定提示文案 */
|
|
135
|
+
code: DeliveryTaskStatusIssueCode;
|
|
136
|
+
/** 後端提供的產品化提示文字,可顯示給消費者 */
|
|
137
|
+
message: string;
|
|
138
|
+
/** 異常發生時間,timestamp ms */
|
|
139
|
+
occurredAt?: number;
|
|
140
|
+
}
|
|
141
|
+
export declare enum DeliveryTaskStatusIssueCode {
|
|
142
|
+
/** 配送狀態同步失敗 */
|
|
143
|
+
statusSyncFailed = "statusSyncFailed",
|
|
144
|
+
/** 第三方外送服務暫時不可用 */
|
|
145
|
+
providerUnavailable = "providerUnavailable",
|
|
146
|
+
/** 第三方回傳未知狀態 */
|
|
147
|
+
unknownStatus = "unknownStatus",
|
|
148
|
+
/** 未知問題 */
|
|
149
|
+
unknown = "unknown"
|
|
150
|
+
}
|
|
151
|
+
export interface DeliveryTask {
|
|
152
|
+
/** 外送服務商,目前只有 METE */
|
|
153
|
+
provider: DeliveryProvider;
|
|
154
|
+
/** 我們給第三方的訂單 ID。目前 METE 使用 POS Order.id 當 client_order_id */
|
|
155
|
+
clientOrderId: string;
|
|
156
|
+
/** 第三方平台自己的配送單號。例如 METE createOrder 回傳的 order_id */
|
|
157
|
+
providerOrderId?: string;
|
|
158
|
+
/** 第三方原始狀態碼,例如 METE ST01 / ST02 / ST04。只供後台、POS、debug 使用 */
|
|
159
|
+
statusCode?: string;
|
|
160
|
+
/** 第三方原始狀態文字。只供後台、POS、debug 使用 */
|
|
161
|
+
status?: string;
|
|
162
|
+
/** 後端標準化後的外送狀態。前端流程判斷請以這個欄位為主 */
|
|
163
|
+
normalizedStatus?: DeliveryTaskStatus;
|
|
164
|
+
/** 此物流狀態發生時間,timestamp ms */
|
|
165
|
+
statusAt?: number;
|
|
166
|
+
/** 第三方回傳的外送費。消費者前端不要用這個取代訂單 deliveryCharge */
|
|
167
|
+
fee?: number;
|
|
168
|
+
/** 第三方回傳的外送距離 */
|
|
169
|
+
distance?: number;
|
|
170
|
+
/** 第三方提供的追蹤連結 */
|
|
171
|
+
trackUrl?: string;
|
|
172
|
+
/** 司機資訊 */
|
|
173
|
+
courier?: DeliveryTaskCourier;
|
|
174
|
+
/** 後端最後更新 deliveryTask 的時間,timestamp ms */
|
|
175
|
+
updatedAt?: number;
|
|
176
|
+
/** 最後一次同步第三方狀態的時間,timestamp ms */
|
|
177
|
+
lastSyncedAt?: number;
|
|
178
|
+
/** 配送進入終態的時間,例如送達或取消,timestamp ms */
|
|
179
|
+
terminalAt?: number;
|
|
180
|
+
/** 給消費者前端可顯示的產品化狀態異常提示 */
|
|
181
|
+
statusIssue?: DeliveryTaskStatusIssue;
|
|
182
|
+
/** 後台、POS、debug 用的原始錯誤資訊。消費者前端不應直接顯示 raw error */
|
|
183
|
+
error?: DeliveryTaskError;
|
|
184
|
+
}
|
|
185
|
+
export interface DeliveryTaskCourier {
|
|
186
|
+
name?: string;
|
|
187
|
+
phone?: string;
|
|
188
|
+
/** 第三方原始司機資訊,格式不保證固定 */
|
|
189
|
+
raw?: string;
|
|
190
|
+
}
|
|
191
|
+
export interface DeliveryTaskError {
|
|
192
|
+
code?: string;
|
|
193
|
+
message: string;
|
|
194
|
+
raw?: unknown;
|
|
195
|
+
occurredAt: number;
|
|
196
|
+
}
|
|
97
197
|
export interface SOOrder {
|
|
98
198
|
id?: string;
|
|
99
199
|
storeId: string;
|
|
@@ -164,6 +264,10 @@ export interface SOOrder {
|
|
|
164
264
|
refundedAt?: number;
|
|
165
265
|
/** 外送地址 */
|
|
166
266
|
deliveryAddress?: Address;
|
|
267
|
+
/** 外送地址經緯度,格式固定為 [longitude, latitude] */
|
|
268
|
+
deliveryAddressLonLat?: number[];
|
|
269
|
+
/** 第三方外送任務 */
|
|
270
|
+
deliveryTask?: SODeliveryTask;
|
|
167
271
|
/** 付款中的Transaction用來反查付款結果 */
|
|
168
272
|
transactionId?: string;
|
|
169
273
|
paymentServiceProvider?: PaymentServiceProvider;
|
|
@@ -270,9 +374,9 @@ export interface SOPublicProduct {
|
|
|
270
374
|
benefit: DiscountLabel;
|
|
271
375
|
}[];
|
|
272
376
|
mainStoreProductId?: string;
|
|
377
|
+
onlineAvailability?: OnlineAvailability;
|
|
273
378
|
type?: ProductType;
|
|
274
379
|
isComboOnly?: boolean;
|
|
275
|
-
onlineAvailability?: OnlineAvailability;
|
|
276
380
|
}
|
|
277
381
|
export interface SOPublicProductWithContext {
|
|
278
382
|
menuId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SOOrderState = exports.SOUnavailableCartItemReasonCode = exports.SOOperateParty = exports.SOOrderErrorType = void 0;
|
|
3
|
+
exports.SOOrderState = exports.SOUnavailableCartItemReasonCode = exports.DeliveryTaskStatusIssueCode = exports.DeliveryTaskStatus = exports.DeliveryProvider = exports.SOOperateParty = exports.SOOrderErrorType = void 0;
|
|
4
4
|
var SOOrderErrorType;
|
|
5
5
|
(function (SOOrderErrorType) {
|
|
6
6
|
/** 未啟用菜單 */
|
|
@@ -28,6 +28,36 @@ var SOOperateParty;
|
|
|
28
28
|
SOOperateParty["buyer"] = "buyer";
|
|
29
29
|
SOOperateParty["system"] = "system";
|
|
30
30
|
})(SOOperateParty = exports.SOOperateParty || (exports.SOOperateParty = {}));
|
|
31
|
+
var DeliveryProvider;
|
|
32
|
+
(function (DeliveryProvider) {
|
|
33
|
+
DeliveryProvider["METE"] = "METE";
|
|
34
|
+
})(DeliveryProvider = exports.DeliveryProvider || (exports.DeliveryProvider = {}));
|
|
35
|
+
var DeliveryTaskStatus;
|
|
36
|
+
(function (DeliveryTaskStatus) {
|
|
37
|
+
/** 等待司機接單 */
|
|
38
|
+
DeliveryTaskStatus["D100"] = "D100";
|
|
39
|
+
/** 司機接單 */
|
|
40
|
+
DeliveryTaskStatus["D200"] = "D200";
|
|
41
|
+
/** 取貨完成 */
|
|
42
|
+
DeliveryTaskStatus["D300"] = "D300";
|
|
43
|
+
/** 貨品送達 */
|
|
44
|
+
DeliveryTaskStatus["D400"] = "D400";
|
|
45
|
+
/** 托運方取消訂單 */
|
|
46
|
+
DeliveryTaskStatus["D500"] = "D500";
|
|
47
|
+
/** 店家方取消託運單 */
|
|
48
|
+
DeliveryTaskStatus["D501"] = "D501";
|
|
49
|
+
})(DeliveryTaskStatus = exports.DeliveryTaskStatus || (exports.DeliveryTaskStatus = {}));
|
|
50
|
+
var DeliveryTaskStatusIssueCode;
|
|
51
|
+
(function (DeliveryTaskStatusIssueCode) {
|
|
52
|
+
/** 配送狀態同步失敗 */
|
|
53
|
+
DeliveryTaskStatusIssueCode["statusSyncFailed"] = "statusSyncFailed";
|
|
54
|
+
/** 第三方外送服務暫時不可用 */
|
|
55
|
+
DeliveryTaskStatusIssueCode["providerUnavailable"] = "providerUnavailable";
|
|
56
|
+
/** 第三方回傳未知狀態 */
|
|
57
|
+
DeliveryTaskStatusIssueCode["unknownStatus"] = "unknownStatus";
|
|
58
|
+
/** 未知問題 */
|
|
59
|
+
DeliveryTaskStatusIssueCode["unknown"] = "unknown";
|
|
60
|
+
})(DeliveryTaskStatusIssueCode = exports.DeliveryTaskStatusIssueCode || (exports.DeliveryTaskStatusIssueCode = {}));
|
|
31
61
|
var SOUnavailableCartItemReasonCode;
|
|
32
62
|
(function (SOUnavailableCartItemReasonCode) {
|
|
33
63
|
SOUnavailableCartItemReasonCode["soldOut"] = "soldOut";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"online-ordering.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/online-ordering.ts"],"names":[],"mappings":";;;AAeA,IAAY,gBAmBX;AAnBD,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;IACnC,YAAY;IACZ,6DAAyC,CAAA;IACzC,YAAY;IACZ,2DAAuC,CAAA;IACvC,cAAc;IACd,2DAAuC,CAAA;AACzC,CAAC,EAnBW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAmB3B;AAoED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;
|
|
1
|
+
{"version":3,"file":"online-ordering.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/online-ordering.ts"],"names":[],"mappings":";;;AAeA,IAAY,gBAmBX;AAnBD,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;IACnC,YAAY;IACZ,6DAAyC,CAAA;IACzC,YAAY;IACZ,2DAAuC,CAAA;IACvC,cAAc;IACd,2DAAuC,CAAA;AACzC,CAAC,EAnBW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAmB3B;AAoED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;AA2BD,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;AACf,CAAC,EAFW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAE3B;AAED,IAAY,kBAaX;AAbD,WAAY,kBAAkB;IAC5B,aAAa;IACb,mCAAa,CAAA;IACb,WAAW;IACX,mCAAa,CAAA;IACb,WAAW;IACX,mCAAa,CAAA;IACb,WAAW;IACX,mCAAa,CAAA;IACb,cAAc;IACd,mCAAa,CAAA;IACb,eAAe;IACf,mCAAa,CAAA;AACf,CAAC,EAbW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAa7B;AAWD,IAAY,2BASX;AATD,WAAY,2BAA2B;IACrC,eAAe;IACf,oEAAqC,CAAA;IACrC,mBAAmB;IACnB,0EAA2C,CAAA;IAC3C,gBAAgB;IAChB,8DAA+B,CAAA;IAC/B,WAAW;IACX,kDAAmB,CAAA;AACrB,CAAC,EATW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAStC;AA2KD,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;AAuCD,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
|
@@ -11,7 +11,7 @@ import { Receipt, Transaction } from './receipt';
|
|
|
11
11
|
import { Customer, CustomerPointDetail } from './customer';
|
|
12
12
|
import { Address, Operator } from './store';
|
|
13
13
|
import { OnlinePlatformType, OOReasonCode, OnlineOrderMappingWarningCode } from './online-integration';
|
|
14
|
-
import { SOEater, SOOperateParty } from './online-ordering';
|
|
14
|
+
import { DeliveryTask, SOEater, SOOperateParty } from './online-ordering';
|
|
15
15
|
import { DiscountMethod } from './discount-module';
|
|
16
16
|
export interface BaseOrder {
|
|
17
17
|
id?: string;
|
|
@@ -188,6 +188,10 @@ export interface Order extends BaseOrder {
|
|
|
188
188
|
canceledByParty?: SOOperateParty;
|
|
189
189
|
/** 外送地址 */
|
|
190
190
|
deliveryAddress?: Address;
|
|
191
|
+
/** 外送地址經緯度,格式固定為 [longitude, latitude] */
|
|
192
|
+
deliveryAddressLonLat?: number[];
|
|
193
|
+
/** 第三方外送任務。只有使用 METE 等第三方外送時才會有;店家自己送不會有。 */
|
|
194
|
+
deliveryTask?: DeliveryTask;
|
|
191
195
|
/**
|
|
192
196
|
* 線上點餐、UberEats等等外送平台,線上成功收款後的
|
|
193
197
|
* Transaction會暫時存在這個Property,待POS接單後,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trusted-solutions/sdit.models",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.2-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": {
|