@trusted-solutions/sdit.models 0.62.0-alpha.0 → 0.62.0-alpha.5

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.
@@ -1,8 +1,9 @@
1
1
  import { Address, DayOfWeekTimePeriod, GalleryConfig, Operator, PointProvider } from '../models/store';
2
2
  import { CustomerPointDetail, MultiLanguageText, OrderDiscount } from '../models';
3
3
  import { PaymentServiceProvider, ServeType } from '../enums';
4
- import { SOPublicMenu, SOPublicCategory, SOPublicProduct, SOPublicProductAttribute, SOPublicProductAttributeCategory, SOPaymentMethod, SOValidateCart, SOOrderState, SOOrder, SOEater, SOPublicDiscountRule } from '../models/online-ordering';
4
+ import { SOPublicMenu, SOPublicCategory, SOPublicProduct, SOPublicProductAttribute, SOPublicProductAttributeCategory, SOPaymentMethod, SOValidateCart, SOOrderState, SOOrder, SOEater, SOPublicDiscountRule, SOMemberCoupon } from '../models/online-ordering';
5
5
  import { RoundingMode } from '../enums/rounding-mode.enum';
6
+ import { MultipleItems } from './response';
6
7
  /**
7
8
  * SO = SDIT Online
8
9
  */
@@ -229,6 +230,13 @@ export interface SOGetStoreMenuResponse {
229
230
  */
230
231
  attributeCategories: SOPublicProductAttributeCategory[];
231
232
  }
233
+ export interface SOGetMyMemberCouponsRequest {
234
+ storeId: string;
235
+ limit?: number;
236
+ paginationToken?: string;
237
+ }
238
+ export interface SOGetMyMemberCouponsResponse extends MultipleItems<SOMemberCoupon> {
239
+ }
232
240
  /*******************************/
233
241
  /*******************************/
234
242
  export interface SOValidateMutationRequest {
@@ -13,3 +13,72 @@ export interface GetKiosksRequest {
13
13
  userId: string;
14
14
  storeId: string;
15
15
  }
16
+ export interface GetKioskConfigRequest {
17
+ storeId: string;
18
+ }
19
+ export interface GetKioskMenuRequest {
20
+ storeId: string;
21
+ }
22
+ export interface GetKioskCouponByQrRequest {
23
+ qr: string;
24
+ }
25
+ export interface GetMemberRequest {
26
+ memberPoolNo: string;
27
+ memberNo?: string;
28
+ phone?: string;
29
+ qrcode?: string;
30
+ }
31
+ export interface RedeemPointDryRunOrderItem {
32
+ name: string;
33
+ quantity: number;
34
+ }
35
+ export interface RedeemPointDryRunRequest {
36
+ storeId: string;
37
+ customer: {
38
+ cognitoUserId: string;
39
+ memberPoolNo: string;
40
+ email?: string;
41
+ phone?: string;
42
+ };
43
+ orderContext: {
44
+ id: string;
45
+ storeId: string;
46
+ createdAt: number;
47
+ expectedPickupAt?: number | null;
48
+ items: RedeemPointDryRunOrderItem[];
49
+ totalAmount: number;
50
+ totalBeforePoints?: number;
51
+ totalDiscountAmount?: number;
52
+ };
53
+ }
54
+ export interface RedeemPointRequest {
55
+ storeId: string;
56
+ customer: {
57
+ cognitoUserId: string;
58
+ memberPoolNo: string;
59
+ email?: string;
60
+ phone?: string;
61
+ };
62
+ points: {
63
+ redeemPoints: number;
64
+ redeemAmount?: number;
65
+ [key: string]: unknown;
66
+ };
67
+ orderContext: {
68
+ id: string;
69
+ storeId: string;
70
+ createdAt: number;
71
+ expectedPickupAt?: number | null;
72
+ items: RedeemPointDryRunOrderItem[];
73
+ totalAmount: number;
74
+ totalBeforePoints?: number;
75
+ totalDiscountAmount?: number;
76
+ };
77
+ }
78
+ export interface RedeemCouponRequest {
79
+ memberCouponNo: string;
80
+ orderNo: string;
81
+ storeNo: number;
82
+ brandNo?: string;
83
+ brandExternalId?: number;
84
+ }
@@ -7,6 +7,7 @@ export interface CreateUserRequest {
7
7
  temporaryPassword: string;
8
8
  group: UserGroupEnum;
9
9
  userAttributes?: UserAttribute[];
10
+ suppressEmail?: boolean;
10
11
  }
11
12
  export interface EnableUserRequest {
12
13
  userPoolId: string;
@@ -1,5 +1,7 @@
1
- import { Kiosk } from "../../models";
1
+ import { Kiosk, Store } from "../../models";
2
+ import { BaseRuleModel } from "../../models";
2
3
  import { SingleItem, MultipleItems } from "./common";
4
+ import { SOGetStoreMenuResponse } from "../online-ordering";
3
5
  /**
4
6
  * Lambda result to kiosk-admin
5
7
  */
@@ -10,3 +12,77 @@ export interface CreateKioskResponse extends SingleItem<Kiosk> {
10
12
  */
11
13
  export interface GetKiosksResponse extends MultipleItems<Kiosk> {
12
14
  }
15
+ export interface GetKioskConfigResponse extends SingleItem<Store> {
16
+ }
17
+ export interface GetKioskMenuResponse extends Omit<SOGetStoreMenuResponse, 'discountRules'> {
18
+ discountRules: BaseRuleModel[];
19
+ }
20
+ export declare type PoskyCrmMemberCouponStatus = string;
21
+ export declare type PoskyCrmMemberCouponListItem = {
22
+ memberCouponNo: string;
23
+ name: string;
24
+ description: string;
25
+ notice?: string | null;
26
+ status: PoskyCrmMemberCouponStatus;
27
+ startDatetime: string;
28
+ endDatetime: string;
29
+ };
30
+ export declare type PoskyCrmCouponDiscountRuleDetail = Omit<BaseRuleModel, 'discountRuleNo' | 'applyMethod' | 'note'> & {
31
+ discountRuleNo: string | number;
32
+ applyMethod: 'AutoApply' | 'Coupon';
33
+ note?: string | null;
34
+ };
35
+ export declare type PoskyCrmMemberCouponDetail = PoskyCrmMemberCouponListItem & {
36
+ brandNo: string;
37
+ memberNo: string;
38
+ state: PoskyCrmMemberCouponStatus;
39
+ redeemedDatetime?: string | null;
40
+ redeemedOrderNo?: string | null;
41
+ redeemedStoreNo?: number | null;
42
+ voidReason?: string | null;
43
+ createDatetime: string;
44
+ discountRuleDetail: PoskyCrmCouponDiscountRuleDetail;
45
+ redeemEligibility: {
46
+ canRedeem: boolean;
47
+ reason?: string;
48
+ };
49
+ };
50
+ export declare type PoskyCrmMemberCouponDetailByQr = Omit<PoskyCrmMemberCouponDetail, 'memberNo'> & {
51
+ notice?: string | null;
52
+ member: {
53
+ memberNo: string;
54
+ memberPoolNo: string;
55
+ name: string;
56
+ carrier?: string;
57
+ };
58
+ };
59
+ export interface GetMemberResponse {
60
+ memberNo: string;
61
+ memberPoolNo: string;
62
+ idpSub: string | null;
63
+ name: string;
64
+ birthday: string | null;
65
+ gender: number | null;
66
+ email: string | null;
67
+ phoneNumber: string | null;
68
+ address: string | null;
69
+ carrier: string | null;
70
+ totalPoints: number;
71
+ expiringPoints: number;
72
+ expirationDatetime: string | null;
73
+ }
74
+ export declare type GetKioskCouponByQrResponse = PoskyCrmMemberCouponDetailByQr;
75
+ export interface RedeemPointDryRunResponse {
76
+ usedPoints: number;
77
+ discountAmount: number;
78
+ errorMessage?: string;
79
+ }
80
+ export declare type RedeemPointResponse = {
81
+ usePoints: number;
82
+ discountAmount: number;
83
+ tradeDatetime: string;
84
+ errorMessage?: string;
85
+ } | null;
86
+ export interface RedeemCouponResponse {
87
+ redeemedDatetime: string;
88
+ }
@@ -8,14 +8,19 @@ export interface Customer {
8
8
  id?: string;
9
9
  name: string;
10
10
  phone: string;
11
+ address?: string;
11
12
  /** Pool ID 不填,為早期cognito User Pool */
12
13
  memberPoolNo?: string;
13
14
  /** 同一個Pool下的唯一user ID */
14
15
  cognitoUserId?: string;
15
16
  cardNo?: string;
17
+ carrier?: string;
16
18
  gender?: CustomerGenderEnum;
17
19
  email?: string;
18
20
  birthday?: CustomerBirthday;
21
+ totalPoints?: number;
22
+ expiringPoints?: number;
23
+ expirationDatetime?: string;
19
24
  totalVisits?: number;
20
25
  totalSpending?: number;
21
26
  firstVisitTime?: number;
@@ -43,6 +43,20 @@ export interface DiscountMethod {
43
43
  type: DiscountMethodTypeEnum;
44
44
  value: number;
45
45
  }
46
+ export interface BaseRuleModel {
47
+ discountRuleNo: string | number;
48
+ applyMethod: "AutoApply" | "Coupon";
49
+ name: string;
50
+ description?: string;
51
+ note?: string | null;
52
+ beginDatetime: string;
53
+ endDatetime: string;
54
+ isActive: number;
55
+ targetCustomers: any;
56
+ useCondition: any;
57
+ moduleType: string;
58
+ modulePayload: any;
59
+ }
46
60
  export declare type UnionOfDiscountModule = EntireOrderDiscountModule | SelectedItemDiscountModule;
47
61
  export declare type UnionOfDiscountItem = SelectedItemDiscountItem;
48
62
  export interface EntireOrderDiscountModuleChoices {
@@ -34,6 +34,14 @@ export interface SOPaymentMethod {
34
34
  name?: string;
35
35
  logo?: string[];
36
36
  }
37
+ export interface SOMemberCoupon {
38
+ memberCouponNo: string;
39
+ name: string;
40
+ description?: string;
41
+ notice?: string;
42
+ startDatetime: string;
43
+ endDatetime: string;
44
+ }
37
45
  export interface SOCartItem {
38
46
  /** cart item Id (timestamp ms) */
39
47
  id: string;
@@ -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;AA2DD,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;AAuHD,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"}
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;AAuHD,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
@@ -293,6 +293,10 @@ export interface OrderPayment {
293
293
  transactionId: string;
294
294
  /** PaidAt provided by third party payment vendor after payment. */
295
295
  paidAt: number;
296
+ cardBrand?: string;
297
+ maskedCardNo?: string;
298
+ terminalId?: string;
299
+ merchantId?: string;
296
300
  /** Used to record the payment results provided by third-party payment vendor */
297
301
  detail: any;
298
302
  /** Used to record info of refund. */
@@ -83,7 +83,7 @@ export interface DdpayOnlineConfig extends BasePaymentConfig {
83
83
  }
84
84
  export interface DdpayConfig extends BasePaymentConfig {
85
85
  provider: PaymentServiceProvider.ddpay;
86
- type: PaymentType.unknown;
86
+ type: PaymentType.unknown | PaymentType.kioskSelfCheckout;
87
87
  clientId: string;
88
88
  clientSecret: string;
89
89
  shopId: string;
@@ -102,3 +102,8 @@ export interface NewebpayOnlineConfig extends BasePaymentConfig {
102
102
  hashKey: string;
103
103
  hashIV: string;
104
104
  }
105
+ export interface NewebpayConfig extends BasePaymentConfig {
106
+ provider: PaymentServiceProvider.newebpay;
107
+ type: PaymentType.creditCard;
108
+ adminPassword: string;
109
+ }
@@ -54,6 +54,10 @@ export interface Transaction {
54
54
  transactionId: string;
55
55
  /** PaidAt provided by third party payment vendor after payment. */
56
56
  timestamp: number;
57
+ cardBrand?: string;
58
+ maskedCardNo?: string;
59
+ terminalId?: string;
60
+ merchantId?: string;
57
61
  /** Used to record the payment results provided by third-party payment vendor */
58
62
  detail: any;
59
63
  operator?: Operator;
package/models/store.d.ts CHANGED
@@ -21,6 +21,29 @@ export interface Operator {
21
21
  storeUserId: string;
22
22
  name: string;
23
23
  }
24
+ export declare type Brand = {
25
+ brandNo: string;
26
+ memberPoolNo: string;
27
+ clientId: string;
28
+ name: string;
29
+ introduction: string;
30
+ logoUrl: string;
31
+ themeColor: {
32
+ primary: string;
33
+ primaryRgb: string;
34
+ primaryTint: string;
35
+ primaryShade: string;
36
+ primaryContrast: string;
37
+ primaryContrastRgb: string;
38
+ };
39
+ mainStoreNo: number;
40
+ createEmployeeNo: number;
41
+ createDatetime: string;
42
+ lastEditEmployeeNo: number;
43
+ lastEditDatetime: string;
44
+ isActive: number;
45
+ isDel: number;
46
+ };
24
47
  export interface Store {
25
48
  id?: string;
26
49
  /** 讓店家自行定義的店號,會印在發票及收據上 */
@@ -225,6 +248,10 @@ export interface Store {
225
248
  onlineStorePointsName?: string;
226
249
  /** 品牌 */
227
250
  brandNo?: string;
251
+ brand?: Brand;
252
+ storePointsEnabled?: boolean;
253
+ storePointsProvider?: PointProvider;
254
+ storePointsName?: string;
228
255
  /** 加入購物車時,是否與相同品相合併 */
229
256
  onlineMergeSameItem?: boolean;
230
257
  /** 內用服務費 1~100(%) undefined為關閉 */
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/store.ts"],"names":[],"mappings":";;;AAEA,oCAAmH;AAuQnH,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,kDAAiC,CAAA;AACnC,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/store.ts"],"names":[],"mappings":";;;AAEA,oCAAmH;AAkSnH,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,kDAAiC,CAAA;AACnC,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
package/models/table.d.ts CHANGED
@@ -3,6 +3,7 @@ export interface ServeConfig {
3
3
  disableTakeOut: boolean;
4
4
  disableDineIn: boolean;
5
5
  dineInInputType: ServeInputType;
6
+ tableId?: string;
6
7
  }
7
8
  export interface BaseTable {
8
9
  id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/table.ts"],"names":[],"mappings":";;;AA0BA,IAAY,cAIX;AAJD,WAAY,cAAc;IACtB,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;IACvB,+BAAa,CAAA;AACjB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB"}
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/table.ts"],"names":[],"mappings":";;;AA2BA,IAAY,cAIX;AAJD,WAAY,cAAc;IACtB,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;IACvB,+BAAa,CAAA;AACjB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trusted-solutions/sdit.models",
3
- "version": "0.62.0-alpha.0",
3
+ "version": "0.62.0-alpha.5",
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": {