@aptos-scp/scp-component-store-selling-features-domain-model 2.7.2 → 2.8.1

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.
@@ -139,6 +139,8 @@ export declare const SHIPPING_FEE_CHANGE_EVENT = "ShippingFeeChange";
139
139
  export declare const ADD_SHIPPING_FEE_EVENT = "AddShippingFee";
140
140
  export declare const APPLY_FEE_DISCOUNT_EVENT = "ApplyFeeDiscount";
141
141
  export declare const PAYMENT_ACCOUNT_HOLDER_MISMATCH_STATUS_EVENT: string;
142
+ export declare const CUSTOMER_INPUT_EVENT: string;
143
+ export declare const CUSTOMER_INPUT_RESULT_EVENT: string;
142
144
  export declare const PAYMENT_ACCOUNT_HOLDER_VALIDATE_EVENT: string;
143
145
  export declare const SHIPPING_FEE_REFUND_EVENT: string;
144
146
  export declare const RETURN_ITEM_EVENT: string;
@@ -142,6 +142,8 @@ exports.SHIPPING_FEE_CHANGE_EVENT = "ShippingFeeChange";
142
142
  exports.ADD_SHIPPING_FEE_EVENT = "AddShippingFee";
143
143
  exports.APPLY_FEE_DISCOUNT_EVENT = "ApplyFeeDiscount";
144
144
  exports.PAYMENT_ACCOUNT_HOLDER_MISMATCH_STATUS_EVENT = "PaymentAccountHolderMismatchStatus";
145
+ exports.CUSTOMER_INPUT_EVENT = "CustomerInput";
146
+ exports.CUSTOMER_INPUT_RESULT_EVENT = "CustomerInputResult";
145
147
  exports.PAYMENT_ACCOUNT_HOLDER_VALIDATE_EVENT = "PaymentAccountHolderValidate";
146
148
  exports.SHIPPING_FEE_REFUND_EVENT = "ShippingFeeRefund";
147
149
  exports.RETURN_ITEM_EVENT = "ReturnItem";
@@ -1,5 +1,6 @@
1
1
  import { Quantity } from "@aptos-scp/scp-component-business-core";
2
- import { EntryMethod } from "@aptos-scp/scp-types-commerce-devices";
2
+ import { EntryMethod, ICustomerInputScreen } from "@aptos-scp/scp-types-commerce-devices";
3
+ import { ICustomerInputSource } from "@aptos-scp/scp-types-commerce-transaction";
3
4
  export interface ILabel {
4
5
  i18nCode?: string;
5
6
  default?: string;
@@ -125,6 +126,7 @@ export declare enum UiInputKey {
125
126
  DONATION_AMOUNT = "input_donationAmount",
126
127
  DONATION_CODE = "input_donationCode",
127
128
  DONATION_AMOUNT_TYPE = "input_donationAmountType",
129
+ CUSTOMER_INPUT_RESPONSE = "input_customerInputResponse",
128
130
  EXCHANGE_RATE = "input_exchangeRate",
129
131
  EMPLOYEE_DISCOUNT_EVENT = "input_discountEvent",
130
132
  EMPLOYEE_SERVICE_RESPONSE = "input_employeeServiceResponse",
@@ -220,6 +222,7 @@ export declare enum UiInputKey {
220
222
  ORIGINAL_TRANSACTION_LINE_REFERENCES = "input_originalTransactionLineReferences",
221
223
  PAYMENT_ACCOUNT_HOLDER_MISMATCH_ACTION = "input_paymentAccountHolderMismatchAction",
222
224
  PAYMENT_ACCOUNT_HOLDER_VALIDATE = "input_paymentAccountHolderValidate",
225
+ CUSTOMER_INPUT_DEVICE_ID = "input_customerInputDeviceId",
223
226
  PAID_AMOUNT = "input_paidAmount",
224
227
  PAID_OUT_REFERENCE = "input_paidOutReference",
225
228
  ATTACHMENTS = "input_attachments",
@@ -449,7 +452,8 @@ export declare enum UiInputKey {
449
452
  TENDER_KEYED_ENTRY = "input_tenderKeyedEntry",
450
453
  PAY_BY_LINK_CUSTOMER = "input_payByLinkCustomer",
451
454
  FISCAL_RETRY = "input_fiscalRetry",
452
- MAX_FISCAL_RETRY = "input_maxFiscalRetry"
455
+ MAX_FISCAL_RETRY = "input_maxFiscalRetry",
456
+ CUSTOMER_INPUT_SCREENS = "input_customerInputScreens"
453
457
  }
454
458
  export declare enum CollectedDataKey {
455
459
  Abort = "abort",
@@ -511,6 +515,8 @@ export declare enum CollectedDataKey {
511
515
  DonationName = "donationName",
512
516
  DonationExternalId = "donationExternalId",
513
517
  DuplicateFlag = "duplicateFlag",
518
+ CustomerInputResponse = "customerInputResponse",
519
+ CustomerInputSourceType = "customerInputSourceType",
514
520
  EmailAddress = "emailAddress",
515
521
  EmployeeCustomer = "employeeCustomer",
516
522
  EmployeeCustomerDiscountDefinitionKey = "employeeCustomerDiscountDefinitionKey",
@@ -666,6 +672,7 @@ export declare enum CollectedDataKey {
666
672
  TenderPaymentIsCompleted = "tenderPaymentIsCompleted",
667
673
  PaginationMetadata = "paginationMetadata",
668
674
  PaidAmount = "PaidAmount",
675
+ CustomerInputDeviceId = "customerInputDeviceId",
669
676
  PaymentAccountHolderMismatchAction = "paymentAccountHolderMismatchAction",
670
677
  PaymentAccountHolderValidationLineReference = "paymentAccountHolderValidationLineReference",
671
678
  PaymentAccountLookupLineReference = "paymentAccountLookupLineReference",
@@ -959,7 +966,8 @@ export declare enum CollectedDataKey {
959
966
  MembershipTypeDescription = "membershipTypeDescription",
960
967
  IsPermanentMembershipDiscount = "isPermanentMembershipDiscount",
961
968
  TerminalForceClosed = "TerminalForceClosed",
962
- TotalLineTax = "totalLineTax"
969
+ TotalLineTax = "totalLineTax",
970
+ CustomerInputScreens = "customerInputScreens"
963
971
  }
964
972
  export declare enum ItemLookupType {
965
973
  ProductInquiryDetail = "ProductInquiryDetail",
@@ -1069,3 +1077,8 @@ export interface ICancelPaymentFunctionData {
1069
1077
  reason?: string;
1070
1078
  }
1071
1079
  export declare const DELIVERY_SHIPPING_FEE_UPDATED_EVENT: string;
1080
+ export declare const CUSTOMER_INPUT_REQUESTED_EVENT: string;
1081
+ export interface ICustomerInputRequestedEventData {
1082
+ customerInputSource: ICustomerInputSource;
1083
+ screens: ICustomerInputScreen[];
1084
+ }
@@ -127,6 +127,7 @@ var UiInputKey;
127
127
  UiInputKey["DONATION_AMOUNT"] = "input_donationAmount";
128
128
  UiInputKey["DONATION_CODE"] = "input_donationCode";
129
129
  UiInputKey["DONATION_AMOUNT_TYPE"] = "input_donationAmountType";
130
+ UiInputKey["CUSTOMER_INPUT_RESPONSE"] = "input_customerInputResponse";
130
131
  UiInputKey["EXCHANGE_RATE"] = "input_exchangeRate";
131
132
  UiInputKey["EMPLOYEE_DISCOUNT_EVENT"] = "input_discountEvent";
132
133
  UiInputKey["EMPLOYEE_SERVICE_RESPONSE"] = "input_employeeServiceResponse";
@@ -222,6 +223,7 @@ var UiInputKey;
222
223
  UiInputKey["ORIGINAL_TRANSACTION_LINE_REFERENCES"] = "input_originalTransactionLineReferences";
223
224
  UiInputKey["PAYMENT_ACCOUNT_HOLDER_MISMATCH_ACTION"] = "input_paymentAccountHolderMismatchAction";
224
225
  UiInputKey["PAYMENT_ACCOUNT_HOLDER_VALIDATE"] = "input_paymentAccountHolderValidate";
226
+ UiInputKey["CUSTOMER_INPUT_DEVICE_ID"] = "input_customerInputDeviceId";
225
227
  UiInputKey["PAID_AMOUNT"] = "input_paidAmount";
226
228
  UiInputKey["PAID_OUT_REFERENCE"] = "input_paidOutReference";
227
229
  UiInputKey["ATTACHMENTS"] = "input_attachments";
@@ -452,6 +454,7 @@ var UiInputKey;
452
454
  UiInputKey["PAY_BY_LINK_CUSTOMER"] = "input_payByLinkCustomer";
453
455
  UiInputKey["FISCAL_RETRY"] = "input_fiscalRetry";
454
456
  UiInputKey["MAX_FISCAL_RETRY"] = "input_maxFiscalRetry";
457
+ UiInputKey["CUSTOMER_INPUT_SCREENS"] = "input_customerInputScreens";
455
458
  })(UiInputKey = exports.UiInputKey || (exports.UiInputKey = {}));
456
459
  //
457
460
  // Keys for use in relaying data collectedData (qualification) and nonContextualData (action).
@@ -519,6 +522,8 @@ var CollectedDataKey;
519
522
  CollectedDataKey["DonationName"] = "donationName";
520
523
  CollectedDataKey["DonationExternalId"] = "donationExternalId";
521
524
  CollectedDataKey["DuplicateFlag"] = "duplicateFlag";
525
+ CollectedDataKey["CustomerInputResponse"] = "customerInputResponse";
526
+ CollectedDataKey["CustomerInputSourceType"] = "customerInputSourceType";
522
527
  CollectedDataKey["EmailAddress"] = "emailAddress";
523
528
  CollectedDataKey["EmployeeCustomer"] = "employeeCustomer";
524
529
  CollectedDataKey["EmployeeCustomerDiscountDefinitionKey"] = "employeeCustomerDiscountDefinitionKey";
@@ -674,6 +679,7 @@ var CollectedDataKey;
674
679
  CollectedDataKey["TenderPaymentIsCompleted"] = "tenderPaymentIsCompleted";
675
680
  CollectedDataKey["PaginationMetadata"] = "paginationMetadata";
676
681
  CollectedDataKey["PaidAmount"] = "PaidAmount";
682
+ CollectedDataKey["CustomerInputDeviceId"] = "customerInputDeviceId";
677
683
  CollectedDataKey["PaymentAccountHolderMismatchAction"] = "paymentAccountHolderMismatchAction";
678
684
  CollectedDataKey["PaymentAccountHolderValidationLineReference"] = "paymentAccountHolderValidationLineReference";
679
685
  CollectedDataKey["PaymentAccountLookupLineReference"] = "paymentAccountLookupLineReference";
@@ -968,6 +974,7 @@ var CollectedDataKey;
968
974
  CollectedDataKey["IsPermanentMembershipDiscount"] = "isPermanentMembershipDiscount";
969
975
  CollectedDataKey["TerminalForceClosed"] = "TerminalForceClosed";
970
976
  CollectedDataKey["TotalLineTax"] = "totalLineTax";
977
+ CollectedDataKey["CustomerInputScreens"] = "customerInputScreens";
971
978
  })(CollectedDataKey = exports.CollectedDataKey || (exports.CollectedDataKey = {}));
972
979
  var ItemLookupType;
973
980
  (function (ItemLookupType) {
@@ -1067,4 +1074,5 @@ exports.DELIVERY_CONTACT_UPDATED_EVENT = "Delivery.ContactUpdated";
1067
1074
  exports.PAYMENT_ACCOUNT_LOOKUP_EVENT = "PaymentAccount.Lookup";
1068
1075
  exports.CANCEL_PAYMENT_FUNCTION_EVENT = "Cancel.PaymentFunction";
1069
1076
  exports.DELIVERY_SHIPPING_FEE_UPDATED_EVENT = "Delivery.ShippingFeeUpdated";
1077
+ exports.CUSTOMER_INPUT_REQUESTED_EVENT = "CustomerInput.Requested";
1070
1078
  //# sourceMappingURL=Constants.js.map
@@ -62,15 +62,16 @@ exports.getItemFilterByValue = getItemFilterByValue;
62
62
  function getItemLookupKey(defaultLookupKey, omniChannelConfig, selectedStoreItem) {
63
63
  var _a, _b, _c;
64
64
  let itemLookupKey = defaultLookupKey;
65
- if (!defaultLookupKey) {
66
- if (omniChannelConfig && omniChannelConfig.inventory && omniChannelConfig.inventory.itemKeyType) {
67
- itemLookupKey = (_b = (_a = selectedStoreItem) === null || _a === void 0 ? void 0 : _a.itemLookupKeys) === null || _b === void 0 ? void 0 : _b.find((itemKey) => {
68
- return itemKey.type === omniChannelConfig.inventory.itemKeyType;
69
- });
65
+ if (omniChannelConfig && omniChannelConfig.inventory && omniChannelConfig.inventory.itemKeyType) {
66
+ const configuredItemKey = (_b = (_a = selectedStoreItem) === null || _a === void 0 ? void 0 : _a.itemLookupKeys) === null || _b === void 0 ? void 0 : _b.find((itemKey) => {
67
+ return itemKey.type === omniChannelConfig.inventory.itemKeyType;
68
+ });
69
+ if (configuredItemKey) {
70
+ itemLookupKey = configuredItemKey;
70
71
  }
71
72
  }
72
73
  if (!itemLookupKey) {
73
- return (_c = selectedStoreItem) === null || _c === void 0 ? void 0 : _c.itemLookupKeys[0];
74
+ return defaultLookupKey || ((_c = selectedStoreItem) === null || _c === void 0 ? void 0 : _c.itemLookupKeys[0]);
74
75
  }
75
76
  return itemLookupKey;
76
77
  }
@@ -5,5 +5,7 @@ export interface IDonationDefinitions {
5
5
  export interface IDonationDefinition {
6
6
  readonly donationName: ILabel;
7
7
  readonly donationImage: string;
8
+ readonly donationPromptTextLine1?: ILabel;
9
+ readonly donationPromptTextLine2?: ILabel;
8
10
  readonly externalId?: string;
9
11
  }
@@ -117,6 +117,10 @@ export interface IDonationButton {
117
117
  donationAmountType: DonationAmountType;
118
118
  donationAmount: string;
119
119
  }
120
+ export declare enum CaptureDevice {
121
+ PaymentDevice = "PaymentDevice",
122
+ StoreSellingDevice = "StoreSellingDevice"
123
+ }
120
124
  export declare type DiscountLimits = {
121
125
  [key in InputLimitsAllowedDiscountTypes]?: IInputLimit;
122
126
  };
@@ -27,6 +27,11 @@ var AllowedOverrideTypes;
27
27
  AllowedOverrideTypes["amount"] = "amount";
28
28
  AllowedOverrideTypes["percent"] = "percent";
29
29
  })(AllowedOverrideTypes = exports.AllowedOverrideTypes || (exports.AllowedOverrideTypes = {}));
30
+ var CaptureDevice;
31
+ (function (CaptureDevice) {
32
+ CaptureDevice["PaymentDevice"] = "PaymentDevice";
33
+ CaptureDevice["StoreSellingDevice"] = "StoreSellingDevice";
34
+ })(CaptureDevice = exports.CaptureDevice || (exports.CaptureDevice = {}));
30
35
  var InputLimitsAllowedDiscountTypes;
31
36
  (function (InputLimitsAllowedDiscountTypes) {
32
37
  InputLimitsAllowedDiscountTypes["reasonCode"] = "reasonCode";
@@ -0,0 +1,20 @@
1
+ import { ITransactionLine, UiBusinessEvent } from "@aptos-scp/scp-component-store-selling-core";
2
+ import { ICustomerInputStatus, IDonationCustomerInputData } from "@aptos-scp/scp-types-commerce-devices";
3
+ import { ICustomerInputSource } from "@aptos-scp/scp-types-commerce-transaction";
4
+ import { BaseTransactionLine } from "../BaseTransactionLine";
5
+ import { ICustomerInputLine } from "./ICustomerInputLine";
6
+ export declare const CUSTOMER_INPUT_LINE_TYPE: string;
7
+ export declare class CustomerInputLine extends BaseTransactionLine implements ICustomerInputLine {
8
+ private readonly _customerInputSource;
9
+ private readonly _status;
10
+ private readonly _donationCustomerInputData;
11
+ static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): CustomerInputLine;
12
+ static createFromJsonObject(transactionLineJsonObj: any): CustomerInputLine;
13
+ get couldAffectPricing(): boolean;
14
+ get customerInputSource(): ICustomerInputSource;
15
+ get status(): ICustomerInputStatus;
16
+ get donationCustomerInputData(): IDonationCustomerInputData;
17
+ constructor(lineNumber: number, lineType: string, customerInputSource: ICustomerInputSource, status: ICustomerInputStatus, donationCustomerInputData: IDonationCustomerInputData);
18
+ protected newTransactionLine(): CustomerInputLine;
19
+ }
20
+ export declare function isCustomerInputLine(transactionLine: ITransactionLine): transactionLine is CustomerInputLine;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const BaseTransactionLine_1 = require("../BaseTransactionLine");
4
+ const Constants_1 = require("../Constants");
5
+ exports.CUSTOMER_INPUT_LINE_TYPE = "CustomerInput";
6
+ class CustomerInputLine extends BaseTransactionLine_1.BaseTransactionLine {
7
+ constructor(lineNumber, lineType, customerInputSource, status, donationCustomerInputData) {
8
+ super(lineNumber, lineType);
9
+ this._customerInputSource = customerInputSource;
10
+ this._status = status;
11
+ this._donationCustomerInputData = donationCustomerInputData;
12
+ }
13
+ static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
14
+ var _a, _b;
15
+ const response = collectedData.get(Constants_1.CollectedDataKey.CustomerInputResponse);
16
+ const deviceId = collectedData.get(Constants_1.CollectedDataKey.CustomerInputDeviceId);
17
+ const customerInputSourceType = collectedData.get(Constants_1.CollectedDataKey.CustomerInputSourceType);
18
+ const customerInputSource = {
19
+ deviceid: deviceId,
20
+ sourceType: customerInputSourceType,
21
+ };
22
+ const status = (_a = response) === null || _a === void 0 ? void 0 : _a.status;
23
+ const donationCustomerInputData = (_b = response) === null || _b === void 0 ? void 0 : _b.donationCustomerInputData;
24
+ return new CustomerInputLine(lineNumber, lineType, customerInputSource, status, donationCustomerInputData);
25
+ }
26
+ static createFromJsonObject(transactionLineJsonObj) {
27
+ const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
28
+ const lineType = BaseTransactionLine_1.BaseTransactionLine.lineTypeFromJsonObject(transactionLineJsonObj);
29
+ const status = transactionLineJsonObj._status;
30
+ const customerInputSource = transactionLineJsonObj._customerInputSource;
31
+ const donationCustomerInputData = transactionLineJsonObj._donationCustomerInputData;
32
+ return new CustomerInputLine(lineNumber, lineType, customerInputSource, status, donationCustomerInputData);
33
+ }
34
+ get couldAffectPricing() {
35
+ return false;
36
+ }
37
+ get customerInputSource() {
38
+ return this._customerInputSource;
39
+ }
40
+ get status() {
41
+ return this._status;
42
+ }
43
+ get donationCustomerInputData() {
44
+ return this._donationCustomerInputData;
45
+ }
46
+ newTransactionLine() {
47
+ return new CustomerInputLine(this.lineNumber, this.lineType, this._customerInputSource, this._status, this._donationCustomerInputData);
48
+ }
49
+ }
50
+ exports.CustomerInputLine = CustomerInputLine;
51
+ function isCustomerInputLine(transactionLine) {
52
+ return (transactionLine instanceof CustomerInputLine || transactionLine.lineType === exports.CUSTOMER_INPUT_LINE_TYPE);
53
+ }
54
+ exports.isCustomerInputLine = isCustomerInputLine;
55
+ //# sourceMappingURL=CustomerInputLine.js.map
@@ -0,0 +1,8 @@
1
+ import { ITransactionLine } from "@aptos-scp/scp-component-store-selling-core";
2
+ import { ICustomerInputStatus, IDonationCustomerInputData } from "@aptos-scp/scp-types-commerce-devices";
3
+ import { ICustomerInputSource } from "@aptos-scp/scp-types-commerce-transaction";
4
+ export interface ICustomerInputLine extends ITransactionLine {
5
+ readonly customerInputSource: ICustomerInputSource;
6
+ readonly status: ICustomerInputStatus;
7
+ readonly donationCustomerInputData: IDonationCustomerInputData;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ICustomerInputLine.js.map
@@ -0,0 +1,2 @@
1
+ export * from "./ICustomerInputLine";
2
+ export * from "./CustomerInputLine";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ function __export(m) {
3
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
+ }
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ __export(require("./CustomerInputLine"));
7
+ //# sourceMappingURL=index.js.map
@@ -2,6 +2,7 @@ export * from "./account";
2
2
  export * from "./cashDrawer";
3
3
  export * from "./configuration/";
4
4
  export * from "./customer/";
5
+ export * from "./customerInput";
5
6
  export * from "./discounts/";
6
7
  export * from "./giftCard/";
7
8
  export * from "./item/";
@@ -7,6 +7,7 @@ __export(require("./account"));
7
7
  __export(require("./cashDrawer"));
8
8
  __export(require("./configuration/"));
9
9
  __export(require("./customer/"));
10
+ __export(require("./customerInput"));
10
11
  __export(require("./discounts/"));
11
12
  __export(require("./giftCard/"));
12
13
  __export(require("./item/"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-scp/scp-component-store-selling-features-domain-model",
3
- "version": "2.7.2",
3
+ "version": "2.8.1",
4
4
  "description": "This component library provides the common components to handle the coordination of processing the business events from the UI.",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -83,8 +83,8 @@
83
83
  "@aptos-scp/scp-component-taxation": "^5.28.0",
84
84
  "@aptos-scp/scp-component-user": "^1.4.0",
85
85
  "@aptos-scp/scp-types-client-registration": "^1.4.0",
86
- "@aptos-scp/scp-types-commerce-devices": "^6.0.0",
87
- "@aptos-scp/scp-types-commerce-transaction": "^1.78.0",
86
+ "@aptos-scp/scp-types-commerce-devices": "^6.2.0",
87
+ "@aptos-scp/scp-types-commerce-transaction": "^1.79.0",
88
88
  "@aptos-scp/scp-types-core": "^1.0.5",
89
89
  "@aptos-scp/scp-types-core-config": "^2.2.1",
90
90
  "@aptos-scp/scp-types-currency-conversion": "^1.2.0",