@aptos-scp/scp-component-store-selling-features-domain-model 1.27.1 → 1.29.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.
@@ -143,6 +143,7 @@ export declare enum UiInputKey {
143
143
  FISCAL_DEVICE_ERROR_DESCRIPTION = "fiscalDeviceErrorDescription",
144
144
  FISCAL_DEVICE_INFORMATION = "fiscalDeviceInformation",
145
145
  FISCAL_TRANSACTION_INFORMATION = "fiscalTransactionInformation",
146
+ FISCAL_VARIANCE_INFORMATION = "fiscalVarianceInformation",
146
147
  FISCAL_RFECEIPT_AMOUNT = "fiscalReceiptAmount",
147
148
  FISCAL_RFECEIPT_DATE = "fiscalReceiptDate",
148
149
  FISCAL_RFECEIPT_TIME = "fiscalReceiptTime",
@@ -302,6 +303,8 @@ export declare enum UiInputKey {
302
303
  TENDER_TYPE_NAME = "input_tenderTypeName",
303
304
  IS_TENDER_FALLBACK = "input_isTenderFallback",
304
305
  MAPPED_REFUND_TENDER_TYPE_NAME = "input_mappedRefundTenderTypeName",
306
+ MAPPED_REFUND_CARD_TYPE_NAME = "input_mappedRefundCardTypeName",
307
+ EXCLUDED_REFUND_CARD_TYPE_NAMES = "input_excludedRefundCardTypeNames",
305
308
  TRANSACTION_NUMBER_FIELD = "input_transactionNumberField",
306
309
  TRANSACTION_REFERENCE_NUMBER_FIELD = "input_referenceNumberField",
307
310
  CASH_DRAWER_KEY = "input_cashDrawerKey",
@@ -529,6 +532,7 @@ export declare enum CollectedDataKey {
529
532
  FiscalDeviceActivitySuccessful = "fiscalDeviceActivitySuccessful",
530
533
  FiscalDeviceInformation = "fiscalDeviceInformation",
531
534
  FiscalTransactionInformation = "fiscalTransactionInformation",
535
+ FiscalVarianceInformation = "FiscalVarianceInformation",
532
536
  FiscalDeviceErrorCode = "fiscalDeviceErrorCode",
533
537
  FiscalDeviceErrorDescription = "fiscalDeviceErrorDescription",
534
538
  ForcedAuthorizationApproval = "ForcedAuthorizationApproval",
@@ -826,6 +830,8 @@ export declare enum CollectedDataKey {
826
830
  DeliveryInterval = "DeliveryInterval",
827
831
  DeliveryFrequencyText = "DeliveryFrequencyText",
828
832
  MappedRefundTenderTypeName = "MappedRefundTenderTypeName",
833
+ MappedRefundCardTypeName = "MappedRefundCardTypeName",
834
+ ExcludedRefundCardTypeNames = "ExcludedRefundCardTypeNames",
829
835
  VatNumberIsRequired = "VatNumberIsRequired",
830
836
  FiscalSignatureRequired = "FiscalSignatureRequired",
831
837
  FiscalTransactionRequired = "FiscalTransactionRequired",
@@ -146,6 +146,7 @@ var UiInputKey;
146
146
  UiInputKey["FISCAL_DEVICE_ERROR_DESCRIPTION"] = "fiscalDeviceErrorDescription";
147
147
  UiInputKey["FISCAL_DEVICE_INFORMATION"] = "fiscalDeviceInformation";
148
148
  UiInputKey["FISCAL_TRANSACTION_INFORMATION"] = "fiscalTransactionInformation";
149
+ UiInputKey["FISCAL_VARIANCE_INFORMATION"] = "fiscalVarianceInformation";
149
150
  UiInputKey["FISCAL_RFECEIPT_AMOUNT"] = "fiscalReceiptAmount";
150
151
  UiInputKey["FISCAL_RFECEIPT_DATE"] = "fiscalReceiptDate";
151
152
  UiInputKey["FISCAL_RFECEIPT_TIME"] = "fiscalReceiptTime";
@@ -305,6 +306,8 @@ var UiInputKey;
305
306
  UiInputKey["TENDER_TYPE_NAME"] = "input_tenderTypeName";
306
307
  UiInputKey["IS_TENDER_FALLBACK"] = "input_isTenderFallback";
307
308
  UiInputKey["MAPPED_REFUND_TENDER_TYPE_NAME"] = "input_mappedRefundTenderTypeName";
309
+ UiInputKey["MAPPED_REFUND_CARD_TYPE_NAME"] = "input_mappedRefundCardTypeName";
310
+ UiInputKey["EXCLUDED_REFUND_CARD_TYPE_NAMES"] = "input_excludedRefundCardTypeNames";
308
311
  UiInputKey["TRANSACTION_NUMBER_FIELD"] = "input_transactionNumberField";
309
312
  UiInputKey["TRANSACTION_REFERENCE_NUMBER_FIELD"] = "input_referenceNumberField";
310
313
  UiInputKey["CASH_DRAWER_KEY"] = "input_cashDrawerKey";
@@ -538,6 +541,7 @@ var CollectedDataKey;
538
541
  CollectedDataKey["FiscalDeviceActivitySuccessful"] = "fiscalDeviceActivitySuccessful";
539
542
  CollectedDataKey["FiscalDeviceInformation"] = "fiscalDeviceInformation";
540
543
  CollectedDataKey["FiscalTransactionInformation"] = "fiscalTransactionInformation";
544
+ CollectedDataKey["FiscalVarianceInformation"] = "FiscalVarianceInformation";
541
545
  CollectedDataKey["FiscalDeviceErrorCode"] = "fiscalDeviceErrorCode";
542
546
  CollectedDataKey["FiscalDeviceErrorDescription"] = "fiscalDeviceErrorDescription";
543
547
  CollectedDataKey["ForcedAuthorizationApproval"] = "ForcedAuthorizationApproval";
@@ -835,6 +839,8 @@ var CollectedDataKey;
835
839
  CollectedDataKey["DeliveryInterval"] = "DeliveryInterval";
836
840
  CollectedDataKey["DeliveryFrequencyText"] = "DeliveryFrequencyText";
837
841
  CollectedDataKey["MappedRefundTenderTypeName"] = "MappedRefundTenderTypeName";
842
+ CollectedDataKey["MappedRefundCardTypeName"] = "MappedRefundCardTypeName";
843
+ CollectedDataKey["ExcludedRefundCardTypeNames"] = "ExcludedRefundCardTypeNames";
838
844
  CollectedDataKey["VatNumberIsRequired"] = "VatNumberIsRequired";
839
845
  CollectedDataKey["FiscalSignatureRequired"] = "FiscalSignatureRequired";
840
846
  CollectedDataKey["FiscalTransactionRequired"] = "FiscalTransactionRequired";
@@ -41,6 +41,8 @@ export interface IOriginalTender {
41
41
  tenderName: string;
42
42
  tenderId: string;
43
43
  tenderType?: TenderType;
44
+ cardType?: string;
45
+ excludedCardTypes?: string[];
44
46
  tenderAuthCategory: TenderAuthCategory;
45
47
  referenceNumber?: string;
46
48
  maskedCardNumber?: string;
@@ -521,7 +521,8 @@ function combineOriginalUnreferencedAndMappedTenders(tender, unreferencedAndMapp
521
521
  combinedTender.isMappedTender &&
522
522
  tender.tenderAuthCategory !== Constants_1.TenderAuthCategory.None &&
523
523
  tender.tenderAuthCategory !== Constants_1.TenderAuthCategory.StoredValueCertificateService &&
524
- tender.tenderType === combinedTender.tenderType));
524
+ tender.tenderType === combinedTender.tenderType &&
525
+ (!combinedTender.cardType || tender.cardType === combinedTender.cardType)));
525
526
  if (matchingUnreferencedTender) {
526
527
  if (tender.mappedOriginTenderId !== matchingUnreferencedTender.tenderId) {
527
528
  matchingUnreferencedTender.refundedAmount = matchingUnreferencedTender.refundedAmount.plus(tender.refundedAmount);
@@ -625,23 +626,65 @@ function getConfiguredTender(originalTender, configurationManager) {
625
626
  .getTendersValues()) === null || _a === void 0 ? void 0 : _a.tenderDefinitions) === null || _b === void 0 ? void 0 : _b.find((tender) => tender.tenderId === originalTender.tenderId);
626
627
  }
627
628
  function getConfiguredMappedTenders(originalTender, configurationManager, transactionId, originalTransactions, refundDue) {
628
- var _a, _b, _c, _d, _e, _f;
629
+ var _a, _b, _c, _d, _e;
629
630
  const mappedTenders = [];
630
631
  const tenderConfig = (_a = configurationManager) === null || _a === void 0 ? void 0 : _a.getTendersValues();
631
632
  const tenderTypeBehaviors = (_c = (_b = tenderConfig) === null || _b === void 0 ? void 0 : _b.tenderBehaviors) === null || _c === void 0 ? void 0 : _c.tenderTypeBehaviors;
632
633
  const tenderDefinitions = (_d = tenderConfig) === null || _d === void 0 ? void 0 : _d.tenderDefinitions;
633
634
  const configuredTender = getConfiguredTender(originalTender, configurationManager);
634
635
  const tenderTypeBehavior = configuredTender && tenderTypeBehaviors && tenderTypeBehaviors[configuredTender.tenderType];
635
- const refundTenderTypes = (_e = tenderTypeBehavior) === null || _e === void 0 ? void 0 : _e.refundTenderTypes;
636
- const mappedTenderTypeNames = refundTenderTypes &&
637
- Object.keys(refundTenderTypes).filter((tenderType) => {
638
- const mappedRefundTenderType = refundTenderTypes[tenderType];
639
- return (mappedRefundTenderType &&
640
- (!mappedRefundTenderType.hasOwnProperty("allowed") || mappedRefundTenderType["allowed"] === true) &&
641
- allowMappedTender(tenderType, tenderConfig) &&
642
- isOriginalTenderAmountAllowed(originalTender, mappedRefundTenderType, originalTransactions, refundDue));
636
+ let refundCardTypes;
637
+ let refundTenderTypes;
638
+ let excludeCardTypes;
639
+ const cardTypeExceptionsForOriginalTender = getCardTypeExceptions(originalTender, tenderDefinitions, tenderTypeBehavior);
640
+ // If the card type for the original tender is defined in the cardTypeExceptions, then use that
641
+ if (!_.isEmpty(cardTypeExceptionsForOriginalTender)) {
642
+ refundTenderTypes = cardTypeExceptionsForOriginalTender.refundTenderTypes;
643
+ refundCardTypes = cardTypeExceptionsForOriginalTender.refundCardTypes;
644
+ const mappedCardTypeNames = getMappedCardTypeNames(originalTender, tenderConfig, refundCardTypes);
645
+ excludeCardTypes = mappedCardTypeNames;
646
+ addCardTypeTendersToMappedTenders(mappedCardTypeNames, tenderDefinitions, mappedTenders, originalTender, transactionId, originalTransactions);
647
+ }
648
+ else {
649
+ // otherwise use the refundTenderTypes from the root tenderTypeBehavior
650
+ refundTenderTypes = (_e = tenderTypeBehavior) === null || _e === void 0 ? void 0 : _e.refundTenderTypes;
651
+ // exclude ANY refundableCardTypes that exist under cardTypeExceptions
652
+ excludeCardTypes = getAllRefundableCardTypes(tenderTypeBehavior);
653
+ }
654
+ const mappedTenderTypeNames = getMappedTenderTypeNames(originalTender, tenderConfig, originalTransactions, refundDue, refundTenderTypes);
655
+ addTenderTypesToMappedTenders(mappedTenderTypeNames, tenderDefinitions, mappedTenders, originalTender, transactionId, originalTransactions, excludeCardTypes);
656
+ return mappedTenders;
657
+ }
658
+ function getAllRefundableCardTypes(tenderTypeBehavior) {
659
+ var _a, _b;
660
+ const refundableCardTypes = [];
661
+ if ((_b = (_a = tenderTypeBehavior) === null || _a === void 0 ? void 0 : _a.cardTypeExceptions) === null || _b === void 0 ? void 0 : _b.enabled) {
662
+ Object.keys(tenderTypeBehavior.cardTypeExceptions).forEach((cardType) => {
663
+ const refundCardTypes = tenderTypeBehavior.cardTypeExceptions[cardType].refundCardTypes;
664
+ if (refundCardTypes) {
665
+ Object.keys(refundCardTypes).forEach((refundCardType) => {
666
+ const refundCardTypeConfig = refundCardTypes[refundCardType];
667
+ if (refundCardTypeConfig.allowed) {
668
+ refundableCardTypes.push(refundCardType);
669
+ }
670
+ });
671
+ }
643
672
  });
644
- (_f = mappedTenderTypeNames) === null || _f === void 0 ? void 0 : _f.forEach((tenderType) => {
673
+ }
674
+ return refundableCardTypes;
675
+ }
676
+ function addCardTypeTendersToMappedTenders(mappedCardTypeNames, tenderDefinitions, mappedTenders, originalTender, transactionId, originalTransactions) {
677
+ var _a;
678
+ (_a = mappedCardTypeNames) === null || _a === void 0 ? void 0 : _a.forEach((cardType) => {
679
+ var _a;
680
+ const tenderDefs = tenderDefinitions.filter((tenderDef) => { var _a; return tenderDef.cardType === cardType && ((_a = tenderDef.allowRefund) === null || _a === void 0 ? void 0 : _a.indexOf("WhenMapped")) > -1; });
681
+ const tenderName = (_a = tenderDefs.find((tenderDef) => tenderDef.cardType === cardType)) === null || _a === void 0 ? void 0 : _a.tenderDescription;
682
+ mappedTenders.push(buildMappedOriginalTender(originalTender, tenderName, originalTender.tenderType, undefined, getTenderAuthCategoryFromTenderType(originalTender.tenderType), transactionId, originalTransactions, undefined, cardType));
683
+ });
684
+ }
685
+ function addTenderTypesToMappedTenders(mappedTenderTypeNames, tenderDefinitions, mappedTenders, originalTender, transactionId, originalTransactions, excludedCardTypes) {
686
+ var _a;
687
+ (_a = mappedTenderTypeNames) === null || _a === void 0 ? void 0 : _a.forEach((tenderType) => {
645
688
  var _a;
646
689
  // For TenderAuthCategory: None tenders and Value certificate tenders need to have a tenderId, so we'll have one mapped tender for each
647
690
  // of those tenders.
@@ -662,15 +705,33 @@ function getConfiguredMappedTenders(originalTender, configurationManager, transa
662
705
  defaultValue: tenderDef.tenderLabel.default,
663
706
  })) ||
664
707
  tenderDef.tenderName;
665
- mappedTenders.push(buildMappedOriginalTender(originalTender, label, tenderDef.tenderType, tenderDef.tenderId, tenderDef.tenderAuthCategory, transactionId, originalTransactions, tenderDef.subType));
708
+ mappedTenders.push(buildMappedOriginalTender(originalTender, label, tenderDef.tenderType, tenderDef.tenderId, tenderDef.tenderAuthCategory, transactionId, originalTransactions, tenderDef.subType, undefined, excludedCardTypes));
666
709
  });
667
710
  }
668
711
  else {
669
712
  const tenderName = I18n.t(mapTenderTypeToI18nCode.get(tenderType), { defaultValue: tenderType });
670
- mappedTenders.push(buildMappedOriginalTender(originalTender, tenderName, tenderType, undefined, getTenderAuthCategoryFromTenderType(tenderType), transactionId, originalTransactions, undefined));
713
+ mappedTenders.push(buildMappedOriginalTender(originalTender, tenderName, tenderType, undefined, getTenderAuthCategoryFromTenderType(tenderType), transactionId, originalTransactions, undefined, undefined, excludedCardTypes));
671
714
  }
672
715
  });
673
- return mappedTenders;
716
+ }
717
+ function getMappedTenderTypeNames(originalTender, tenderConfig, originalTransactions, refundDue, refundTenderTypes) {
718
+ return (refundTenderTypes &&
719
+ Object.keys(refundTenderTypes).filter((tenderType) => {
720
+ const mappedRefundTenderType = refundTenderTypes[tenderType];
721
+ return (mappedRefundTenderType &&
722
+ (!mappedRefundTenderType.hasOwnProperty("allowed") || mappedRefundTenderType["allowed"] === true) &&
723
+ allowMappedTender(tenderType, tenderConfig) &&
724
+ isOriginalTenderAmountAllowed(originalTender, mappedRefundTenderType, originalTransactions, refundDue));
725
+ }));
726
+ }
727
+ function getMappedCardTypeNames(originalTender, tenderConfig, refundCardTypes) {
728
+ return (refundCardTypes &&
729
+ Object.keys(refundCardTypes).filter((cardType) => {
730
+ const mappedRefundCardType = refundCardTypes[cardType];
731
+ return (mappedRefundCardType &&
732
+ allowMappedCardType(cardType, tenderConfig) &&
733
+ (!mappedRefundCardType.hasOwnProperty("allowed") || mappedRefundCardType["allowed"] === true));
734
+ }));
674
735
  }
675
736
  function getActiveTendersByConfiguredPaymentRestrictions(activeTenderTypes, saleItemTypes, diContainer, orderTypes, productAttributeTypes) {
676
737
  let nonRestrictedTenderTypes = [];
@@ -925,11 +986,14 @@ function sortOriginalTenders(originalTenders) {
925
986
  function allowMappedTender(tenderType, tenderConfig) {
926
987
  return tenderConfig.tenderDefinitions.some((tender) => { var _a; return tender.tenderType === tenderType && ((_a = tender.allowRefund) === null || _a === void 0 ? void 0 : _a.indexOf("WhenMapped")) > -1; });
927
988
  }
989
+ function allowMappedCardType(cardType, tenderConfig) {
990
+ return tenderConfig.tenderDefinitions.some((tender) => { var _a; return tender.cardType === cardType && ((_a = tender.allowRefund) === null || _a === void 0 ? void 0 : _a.indexOf("WhenMapped")) > -1; });
991
+ }
928
992
  function adjustAmount(amount, adjustmentAmount) {
929
993
  var _a;
930
994
  return (adjustmentAmount && ((_a = amount) === null || _a === void 0 ? void 0 : _a.plus(adjustmentAmount))) || amount;
931
995
  }
932
- function buildMappedOriginalTender(originalTender, tenderName, tenderType, tenderId, tenderAuthCategory, transactionId, originalTransactions, subType) {
996
+ function buildMappedOriginalTender(originalTender, tenderName, tenderType, tenderId, tenderAuthCategory, transactionId, originalTransactions, subType, cardType, excludedCardTypes) {
933
997
  var _a;
934
998
  const originalTran = (_a = originalTransactions) === null || _a === void 0 ? void 0 : _a.find((origTran) => origTran.originalTransactionId === transactionId);
935
999
  const returnTotalAmount = getReturnOrCancelTotalAmount(originalTran);
@@ -942,6 +1006,8 @@ function buildMappedOriginalTender(originalTender, tenderName, tenderType, tende
942
1006
  tenderName,
943
1007
  tenderType: tenderTypeName,
944
1008
  subType,
1009
+ cardType,
1010
+ excludedCardTypes,
945
1011
  originalTransactionReferences: isOriginalTenderFullyRefunded(originalTender, returnTotalAmount)
946
1012
  ? undefined
947
1013
  : TenderHandlingSession_1.getOriginalTransactionReferences(transactionId, originalTender.originalLineReferences),
@@ -1403,4 +1469,14 @@ function getChangeAmount(balanceDue, tenderAmount) {
1403
1469
  return tenderAmount.minus(balanceDue);
1404
1470
  }
1405
1471
  }
1472
+ function getCardTypeExceptions(originalTender, tenderDefinitions, tenderTypeBehavior) {
1473
+ var _a, _b;
1474
+ // Find the tender definition for the original tender
1475
+ const originalTenderDefinition = tenderDefinitions.find((tender) => tender.tenderId === originalTender.tenderId);
1476
+ // If
1477
+ if (originalTenderDefinition && ((_b = (_a = tenderTypeBehavior) === null || _a === void 0 ? void 0 : _a.cardTypeExceptions) === null || _b === void 0 ? void 0 : _b.enabled)) {
1478
+ // Is there an entry for the card type in the cardTypeExceptions?
1479
+ return tenderTypeBehavior.cardTypeExceptions[originalTenderDefinition.cardType];
1480
+ }
1481
+ }
1406
1482
  //# sourceMappingURL=TenderType.js.map
@@ -10,6 +10,7 @@ export declare class FiscalDeviceStatusLine extends BaseTransactionLine {
10
10
  private _transactionLineReference?;
11
11
  private _fiscalDeviceInformation?;
12
12
  private _fiscalTransactionInformation?;
13
+ private _fiscalVarianceInformation?;
13
14
  /**
14
15
  * The create method is called by the transaction line factory to create an instance and initialize it from the
15
16
  * data collected during the qualification process.
@@ -29,7 +30,8 @@ export declare class FiscalDeviceStatusLine extends BaseTransactionLine {
29
30
  get fiscalDeviceActivityResult(): IDeviceActivityResult;
30
31
  get fiscalDeviceInformation(): IFiscalDeviceInformation;
31
32
  get fiscalTransactionInformation(): IFiscalTransactionInformation;
32
- protected constructor(lineNumber: number, lineType: string, peripheralDeviceId: string, fiscalDeviceActivityResult: IDeviceActivityResult, transactionLineReference?: ITransactionLineReferenceType, fiscalDeviceInformation?: IFiscalDeviceInformation, fiscalTransactionInformation?: IFiscalTransactionInformation);
33
+ get fiscalVarianceInformation(): IFiscalTransactionInformation;
34
+ protected constructor(lineNumber: number, lineType: string, peripheralDeviceId: string, fiscalDeviceActivityResult: IDeviceActivityResult, transactionLineReference?: ITransactionLineReferenceType, fiscalDeviceInformation?: IFiscalDeviceInformation, fiscalTransactionInformation?: IFiscalTransactionInformation, fiscalVarianceInformation?: IFiscalTransactionInformation);
33
35
  protected newTransactionLine(): BaseTransactionLine;
34
36
  }
35
37
  export declare function isFiscalDeviceStatusLine(transactionLine: ITransactionLine): transactionLine is FiscalDeviceStatusLine;
@@ -6,13 +6,14 @@ const Constants_1 = require("../Constants");
6
6
  exports.FISCAL_DEVICE_STATUS_LINE_TYPE = "FiscalDeviceStatus";
7
7
  class FiscalDeviceStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
8
8
  // Since the constructor is only called from the create methods it is made protected to prevent use by others.
9
- constructor(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation) {
9
+ constructor(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation, fiscalVarianceInformation) {
10
10
  super(lineNumber, lineType);
11
11
  this._peripheralDeviceId = peripheralDeviceId;
12
12
  this._fiscalDeviceActivityResult = fiscalDeviceActivityResult;
13
13
  this._transactionLineReference = transactionLineReference;
14
14
  this._fiscalDeviceInformation = fiscalDeviceInformation;
15
15
  this._fiscalTransactionInformation = fiscalTransactionInformation;
16
+ this._fiscalVarianceInformation = fiscalVarianceInformation;
16
17
  }
17
18
  /**
18
19
  * The create method is called by the transaction line factory to create an instance and initialize it from the
@@ -42,7 +43,8 @@ class FiscalDeviceStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
42
43
  const transactionLineReference = collectedData.get(Constants_1.CollectedDataKey.TransactionLineReference);
43
44
  const fiscalDeviceInformation = collectedData.get(Constants_1.CollectedDataKey.FiscalDeviceInformation);
44
45
  const fiscalTransactionInformation = collectedData.get(Constants_1.CollectedDataKey.FiscalTransactionInformation);
45
- const fiscalDeviceStatusLine = new FiscalDeviceStatusLine(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation);
46
+ const fiscalVarianceInformation = collectedData.get(Constants_1.CollectedDataKey.FiscalVarianceInformation);
47
+ const fiscalDeviceStatusLine = new FiscalDeviceStatusLine(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation, fiscalVarianceInformation);
46
48
  return fiscalDeviceStatusLine;
47
49
  }
48
50
  static createFromJsonObject(transactionLineJsonObj) {
@@ -53,7 +55,8 @@ class FiscalDeviceStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
53
55
  const transactionLineReference = transactionLineJsonObj._transactionLineReference;
54
56
  const fiscalDeviceInformation = transactionLineJsonObj._fiscalDeviceInformation;
55
57
  const fiscalTransactionInformation = transactionLineJsonObj._fiscalTransactionInformation;
56
- const fiscalDeviceStatusLine = new FiscalDeviceStatusLine(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation);
58
+ const fiscalVarianceInformation = transactionLineJsonObj._fiscalVarianceInformation;
59
+ const fiscalDeviceStatusLine = new FiscalDeviceStatusLine(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation, fiscalVarianceInformation);
57
60
  fiscalDeviceStatusLine.loadFromJsonObject(transactionLineJsonObj);
58
61
  return fiscalDeviceStatusLine;
59
62
  }
@@ -75,8 +78,11 @@ class FiscalDeviceStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
75
78
  get fiscalTransactionInformation() {
76
79
  return this._fiscalTransactionInformation;
77
80
  }
81
+ get fiscalVarianceInformation() {
82
+ return this._fiscalVarianceInformation;
83
+ }
78
84
  newTransactionLine() {
79
- return new FiscalDeviceStatusLine(this.lineNumber, this.lineType, this._peripheralDeviceId, this._fiscalDeviceActivityResult, this._transactionLineReference, this._fiscalDeviceInformation, this._fiscalTransactionInformation);
85
+ return new FiscalDeviceStatusLine(this.lineNumber, this.lineType, this._peripheralDeviceId, this._fiscalDeviceActivityResult, this._transactionLineReference, this._fiscalDeviceInformation, this._fiscalTransactionInformation, this._fiscalVarianceInformation);
80
86
  }
81
87
  }
82
88
  exports.FiscalDeviceStatusLine = FiscalDeviceStatusLine;
@@ -29,6 +29,8 @@ export declare class TenderAuthorizationStatusLine extends BaseTransactionLine i
29
29
  private _actionType;
30
30
  private _originalTenderLineReferences;
31
31
  private _mappedRefundTenderTypeName;
32
+ private _mappedRefundCardTypeName;
33
+ private _excludedRefundCardTypeNames;
32
34
  private _subType;
33
35
  private readonly _isChangeProcessing;
34
36
  static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): TenderAuthorizationStatusLine;
@@ -58,8 +60,10 @@ export declare class TenderAuthorizationStatusLine extends BaseTransactionLine i
58
60
  get actionType(): ActionType;
59
61
  get subType(): TenderSubType;
60
62
  get mappedRefundTenderTypeName(): string;
63
+ get mappedRefundCardTypeName(): string;
64
+ get excludedRefundCardTypeNames(): string[];
61
65
  get isTenderAuthorizationFallback(): boolean;
62
- protected constructor(lineNumber: number, lineType: string, status: TenderAuthorizationStatus, tenderAmount: Money, authResponse: IAuthorizationResponse, failureReasonCode: TenderAuthFailureReasonCode, authorizationDeviceId: string, transactionLineReference: ITransactionLineReferenceType, forcedAuthorizationApproval: boolean, cardNumber: string, giftCardPin: string, valueCertificateNumber: string, offlineAuthorizationCode: string, offlineApprovalCode: string, tenderAuthCategory: TenderAuthCategory, tenderType: TenderType, tenderTypeName: string, entryMethod: EntryMethod, tenderReversalFailed: boolean, originalTenderLineReferences: IOriginalTransactionRefundReference[], actionType: ActionType, mappedRefundTenderTypeName: string, subType: TenderSubType, isChangeProcessing: boolean, isTenderAuthorizationFallback: boolean);
66
+ protected constructor(lineNumber: number, lineType: string, status: TenderAuthorizationStatus, tenderAmount: Money, authResponse: IAuthorizationResponse, failureReasonCode: TenderAuthFailureReasonCode, authorizationDeviceId: string, transactionLineReference: ITransactionLineReferenceType, forcedAuthorizationApproval: boolean, cardNumber: string, giftCardPin: string, valueCertificateNumber: string, offlineAuthorizationCode: string, offlineApprovalCode: string, tenderAuthCategory: TenderAuthCategory, tenderType: TenderType, tenderTypeName: string, entryMethod: EntryMethod, tenderReversalFailed: boolean, originalTenderLineReferences: IOriginalTransactionRefundReference[], actionType: ActionType, mappedRefundTenderTypeName: string, mappedRefundCardTypeName: string, excludedRefundCardTypeNames: string[], subType: TenderSubType, isChangeProcessing: boolean, isTenderAuthorizationFallback: boolean);
63
67
  protected newTransactionLine(): TenderAuthorizationStatusLine;
64
68
  }
65
69
  export declare function isTenderAuthorizationStatusLine(transactionLine: ITransactionLine): transactionLine is TenderAuthorizationStatusLine;
@@ -9,7 +9,7 @@ const Constants_1 = require("../Constants");
9
9
  const TenderType_1 = require("../TenderType");
10
10
  exports.TENDER_AUTH_STATUS_LINE_TYPE = "TenderAuthorizationStatus";
11
11
  class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
12
- constructor(lineNumber, lineType, status, tenderAmount, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, subType, isChangeProcessing, isTenderAuthorizationFallback) {
12
+ constructor(lineNumber, lineType, status, tenderAmount, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeName, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback) {
13
13
  super(lineNumber, lineType);
14
14
  this._status = status;
15
15
  this._tenderAmount = tenderAmount;
@@ -31,6 +31,8 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
31
31
  this._originalTenderLineReferences = originalTenderLineReferences;
32
32
  this._actionType = actionType;
33
33
  this._mappedRefundTenderTypeName = mappedRefundTenderTypeName;
34
+ this._mappedRefundCardTypeName = mappedRefundCardTypeName;
35
+ this._excludedRefundCardTypeNames = excludedRefundCardTypeNames;
34
36
  this._subType = subType;
35
37
  this._isChangeProcessing = isChangeProcessing;
36
38
  this._isTenderAuthorizationFallback = isTenderAuthorizationFallback;
@@ -60,10 +62,12 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
60
62
  const tenderReversalFailed = collectedData.get(Constants_1.CollectedDataKey.TenderReversalFailed);
61
63
  const actionType = collectedData.get(Constants_1.CollectedDataKey.ActionType);
62
64
  const mappedRefundTenderTypeName = collectedData.get(Constants_1.CollectedDataKey.MappedRefundTenderTypeName);
65
+ const mappedRefundCardTypeNames = collectedData.get(Constants_1.CollectedDataKey.MappedRefundCardTypeName);
66
+ const excludedRefundCardTypeNames = collectedData.get(Constants_1.CollectedDataKey.ExcludedRefundCardTypeNames);
63
67
  const subType = collectedData.get(Constants_1.CollectedDataKey.TenderSubType);
64
68
  const isChangeProcessing = collectedData.get(Constants_1.CollectedDataKey.IsChangeProcessing);
65
69
  const isTenderAuthorizationFallback = collectedData.get(Constants_1.CollectedDataKey.IsTenderFallback);
66
- return new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, subType, isChangeProcessing, isTenderAuthorizationFallback);
70
+ return new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeNames, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback);
67
71
  }
68
72
  static createFromJsonObject(transactionLineJsonObj) {
69
73
  const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
@@ -84,6 +88,8 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
84
88
  const tenderReversalFailed = transactionLineJsonObj._tenderReversalFailed;
85
89
  const actionType = transactionLineJsonObj._actionType;
86
90
  const mappedRefundTenderTypeName = transactionLineJsonObj._mappedRefundTenderTypeName;
91
+ const mappedRefundCardTypeName = transactionLineJsonObj._mappedRefundCardTypeName;
92
+ const excludedRefundCardTypeNames = transactionLineJsonObj._excludedRefundCardTypeNames;
87
93
  const subType = transactionLineJsonObj._subType;
88
94
  const isChangeProcessing = transactionLineJsonObj._isChangeProcessing;
89
95
  const isTenderAuthorizationFallback = transactionLineJsonObj._isTenderAuthorizationFallback;
@@ -105,7 +111,7 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
105
111
  }
106
112
  const status = scp_types_commerce_transaction_1.TenderAuthorizationStatus[transactionLineJsonObj._status];
107
113
  const failureReasonCode = scp_types_commerce_transaction_1.TenderAuthFailureReasonCode[transactionLineJsonObj._failureReasonCode];
108
- const tenderAuthorizationStatusLine = new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, subType, isChangeProcessing, isTenderAuthorizationFallback);
114
+ const tenderAuthorizationStatusLine = new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeName, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback);
109
115
  tenderAuthorizationStatusLine.loadFromJsonObject(transactionLineJsonObj);
110
116
  return tenderAuthorizationStatusLine;
111
117
  }
@@ -184,11 +190,17 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
184
190
  get mappedRefundTenderTypeName() {
185
191
  return this._mappedRefundTenderTypeName;
186
192
  }
193
+ get mappedRefundCardTypeName() {
194
+ return this._mappedRefundCardTypeName;
195
+ }
196
+ get excludedRefundCardTypeNames() {
197
+ return this._excludedRefundCardTypeNames;
198
+ }
187
199
  get isTenderAuthorizationFallback() {
188
200
  return this._isTenderAuthorizationFallback;
189
201
  }
190
202
  newTransactionLine() {
191
- return new TenderAuthorizationStatusLine(this.lineNumber, this.lineType, this.status, this.tenderAmount, this.authResponse, this.failureReasonCode, this.authorizationDeviceId, this.transactionLineReference, this.forcedAuthorizationApproval, this.cardNumber, this.giftCardPin, this._valueCertificateNumber, this.offlineAuthorizationCode, this.offlineApprovalCode, this.tenderAuthCategory, this._tenderType, this.tenderTypeName, this._entryMethod, this._tenderReversalFailed, this._originalTenderLineReferences, this._actionType, this._mappedRefundTenderTypeName, this._subType, this._isChangeProcessing, this._isTenderAuthorizationFallback);
203
+ return new TenderAuthorizationStatusLine(this.lineNumber, this.lineType, this.status, this.tenderAmount, this.authResponse, this.failureReasonCode, this.authorizationDeviceId, this.transactionLineReference, this.forcedAuthorizationApproval, this.cardNumber, this.giftCardPin, this._valueCertificateNumber, this.offlineAuthorizationCode, this.offlineApprovalCode, this.tenderAuthCategory, this._tenderType, this.tenderTypeName, this._entryMethod, this._tenderReversalFailed, this._originalTenderLineReferences, this._actionType, this._mappedRefundTenderTypeName, this._mappedRefundCardTypeName, this._excludedRefundCardTypeNames, this._subType, this._isChangeProcessing, this._isTenderAuthorizationFallback);
192
204
  }
193
205
  }
194
206
  exports.TenderAuthorizationStatusLine = TenderAuthorizationStatusLine;
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.27.1",
3
+ "version": "1.29.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",
@@ -83,7 +83,7 @@
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.4.0",
86
+ "@aptos-scp/scp-types-commerce-devices": "^3.6.0",
87
87
  "@aptos-scp/scp-types-commerce-transaction": "^1.63.0",
88
88
  "@aptos-scp/scp-types-core": "^1.0.5",
89
89
  "@aptos-scp/scp-types-core-config": "^2.2.1",