@aptos-scp/scp-component-store-selling-features-domain-model 1.53.4 → 1.55.0

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.
@@ -138,6 +138,7 @@ export declare const SHIPPING_FEE_EVENT = "ShippingFee";
138
138
  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
+ export declare const PAYMENT_ACCOUNT_HOLDER_VALIDATE_EVENT: string;
141
142
  export declare const SHIPPING_FEE_REFUND_EVENT: string;
142
143
  export declare const RETURN_ITEM_EVENT: string;
143
144
  export declare const ITEM_FEE_REFUND_EVENT: string;
@@ -141,6 +141,7 @@ exports.SHIPPING_FEE_EVENT = "ShippingFee";
141
141
  exports.SHIPPING_FEE_CHANGE_EVENT = "ShippingFeeChange";
142
142
  exports.ADD_SHIPPING_FEE_EVENT = "AddShippingFee";
143
143
  exports.APPLY_FEE_DISCOUNT_EVENT = "ApplyFeeDiscount";
144
+ exports.PAYMENT_ACCOUNT_HOLDER_VALIDATE_EVENT = "PaymentAccountHolderValidate";
144
145
  exports.SHIPPING_FEE_REFUND_EVENT = "ShippingFeeRefund";
145
146
  exports.RETURN_ITEM_EVENT = "ReturnItem";
146
147
  exports.ITEM_FEE_REFUND_EVENT = "RefundItemFee";
@@ -1,4 +1,5 @@
1
1
  import { Quantity } from "@aptos-scp/scp-component-business-core";
2
+ import { EntryMethod } from "@aptos-scp/scp-types-commerce-devices";
2
3
  export interface ILabel {
3
4
  i18nCode?: string;
4
5
  default?: string;
@@ -102,6 +103,7 @@ export declare enum UiInputKey {
102
103
  SAME_AS_BILLTO = "input_sameAsBillTo",
103
104
  BILLING = "input_billing",
104
105
  CANCEL_PAYMENT_REASON = "input_cancelPaymentReason",
106
+ CARD_HOLDER = "input_cardHolder",
105
107
  CASH_DRAWER_STATUS = "input_cashDrawerStatus",
106
108
  COMPLETE_RESUME_EVENT = "input_resumeCompleteEvent",
107
109
  COUNTRY_CODE = "input_countryCode",
@@ -129,6 +131,7 @@ export declare enum UiInputKey {
129
131
  EMPLOYEE_DISCOUNT_OVERRIDE = "input_employeeDiscountOverride",
130
132
  EXCHANGE_RATE_VALUE = "input_exchangeRateValue",
131
133
  EMPLOYEE_ID = "input_employeeId",
134
+ ENTRY_METHOD = "input_entryMethod",
132
135
  EXEMPTED_TAX_AUTHORITIES = "input_exemptedTaxAuthorities",
133
136
  EXISTING_GIFT_CARD = "input_existingGiftCard",
134
137
  EXPIRED_COUPON_OVERRIDE = "input_expiredCouponOverride",
@@ -140,6 +143,7 @@ export declare enum UiInputKey {
140
143
  FEE_TYPE = "input_feeType",
141
144
  FEE_UNIT_COST = "input_feeUnitCost",
142
145
  FISCAL_CODE = "fiscalCode",
146
+ FIRST_ADMIN_DIVISION = "input_firstAdminDivision",
143
147
  FISCAL_DEVICE_ACTIVITY_SUCCESSFUL = "fiscalDeviceActivitySuccessful",
144
148
  FISCAL_DEVICE_ERROR_CODE = "fiscalDeviceErrorCode",
145
149
  FISCAL_DEVICE_ERROR_DESCRIPTION = "fiscalDeviceErrorDescription",
@@ -164,6 +168,7 @@ export declare enum UiInputKey {
164
168
  GIFT_RECEIPT_MODE = "input_giftReceiptMode",
165
169
  INVOICE_NUMBER = "input_invoiceNumber",
166
170
  IS_INVOICE = "input_isInvoice",
171
+ IDENTIFICATION_TYPE = "input_identificationType",
167
172
  ITEM_COMMENT = "input_selectedComment",
168
173
  ITEM_FILTER_BY = "input_itemFilterBy",
169
174
  ITEM_CALCULATION_PROFILE = "item_calculationProfile",
@@ -445,6 +450,7 @@ export declare enum CollectedDataKey {
445
450
  Abort = "abort",
446
451
  AccountingCurrency = "accountingCurrency",
447
452
  ActionType = "actionType",
453
+ AccountHolderMismatch = "accountHolderMismatch",
448
454
  AllowedDiscountType = "allowedDiscountType",
449
455
  Amount = "amount",
450
456
  AssignCustomer = "assignCustomer",
@@ -507,6 +513,8 @@ export declare enum CollectedDataKey {
507
513
  EvaluateOnly = "evaluateOnly",
508
514
  ExchangeRate = "exchangeRate",
509
515
  ExchangeRates = "exchangeRates",
516
+ FirstAdminDivision = "firstAdminDivision",
517
+ FirstName = "firstName",
510
518
  ForeignTenderAmount = "foreignTenderAmount",
511
519
  FiscalConfigValidation = "fiscalConfigValidation",
512
520
  TaxExemptDisplayName = "taxExemptDisplayName",
@@ -559,6 +567,7 @@ export declare enum CollectedDataKey {
559
567
  GiftCardPin = "GiftCardPin",
560
568
  GiftReceiptMode = "GiftReceiptMode",
561
569
  HardSoftStopItems = "hardSoftStopItems",
570
+ IdentificationType = "identificationType",
562
571
  IncomingCashDrawerStatusCode = "IncomingCashDrawerStatusCode",
563
572
  InputSource = "inputSource",
564
573
  InternalCouponNumber = "internalCouponNumber",
@@ -570,6 +579,7 @@ export declare enum CollectedDataKey {
570
579
  ItemQuantityInBasket = "itemQuantityInBasket",
571
580
  ItemStatus = "itemStatus",
572
581
  ItemStopStatusMessage = "itemStopStatusMessage",
582
+ LastName = "lastName",
573
583
  LastTransaction = "lastTransaction",
574
584
  LineNumberReference = "lineNumberReference",
575
585
  LineNumbers = "LineNumbers",
@@ -1040,6 +1050,7 @@ export declare enum AssignCustomerForReturnAction {
1040
1050
  export declare const DELIVERY_CONTACT_UPDATED_EVENT: string;
1041
1051
  export declare const PAYMENT_ACCOUNT_LOOKUP_EVENT: string;
1042
1052
  export interface IPaymentAccountLookupEventData {
1043
- deviceIds: string[];
1053
+ deviceId: string;
1054
+ entryMethod?: EntryMethod;
1044
1055
  }
1045
1056
  export declare const DELIVERY_SHIPPING_FEE_UPDATED_EVENT: string;
@@ -105,6 +105,7 @@ var UiInputKey;
105
105
  UiInputKey["SAME_AS_BILLTO"] = "input_sameAsBillTo";
106
106
  UiInputKey["BILLING"] = "input_billing";
107
107
  UiInputKey["CANCEL_PAYMENT_REASON"] = "input_cancelPaymentReason";
108
+ UiInputKey["CARD_HOLDER"] = "input_cardHolder";
108
109
  UiInputKey["CASH_DRAWER_STATUS"] = "input_cashDrawerStatus";
109
110
  UiInputKey["COMPLETE_RESUME_EVENT"] = "input_resumeCompleteEvent";
110
111
  UiInputKey["COUNTRY_CODE"] = "input_countryCode";
@@ -132,6 +133,7 @@ var UiInputKey;
132
133
  UiInputKey["EMPLOYEE_DISCOUNT_OVERRIDE"] = "input_employeeDiscountOverride";
133
134
  UiInputKey["EXCHANGE_RATE_VALUE"] = "input_exchangeRateValue";
134
135
  UiInputKey["EMPLOYEE_ID"] = "input_employeeId";
136
+ UiInputKey["ENTRY_METHOD"] = "input_entryMethod";
135
137
  UiInputKey["EXEMPTED_TAX_AUTHORITIES"] = "input_exemptedTaxAuthorities";
136
138
  UiInputKey["EXISTING_GIFT_CARD"] = "input_existingGiftCard";
137
139
  UiInputKey["EXPIRED_COUPON_OVERRIDE"] = "input_expiredCouponOverride";
@@ -143,6 +145,7 @@ var UiInputKey;
143
145
  UiInputKey["FEE_TYPE"] = "input_feeType";
144
146
  UiInputKey["FEE_UNIT_COST"] = "input_feeUnitCost";
145
147
  UiInputKey["FISCAL_CODE"] = "fiscalCode";
148
+ UiInputKey["FIRST_ADMIN_DIVISION"] = "input_firstAdminDivision";
146
149
  UiInputKey["FISCAL_DEVICE_ACTIVITY_SUCCESSFUL"] = "fiscalDeviceActivitySuccessful";
147
150
  UiInputKey["FISCAL_DEVICE_ERROR_CODE"] = "fiscalDeviceErrorCode";
148
151
  UiInputKey["FISCAL_DEVICE_ERROR_DESCRIPTION"] = "fiscalDeviceErrorDescription";
@@ -167,6 +170,7 @@ var UiInputKey;
167
170
  UiInputKey["GIFT_RECEIPT_MODE"] = "input_giftReceiptMode";
168
171
  UiInputKey["INVOICE_NUMBER"] = "input_invoiceNumber";
169
172
  UiInputKey["IS_INVOICE"] = "input_isInvoice";
173
+ UiInputKey["IDENTIFICATION_TYPE"] = "input_identificationType";
170
174
  UiInputKey["ITEM_COMMENT"] = "input_selectedComment";
171
175
  UiInputKey["ITEM_FILTER_BY"] = "input_itemFilterBy";
172
176
  UiInputKey["ITEM_CALCULATION_PROFILE"] = "item_calculationProfile";
@@ -454,6 +458,7 @@ var CollectedDataKey;
454
458
  CollectedDataKey["Abort"] = "abort";
455
459
  CollectedDataKey["AccountingCurrency"] = "accountingCurrency";
456
460
  CollectedDataKey["ActionType"] = "actionType";
461
+ CollectedDataKey["AccountHolderMismatch"] = "accountHolderMismatch";
457
462
  CollectedDataKey["AllowedDiscountType"] = "allowedDiscountType";
458
463
  CollectedDataKey["Amount"] = "amount";
459
464
  CollectedDataKey["AssignCustomer"] = "assignCustomer";
@@ -516,6 +521,8 @@ var CollectedDataKey;
516
521
  CollectedDataKey["EvaluateOnly"] = "evaluateOnly";
517
522
  CollectedDataKey["ExchangeRate"] = "exchangeRate";
518
523
  CollectedDataKey["ExchangeRates"] = "exchangeRates";
524
+ CollectedDataKey["FirstAdminDivision"] = "firstAdminDivision";
525
+ CollectedDataKey["FirstName"] = "firstName";
519
526
  CollectedDataKey["ForeignTenderAmount"] = "foreignTenderAmount";
520
527
  CollectedDataKey["FiscalConfigValidation"] = "fiscalConfigValidation";
521
528
  CollectedDataKey["TaxExemptDisplayName"] = "taxExemptDisplayName";
@@ -568,6 +575,7 @@ var CollectedDataKey;
568
575
  CollectedDataKey["GiftCardPin"] = "GiftCardPin";
569
576
  CollectedDataKey["GiftReceiptMode"] = "GiftReceiptMode";
570
577
  CollectedDataKey["HardSoftStopItems"] = "hardSoftStopItems";
578
+ CollectedDataKey["IdentificationType"] = "identificationType";
571
579
  CollectedDataKey["IncomingCashDrawerStatusCode"] = "IncomingCashDrawerStatusCode";
572
580
  CollectedDataKey["InputSource"] = "inputSource";
573
581
  CollectedDataKey["InternalCouponNumber"] = "internalCouponNumber";
@@ -579,6 +587,7 @@ var CollectedDataKey;
579
587
  CollectedDataKey["ItemQuantityInBasket"] = "itemQuantityInBasket";
580
588
  CollectedDataKey["ItemStatus"] = "itemStatus";
581
589
  CollectedDataKey["ItemStopStatusMessage"] = "itemStopStatusMessage";
590
+ CollectedDataKey["LastName"] = "lastName";
582
591
  CollectedDataKey["LastTransaction"] = "lastTransaction";
583
592
  CollectedDataKey["LineNumberReference"] = "lineNumberReference";
584
593
  CollectedDataKey["LineNumbers"] = "LineNumbers";
@@ -0,0 +1,9 @@
1
+ import { ITransactionLine } from "@aptos-scp/scp-component-store-selling-core";
2
+ import { ICardHolder } from "@aptos-scp/scp-types-commerce-devices";
3
+ import { PaymentAccountHolderIdentificationType } from "@aptos-scp/scp-types-commerce-transaction";
4
+ export interface IPaymentAccountHolderValidationLine extends ITransactionLine {
5
+ readonly accountHolder: ICardHolder;
6
+ readonly identificationType: PaymentAccountHolderIdentificationType;
7
+ readonly firstAdminDivision: string;
8
+ readonly accountHolderMismatch?: boolean;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPaymentAccountHolderValidationLine.js.map
@@ -1,3 +1,4 @@
1
+ import { IMoney } from "@aptos-scp/scp-component-business-core";
1
2
  import { ITransactionLine } from "@aptos-scp/scp-component-store-selling-core";
2
3
  import { ICardHolder } from "@aptos-scp/scp-types-commerce-devices";
3
4
  import { PaymentAccountLookupResult } from "@aptos-scp/scp-types-commerce-transaction";
@@ -9,4 +10,5 @@ export interface IPaymentAccountLookupLine extends ITransactionLine {
9
10
  readonly cardToken?: string;
10
11
  readonly referenceNumber?: string;
11
12
  readonly authorizationDeviceId?: string;
13
+ readonly accountBalance?: IMoney;
12
14
  }
@@ -0,0 +1,22 @@
1
+ import { ITransactionLine, UiBusinessEvent } from "@aptos-scp/scp-component-store-selling-core";
2
+ import { PaymentAccountHolderIdentificationType } from "@aptos-scp/scp-types-commerce-transaction";
3
+ import { ICardHolder } from "@aptos-scp/scp-types-commerce-devices";
4
+ import { BaseTransactionLine } from "../BaseTransactionLine";
5
+ import { IPaymentAccountHolderValidationLine } from "./IPaymentAccountHolderValidationLine";
6
+ export declare const PAYMENT_ACCOUNT_HOLDER_VALIDATION_LINE_TYPE: string;
7
+ export declare class PaymentAccountHolderValidationLine extends BaseTransactionLine implements IPaymentAccountHolderValidationLine {
8
+ private readonly _accountHolder;
9
+ private readonly _identificationType;
10
+ private readonly _firstAdminDivision;
11
+ private readonly _accountHolderMismatch?;
12
+ static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): PaymentAccountHolderValidationLine;
13
+ static createFromJsonObject(transactionLineJsonObj: any): PaymentAccountHolderValidationLine;
14
+ get couldAffectPricing(): boolean;
15
+ get accountHolder(): ICardHolder;
16
+ get identificationType(): PaymentAccountHolderIdentificationType;
17
+ get firstAdminDivision(): string;
18
+ get accountHolderMismatch(): boolean;
19
+ constructor(lineNumber: number, lineType: string, accountHolder: ICardHolder, identificationType: PaymentAccountHolderIdentificationType, firstAdminDivision: string, accountHolderMismatch: boolean);
20
+ protected newTransactionLine(): PaymentAccountHolderValidationLine;
21
+ }
22
+ export declare function isPaymentAccountHolderValidationLine(transactionLine: ITransactionLine): transactionLine is IPaymentAccountHolderValidationLine;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const BaseTransactionLine_1 = require("../BaseTransactionLine");
4
+ const Constants_1 = require("../Constants");
5
+ exports.PAYMENT_ACCOUNT_HOLDER_VALIDATION_LINE_TYPE = "PaymentAccountHolderValidation";
6
+ class PaymentAccountHolderValidationLine extends BaseTransactionLine_1.BaseTransactionLine {
7
+ constructor(lineNumber, lineType, accountHolder, identificationType, firstAdminDivision, accountHolderMismatch) {
8
+ super(lineNumber, lineType);
9
+ this._accountHolder = accountHolder;
10
+ this._identificationType = identificationType;
11
+ this._firstAdminDivision = firstAdminDivision;
12
+ this._accountHolderMismatch = accountHolderMismatch;
13
+ }
14
+ static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
15
+ const firstName = collectedData.get(Constants_1.CollectedDataKey.FirstName);
16
+ const lastName = collectedData.get(Constants_1.CollectedDataKey.LastName);
17
+ const accountHolder = {
18
+ firstName,
19
+ lastName,
20
+ };
21
+ const identificationType = collectedData.get(Constants_1.CollectedDataKey.IdentificationType);
22
+ const firstAdminDivision = collectedData.get(Constants_1.CollectedDataKey.FirstAdminDivision);
23
+ const accountHolderMismatch = collectedData.get(Constants_1.CollectedDataKey.AccountHolderMismatch);
24
+ return new PaymentAccountHolderValidationLine(lineNumber, lineType, accountHolder, identificationType, firstAdminDivision, accountHolderMismatch);
25
+ }
26
+ static createFromJsonObject(transactionLineJsonObj) {
27
+ const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
28
+ const lineType = BaseTransactionLine_1.BaseTransactionLine.lineTypeFromJsonObject(transactionLineJsonObj);
29
+ const accountHolder = transactionLineJsonObj._accountHolder;
30
+ const identificationType = transactionLineJsonObj._identificationType;
31
+ const firstAdminDivision = transactionLineJsonObj._firstAdminDivision;
32
+ const accountHolderMismatch = transactionLineJsonObj._accountHolderMismatch;
33
+ return new PaymentAccountHolderValidationLine(lineNumber, lineType, accountHolder, identificationType, firstAdminDivision, accountHolderMismatch);
34
+ }
35
+ get couldAffectPricing() {
36
+ return false;
37
+ }
38
+ get accountHolder() {
39
+ return this._accountHolder;
40
+ }
41
+ get identificationType() {
42
+ return this._identificationType;
43
+ }
44
+ get firstAdminDivision() {
45
+ return this._firstAdminDivision;
46
+ }
47
+ get accountHolderMismatch() {
48
+ return this._accountHolderMismatch;
49
+ }
50
+ newTransactionLine() {
51
+ return new PaymentAccountHolderValidationLine(this.lineNumber, this.lineType, this._accountHolder, this._identificationType, this._firstAdminDivision, this._accountHolderMismatch);
52
+ }
53
+ }
54
+ exports.PaymentAccountHolderValidationLine = PaymentAccountHolderValidationLine;
55
+ function isPaymentAccountHolderValidationLine(transactionLine) {
56
+ return (transactionLine instanceof PaymentAccountHolderValidationLine ||
57
+ transactionLine.lineType === exports.PAYMENT_ACCOUNT_HOLDER_VALIDATION_LINE_TYPE);
58
+ }
59
+ exports.isPaymentAccountHolderValidationLine = isPaymentAccountHolderValidationLine;
60
+ //# sourceMappingURL=PaymentAccountHolderValidationLine.js.map
@@ -3,6 +3,7 @@ import { PaymentAccountLookupResult } from "@aptos-scp/scp-types-commerce-transa
3
3
  import { ICardHolder, ResponseCodes } from "@aptos-scp/scp-types-commerce-devices";
4
4
  import { BaseTransactionLine } from "../BaseTransactionLine";
5
5
  import { IPaymentAccountLookupLine } from "./IPaymentAccountLookupLine";
6
+ import { IMoney } from "@aptos-scp/scp-component-business-core";
6
7
  export declare const PAYMENT_ACCOUNT_LOOKUP_LINE_TYPE: string;
7
8
  export declare class PaymentAccountLookupLine extends BaseTransactionLine implements IPaymentAccountLookupLine {
8
9
  private readonly _cardHolder;
@@ -12,6 +13,7 @@ export declare class PaymentAccountLookupLine extends BaseTransactionLine implem
12
13
  private readonly _cardToken?;
13
14
  private readonly _referenceNumber?;
14
15
  private readonly _authorizationDeviceId?;
16
+ private readonly _accountBalance?;
15
17
  static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): PaymentAccountLookupLine;
16
18
  static createFromJsonObject(transactionLineJsonObj: any): PaymentAccountLookupLine;
17
19
  get couldAffectPricing(): boolean;
@@ -22,8 +24,9 @@ export declare class PaymentAccountLookupLine extends BaseTransactionLine implem
22
24
  get cardToken(): string;
23
25
  get referenceNumber(): string;
24
26
  get authorizationDeviceId(): string;
25
- protected constructor(lineNumber: number, lineType: string, cardHolder: ICardHolder, lookupResult?: PaymentAccountLookupResult, lookupResultReason?: string, accountNumber?: string, cardToken?: string, referenceNumber?: string, authorizationDeviceId?: string);
27
+ get accountBalance(): IMoney;
28
+ protected constructor(lineNumber: number, lineType: string, cardHolder: ICardHolder, lookupResult?: PaymentAccountLookupResult, lookupResultReason?: string, accountNumber?: string, cardToken?: string, referenceNumber?: string, authorizationDeviceId?: string, accountBalance?: IMoney);
26
29
  protected newTransactionLine(): PaymentAccountLookupLine;
27
30
  }
28
- export declare function isAccountLookupLine(transactionLine: ITransactionLine): transactionLine is PaymentAccountLookupLine;
31
+ export declare function isPaymentAccountLookupLine(transactionLine: ITransactionLine): transactionLine is PaymentAccountLookupLine;
29
32
  export declare function convertLookupResultToResponseCode(lookupResult: PaymentAccountLookupResult): ResponseCodes;
@@ -6,7 +6,7 @@ const BaseTransactionLine_1 = require("../BaseTransactionLine");
6
6
  const Constants_1 = require("../Constants");
7
7
  exports.PAYMENT_ACCOUNT_LOOKUP_LINE_TYPE = "PaymentAccountLookup";
8
8
  class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine {
9
- constructor(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId) {
9
+ constructor(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId, accountBalance) {
10
10
  super(lineNumber, lineType);
11
11
  this._cardHolder = cardHolder;
12
12
  this._lookupResult = lookupResult;
@@ -15,9 +15,10 @@ class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine
15
15
  this._cardToken = cardToken;
16
16
  this._referenceNumber = referenceNumber;
17
17
  this._authorizationDeviceId = authorizationDeviceId;
18
+ this._accountBalance = accountBalance;
18
19
  }
19
20
  static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
20
- var _a, _b, _c, _d, _e, _f;
21
+ var _a, _b, _c, _d, _e, _f, _g;
21
22
  const accountLookupResponse = collectedData.get(Constants_1.CollectedDataKey.TenderAuthResponse);
22
23
  const lookupResult = convertResponseCodeToLookupResult((_a = accountLookupResponse) === null || _a === void 0 ? void 0 : _a.responseCode);
23
24
  const lookupResultReason = (_b = accountLookupResponse) === null || _b === void 0 ? void 0 : _b.status;
@@ -25,8 +26,9 @@ class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine
25
26
  const accountNumber = (_d = accountLookupResponse) === null || _d === void 0 ? void 0 : _d.cardNumber;
26
27
  const cardToken = (_e = accountLookupResponse) === null || _e === void 0 ? void 0 : _e.cardToken;
27
28
  const referenceNumber = (_f = accountLookupResponse) === null || _f === void 0 ? void 0 : _f.referenceNumber;
29
+ const accountBalance = (_g = accountLookupResponse) === null || _g === void 0 ? void 0 : _g.balance;
28
30
  const authorizationDeviceId = collectedData.get(Constants_1.CollectedDataKey.AuthorizationDeviceId);
29
- return new PaymentAccountLookupLine(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId);
31
+ return new PaymentAccountLookupLine(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId, accountBalance);
30
32
  }
31
33
  static createFromJsonObject(transactionLineJsonObj) {
32
34
  const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
@@ -38,7 +40,8 @@ class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine
38
40
  const cardToken = transactionLineJsonObj._cardToken;
39
41
  const referenceNumber = transactionLineJsonObj._referenceNumber;
40
42
  const authorizationDeviceId = transactionLineJsonObj._authorizationDeviceId;
41
- const accountLookupLine = new PaymentAccountLookupLine(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId);
43
+ const accountBalance = transactionLineJsonObj._accountBalance;
44
+ const accountLookupLine = new PaymentAccountLookupLine(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId, accountBalance);
42
45
  accountLookupLine.loadFromJsonObject(transactionLineJsonObj);
43
46
  return accountLookupLine;
44
47
  }
@@ -66,16 +69,20 @@ class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine
66
69
  get authorizationDeviceId() {
67
70
  return this._authorizationDeviceId;
68
71
  }
72
+ get accountBalance() {
73
+ return this._accountBalance;
74
+ }
69
75
  newTransactionLine() {
70
- return new PaymentAccountLookupLine(this.lineNumber, this.lineType, this._cardHolder, this._lookupResult, this._lookupResultReason, this._accountNumber, this._cardToken, this._referenceNumber, this._authorizationDeviceId);
76
+ return new PaymentAccountLookupLine(this.lineNumber, this.lineType, this._cardHolder, this._lookupResult, this._lookupResultReason, this._accountNumber, this._cardToken, this._referenceNumber, this._authorizationDeviceId, this._accountBalance);
71
77
  }
72
78
  }
73
79
  exports.PaymentAccountLookupLine = PaymentAccountLookupLine;
74
- function isAccountLookupLine(transactionLine) {
75
- return (transactionLine instanceof PaymentAccountLookupLine ||
76
- transactionLine.lineType === exports.PAYMENT_ACCOUNT_LOOKUP_LINE_TYPE);
80
+ function isPaymentAccountLookupLine(transactionLine) {
81
+ return (transactionLine &&
82
+ (transactionLine instanceof PaymentAccountLookupLine ||
83
+ transactionLine.lineType === exports.PAYMENT_ACCOUNT_LOOKUP_LINE_TYPE));
77
84
  }
78
- exports.isAccountLookupLine = isAccountLookupLine;
85
+ exports.isPaymentAccountLookupLine = isPaymentAccountLookupLine;
79
86
  function convertResponseCodeToLookupResult(responseCode) {
80
87
  switch (responseCode) {
81
88
  case scp_types_commerce_devices_1.ResponseCodes.Approved:
@@ -0,0 +1,21 @@
1
+ import { IState } from "@aptos-scp/scp-component-store-selling-core";
2
+ export declare const PAYMENT_ACCOUNT_SESSION: string;
3
+ export declare enum PaymentAccountSessionState {
4
+ Completed = "Completed",
5
+ LookupInProgress = "LookupInProgress"
6
+ }
7
+ export declare class PaymentAccountSession implements IState {
8
+ private readonly _type;
9
+ private readonly _state;
10
+ private readonly _deviceId;
11
+ static createFromJsonObject(paymentAccountSessionJsonObj: any): PaymentAccountSession;
12
+ static create(): PaymentAccountSession;
13
+ get type(): string;
14
+ get deviceId(): string | undefined;
15
+ get stateValues(): Readonly<Map<string, any>>;
16
+ complete(): PaymentAccountSession;
17
+ get inProgress(): boolean;
18
+ get inLookupInProgress(): boolean;
19
+ startLookup(deviceId: string): PaymentAccountSession;
20
+ private constructor();
21
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAYMENT_ACCOUNT_SESSION = "PaymentAccountSession";
4
+ var PaymentAccountSessionState;
5
+ (function (PaymentAccountSessionState) {
6
+ PaymentAccountSessionState["Completed"] = "Completed";
7
+ PaymentAccountSessionState["LookupInProgress"] = "LookupInProgress";
8
+ })(PaymentAccountSessionState = exports.PaymentAccountSessionState || (exports.PaymentAccountSessionState = {}));
9
+ class PaymentAccountSession {
10
+ constructor(state, deviceId) {
11
+ this._type = "PaymentAccountSession";
12
+ this._state = state;
13
+ this._deviceId = deviceId;
14
+ }
15
+ static createFromJsonObject(paymentAccountSessionJsonObj) {
16
+ const state = paymentAccountSessionJsonObj._state;
17
+ const deviceId = paymentAccountSessionJsonObj._deviceId;
18
+ return new PaymentAccountSession(state, deviceId);
19
+ }
20
+ static create() {
21
+ return new PaymentAccountSession(PaymentAccountSessionState.Completed);
22
+ }
23
+ get type() {
24
+ return this._type;
25
+ }
26
+ get deviceId() {
27
+ return this._deviceId;
28
+ }
29
+ get stateValues() {
30
+ return new Map([["PaymentAccountSession.state", this._state]]);
31
+ }
32
+ complete() {
33
+ return new PaymentAccountSession(PaymentAccountSessionState.Completed);
34
+ }
35
+ get inProgress() {
36
+ return this._state === PaymentAccountSessionState.LookupInProgress;
37
+ }
38
+ get inLookupInProgress() {
39
+ return this._state === PaymentAccountSessionState.LookupInProgress;
40
+ }
41
+ startLookup(deviceId) {
42
+ return this.inLookupInProgress
43
+ ? this
44
+ : new PaymentAccountSession(PaymentAccountSessionState.LookupInProgress, deviceId);
45
+ }
46
+ }
47
+ exports.PaymentAccountSession = PaymentAccountSession;
48
+ //# sourceMappingURL=PaymentAccountSession.js.map
@@ -1,2 +1,5 @@
1
1
  export * from "./PaymentAccountLookupLine";
2
2
  export * from "./IPaymentAccountLookupLine";
3
+ export * from "./PaymentAccountSession";
4
+ export * from "./PaymentAccountHolderValidationLine";
5
+ export * from "./IPaymentAccountHolderValidationLine";
@@ -4,4 +4,6 @@ function __export(m) {
4
4
  }
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  __export(require("./PaymentAccountLookupLine"));
7
+ __export(require("./PaymentAccountSession"));
8
+ __export(require("./PaymentAccountHolderValidationLine"));
7
9
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-scp/scp-component-store-selling-features-domain-model",
3
- "version": "1.53.4",
3
+ "version": "1.55.0",
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",
@@ -61,8 +61,8 @@
61
61
  "@aptos-scp/scp-component-user": "^1.4.0",
62
62
  "@aptos-scp/scp-types-client-registration": "^1.4.0",
63
63
  "@aptos-scp/scp-types-core-config": "^2.2.1",
64
- "@aptos-scp/scp-types-commerce-devices": "^3.14.0",
65
- "@aptos-scp/scp-types-commerce-transaction": "^1.74.0",
64
+ "@aptos-scp/scp-types-commerce-devices": "^4.1.0",
65
+ "@aptos-scp/scp-types-commerce-transaction": "^1.75.0",
66
66
  "@aptos-scp/scp-types-customer": "^3.7.0",
67
67
  "@aptos-scp/scp-types-einvoice": "^1.17.0",
68
68
  "@aptos-scp/scp-types-inventory": "^2.0.0",
@@ -83,8 +83,8 @@
83
83
  "@aptos-scp/scp-component-taxation": "^5.27.3",
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": "^3.14.0",
87
- "@aptos-scp/scp-types-commerce-transaction": "^1.74.0",
86
+ "@aptos-scp/scp-types-commerce-devices": "^4.1.0",
87
+ "@aptos-scp/scp-types-commerce-transaction": "^1.75.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",