@aptos-scp/scp-component-store-selling-features-domain-model 1.0.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.
- package/LICENSE.md +1 -0
- package/README.md +96 -0
- package/lib/config/DiTypes.d.ts +6 -0
- package/lib/config/DiTypes.js +10 -0
- package/lib/config/ErrorCodes.d.ts +10 -0
- package/lib/config/ErrorCodes.js +14 -0
- package/lib/config/index.d.ts +3 -0
- package/lib/config/index.js +9 -0
- package/lib/config/inversify/binding-helpers.d.ts +3 -0
- package/lib/config/inversify/binding-helpers.js +7 -0
- package/lib/config/inversify/index.d.ts +3 -0
- package/lib/config/inversify/index.js +9 -0
- package/lib/config/inversify/inversify.app.config.d.ts +19 -0
- package/lib/config/inversify/inversify.app.config.js +45 -0
- package/lib/config/inversify/inversify.terminal.config/index.d.ts +1 -0
- package/lib/config/inversify/inversify.terminal.config/index.js +7 -0
- package/lib/config/inversify/inversify.terminal.config/transaction-services.config.d.ts +11 -0
- package/lib/config/inversify/inversify.terminal.config/transaction-services.config.js +30 -0
- package/lib/domain/UIBusinessEventTypes.d.ts +305 -0
- package/lib/domain/UIBusinessEventTypes.js +313 -0
- package/lib/domain/index.d.ts +5 -0
- package/lib/domain/index.js +10 -0
- package/lib/domain/model/AddressVerification.d.ts +21 -0
- package/lib/domain/model/AddressVerification.js +3 -0
- package/lib/domain/model/ApplicationControlTransaction.d.ts +13 -0
- package/lib/domain/model/ApplicationControlTransaction.js +47 -0
- package/lib/domain/model/AtcudCodePrefixData.d.ts +19 -0
- package/lib/domain/model/AtcudCodePrefixData.js +3 -0
- package/lib/domain/model/BaseLineDecorator.d.ts +83 -0
- package/lib/domain/model/BaseLineDecorator.js +216 -0
- package/lib/domain/model/BaseTransactionLine.d.ts +71 -0
- package/lib/domain/model/BaseTransactionLine.js +183 -0
- package/lib/domain/model/CashDrawerDetail.d.ts +21 -0
- package/lib/domain/model/CashDrawerDetail.js +3 -0
- package/lib/domain/model/Constants.d.ts +977 -0
- package/lib/domain/model/Constants.js +985 -0
- package/lib/domain/model/CorruptedTransaction.d.ts +16 -0
- package/lib/domain/model/CorruptedTransaction.js +58 -0
- package/lib/domain/model/Coupon.d.ts +8 -0
- package/lib/domain/model/Coupon.js +3 -0
- package/lib/domain/model/CreateEinvoiceLine.d.ts +32 -0
- package/lib/domain/model/CreateEinvoiceLine.js +71 -0
- package/lib/domain/model/Customer.d.ts +387 -0
- package/lib/domain/model/Customer.js +320 -0
- package/lib/domain/model/CustomerServiceTransaction.d.ts +12 -0
- package/lib/domain/model/CustomerServiceTransaction.js +39 -0
- package/lib/domain/model/Department.d.ts +15 -0
- package/lib/domain/model/Department.js +3 -0
- package/lib/domain/model/EmailVerification.d.ts +24 -0
- package/lib/domain/model/EmailVerification.js +35 -0
- package/lib/domain/model/Employee.d.ts +80 -0
- package/lib/domain/model/Employee.js +73 -0
- package/lib/domain/model/EndOfTransactionTenderingSession.d.ts +39 -0
- package/lib/domain/model/EndOfTransactionTenderingSession.js +89 -0
- package/lib/domain/model/ExchangeRates.d.ts +13 -0
- package/lib/domain/model/ExchangeRates.js +8 -0
- package/lib/domain/model/FiscalControlTransaction.d.ts +12 -0
- package/lib/domain/model/FiscalControlTransaction.js +43 -0
- package/lib/domain/model/FulfillmentGroup.d.ts +35 -0
- package/lib/domain/model/FulfillmentGroup.js +137 -0
- package/lib/domain/model/IAppLocalFeaturesStorage.d.ts +78 -0
- package/lib/domain/model/IAppLocalFeaturesStorage.js +3 -0
- package/lib/domain/model/ICreateEinvoiceLine.d.ts +9 -0
- package/lib/domain/model/ICreateEinvoiceLine.js +3 -0
- package/lib/domain/model/IEmployeeDiscount.d.ts +15 -0
- package/lib/domain/model/IEmployeeDiscount.js +3 -0
- package/lib/domain/model/IFiscalTransactionNumberMaintainer.d.ts +10 -0
- package/lib/domain/model/IFiscalTransactionNumberMaintainer.js +8 -0
- package/lib/domain/model/IInvoiceOperation.d.ts +10 -0
- package/lib/domain/model/IInvoiceOperation.js +8 -0
- package/lib/domain/model/ILastRetailTransactionInfo.d.ts +13 -0
- package/lib/domain/model/ILastRetailTransactionInfo.js +3 -0
- package/lib/domain/model/ILastTransactionStatus.d.ts +5 -0
- package/lib/domain/model/ILastTransactionStatus.js +3 -0
- package/lib/domain/model/ILoyaltyVoucher.d.ts +28 -0
- package/lib/domain/model/ILoyaltyVoucher.js +9 -0
- package/lib/domain/model/IPrinterInfo.d.ts +6 -0
- package/lib/domain/model/IPrinterInfo.js +3 -0
- package/lib/domain/model/ISequence.d.ts +8 -0
- package/lib/domain/model/ISequence.js +3 -0
- package/lib/domain/model/IServiceResultLine.d.ts +4 -0
- package/lib/domain/model/IServiceResultLine.js +3 -0
- package/lib/domain/model/ISingleUseCoupon.d.ts +22 -0
- package/lib/domain/model/ISingleUseCoupon.js +38 -0
- package/lib/domain/model/ITransactionMetadataPersistanceObject.d.ts +12 -0
- package/lib/domain/model/ITransactionMetadataPersistanceObject.js +3 -0
- package/lib/domain/model/Inventory.d.ts +156 -0
- package/lib/domain/model/Inventory.js +78 -0
- package/lib/domain/model/ItemHandlingSession.d.ts +40 -0
- package/lib/domain/model/ItemHandlingSession.js +131 -0
- package/lib/domain/model/LoyaltyMembership.d.ts +153 -0
- package/lib/domain/model/LoyaltyMembership.js +23 -0
- package/lib/domain/model/MerchandiseTransaction.d.ts +310 -0
- package/lib/domain/model/MerchandiseTransaction.js +1299 -0
- package/lib/domain/model/MetricsLogs.d.ts +41 -0
- package/lib/domain/model/MetricsLogs.js +3 -0
- package/lib/domain/model/MunicipalFiscalCode.d.ts +25 -0
- package/lib/domain/model/MunicipalFiscalCode.js +3 -0
- package/lib/domain/model/NoSaleTransaction.d.ts +13 -0
- package/lib/domain/model/NoSaleTransaction.js +49 -0
- package/lib/domain/model/Order.d.ts +67 -0
- package/lib/domain/model/Order.js +190 -0
- package/lib/domain/model/OrderTotals.d.ts +44 -0
- package/lib/domain/model/OrderTotals.js +76 -0
- package/lib/domain/model/Organization.d.ts +99 -0
- package/lib/domain/model/Organization.js +3 -0
- package/lib/domain/model/PrepaidTender.d.ts +14 -0
- package/lib/domain/model/PrepaidTender.js +3 -0
- package/lib/domain/model/ReceiptSession.d.ts +87 -0
- package/lib/domain/model/ReceiptSession.js +206 -0
- package/lib/domain/model/ReprintReceiptTransaction.d.ts +49 -0
- package/lib/domain/model/ReprintReceiptTransaction.js +179 -0
- package/lib/domain/model/ResumeTransactionSession.d.ts +22 -0
- package/lib/domain/model/ResumeTransactionSession.js +56 -0
- package/lib/domain/model/RetailTransaction.d.ts +127 -0
- package/lib/domain/model/RetailTransaction.js +556 -0
- package/lib/domain/model/Sendsale.d.ts +4 -0
- package/lib/domain/model/Sendsale.js +3 -0
- package/lib/domain/model/StoreItem.d.ts +175 -0
- package/lib/domain/model/StoreItem.js +750 -0
- package/lib/domain/model/StoredValueCardSession.d.ts +29 -0
- package/lib/domain/model/StoredValueCardSession.js +65 -0
- package/lib/domain/model/StoredValueCertificateSession.d.ts +47 -0
- package/lib/domain/model/StoredValueCertificateSession.js +153 -0
- package/lib/domain/model/SubscriptionTokenSession.d.ts +22 -0
- package/lib/domain/model/SubscriptionTokenSession.js +60 -0
- package/lib/domain/model/Subscriptions.d.ts +12 -0
- package/lib/domain/model/Subscriptions.js +3 -0
- package/lib/domain/model/TaxRefundControlTransaction.d.ts +13 -0
- package/lib/domain/model/TaxRefundControlTransaction.js +50 -0
- package/lib/domain/model/TenderAuthorizationSession.d.ts +102 -0
- package/lib/domain/model/TenderAuthorizationSession.js +337 -0
- package/lib/domain/model/TenderControlTransaction.d.ts +30 -0
- package/lib/domain/model/TenderControlTransaction.js +138 -0
- package/lib/domain/model/TenderHandlingSession.d.ts +100 -0
- package/lib/domain/model/TenderHandlingSession.js +379 -0
- package/lib/domain/model/TenderType.d.ts +161 -0
- package/lib/domain/model/TenderType.js +1317 -0
- package/lib/domain/model/TerminalControlTransaction.d.ts +14 -0
- package/lib/domain/model/TerminalControlTransaction.js +55 -0
- package/lib/domain/model/TerminalSession.d.ts +49 -0
- package/lib/domain/model/TerminalSession.js +122 -0
- package/lib/domain/model/TillControlTransaction.d.ts +20 -0
- package/lib/domain/model/TillControlTransaction.js +79 -0
- package/lib/domain/model/TillSession.d.ts +67 -0
- package/lib/domain/model/TillSession.js +222 -0
- package/lib/domain/model/TransactionFlowState.d.ts +26 -0
- package/lib/domain/model/TransactionFlowState.js +72 -0
- package/lib/domain/model/TransactionReferenceLine.d.ts +112 -0
- package/lib/domain/model/TransactionReferenceLine.js +323 -0
- package/lib/domain/model/User.d.ts +115 -0
- package/lib/domain/model/User.js +210 -0
- package/lib/domain/model/UserSession.d.ts +36 -0
- package/lib/domain/model/UserSession.js +186 -0
- package/lib/domain/model/UserTransaction.d.ts +12 -0
- package/lib/domain/model/UserTransaction.js +38 -0
- package/lib/domain/model/VoidInterfaces.d.ts +15 -0
- package/lib/domain/model/VoidInterfaces.js +23 -0
- package/lib/domain/model/cashDrawer/CashDrawerRequestLine.d.ts +17 -0
- package/lib/domain/model/cashDrawer/CashDrawerRequestLine.js +50 -0
- package/lib/domain/model/cashDrawer/CashDrawerSession.d.ts +67 -0
- package/lib/domain/model/cashDrawer/CashDrawerSession.js +211 -0
- package/lib/domain/model/cashDrawer/CashDrawerStatusChangeLine.d.ts +30 -0
- package/lib/domain/model/cashDrawer/CashDrawerStatusChangeLine.js +86 -0
- package/lib/domain/model/cashDrawer/ICashDrawerRequestLine.d.ts +6 -0
- package/lib/domain/model/cashDrawer/ICashDrawerRequestLine.js +3 -0
- package/lib/domain/model/cashDrawer/ICashDrawerStatusChangeLine.d.ts +13 -0
- package/lib/domain/model/cashDrawer/ICashDrawerStatusChangeLine.js +3 -0
- package/lib/domain/model/cashDrawer/index.d.ts +5 -0
- package/lib/domain/model/cashDrawer/index.js +9 -0
- package/lib/domain/model/configuration/ConfigurationUtils.d.ts +3 -0
- package/lib/domain/model/configuration/ConfigurationUtils.js +8 -0
- package/lib/domain/model/configuration/DataEntryRule.d.ts +31 -0
- package/lib/domain/model/configuration/DataEntryRule.js +303 -0
- package/lib/domain/model/configuration/I18nReceiptFormattingInterface.d.ts +38 -0
- package/lib/domain/model/configuration/I18nReceiptFormattingInterface.js +3 -0
- package/lib/domain/model/configuration/I18nTaxFreeConfig.d.ts +11 -0
- package/lib/domain/model/configuration/I18nTaxFreeConfig.js +3 -0
- package/lib/domain/model/configuration/IAccessPolicyConfig.d.ts +5 -0
- package/lib/domain/model/configuration/IAccessPolicyConfig.js +3 -0
- package/lib/domain/model/configuration/IAdapterPoliciesConfig.d.ts +24 -0
- package/lib/domain/model/configuration/IAdapterPoliciesConfig.js +13 -0
- package/lib/domain/model/configuration/IConditionalAttributeBehaviorRuleConfig.d.ts +32 -0
- package/lib/domain/model/configuration/IConditionalAttributeBehaviorRuleConfig.js +8 -0
- package/lib/domain/model/configuration/ICustomerConfig.d.ts +31 -0
- package/lib/domain/model/configuration/ICustomerConfig.js +15 -0
- package/lib/domain/model/configuration/IDataEntryRuleConfig.d.ts +66 -0
- package/lib/domain/model/configuration/IDataEntryRuleConfig.js +22 -0
- package/lib/domain/model/configuration/IDiscountAttributesConfig .d.ts +26 -0
- package/lib/domain/model/configuration/IDiscountAttributesConfig .js +8 -0
- package/lib/domain/model/configuration/IDiscountBehaviorsConfig.d.ts +27 -0
- package/lib/domain/model/configuration/IDiscountBehaviorsConfig.js +21 -0
- package/lib/domain/model/configuration/IDonationBehaviorsConfig.d.ts +9 -0
- package/lib/domain/model/configuration/IDonationBehaviorsConfig.js +3 -0
- package/lib/domain/model/configuration/IFeatureAccessConfig.d.ts +186 -0
- package/lib/domain/model/configuration/IFeatureAccessConfig.js +51 -0
- package/lib/domain/model/configuration/IFeesConfig.d.ts +109 -0
- package/lib/domain/model/configuration/IFeesConfig.js +86 -0
- package/lib/domain/model/configuration/IPrinterTypeConfig.d.ts +25 -0
- package/lib/domain/model/configuration/IPrinterTypeConfig.js +3 -0
- package/lib/domain/model/configuration/IProductInquiryBehaviorsConfig.d.ts +8 -0
- package/lib/domain/model/configuration/IProductInquiryBehaviorsConfig.js +8 -0
- package/lib/domain/model/configuration/IReasonCodesConfig.d.ts +16 -0
- package/lib/domain/model/configuration/IReasonCodesConfig.js +3 -0
- package/lib/domain/model/configuration/IReceiptConfig.d.ts +64 -0
- package/lib/domain/model/configuration/IReceiptConfig.js +24 -0
- package/lib/domain/model/configuration/IReceiptFormattingConfig.d.ts +155 -0
- package/lib/domain/model/configuration/IReceiptFormattingConfig.js +27 -0
- package/lib/domain/model/configuration/IReceiptStylingConfig.d.ts +52 -0
- package/lib/domain/model/configuration/IReceiptStylingConfig.js +18 -0
- package/lib/domain/model/configuration/IReserveInventoryConfig.d.ts +4 -0
- package/lib/domain/model/configuration/IReserveInventoryConfig.js +8 -0
- package/lib/domain/model/configuration/ISelfCheckoutModeBehaviorsConfig.d.ts +14 -0
- package/lib/domain/model/configuration/ISelfCheckoutModeBehaviorsConfig.js +3 -0
- package/lib/domain/model/configuration/ISequenceConfig.d.ts +44 -0
- package/lib/domain/model/configuration/ISequenceConfig.js +26 -0
- package/lib/domain/model/configuration/IStoreOperationsBehavior.d.ts +7 -0
- package/lib/domain/model/configuration/IStoreOperationsBehavior.js +8 -0
- package/lib/domain/model/configuration/IStoreShippingMethodConfig.d.ts +21 -0
- package/lib/domain/model/configuration/IStoreShippingMethodConfig.js +3 -0
- package/lib/domain/model/configuration/ITaxBehaviorConfig.d.ts +14 -0
- package/lib/domain/model/configuration/ITaxBehaviorConfig.js +3 -0
- package/lib/domain/model/configuration/ITaxRefundConfig.d.ts +8 -0
- package/lib/domain/model/configuration/ITaxRefundConfig.js +3 -0
- package/lib/domain/model/configuration/ITendersConfig.d.ts +88 -0
- package/lib/domain/model/configuration/ITendersConfig.js +22 -0
- package/lib/domain/model/configuration/Ii18n.d.ts +4 -0
- package/lib/domain/model/configuration/Ii18n.js +3 -0
- package/lib/domain/model/configuration/TaxLottery.d.ts +4 -0
- package/lib/domain/model/configuration/TaxLottery.js +8 -0
- package/lib/domain/model/configuration/index.d.ts +30 -0
- package/lib/domain/model/configuration/index.js +25 -0
- package/lib/domain/model/customer/CreateCustomerLine.d.ts +151 -0
- package/lib/domain/model/customer/CreateCustomerLine.js +312 -0
- package/lib/domain/model/customer/CustomerLine.d.ts +43 -0
- package/lib/domain/model/customer/CustomerLine.js +109 -0
- package/lib/domain/model/customer/ICreateCustomerLine.d.ts +16 -0
- package/lib/domain/model/customer/ICreateCustomerLine.js +3 -0
- package/lib/domain/model/customer/ICustomerI18nFormats.d.ts +126 -0
- package/lib/domain/model/customer/ICustomerI18nFormats.js +67 -0
- package/lib/domain/model/customer/ICustomerLine.d.ts +8 -0
- package/lib/domain/model/customer/ICustomerLine.js +3 -0
- package/lib/domain/model/customer/ITaxCustomerLine.d.ts +46 -0
- package/lib/domain/model/customer/ITaxCustomerLine.js +3 -0
- package/lib/domain/model/customer/IUpdateCustomerLine.d.ts +30 -0
- package/lib/domain/model/customer/IUpdateCustomerLine.js +3 -0
- package/lib/domain/model/customer/TaxCustomerLine.d.ts +105 -0
- package/lib/domain/model/customer/TaxCustomerLine.js +252 -0
- package/lib/domain/model/customer/UpdateCustomerLine.d.ts +148 -0
- package/lib/domain/model/customer/UpdateCustomerLine.js +296 -0
- package/lib/domain/model/customer/index.d.ts +9 -0
- package/lib/domain/model/customer/index.js +11 -0
- package/lib/domain/model/digitalSignature/DigitalSignatureFailureLine.d.ts +11 -0
- package/lib/domain/model/digitalSignature/DigitalSignatureFailureLine.js +33 -0
- package/lib/domain/model/digitalSignature/index.d.ts +1 -0
- package/lib/domain/model/digitalSignature/index.js +7 -0
- package/lib/domain/model/discounts/BaseManualDiscountLine.d.ts +119 -0
- package/lib/domain/model/discounts/BaseManualDiscountLine.js +435 -0
- package/lib/domain/model/discounts/BaseManualDiscountLineDecorator.d.ts +42 -0
- package/lib/domain/model/discounts/BaseManualDiscountLineDecorator.js +107 -0
- package/lib/domain/model/discounts/BasePromotionCouponLine.d.ts +22 -0
- package/lib/domain/model/discounts/BasePromotionCouponLine.js +45 -0
- package/lib/domain/model/discounts/BasePromotionCouponLineDecorator.d.ts +15 -0
- package/lib/domain/model/discounts/BasePromotionCouponLineDecorator.js +38 -0
- package/lib/domain/model/discounts/ExpiredCouponOverrideLine.d.ts +27 -0
- package/lib/domain/model/discounts/ExpiredCouponOverrideLine.js +54 -0
- package/lib/domain/model/discounts/IManualDiscountLine.d.ts +33 -0
- package/lib/domain/model/discounts/IManualDiscountLine.js +3 -0
- package/lib/domain/model/discounts/IPromotionCouponLine.d.ts +10 -0
- package/lib/domain/model/discounts/IPromotionCouponLine.js +3 -0
- package/lib/domain/model/discounts/LoyaltyActivityDiscountLineTotalDecorator.d.ts +15 -0
- package/lib/domain/model/discounts/LoyaltyActivityDiscountLineTotalDecorator.js +32 -0
- package/lib/domain/model/discounts/LoyaltyDiscountLine.d.ts +52 -0
- package/lib/domain/model/discounts/LoyaltyDiscountLine.js +131 -0
- package/lib/domain/model/discounts/LoyaltyDiscountLineTotalDecorator.d.ts +26 -0
- package/lib/domain/model/discounts/LoyaltyDiscountLineTotalDecorator.js +66 -0
- package/lib/domain/model/discounts/ManualDiscountLineModificationDecorator.d.ts +49 -0
- package/lib/domain/model/discounts/ManualDiscountLineModificationDecorator.js +143 -0
- package/lib/domain/model/discounts/ManualDiscountLineTotalDecorator.d.ts +15 -0
- package/lib/domain/model/discounts/ManualDiscountLineTotalDecorator.js +32 -0
- package/lib/domain/model/discounts/ManualItemDiscountLine.d.ts +27 -0
- package/lib/domain/model/discounts/ManualItemDiscountLine.js +53 -0
- package/lib/domain/model/discounts/ManualTransactionDiscountLine.d.ts +22 -0
- package/lib/domain/model/discounts/ManualTransactionDiscountLine.js +40 -0
- package/lib/domain/model/discounts/ModifyManualDiscountLine.d.ts +29 -0
- package/lib/domain/model/discounts/ModifyManualDiscountLine.js +62 -0
- package/lib/domain/model/discounts/PromotionCouponLine.d.ts +22 -0
- package/lib/domain/model/discounts/PromotionCouponLine.js +59 -0
- package/lib/domain/model/discounts/VoidedDiscountLineDecorator.d.ts +15 -0
- package/lib/domain/model/discounts/VoidedDiscountLineDecorator.js +38 -0
- package/lib/domain/model/discounts/VoidedLoyaltyDiscountLineDecorator.d.ts +18 -0
- package/lib/domain/model/discounts/VoidedLoyaltyDiscountLineDecorator.js +46 -0
- package/lib/domain/model/discounts/VoidedPromotionCouponLineDecorator.d.ts +13 -0
- package/lib/domain/model/discounts/VoidedPromotionCouponLineDecorator.js +32 -0
- package/lib/domain/model/discounts/employee/EmployeeDiscountLine.d.ts +17 -0
- package/lib/domain/model/discounts/employee/EmployeeDiscountLine.js +43 -0
- package/lib/domain/model/discounts/employee/index.d.ts +1 -0
- package/lib/domain/model/discounts/employee/index.js +7 -0
- package/lib/domain/model/discounts/index.d.ts +19 -0
- package/lib/domain/model/discounts/index.js +23 -0
- package/lib/domain/model/discounts/lineTypes.d.ts +12 -0
- package/lib/domain/model/discounts/lineTypes.js +30 -0
- package/lib/domain/model/donation/BaseDonationLineDecorator.d.ts +16 -0
- package/lib/domain/model/donation/BaseDonationLineDecorator.js +38 -0
- package/lib/domain/model/donation/DonationLine.d.ts +43 -0
- package/lib/domain/model/donation/DonationLine.js +102 -0
- package/lib/domain/model/donation/IDonationLine.d.ts +9 -0
- package/lib/domain/model/donation/IDonationLine.js +3 -0
- package/lib/domain/model/donation/VoidedDonationLineDecorator.d.ts +17 -0
- package/lib/domain/model/donation/VoidedDonationLineDecorator.js +43 -0
- package/lib/domain/model/donation/index.d.ts +4 -0
- package/lib/domain/model/donation/index.js +9 -0
- package/lib/domain/model/employeeCustomer/BaseEmployeeCustomerLineDecorator.d.ts +13 -0
- package/lib/domain/model/employeeCustomer/BaseEmployeeCustomerLineDecorator.js +32 -0
- package/lib/domain/model/employeeCustomer/EmployeeCustomerLine.d.ts +39 -0
- package/lib/domain/model/employeeCustomer/EmployeeCustomerLine.js +98 -0
- package/lib/domain/model/employeeCustomer/IEmployeeCustomerLine.d.ts +8 -0
- package/lib/domain/model/employeeCustomer/IEmployeeCustomerLine.js +3 -0
- package/lib/domain/model/employeeCustomer/VoidedEmployeeCustomerLineDecorator.d.ts +15 -0
- package/lib/domain/model/employeeCustomer/VoidedEmployeeCustomerLineDecorator.js +38 -0
- package/lib/domain/model/employeeCustomer/index.d.ts +4 -0
- package/lib/domain/model/employeeCustomer/index.js +9 -0
- package/lib/domain/model/extensibilityForm/ExtensibilityFormDataLine.d.ts +26 -0
- package/lib/domain/model/extensibilityForm/ExtensibilityFormDataLine.js +74 -0
- package/lib/domain/model/extensibilityForm/IExtensibilityForm.d.ts +8 -0
- package/lib/domain/model/extensibilityForm/IExtensibilityForm.js +3 -0
- package/lib/domain/model/extensibilityForm/index.d.ts +2 -0
- package/lib/domain/model/extensibilityForm/index.js +7 -0
- package/lib/domain/model/fee/BaseFeeLineDecorator.d.ts +68 -0
- package/lib/domain/model/fee/BaseFeeLineDecorator.js +194 -0
- package/lib/domain/model/fee/FeeLine.d.ts +179 -0
- package/lib/domain/model/fee/FeeLine.js +660 -0
- package/lib/domain/model/fee/FeeLineBaseTaxAdjustmentDecorator.d.ts +18 -0
- package/lib/domain/model/fee/FeeLineBaseTaxAdjustmentDecorator.js +52 -0
- package/lib/domain/model/fee/FeeLineChangeQuantityDecorator.d.ts +14 -0
- package/lib/domain/model/fee/FeeLineChangeQuantityDecorator.js +35 -0
- package/lib/domain/model/fee/FeeLineExtendedAmountDecorator.d.ts +38 -0
- package/lib/domain/model/fee/FeeLineExtendedAmountDecorator.js +134 -0
- package/lib/domain/model/fee/FeeLineOriginalPricingAdjustmentDecorator.d.ts +22 -0
- package/lib/domain/model/fee/FeeLineOriginalPricingAdjustmentDecorator.js +82 -0
- package/lib/domain/model/fee/FeeLinePricingExtendedAmountDecorator.d.ts +22 -0
- package/lib/domain/model/fee/FeeLinePricingExtendedAmountDecorator.js +82 -0
- package/lib/domain/model/fee/FeeLineTaxExemptDecorator.d.ts +24 -0
- package/lib/domain/model/fee/FeeLineTaxExemptDecorator.js +67 -0
- package/lib/domain/model/fee/FeeLineTaxOverrideDecorator.d.ts +21 -0
- package/lib/domain/model/fee/FeeLineTaxOverrideDecorator.js +63 -0
- package/lib/domain/model/fee/FeeQuantityChangeLine.d.ts +19 -0
- package/lib/domain/model/fee/FeeQuantityChangeLine.js +52 -0
- package/lib/domain/model/fee/IFeeLine.d.ts +104 -0
- package/lib/domain/model/fee/IFeeLine.js +3 -0
- package/lib/domain/model/fee/VoidedFeeLineDecorator.d.ts +15 -0
- package/lib/domain/model/fee/VoidedFeeLineDecorator.js +38 -0
- package/lib/domain/model/fee/index.d.ts +12 -0
- package/lib/domain/model/fee/index.js +17 -0
- package/lib/domain/model/fiscalDevice/FiscalDeviceManagementLine.d.ts +34 -0
- package/lib/domain/model/fiscalDevice/FiscalDeviceManagementLine.js +69 -0
- package/lib/domain/model/fiscalDevice/FiscalDeviceManagementRetryLine.d.ts +15 -0
- package/lib/domain/model/fiscalDevice/FiscalDeviceManagementRetryLine.js +45 -0
- package/lib/domain/model/fiscalDevice/FiscalDeviceStatusLine.d.ts +35 -0
- package/lib/domain/model/fiscalDevice/FiscalDeviceStatusLine.js +87 -0
- package/lib/domain/model/fiscalDevice/index.d.ts +3 -0
- package/lib/domain/model/fiscalDevice/index.js +9 -0
- package/lib/domain/model/foreignCurrency/ExchangeRateManualEntryLine.d.ts +29 -0
- package/lib/domain/model/foreignCurrency/ExchangeRateManualEntryLine.js +67 -0
- package/lib/domain/model/foreignCurrency/index.d.ts +1 -0
- package/lib/domain/model/foreignCurrency/index.js +7 -0
- package/lib/domain/model/geoLocation.d.ts +23 -0
- package/lib/domain/model/geoLocation.js +3 -0
- package/lib/domain/model/giftCard/BalanceInquiryLine.d.ts +34 -0
- package/lib/domain/model/giftCard/BalanceInquiryLine.js +86 -0
- package/lib/domain/model/giftCard/index.d.ts +1 -0
- package/lib/domain/model/giftCard/index.js +7 -0
- package/lib/domain/model/index.d.ts +108 -0
- package/lib/domain/model/index.js +95 -0
- package/lib/domain/model/inventory/ReserveInventoryLine.d.ts +32 -0
- package/lib/domain/model/inventory/ReserveInventoryLine.js +76 -0
- package/lib/domain/model/inventory/index.d.ts +1 -0
- package/lib/domain/model/inventory/index.js +7 -0
- package/lib/domain/model/item/BaseItemLineDecorator.d.ts +148 -0
- package/lib/domain/model/item/BaseItemLineDecorator.js +400 -0
- package/lib/domain/model/item/BasePriceChangeLineDecorator.d.ts +20 -0
- package/lib/domain/model/item/BasePriceChangeLineDecorator.js +50 -0
- package/lib/domain/model/item/IAllLinePricingAdjustments.d.ts +32 -0
- package/lib/domain/model/item/IAllLinePricingAdjustments.js +66 -0
- package/lib/domain/model/item/IHardSoftStopItemInfo.d.ts +11 -0
- package/lib/domain/model/item/IHardSoftStopItemInfo.js +3 -0
- package/lib/domain/model/item/IItemLine.d.ts +313 -0
- package/lib/domain/model/item/IItemLine.js +7 -0
- package/lib/domain/model/item/ISerializedPriceCalculationResultsWithSource.d.ts +45 -0
- package/lib/domain/model/item/ISerializedPriceCalculationResultsWithSource.js +3 -0
- package/lib/domain/model/item/ItemLine.d.ts +303 -0
- package/lib/domain/model/item/ItemLine.js +1169 -0
- package/lib/domain/model/item/ItemLineBaseDiscountDecorator.d.ts +75 -0
- package/lib/domain/model/item/ItemLineBaseDiscountDecorator.js +178 -0
- package/lib/domain/model/item/ItemLineBaseTaxAdjustmentDecorator.d.ts +19 -0
- package/lib/domain/model/item/ItemLineBaseTaxAdjustmentDecorator.js +51 -0
- package/lib/domain/model/item/ItemLineCommentReceiptDecorator.d.ts +17 -0
- package/lib/domain/model/item/ItemLineCommentReceiptDecorator.js +40 -0
- package/lib/domain/model/item/ItemLineExtendedAmountDecorator.d.ts +30 -0
- package/lib/domain/model/item/ItemLineExtendedAmountDecorator.js +124 -0
- package/lib/domain/model/item/ItemLineExtensibilityFormDataDecorator.d.ts +18 -0
- package/lib/domain/model/item/ItemLineExtensibilityFormDataDecorator.js +43 -0
- package/lib/domain/model/item/ItemLineGiftIssueDecorator.d.ts +17 -0
- package/lib/domain/model/item/ItemLineGiftIssueDecorator.js +53 -0
- package/lib/domain/model/item/ItemLineGiftReceiptDecorator.d.ts +15 -0
- package/lib/domain/model/item/ItemLineGiftReceiptDecorator.js +37 -0
- package/lib/domain/model/item/ItemLineManualDiscountDecorator.d.ts +57 -0
- package/lib/domain/model/item/ItemLineManualDiscountDecorator.js +198 -0
- package/lib/domain/model/item/ItemLineNonFinancialRewardDecorator.d.ts +40 -0
- package/lib/domain/model/item/ItemLineNonFinancialRewardDecorator.js +116 -0
- package/lib/domain/model/item/ItemLineOriginalAdjustmentDecorator.d.ts +13 -0
- package/lib/domain/model/item/ItemLineOriginalAdjustmentDecorator.js +54 -0
- package/lib/domain/model/item/ItemLinePriceChangeDecorator.d.ts +18 -0
- package/lib/domain/model/item/ItemLinePriceChangeDecorator.js +47 -0
- package/lib/domain/model/item/ItemLinePromotionDecorator.d.ts +45 -0
- package/lib/domain/model/item/ItemLinePromotionDecorator.js +142 -0
- package/lib/domain/model/item/ItemLineQuantityChangeDecorator.d.ts +18 -0
- package/lib/domain/model/item/ItemLineQuantityChangeDecorator.js +57 -0
- package/lib/domain/model/item/ItemLineReasonCodeChangeDecorator.d.ts +16 -0
- package/lib/domain/model/item/ItemLineReasonCodeChangeDecorator.js +49 -0
- package/lib/domain/model/item/ItemLineRegularPriceDecorator.d.ts +21 -0
- package/lib/domain/model/item/ItemLineRegularPriceDecorator.js +58 -0
- package/lib/domain/model/item/ItemLineReserveInventoryDecorator.d.ts +17 -0
- package/lib/domain/model/item/ItemLineReserveInventoryDecorator.js +42 -0
- package/lib/domain/model/item/ItemLineRewardDecorator.d.ts +39 -0
- package/lib/domain/model/item/ItemLineRewardDecorator.js +115 -0
- package/lib/domain/model/item/ItemLineSalePriceDecorator.d.ts +19 -0
- package/lib/domain/model/item/ItemLineSalePriceDecorator.js +51 -0
- package/lib/domain/model/item/ItemLineSalespersonDecorator.d.ts +17 -0
- package/lib/domain/model/item/ItemLineSalespersonDecorator.js +44 -0
- package/lib/domain/model/item/ItemLineSendSaleDecorator.d.ts +16 -0
- package/lib/domain/model/item/ItemLineSendSaleDecorator.js +39 -0
- package/lib/domain/model/item/ItemLineSubscriptionDecorator.d.ts +17 -0
- package/lib/domain/model/item/ItemLineSubscriptionDecorator.js +40 -0
- package/lib/domain/model/item/ItemLineTaxExemptDecorator.d.ts +21 -0
- package/lib/domain/model/item/ItemLineTaxExemptDecorator.js +64 -0
- package/lib/domain/model/item/ItemLineTaxOverrideDecorator.d.ts +19 -0
- package/lib/domain/model/item/ItemLineTaxOverrideDecorator.js +59 -0
- package/lib/domain/model/item/ItemOrderCancellationLine.d.ts +27 -0
- package/lib/domain/model/item/ItemOrderCancellationLine.js +65 -0
- package/lib/domain/model/item/ItemPriceChangeLine.d.ts +44 -0
- package/lib/domain/model/item/ItemPriceChangeLine.js +131 -0
- package/lib/domain/model/item/ItemQuantityChangeLine.d.ts +31 -0
- package/lib/domain/model/item/ItemQuantityChangeLine.js +93 -0
- package/lib/domain/model/item/ReasonCodeChangeLine.d.ts +32 -0
- package/lib/domain/model/item/ReasonCodeChangeLine.js +83 -0
- package/lib/domain/model/item/ReservedOrderItemLineCancellationDecorator.d.ts +19 -0
- package/lib/domain/model/item/ReservedOrderItemLineCancellationDecorator.js +52 -0
- package/lib/domain/model/item/VoidedItemLineDecorator.d.ts +28 -0
- package/lib/domain/model/item/VoidedItemLineDecorator.js +65 -0
- package/lib/domain/model/item/VoidedPriceChangeLineDecorator.d.ts +15 -0
- package/lib/domain/model/item/VoidedPriceChangeLineDecorator.js +38 -0
- package/lib/domain/model/item/index.d.ts +37 -0
- package/lib/domain/model/item/index.js +41 -0
- package/lib/domain/model/lottery/TaxLotteryAddLine.d.ts +24 -0
- package/lib/domain/model/lottery/TaxLotteryAddLine.js +54 -0
- package/lib/domain/model/lottery/TaxLotteryModificationLine.d.ts +26 -0
- package/lib/domain/model/lottery/TaxLotteryModificationLine.js +61 -0
- package/lib/domain/model/lottery/TaxLotteryVoidLine.d.ts +28 -0
- package/lib/domain/model/lottery/TaxLotteryVoidLine.js +66 -0
- package/lib/domain/model/lottery/index.d.ts +3 -0
- package/lib/domain/model/lottery/index.js +9 -0
- package/lib/domain/model/loyaltyMembership/LoyaltyEnrollmentLine.d.ts +46 -0
- package/lib/domain/model/loyaltyMembership/LoyaltyEnrollmentLine.js +105 -0
- package/lib/domain/model/loyaltyMembership/LoyaltyMembershipLine.d.ts +34 -0
- package/lib/domain/model/loyaltyMembership/LoyaltyMembershipLine.js +117 -0
- package/lib/domain/model/loyaltyMembership/index.d.ts +2 -0
- package/lib/domain/model/loyaltyMembership/index.js +8 -0
- package/lib/domain/model/mixedBasket/IMixedBasket.d.ts +4 -0
- package/lib/domain/model/mixedBasket/IMixedBasket.js +3 -0
- package/lib/domain/model/mixedBasket/MixedBasketSession.d.ts +21 -0
- package/lib/domain/model/mixedBasket/MixedBasketSession.js +55 -0
- package/lib/domain/model/mixedBasket/index.d.ts +2 -0
- package/lib/domain/model/mixedBasket/index.js +7 -0
- package/lib/domain/model/noSale/NoSaleLine.d.ts +32 -0
- package/lib/domain/model/noSale/NoSaleLine.js +75 -0
- package/lib/domain/model/noSale/StartNoSaleLine.d.ts +33 -0
- package/lib/domain/model/noSale/StartNoSaleLine.js +75 -0
- package/lib/domain/model/noSale/index.d.ts +2 -0
- package/lib/domain/model/noSale/index.js +8 -0
- package/lib/domain/model/order/IOrderTotalsAccumulator.d.ts +23 -0
- package/lib/domain/model/order/IOrderTotalsAccumulator.js +3 -0
- package/lib/domain/model/order/OrderDeliveryAssignmentLine.d.ts +20 -0
- package/lib/domain/model/order/OrderDeliveryAssignmentLine.js +64 -0
- package/lib/domain/model/order/OrderItemReference.d.ts +5 -0
- package/lib/domain/model/order/OrderItemReference.js +3 -0
- package/lib/domain/model/order/OrderTotalsAccumulator.d.ts +39 -0
- package/lib/domain/model/order/OrderTotalsAccumulator.js +48 -0
- package/lib/domain/model/order/index.d.ts +4 -0
- package/lib/domain/model/order/index.js +8 -0
- package/lib/domain/model/paidOperation/PaidOperationLine.d.ts +23 -0
- package/lib/domain/model/paidOperation/PaidOperationLine.js +65 -0
- package/lib/domain/model/paidOperation/PaidOperationSignatureLine.d.ts +27 -0
- package/lib/domain/model/paidOperation/PaidOperationSignatureLine.js +58 -0
- package/lib/domain/model/paidOperation/StartPaidOperationLine.d.ts +34 -0
- package/lib/domain/model/paidOperation/StartPaidOperationLine.js +75 -0
- package/lib/domain/model/paidOperation/index.d.ts +3 -0
- package/lib/domain/model/paidOperation/index.js +9 -0
- package/lib/domain/model/paymentDevice/IUploadDeviceLogsLine.d.ts +6 -0
- package/lib/domain/model/paymentDevice/IUploadDeviceLogsLine.js +3 -0
- package/lib/domain/model/paymentDevice/UploadDeviceLogLine.d.ts +28 -0
- package/lib/domain/model/paymentDevice/UploadDeviceLogLine.js +57 -0
- package/lib/domain/model/paymentDevice/index.d.ts +1 -0
- package/lib/domain/model/paymentDevice/index.js +7 -0
- package/lib/domain/model/print/PrintStatusLine.d.ts +27 -0
- package/lib/domain/model/print/PrintStatusLine.js +55 -0
- package/lib/domain/model/print/index.d.ts +1 -0
- package/lib/domain/model/print/index.js +7 -0
- package/lib/domain/model/receipt/BaseReceiptLineDecorator.d.ts +49 -0
- package/lib/domain/model/receipt/BaseReceiptLineDecorator.js +115 -0
- package/lib/domain/model/receipt/FiscalReceiptLine.d.ts +63 -0
- package/lib/domain/model/receipt/FiscalReceiptLine.js +170 -0
- package/lib/domain/model/receipt/GiftReceiptLine.d.ts +17 -0
- package/lib/domain/model/receipt/GiftReceiptLine.js +51 -0
- package/lib/domain/model/receipt/IPrintRetryLine.d.ts +4 -0
- package/lib/domain/model/receipt/IPrintRetryLine.js +3 -0
- package/lib/domain/model/receipt/IReceiptLine.d.ts +37 -0
- package/lib/domain/model/receipt/IReceiptLine.js +3 -0
- package/lib/domain/model/receipt/IReceiptRefundMessage.d.ts +4 -0
- package/lib/domain/model/receipt/IReceiptRefundMessage.js +3 -0
- package/lib/domain/model/receipt/ItemCommentLine.d.ts +16 -0
- package/lib/domain/model/receipt/ItemCommentLine.js +50 -0
- package/lib/domain/model/receipt/PrintRetryLine.d.ts +14 -0
- package/lib/domain/model/receipt/PrintRetryLine.js +43 -0
- package/lib/domain/model/receipt/PrintRetryLineDecorator.d.ts +12 -0
- package/lib/domain/model/receipt/PrintRetryLineDecorator.js +28 -0
- package/lib/domain/model/receipt/PrinterStatusReceiptLineDecorator.d.ts +12 -0
- package/lib/domain/model/receipt/PrinterStatusReceiptLineDecorator.js +38 -0
- package/lib/domain/model/receipt/ReceiptDestinationReceiptLineDecorator.d.ts +18 -0
- package/lib/domain/model/receipt/ReceiptDestinationReceiptLineDecorator.js +44 -0
- package/lib/domain/model/receipt/ReceiptLine.d.ts +88 -0
- package/lib/domain/model/receipt/ReceiptLine.js +236 -0
- package/lib/domain/model/receipt/ReceiptOptionLine.d.ts +44 -0
- package/lib/domain/model/receipt/ReceiptOptionLine.js +107 -0
- package/lib/domain/model/receipt/index.d.ts +12 -0
- package/lib/domain/model/receipt/index.js +15 -0
- package/lib/domain/model/reprint/ReprintTransactionLine.d.ts +30 -0
- package/lib/domain/model/reprint/ReprintTransactionLine.js +64 -0
- package/lib/domain/model/reprint/index.d.ts +1 -0
- package/lib/domain/model/reprint/index.js +7 -0
- package/lib/domain/model/salesperson/SalespersonLine.d.ts +27 -0
- package/lib/domain/model/salesperson/SalespersonLine.js +60 -0
- package/lib/domain/model/salesperson/index.d.ts +1 -0
- package/lib/domain/model/salesperson/index.js +7 -0
- package/lib/domain/model/sendsale/SendSaleConversionLine.d.ts +25 -0
- package/lib/domain/model/sendsale/SendSaleConversionLine.js +50 -0
- package/lib/domain/model/sendsale/index.d.ts +1 -0
- package/lib/domain/model/sendsale/index.js +7 -0
- package/lib/domain/model/shipping/ShippingFeeChangeLine.d.ts +39 -0
- package/lib/domain/model/shipping/ShippingFeeChangeLine.js +95 -0
- package/lib/domain/model/shipping/ShippingFeeLineChangeDecorator.d.ts +26 -0
- package/lib/domain/model/shipping/ShippingFeeLineChangeDecorator.js +81 -0
- package/lib/domain/model/shipping/index.d.ts +2 -0
- package/lib/domain/model/shipping/index.js +8 -0
- package/lib/domain/model/subscription/AddSubscriptionLine.d.ts +31 -0
- package/lib/domain/model/subscription/AddSubscriptionLine.js +69 -0
- package/lib/domain/model/subscription/ModifySubscriptionLine.d.ts +31 -0
- package/lib/domain/model/subscription/ModifySubscriptionLine.js +69 -0
- package/lib/domain/model/subscription/RemoveSubscriptionLine.d.ts +25 -0
- package/lib/domain/model/subscription/RemoveSubscriptionLine.js +50 -0
- package/lib/domain/model/subscription/index.d.ts +3 -0
- package/lib/domain/model/subscription/index.js +9 -0
- package/lib/domain/model/supervisorOverride/ISupervisorCredentials.d.ts +4 -0
- package/lib/domain/model/supervisorOverride/ISupervisorCredentials.js +3 -0
- package/lib/domain/model/supervisorOverride/SupervisorOverrideLine.d.ts +24 -0
- package/lib/domain/model/supervisorOverride/SupervisorOverrideLine.js +51 -0
- package/lib/domain/model/supervisorOverride/index.d.ts +2 -0
- package/lib/domain/model/supervisorOverride/index.js +7 -0
- package/lib/domain/model/taxExempt/BaseTaxExemptLine.d.ts +53 -0
- package/lib/domain/model/taxExempt/BaseTaxExemptLine.js +187 -0
- package/lib/domain/model/taxExempt/BaseTaxExemptLineDecorator.d.ts +27 -0
- package/lib/domain/model/taxExempt/BaseTaxExemptLineDecorator.js +74 -0
- package/lib/domain/model/taxExempt/ITaxExemptLine.d.ts +22 -0
- package/lib/domain/model/taxExempt/ITaxExemptLine.js +3 -0
- package/lib/domain/model/taxExempt/ItemTaxExemptLine.d.ts +23 -0
- package/lib/domain/model/taxExempt/ItemTaxExemptLine.js +47 -0
- package/lib/domain/model/taxExempt/ItemTaxExemptLineModificationDecorator.d.ts +32 -0
- package/lib/domain/model/taxExempt/ItemTaxExemptLineModificationDecorator.js +91 -0
- package/lib/domain/model/taxExempt/ModifyItemTaxExemptLine.d.ts +28 -0
- package/lib/domain/model/taxExempt/ModifyItemTaxExemptLine.js +62 -0
- package/lib/domain/model/taxExempt/ModifyTransactionTaxExemptLine.d.ts +28 -0
- package/lib/domain/model/taxExempt/ModifyTransactionTaxExemptLine.js +62 -0
- package/lib/domain/model/taxExempt/TransactionTaxExemptLine.d.ts +23 -0
- package/lib/domain/model/taxExempt/TransactionTaxExemptLine.js +47 -0
- package/lib/domain/model/taxExempt/TransactionTaxExemptLineModificationDecorator.d.ts +32 -0
- package/lib/domain/model/taxExempt/TransactionTaxExemptLineModificationDecorator.js +93 -0
- package/lib/domain/model/taxExempt/VoidedItemTaxExemptLineDecorator.d.ts +15 -0
- package/lib/domain/model/taxExempt/VoidedItemTaxExemptLineDecorator.js +38 -0
- package/lib/domain/model/taxExempt/VoidedTransactionTaxExemptLineDecorator.d.ts +15 -0
- package/lib/domain/model/taxExempt/VoidedTransactionTaxExemptLineDecorator.js +38 -0
- package/lib/domain/model/taxExempt/index.d.ts +11 -0
- package/lib/domain/model/taxExempt/index.js +16 -0
- package/lib/domain/model/taxLottery/TaxLotteryLine.d.ts +24 -0
- package/lib/domain/model/taxLottery/TaxLotteryLine.js +49 -0
- package/lib/domain/model/taxLottery/index.d.ts +1 -0
- package/lib/domain/model/taxLottery/index.js +7 -0
- package/lib/domain/model/taxOverride/BaseTaxOverrideLine.d.ts +40 -0
- package/lib/domain/model/taxOverride/BaseTaxOverrideLine.js +153 -0
- package/lib/domain/model/taxOverride/BaseTaxOverrideLineDecorator.d.ts +21 -0
- package/lib/domain/model/taxOverride/BaseTaxOverrideLineDecorator.js +54 -0
- package/lib/domain/model/taxOverride/ITaxOverrideLine.d.ts +19 -0
- package/lib/domain/model/taxOverride/ITaxOverrideLine.js +3 -0
- package/lib/domain/model/taxOverride/ModifyTaxOverrideLine.d.ts +31 -0
- package/lib/domain/model/taxOverride/ModifyTaxOverrideLine.js +70 -0
- package/lib/domain/model/taxOverride/TaxOverrideLine.d.ts +15 -0
- package/lib/domain/model/taxOverride/TaxOverrideLine.js +49 -0
- package/lib/domain/model/taxOverride/TaxOverrideLineModificationDecorator.d.ts +14 -0
- package/lib/domain/model/taxOverride/TaxOverrideLineModificationDecorator.js +39 -0
- package/lib/domain/model/taxOverride/VoidedTaxOverrideLineDecorator.d.ts +15 -0
- package/lib/domain/model/taxOverride/VoidedTaxOverrideLineDecorator.js +38 -0
- package/lib/domain/model/taxOverride/index.d.ts +7 -0
- package/lib/domain/model/taxOverride/index.js +12 -0
- package/lib/domain/model/taxRecord/ITaxRecordLine.d.ts +90 -0
- package/lib/domain/model/taxRecord/ITaxRecordLine.js +3 -0
- package/lib/domain/model/taxRecord/TaxRecordLine.d.ts +67 -0
- package/lib/domain/model/taxRecord/TaxRecordLine.js +175 -0
- package/lib/domain/model/taxRecord/index.d.ts +2 -0
- package/lib/domain/model/taxRecord/index.js +7 -0
- package/lib/domain/model/taxRefund/ReprintTaxRefundLine.d.ts +30 -0
- package/lib/domain/model/taxRefund/ReprintTaxRefundLine.js +64 -0
- package/lib/domain/model/taxRefund/StartTaxRefundLine.d.ts +29 -0
- package/lib/domain/model/taxRefund/StartTaxRefundLine.js +62 -0
- package/lib/domain/model/taxRefund/TaxRefundInterfaces.d.ts +229 -0
- package/lib/domain/model/taxRefund/TaxRefundInterfaces.js +36 -0
- package/lib/domain/model/taxRefund/TaxRefundLine.d.ts +34 -0
- package/lib/domain/model/taxRefund/TaxRefundLine.js +73 -0
- package/lib/domain/model/taxRefund/TaxRefundSession.d.ts +84 -0
- package/lib/domain/model/taxRefund/TaxRefundSession.js +214 -0
- package/lib/domain/model/taxRefund/VoidTaxRefundLine.d.ts +30 -0
- package/lib/domain/model/taxRefund/VoidTaxRefundLine.js +71 -0
- package/lib/domain/model/taxRefund/index.d.ts +6 -0
- package/lib/domain/model/taxRefund/index.js +12 -0
- package/lib/domain/model/tender/BaseTenderLineDecorator.d.ts +47 -0
- package/lib/domain/model/tender/BaseTenderLineDecorator.js +110 -0
- package/lib/domain/model/tender/CancelSubscriptionTokenLine.d.ts +11 -0
- package/lib/domain/model/tender/CancelSubscriptionTokenLine.js +32 -0
- package/lib/domain/model/tender/ITenderLine.d.ts +45 -0
- package/lib/domain/model/tender/ITenderLine.js +3 -0
- package/lib/domain/model/tender/OfflineAuthorization.d.ts +17 -0
- package/lib/domain/model/tender/OfflineAuthorization.js +47 -0
- package/lib/domain/model/tender/RefundedTenderLineDecorator.d.ts +12 -0
- package/lib/domain/model/tender/RefundedTenderLineDecorator.js +42 -0
- package/lib/domain/model/tender/TenderAuthorizationStatusLine.d.ts +65 -0
- package/lib/domain/model/tender/TenderAuthorizationStatusLine.js +220 -0
- package/lib/domain/model/tender/TenderChangeCancelLine.d.ts +25 -0
- package/lib/domain/model/tender/TenderChangeCancelLine.js +51 -0
- package/lib/domain/model/tender/TenderLine.d.ts +113 -0
- package/lib/domain/model/tender/TenderLine.js +385 -0
- package/lib/domain/model/tender/TenderSignatureLine.d.ts +29 -0
- package/lib/domain/model/tender/TenderSignatureLine.js +66 -0
- package/lib/domain/model/tender/TenderTaxLineDecorator.d.ts +12 -0
- package/lib/domain/model/tender/TenderTaxLineDecorator.js +29 -0
- package/lib/domain/model/tender/TenderUtils.d.ts +9 -0
- package/lib/domain/model/tender/TenderUtils.js +43 -0
- package/lib/domain/model/tender/VoidedTenderLineDecorator.d.ts +13 -0
- package/lib/domain/model/tender/VoidedTenderLineDecorator.js +43 -0
- package/lib/domain/model/tender/exchange/StartTenderExchangeLine.d.ts +28 -0
- package/lib/domain/model/tender/exchange/StartTenderExchangeLine.js +56 -0
- package/lib/domain/model/tender/exchange/index.d.ts +1 -0
- package/lib/domain/model/tender/exchange/index.js +7 -0
- package/lib/domain/model/tender/index.d.ts +16 -0
- package/lib/domain/model/tender/index.js +21 -0
- package/lib/domain/model/tender/reversals/Interfaces.d.ts +25 -0
- package/lib/domain/model/tender/reversals/Interfaces.js +10 -0
- package/lib/domain/model/tender/reversals/index.d.ts +1 -0
- package/lib/domain/model/tender/reversals/index.js +7 -0
- package/lib/domain/model/tender/valueCard/Interfaces.d.ts +84 -0
- package/lib/domain/model/tender/valueCard/Interfaces.js +104 -0
- package/lib/domain/model/tender/valueCard/index.d.ts +1 -0
- package/lib/domain/model/tender/valueCard/index.js +7 -0
- package/lib/domain/model/tender/valueCertificate/Interfaces.d.ts +228 -0
- package/lib/domain/model/tender/valueCertificate/Interfaces.js +78 -0
- package/lib/domain/model/tender/valueCertificate/index.d.ts +1 -0
- package/lib/domain/model/tender/valueCertificate/index.js +7 -0
- package/lib/domain/model/terminal/FiscalPrinterAbortLineType.d.ts +21 -0
- package/lib/domain/model/terminal/FiscalPrinterAbortLineType.js +45 -0
- package/lib/domain/model/terminal/FiscalPrinterReportLineType.d.ts +34 -0
- package/lib/domain/model/terminal/FiscalPrinterReportLineType.js +85 -0
- package/lib/domain/model/terminal/FiscalPrinterStatusLineType.d.ts +24 -0
- package/lib/domain/model/terminal/FiscalPrinterStatusLineType.js +55 -0
- package/lib/domain/model/terminal/FiscalPrinterSyncLineType.d.ts +28 -0
- package/lib/domain/model/terminal/FiscalPrinterSyncLineType.js +67 -0
- package/lib/domain/model/terminal/TerminalStateChangeLine.d.ts +27 -0
- package/lib/domain/model/terminal/TerminalStateChangeLine.js +61 -0
- package/lib/domain/model/terminal/index.d.ts +5 -0
- package/lib/domain/model/terminal/index.js +11 -0
- package/lib/domain/model/till/StartTillLine.d.ts +58 -0
- package/lib/domain/model/till/StartTillLine.js +119 -0
- package/lib/domain/model/till/TenderTransferLine.d.ts +33 -0
- package/lib/domain/model/till/TenderTransferLine.js +140 -0
- package/lib/domain/model/till/TillAdjustmentLine.d.ts +21 -0
- package/lib/domain/model/till/TillAdjustmentLine.js +64 -0
- package/lib/domain/model/till/TillCountLine.d.ts +27 -0
- package/lib/domain/model/till/TillCountLine.js +96 -0
- package/lib/domain/model/till/TillFloatLine.d.ts +29 -0
- package/lib/domain/model/till/TillFloatLine.js +90 -0
- package/lib/domain/model/till/TillStateChangeLine.d.ts +26 -0
- package/lib/domain/model/till/TillStateChangeLine.js +78 -0
- package/lib/domain/model/till/index.d.ts +6 -0
- package/lib/domain/model/till/index.js +12 -0
- package/lib/domain/model/transaction/AttachmentLine.d.ts +17 -0
- package/lib/domain/model/transaction/AttachmentLine.js +45 -0
- package/lib/domain/model/transaction/CloseTransactionLine.d.ts +22 -0
- package/lib/domain/model/transaction/CloseTransactionLine.js +44 -0
- package/lib/domain/model/transaction/IPostVoidSearchResult.d.ts +7 -0
- package/lib/domain/model/transaction/IPostVoidSearchResult.js +4 -0
- package/lib/domain/model/transaction/RecordTransactionLine.d.ts +29 -0
- package/lib/domain/model/transaction/RecordTransactionLine.js +60 -0
- package/lib/domain/model/transaction/SignatureLine.d.ts +30 -0
- package/lib/domain/model/transaction/SignatureLine.js +67 -0
- package/lib/domain/model/transaction/SuspendTransactionLine.d.ts +24 -0
- package/lib/domain/model/transaction/SuspendTransactionLine.js +52 -0
- package/lib/domain/model/transaction/TotalTransactionLine.d.ts +26 -0
- package/lib/domain/model/transaction/TotalTransactionLine.js +55 -0
- package/lib/domain/model/transaction/TransactionResumeCompleteLine.d.ts +22 -0
- package/lib/domain/model/transaction/TransactionResumeCompleteLine.js +44 -0
- package/lib/domain/model/transaction/TransactionResumeStartLine.d.ts +25 -0
- package/lib/domain/model/transaction/TransactionResumeStartLine.js +55 -0
- package/lib/domain/model/transaction/TransactionReturnModeLine.d.ts +23 -0
- package/lib/domain/model/transaction/TransactionReturnModeLine.js +45 -0
- package/lib/domain/model/transaction/fiscal/FiscalTransactionLine.d.ts +27 -0
- package/lib/domain/model/transaction/fiscal/FiscalTransactionLine.js +61 -0
- package/lib/domain/model/transaction/fiscal/index.d.ts +1 -0
- package/lib/domain/model/transaction/fiscal/index.js +7 -0
- package/lib/domain/model/transaction/index.d.ts +12 -0
- package/lib/domain/model/transaction/index.js +18 -0
- package/lib/domain/model/transaction/order/ItemFulfillmentReferenceLine.d.ts +25 -0
- package/lib/domain/model/transaction/order/ItemFulfillmentReferenceLine.js +51 -0
- package/lib/domain/model/transaction/order/ItemPickupSignatureLine.d.ts +28 -0
- package/lib/domain/model/transaction/order/ItemPickupSignatureLine.js +63 -0
- package/lib/domain/model/transaction/order/OrderReferenceLine.d.ts +25 -0
- package/lib/domain/model/transaction/order/OrderReferenceLine.js +50 -0
- package/lib/domain/model/transaction/order/index.d.ts +3 -0
- package/lib/domain/model/transaction/order/index.js +9 -0
- package/lib/domain/model/user/AuthenticationFailedLine.d.ts +16 -0
- package/lib/domain/model/user/AuthenticationFailedLine.js +45 -0
- package/lib/domain/model/user/IPasswordExpiration.d.ts +4 -0
- package/lib/domain/model/user/IPasswordExpiration.js +3 -0
- package/lib/domain/model/user/PasswordExpiration.d.ts +10 -0
- package/lib/domain/model/user/PasswordExpiration.js +38 -0
- package/lib/domain/model/user/UserLine.d.ts +33 -0
- package/lib/domain/model/user/UserLine.js +84 -0
- package/lib/domain/model/user/index.d.ts +4 -0
- package/lib/domain/model/user/index.js +9 -0
- package/lib/domain/model/void/LineVoidLine.d.ts +50 -0
- package/lib/domain/model/void/LineVoidLine.js +158 -0
- package/lib/domain/model/void/TransactionVoidLine.d.ts +34 -0
- package/lib/domain/model/void/TransactionVoidLine.js +86 -0
- package/lib/domain/model/void/VoidedLineDecorator.d.ts +10 -0
- package/lib/domain/model/void/VoidedLineDecorator.js +40 -0
- package/lib/domain/model/void/index.d.ts +3 -0
- package/lib/domain/model/void/index.js +9 -0
- package/lib/domain/processing/PosBusinessAction.d.ts +9 -0
- package/lib/domain/processing/PosBusinessAction.js +55 -0
- package/lib/domain/processing/index.d.ts +1 -0
- package/lib/domain/processing/index.js +7 -0
- package/lib/domain/service/IReceiptFormattingService.d.ts +48 -0
- package/lib/domain/service/IReceiptFormattingService.js +3 -0
- package/lib/domain/service/ITransactionAccountingService.d.ts +6 -0
- package/lib/domain/service/ITransactionAccountingService.js +3 -0
- package/lib/domain/service/ITransactionReferenceFormatter.d.ts +4 -0
- package/lib/domain/service/ITransactionReferenceFormatter.js +3 -0
- package/lib/domain/service/index.d.ts +3 -0
- package/lib/domain/service/index.js +3 -0
- package/lib/domain/utility/index.d.ts +3 -0
- package/lib/domain/utility/index.js +9 -0
- package/lib/domain/utility/orderUtils.d.ts +6 -0
- package/lib/domain/utility/orderUtils.js +47 -0
- package/lib/domain/utility/supervisorOverride.d.ts +28 -0
- package/lib/domain/utility/supervisorOverride.js +298 -0
- package/lib/domain/utility/utils.d.ts +12 -0
- package/lib/domain/utility/utils.js +128 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +8 -0
- package/package.json +194 -0
- package/types/es-symbol/index.d.ts +4 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { DeviceIdentity, ITransaction, ITransactionLine, ITransactionLineFactory, IUser } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
|
+
import { AccountabilityMode, CashDrawerAccessMode, ITransactionDetails, MerchandiseTransactionClosingState } from "@aptos-scp/scp-types-commerce-transaction";
|
|
3
|
+
export interface ITransactionReference {
|
|
4
|
+
transactionId: string;
|
|
5
|
+
retailLocationId: string;
|
|
6
|
+
deviceId: string;
|
|
7
|
+
businessDayDate: string;
|
|
8
|
+
transactionNumber: number;
|
|
9
|
+
}
|
|
10
|
+
export declare abstract class RetailTransaction implements ITransaction {
|
|
11
|
+
private _transactionId;
|
|
12
|
+
private _deviceIdentity;
|
|
13
|
+
private _businessDayDate;
|
|
14
|
+
private _transactionNumber;
|
|
15
|
+
private _transactionType;
|
|
16
|
+
private _performingUser;
|
|
17
|
+
private _selfService;
|
|
18
|
+
private _startDateTime;
|
|
19
|
+
private _endDateTime;
|
|
20
|
+
private _timezoneOffsetInMinutes;
|
|
21
|
+
private _lines;
|
|
22
|
+
private _state;
|
|
23
|
+
private _originalTransactionDetails;
|
|
24
|
+
private _resumingLineNumber;
|
|
25
|
+
private _voided;
|
|
26
|
+
private _closingState;
|
|
27
|
+
private _resumeToken;
|
|
28
|
+
private _cashDrawerKey?;
|
|
29
|
+
private _cashDrawerInputSource?;
|
|
30
|
+
private _tillAccountabilityMode?;
|
|
31
|
+
private _cashDrawerAccessMode?;
|
|
32
|
+
private _taxFreeFormKey?;
|
|
33
|
+
private _taxFreeInvoiceNumber?;
|
|
34
|
+
private _taxFreeInvoiceSequenceNumber?;
|
|
35
|
+
private _taxFreeInvoiceSequenceNumberGenerator?;
|
|
36
|
+
private _taxFreeCreditNoteNumber?;
|
|
37
|
+
private _taxFreeCreditNoteSequenceNumber?;
|
|
38
|
+
private _taxFreeCreditNoteSequenceNumberGenerator?;
|
|
39
|
+
private _tillKey?;
|
|
40
|
+
static getTransactionIdFromJsonObject(transactionJsonObj: any): string;
|
|
41
|
+
static getDeviceIdentityFromJsonObject(transactionJsonObj: any): DeviceIdentity;
|
|
42
|
+
static getBusinessDayDateFromJsonObject(transactionJsonObj: any): string;
|
|
43
|
+
static getTransactionNumberFromJsonObject(transactionJsonObj: any): number;
|
|
44
|
+
static getTransactionTypeFromJsonObject(transactionJsonObj: any): string;
|
|
45
|
+
static getPerformingUserFromJsonObject(transactionJsonObj: any): IUser;
|
|
46
|
+
constructor(deviceIdentity: DeviceIdentity, businessDayDate: string, transactionNumber: number, transactionType: string, performingUser?: IUser, transactionId?: string);
|
|
47
|
+
clone(): ITransaction;
|
|
48
|
+
setTransactionProperty(propertyName: string, propertyValue: any): ITransaction;
|
|
49
|
+
setTransactionProperties(properties: Map<string, any>): ITransaction;
|
|
50
|
+
get transactionId(): string;
|
|
51
|
+
get deviceIdentity(): DeviceIdentity;
|
|
52
|
+
get businessDayDate(): string;
|
|
53
|
+
get transactionNumber(): number;
|
|
54
|
+
get transactionType(): string;
|
|
55
|
+
get performingUser(): IUser;
|
|
56
|
+
get startDateTime(): Date;
|
|
57
|
+
get endDateTime(): Date;
|
|
58
|
+
get timezoneOffsetInMinutes(): number;
|
|
59
|
+
get closingState(): MerchandiseTransactionClosingState;
|
|
60
|
+
get resumeToken(): string;
|
|
61
|
+
get originalTransactionDetails(): ITransactionDetails;
|
|
62
|
+
get resumingLineNumber(): number;
|
|
63
|
+
get voided(): boolean;
|
|
64
|
+
get state(): string;
|
|
65
|
+
get selfService(): boolean;
|
|
66
|
+
get cashDrawerKey(): string;
|
|
67
|
+
get tillKey(): string;
|
|
68
|
+
get cashDrawerInputSource(): string;
|
|
69
|
+
get tillAccountabilityMode(): AccountabilityMode;
|
|
70
|
+
get cashDrawerAccessMode(): CashDrawerAccessMode;
|
|
71
|
+
get taxFreeFormKey(): string;
|
|
72
|
+
get taxFreeInvoiceNumber(): string;
|
|
73
|
+
get taxFreeInvoiceSequenceNumber(): number;
|
|
74
|
+
get taxFreeInvoiceSequenceNumberGenerator(): string;
|
|
75
|
+
get taxFreeCreditNoteNumber(): string;
|
|
76
|
+
get taxFreeCreditNoteSequenceNumber(): number;
|
|
77
|
+
get taxFreeCreditNoteSequenceNumberGenerator(): string;
|
|
78
|
+
isNew(): boolean;
|
|
79
|
+
isOpen(): boolean;
|
|
80
|
+
isResuming(): boolean;
|
|
81
|
+
isOpenOrResuming(): boolean;
|
|
82
|
+
isWaiting(): boolean;
|
|
83
|
+
isPreparingToClose(): boolean;
|
|
84
|
+
isReadyToClose(): boolean;
|
|
85
|
+
isWaitingToClose(): boolean;
|
|
86
|
+
isClosing(): boolean;
|
|
87
|
+
isClosed(): boolean;
|
|
88
|
+
isSuspended(): boolean;
|
|
89
|
+
isVoided(): boolean;
|
|
90
|
+
isPostVoid(): boolean;
|
|
91
|
+
isPostVoidFailed(): boolean;
|
|
92
|
+
findLineByLineNumber(lineNumber: number): ITransactionLine;
|
|
93
|
+
findLineIndexByLineNumber(lineNumber: number): number;
|
|
94
|
+
findLineByLineType(lineType: string): ITransactionLine;
|
|
95
|
+
findLastLineByLineType(lineType: string): ITransactionLine;
|
|
96
|
+
start(): ITransaction;
|
|
97
|
+
prepareToClose(): ITransaction;
|
|
98
|
+
readyToClose(): ITransaction;
|
|
99
|
+
resume(originalTransactionDetails?: ITransactionDetails, currentLineNumber?: number): ITransaction;
|
|
100
|
+
finishResume(): ITransaction;
|
|
101
|
+
startWaiting(): ITransaction;
|
|
102
|
+
stopWaiting(): ITransaction;
|
|
103
|
+
startClosing(): ITransaction;
|
|
104
|
+
close(): ITransaction;
|
|
105
|
+
suspend(resumeToken?: string): ITransaction;
|
|
106
|
+
void(): ITransaction;
|
|
107
|
+
updateAccountabilityMode(accountabilityMode: AccountabilityMode, cashDrawerAccessMode: CashDrawerAccessMode): RetailTransaction;
|
|
108
|
+
postVoid(): ITransaction;
|
|
109
|
+
postVoidFailed(): ITransaction;
|
|
110
|
+
get lines(): ReadonlyArray<ITransactionLine>;
|
|
111
|
+
addLine(line: ITransactionLine): ITransaction;
|
|
112
|
+
replaceLine(transactionLineIndex: number, transactionLine: ITransactionLine): ITransaction;
|
|
113
|
+
get transactionStateValues(): Readonly<Map<string, any>>;
|
|
114
|
+
/**
|
|
115
|
+
* Create a new instance of the final transaction class in the transaction class hierarchy. This is used by
|
|
116
|
+
* <code>clone()</code> to get an instance of the correct class.
|
|
117
|
+
*
|
|
118
|
+
* Note: Subclasses must implement this to enable clone to work properly.
|
|
119
|
+
*
|
|
120
|
+
* @return {RetailTransaction}
|
|
121
|
+
*/
|
|
122
|
+
protected abstract newTransaction(): RetailTransaction;
|
|
123
|
+
protected loadFromJsonObject(transactionJsonObj: any, transactionLineFactory: ITransactionLineFactory): void;
|
|
124
|
+
private static generateTransactionId;
|
|
125
|
+
private loadTransactionLinesFromJsonObject;
|
|
126
|
+
}
|
|
127
|
+
export declare function isRetailTransaction(transaction: ITransaction): transaction is RetailTransaction;
|
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const scp_component_logging_1 = require("@aptos-scp/scp-component-logging");
|
|
4
|
+
const uuid = require("uuid");
|
|
5
|
+
const scp_component_store_selling_core_1 = require("@aptos-scp/scp-component-store-selling-core");
|
|
6
|
+
const scp_types_commerce_transaction_1 = require("@aptos-scp/scp-types-commerce-transaction");
|
|
7
|
+
const ErrorCodes_1 = require("../../config/ErrorCodes");
|
|
8
|
+
const User_1 = require("./User");
|
|
9
|
+
const logger = scp_component_logging_1.LogManager.getLogger("com.aptos.storesellingfeatures.domain.model.RetailTransaction");
|
|
10
|
+
var RetailTransactionState;
|
|
11
|
+
(function (RetailTransactionState) {
|
|
12
|
+
RetailTransactionState["New"] = "New";
|
|
13
|
+
RetailTransactionState["Open"] = "Open";
|
|
14
|
+
RetailTransactionState["Resuming"] = "Resuming";
|
|
15
|
+
RetailTransactionState["ResumingWaiting"] = "ResumingWaiting";
|
|
16
|
+
RetailTransactionState["Waiting"] = "Waiting";
|
|
17
|
+
RetailTransactionState["PreparingToClose"] = "PreparingToClose";
|
|
18
|
+
RetailTransactionState["ReadyToClose"] = "ReadyToClose";
|
|
19
|
+
RetailTransactionState["WaitingToClose"] = "WaitingToClose";
|
|
20
|
+
RetailTransactionState["Closing"] = "Closing";
|
|
21
|
+
RetailTransactionState["Closed"] = "Closed";
|
|
22
|
+
})(RetailTransactionState || (RetailTransactionState = {}));
|
|
23
|
+
function findRetailTransactionState(state) {
|
|
24
|
+
switch (state) {
|
|
25
|
+
case "New":
|
|
26
|
+
return RetailTransactionState.New;
|
|
27
|
+
case "Open":
|
|
28
|
+
return RetailTransactionState.Open;
|
|
29
|
+
case "Waiting":
|
|
30
|
+
return RetailTransactionState.Waiting;
|
|
31
|
+
case "PreparingToClose":
|
|
32
|
+
return RetailTransactionState.PreparingToClose;
|
|
33
|
+
case "ReadyToClose":
|
|
34
|
+
return RetailTransactionState.ReadyToClose;
|
|
35
|
+
case "WaitingToClose":
|
|
36
|
+
return RetailTransactionState.WaitingToClose;
|
|
37
|
+
case "Closing":
|
|
38
|
+
return RetailTransactionState.Closing;
|
|
39
|
+
case "Closed":
|
|
40
|
+
return RetailTransactionState.Closed;
|
|
41
|
+
case "Resuming":
|
|
42
|
+
return RetailTransactionState.Resuming;
|
|
43
|
+
case "ResumingWaiting":
|
|
44
|
+
return RetailTransactionState.ResumingWaiting;
|
|
45
|
+
default:
|
|
46
|
+
throw new scp_component_store_selling_core_1.PosError(`Unable to determine RetailTransactionState for state: ${state}`, ErrorCodes_1.SSF_TRANSACTION_ERROR_CODE);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
class RetailTransaction {
|
|
50
|
+
constructor(deviceIdentity, businessDayDate, transactionNumber, transactionType, performingUser, transactionId) {
|
|
51
|
+
this._transactionId = transactionId ? transactionId : RetailTransaction.generateTransactionId();
|
|
52
|
+
this._deviceIdentity = deviceIdentity;
|
|
53
|
+
this._businessDayDate = businessDayDate;
|
|
54
|
+
this._transactionNumber = transactionNumber;
|
|
55
|
+
this._transactionType = transactionType;
|
|
56
|
+
this._performingUser = performingUser;
|
|
57
|
+
this._state = RetailTransactionState.New;
|
|
58
|
+
this._lines = [];
|
|
59
|
+
this._originalTransactionDetails = undefined;
|
|
60
|
+
this._resumingLineNumber = undefined;
|
|
61
|
+
this._voided = false;
|
|
62
|
+
this._closingState = undefined;
|
|
63
|
+
this._resumeToken = undefined;
|
|
64
|
+
this._selfService = undefined;
|
|
65
|
+
this._cashDrawerKey = undefined;
|
|
66
|
+
this._cashDrawerInputSource = undefined;
|
|
67
|
+
this._taxFreeFormKey = undefined;
|
|
68
|
+
this._tillKey = undefined;
|
|
69
|
+
}
|
|
70
|
+
static getTransactionIdFromJsonObject(transactionJsonObj) {
|
|
71
|
+
return transactionJsonObj._transactionId;
|
|
72
|
+
}
|
|
73
|
+
static getDeviceIdentityFromJsonObject(transactionJsonObj) {
|
|
74
|
+
return scp_component_store_selling_core_1.DeviceIdentity.createFromJsonObject(transactionJsonObj._deviceIdentity);
|
|
75
|
+
}
|
|
76
|
+
static getBusinessDayDateFromJsonObject(transactionJsonObj) {
|
|
77
|
+
return transactionJsonObj._businessDayDate;
|
|
78
|
+
}
|
|
79
|
+
static getTransactionNumberFromJsonObject(transactionJsonObj) {
|
|
80
|
+
return transactionJsonObj._transactionNumber;
|
|
81
|
+
}
|
|
82
|
+
static getTransactionTypeFromJsonObject(transactionJsonObj) {
|
|
83
|
+
return transactionJsonObj._transactionType;
|
|
84
|
+
}
|
|
85
|
+
static getPerformingUserFromJsonObject(transactionJsonObj) {
|
|
86
|
+
return User_1.User.createFromJsonObject(transactionJsonObj._performingUser);
|
|
87
|
+
}
|
|
88
|
+
clone() {
|
|
89
|
+
const transaction = this.newTransaction();
|
|
90
|
+
transaction._startDateTime = this._startDateTime;
|
|
91
|
+
transaction._endDateTime = this._endDateTime;
|
|
92
|
+
transaction._timezoneOffsetInMinutes = this._timezoneOffsetInMinutes;
|
|
93
|
+
transaction._state = this._state;
|
|
94
|
+
transaction._performingUser = this._performingUser;
|
|
95
|
+
// Note: This new lines array still references the original line objects.
|
|
96
|
+
transaction._lines = [...this._lines];
|
|
97
|
+
transaction._voided = this._voided;
|
|
98
|
+
transaction._closingState = this._closingState;
|
|
99
|
+
transaction._resumeToken = this._resumeToken;
|
|
100
|
+
transaction._originalTransactionDetails = this._originalTransactionDetails;
|
|
101
|
+
transaction._resumingLineNumber = this._resumingLineNumber;
|
|
102
|
+
transaction._selfService = this._selfService;
|
|
103
|
+
transaction._cashDrawerKey = this._cashDrawerKey;
|
|
104
|
+
transaction._tillKey = this._tillKey;
|
|
105
|
+
transaction._cashDrawerInputSource = this._cashDrawerInputSource;
|
|
106
|
+
transaction._tillAccountabilityMode = this._tillAccountabilityMode;
|
|
107
|
+
transaction._cashDrawerAccessMode = this._cashDrawerAccessMode;
|
|
108
|
+
transaction._taxFreeFormKey = this._taxFreeFormKey;
|
|
109
|
+
transaction._taxFreeInvoiceNumber = this._taxFreeInvoiceNumber;
|
|
110
|
+
transaction._taxFreeInvoiceSequenceNumber = this._taxFreeInvoiceSequenceNumber;
|
|
111
|
+
transaction._taxFreeInvoiceSequenceNumberGenerator = this._taxFreeInvoiceSequenceNumberGenerator;
|
|
112
|
+
transaction._taxFreeCreditNoteNumber = this._taxFreeCreditNoteNumber;
|
|
113
|
+
transaction._taxFreeCreditNoteSequenceNumber = this._taxFreeCreditNoteSequenceNumber;
|
|
114
|
+
transaction._taxFreeCreditNoteSequenceNumberGenerator = this._taxFreeCreditNoteSequenceNumberGenerator;
|
|
115
|
+
return transaction;
|
|
116
|
+
}
|
|
117
|
+
setTransactionProperty(propertyName, propertyValue) {
|
|
118
|
+
const newTransaction = this.clone();
|
|
119
|
+
const propName = "_" + propertyName;
|
|
120
|
+
if (newTransaction.hasOwnProperty(propName)) {
|
|
121
|
+
newTransaction[propName] = propertyValue;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
throw new scp_component_store_selling_core_1.PosError(`Cannot set property with name ${propertyName} on transaction, ` +
|
|
125
|
+
`because that property does not exist.`, ErrorCodes_1.SSF_TRANSACTION_ERROR_CODE);
|
|
126
|
+
}
|
|
127
|
+
return newTransaction;
|
|
128
|
+
}
|
|
129
|
+
setTransactionProperties(properties) {
|
|
130
|
+
const newTransaction = this.clone();
|
|
131
|
+
[...properties.entries()].forEach((entry) => {
|
|
132
|
+
const propName = "_" + entry[0];
|
|
133
|
+
const value = entry[1];
|
|
134
|
+
if (newTransaction.hasOwnProperty(propName)) {
|
|
135
|
+
newTransaction[propName] = value;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
throw new scp_component_store_selling_core_1.PosError(`Cannot set property with name ${propName} on transaction, ` +
|
|
139
|
+
`because that property does not exist.`, ErrorCodes_1.SSF_TRANSACTION_ERROR_CODE);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return newTransaction;
|
|
143
|
+
}
|
|
144
|
+
get transactionId() {
|
|
145
|
+
return this._transactionId;
|
|
146
|
+
}
|
|
147
|
+
get deviceIdentity() {
|
|
148
|
+
return this._deviceIdentity;
|
|
149
|
+
}
|
|
150
|
+
get businessDayDate() {
|
|
151
|
+
return this._businessDayDate;
|
|
152
|
+
}
|
|
153
|
+
get transactionNumber() {
|
|
154
|
+
return this._transactionNumber;
|
|
155
|
+
}
|
|
156
|
+
get transactionType() {
|
|
157
|
+
return this._transactionType;
|
|
158
|
+
}
|
|
159
|
+
get performingUser() {
|
|
160
|
+
return this._performingUser;
|
|
161
|
+
}
|
|
162
|
+
get startDateTime() {
|
|
163
|
+
return this._startDateTime;
|
|
164
|
+
}
|
|
165
|
+
get endDateTime() {
|
|
166
|
+
return this._endDateTime;
|
|
167
|
+
}
|
|
168
|
+
get timezoneOffsetInMinutes() {
|
|
169
|
+
return this._timezoneOffsetInMinutes;
|
|
170
|
+
}
|
|
171
|
+
get closingState() {
|
|
172
|
+
return this._closingState;
|
|
173
|
+
}
|
|
174
|
+
get resumeToken() {
|
|
175
|
+
return this._resumeToken;
|
|
176
|
+
}
|
|
177
|
+
get originalTransactionDetails() {
|
|
178
|
+
return this._originalTransactionDetails;
|
|
179
|
+
}
|
|
180
|
+
get resumingLineNumber() {
|
|
181
|
+
return this._resumingLineNumber;
|
|
182
|
+
}
|
|
183
|
+
get voided() {
|
|
184
|
+
return this._voided;
|
|
185
|
+
}
|
|
186
|
+
get state() {
|
|
187
|
+
return this._state;
|
|
188
|
+
}
|
|
189
|
+
get selfService() {
|
|
190
|
+
return this._selfService;
|
|
191
|
+
}
|
|
192
|
+
get cashDrawerKey() {
|
|
193
|
+
return this._cashDrawerKey;
|
|
194
|
+
}
|
|
195
|
+
get tillKey() {
|
|
196
|
+
return this._tillKey;
|
|
197
|
+
}
|
|
198
|
+
get cashDrawerInputSource() {
|
|
199
|
+
return this._cashDrawerInputSource;
|
|
200
|
+
}
|
|
201
|
+
get tillAccountabilityMode() {
|
|
202
|
+
return this._tillAccountabilityMode;
|
|
203
|
+
}
|
|
204
|
+
get cashDrawerAccessMode() {
|
|
205
|
+
return this._cashDrawerAccessMode;
|
|
206
|
+
}
|
|
207
|
+
get taxFreeFormKey() {
|
|
208
|
+
return this._taxFreeFormKey;
|
|
209
|
+
}
|
|
210
|
+
get taxFreeInvoiceNumber() {
|
|
211
|
+
return this._taxFreeInvoiceNumber;
|
|
212
|
+
}
|
|
213
|
+
get taxFreeInvoiceSequenceNumber() {
|
|
214
|
+
return this._taxFreeInvoiceSequenceNumber;
|
|
215
|
+
}
|
|
216
|
+
get taxFreeInvoiceSequenceNumberGenerator() {
|
|
217
|
+
return this._taxFreeInvoiceSequenceNumberGenerator;
|
|
218
|
+
}
|
|
219
|
+
get taxFreeCreditNoteNumber() {
|
|
220
|
+
return this._taxFreeCreditNoteNumber;
|
|
221
|
+
}
|
|
222
|
+
get taxFreeCreditNoteSequenceNumber() {
|
|
223
|
+
return this._taxFreeCreditNoteSequenceNumber;
|
|
224
|
+
}
|
|
225
|
+
get taxFreeCreditNoteSequenceNumberGenerator() {
|
|
226
|
+
return this._taxFreeCreditNoteSequenceNumberGenerator;
|
|
227
|
+
}
|
|
228
|
+
isNew() {
|
|
229
|
+
return this._state === RetailTransactionState.New;
|
|
230
|
+
}
|
|
231
|
+
isOpen() {
|
|
232
|
+
return this._state === RetailTransactionState.Open;
|
|
233
|
+
}
|
|
234
|
+
isResuming() {
|
|
235
|
+
return (this._state === RetailTransactionState.Resuming ||
|
|
236
|
+
this._state === RetailTransactionState.ResumingWaiting);
|
|
237
|
+
}
|
|
238
|
+
isOpenOrResuming() {
|
|
239
|
+
return this.isOpen() || this._state === RetailTransactionState.Resuming;
|
|
240
|
+
}
|
|
241
|
+
isWaiting() {
|
|
242
|
+
return (this._state === RetailTransactionState.Waiting || this._state === RetailTransactionState.ResumingWaiting);
|
|
243
|
+
}
|
|
244
|
+
isPreparingToClose() {
|
|
245
|
+
return this._state === RetailTransactionState.PreparingToClose;
|
|
246
|
+
}
|
|
247
|
+
isReadyToClose() {
|
|
248
|
+
return this._state === RetailTransactionState.ReadyToClose;
|
|
249
|
+
}
|
|
250
|
+
isWaitingToClose() {
|
|
251
|
+
return this._state === RetailTransactionState.WaitingToClose;
|
|
252
|
+
}
|
|
253
|
+
isClosing() {
|
|
254
|
+
return this._state === RetailTransactionState.Closing;
|
|
255
|
+
}
|
|
256
|
+
isClosed() {
|
|
257
|
+
return this._state === RetailTransactionState.Closed;
|
|
258
|
+
}
|
|
259
|
+
isSuspended() {
|
|
260
|
+
return this._closingState === scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.Suspended;
|
|
261
|
+
}
|
|
262
|
+
isVoided() {
|
|
263
|
+
return this._closingState === scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.Voided;
|
|
264
|
+
}
|
|
265
|
+
isPostVoid() {
|
|
266
|
+
return this._closingState === scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.PostVoidCompleted;
|
|
267
|
+
}
|
|
268
|
+
isPostVoidFailed() {
|
|
269
|
+
return this._closingState === scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.PostVoidFailed;
|
|
270
|
+
}
|
|
271
|
+
findLineByLineNumber(lineNumber) {
|
|
272
|
+
return this._lines.find((lineToExamine) => lineToExamine.lineNumber === lineNumber);
|
|
273
|
+
}
|
|
274
|
+
findLineIndexByLineNumber(lineNumber) {
|
|
275
|
+
return this._lines.findIndex((lineToExamine) => lineToExamine.lineNumber === lineNumber);
|
|
276
|
+
}
|
|
277
|
+
findLineByLineType(lineType) {
|
|
278
|
+
return this._lines.find((lineToExamine) => lineToExamine.lineType === lineType);
|
|
279
|
+
}
|
|
280
|
+
findLastLineByLineType(lineType) {
|
|
281
|
+
return [...this._lines]
|
|
282
|
+
.reverse()
|
|
283
|
+
.find((lineToExamine) => lineToExamine.lineType === lineType);
|
|
284
|
+
}
|
|
285
|
+
start() {
|
|
286
|
+
let transaction = this;
|
|
287
|
+
if (this._state === RetailTransactionState.New) {
|
|
288
|
+
transaction = this.clone();
|
|
289
|
+
transaction._state = RetailTransactionState.Open;
|
|
290
|
+
transaction._startDateTime = new Date();
|
|
291
|
+
transaction._timezoneOffsetInMinutes = transaction._startDateTime.getTimezoneOffset();
|
|
292
|
+
}
|
|
293
|
+
return transaction;
|
|
294
|
+
}
|
|
295
|
+
prepareToClose() {
|
|
296
|
+
let transaction = this;
|
|
297
|
+
if (this.isOpen()) {
|
|
298
|
+
transaction = this.clone();
|
|
299
|
+
transaction._state = RetailTransactionState.PreparingToClose;
|
|
300
|
+
}
|
|
301
|
+
return transaction;
|
|
302
|
+
}
|
|
303
|
+
readyToClose() {
|
|
304
|
+
let transaction = this;
|
|
305
|
+
if (this.isPreparingToClose()) {
|
|
306
|
+
transaction = this.clone();
|
|
307
|
+
transaction._state = RetailTransactionState.ReadyToClose;
|
|
308
|
+
// We need the endDateTime for things like receipt formatting that happen at end of transaction.
|
|
309
|
+
// Receipt formatting happens in the ReadyToClose state, not while in Closing or Closed, so we need to set the
|
|
310
|
+
// endDateTime here. It would be more appropriate to set it, when we transition to Closing, since from there, the
|
|
311
|
+
// transaction state can only go to Closed, and nothing can re-open it at that point. Unfortunately, that is too
|
|
312
|
+
// late to get the endDateTime for the receipt, so we set it here.
|
|
313
|
+
// In the future, we might need to allow a transition from ReadyToClose to Open, but that is not currently allowed
|
|
314
|
+
// or needed. If we do need to support that, we need to review whether this should only get set once, or what.
|
|
315
|
+
// Maybe it should only be set, here, if it is not set, and it should be cleared, if we go back to Open/Waiting.
|
|
316
|
+
// Or maybe it is OK to always set it here, if the readyToClose method is only used for the transition from Open
|
|
317
|
+
// to ReadyToClose.
|
|
318
|
+
transaction._endDateTime = new Date();
|
|
319
|
+
}
|
|
320
|
+
return transaction;
|
|
321
|
+
}
|
|
322
|
+
resume(originalTransactionDetails, currentLineNumber) {
|
|
323
|
+
let transaction = this;
|
|
324
|
+
if (this._state === RetailTransactionState.Open || this._state === RetailTransactionState.Resuming) {
|
|
325
|
+
transaction = this.clone();
|
|
326
|
+
transaction._state = RetailTransactionState.Resuming;
|
|
327
|
+
transaction._originalTransactionDetails = originalTransactionDetails;
|
|
328
|
+
transaction._resumingLineNumber = currentLineNumber;
|
|
329
|
+
}
|
|
330
|
+
return transaction;
|
|
331
|
+
}
|
|
332
|
+
finishResume() {
|
|
333
|
+
let transaction = this;
|
|
334
|
+
if (this._state === RetailTransactionState.Resuming) {
|
|
335
|
+
transaction = this.clone();
|
|
336
|
+
transaction._state = RetailTransactionState.Open;
|
|
337
|
+
transaction._resumingLineNumber = undefined;
|
|
338
|
+
}
|
|
339
|
+
return transaction;
|
|
340
|
+
}
|
|
341
|
+
// Note: It is up-to the state objects to track what is being waited-for.
|
|
342
|
+
startWaiting() {
|
|
343
|
+
let transaction = this;
|
|
344
|
+
if (this._state === RetailTransactionState.Open) {
|
|
345
|
+
transaction = this.clone();
|
|
346
|
+
transaction._state = RetailTransactionState.Waiting;
|
|
347
|
+
}
|
|
348
|
+
else if (this._state === RetailTransactionState.ReadyToClose) {
|
|
349
|
+
transaction = this.clone();
|
|
350
|
+
transaction._state = RetailTransactionState.WaitingToClose;
|
|
351
|
+
}
|
|
352
|
+
else if (this._state === RetailTransactionState.Resuming) {
|
|
353
|
+
transaction = this.clone();
|
|
354
|
+
transaction._state = RetailTransactionState.ResumingWaiting;
|
|
355
|
+
}
|
|
356
|
+
return transaction;
|
|
357
|
+
}
|
|
358
|
+
stopWaiting() {
|
|
359
|
+
let transaction = this;
|
|
360
|
+
if (this._state === RetailTransactionState.Waiting) {
|
|
361
|
+
transaction = this.clone();
|
|
362
|
+
transaction._state = RetailTransactionState.Open;
|
|
363
|
+
}
|
|
364
|
+
else if (this._state === RetailTransactionState.WaitingToClose) {
|
|
365
|
+
transaction = this.clone();
|
|
366
|
+
transaction._state = RetailTransactionState.ReadyToClose;
|
|
367
|
+
}
|
|
368
|
+
else if (this._state === RetailTransactionState.ResumingWaiting) {
|
|
369
|
+
transaction = this.clone();
|
|
370
|
+
transaction._state = RetailTransactionState.Resuming;
|
|
371
|
+
}
|
|
372
|
+
return transaction;
|
|
373
|
+
}
|
|
374
|
+
startClosing() {
|
|
375
|
+
let transaction = this;
|
|
376
|
+
if (this._state === RetailTransactionState.ReadyToClose) {
|
|
377
|
+
transaction = this.clone();
|
|
378
|
+
transaction._state = RetailTransactionState.Closing;
|
|
379
|
+
}
|
|
380
|
+
return transaction;
|
|
381
|
+
}
|
|
382
|
+
close() {
|
|
383
|
+
let transaction = this;
|
|
384
|
+
if (this._state === RetailTransactionState.Closing) {
|
|
385
|
+
transaction = this.clone();
|
|
386
|
+
transaction._state = RetailTransactionState.Closed;
|
|
387
|
+
}
|
|
388
|
+
return transaction;
|
|
389
|
+
}
|
|
390
|
+
suspend(resumeToken) {
|
|
391
|
+
let transaction = this;
|
|
392
|
+
if (this._closingState === undefined) {
|
|
393
|
+
transaction = this.clone();
|
|
394
|
+
transaction._closingState = scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.Suspended;
|
|
395
|
+
transaction._resumeToken = resumeToken;
|
|
396
|
+
}
|
|
397
|
+
return transaction;
|
|
398
|
+
}
|
|
399
|
+
void() {
|
|
400
|
+
let transaction = this;
|
|
401
|
+
if (this._closingState === undefined) {
|
|
402
|
+
transaction = this.clone();
|
|
403
|
+
transaction._closingState = scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.Voided;
|
|
404
|
+
}
|
|
405
|
+
return transaction;
|
|
406
|
+
}
|
|
407
|
+
updateAccountabilityMode(accountabilityMode, cashDrawerAccessMode) {
|
|
408
|
+
const newTransaction = this.clone();
|
|
409
|
+
newTransaction._tillAccountabilityMode = accountabilityMode;
|
|
410
|
+
newTransaction._cashDrawerAccessMode = cashDrawerAccessMode;
|
|
411
|
+
return newTransaction;
|
|
412
|
+
}
|
|
413
|
+
postVoid() {
|
|
414
|
+
let transaction = this;
|
|
415
|
+
if (this._closingState === undefined) {
|
|
416
|
+
transaction = this.clone();
|
|
417
|
+
transaction._closingState = scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.PostVoidCompleted;
|
|
418
|
+
}
|
|
419
|
+
return transaction;
|
|
420
|
+
}
|
|
421
|
+
postVoidFailed() {
|
|
422
|
+
let transaction = this;
|
|
423
|
+
if (this._closingState === undefined ||
|
|
424
|
+
this._closingState === scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.PostVoidCompleted) {
|
|
425
|
+
transaction = this.clone();
|
|
426
|
+
transaction._closingState = scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.PostVoidFailed;
|
|
427
|
+
}
|
|
428
|
+
return transaction;
|
|
429
|
+
}
|
|
430
|
+
get lines() {
|
|
431
|
+
return this._lines;
|
|
432
|
+
}
|
|
433
|
+
addLine(line) {
|
|
434
|
+
const logEntryMessage = logger.traceEntry("addLine", line);
|
|
435
|
+
let transaction = this;
|
|
436
|
+
if (this._state !== RetailTransactionState.New && this._state !== RetailTransactionState.Closed) {
|
|
437
|
+
transaction = transaction.clone();
|
|
438
|
+
transaction._lines = [...this._lines, line];
|
|
439
|
+
logger.trace("Added new line to (copy of) transaction.");
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
logger.trace("Line was not added, because the transaction was not open.");
|
|
443
|
+
throw logger.throwing(new scp_component_store_selling_core_1.PosError("Cannot add a line to a transaction that is not open.", ErrorCodes_1.SSF_TRANSACTION_ERROR_CODE), logEntryMessage, scp_component_logging_1.LogLevel.DEBUG);
|
|
444
|
+
}
|
|
445
|
+
return logger.traceExit(logEntryMessage, transaction);
|
|
446
|
+
}
|
|
447
|
+
replaceLine(transactionLineIndex, transactionLine) {
|
|
448
|
+
const logEntryMessage = logger.traceEntry("replaceLine", transactionLineIndex, transactionLine);
|
|
449
|
+
if (this._state === RetailTransactionState.New || this._state === RetailTransactionState.Closed) {
|
|
450
|
+
throw logger.throwing(new scp_component_store_selling_core_1.PosError("Cannot replace a line in a transaction that is not open.", ErrorCodes_1.SSF_TRANSACTION_ERROR_CODE), logEntryMessage, scp_component_logging_1.LogLevel.DEBUG);
|
|
451
|
+
}
|
|
452
|
+
if (transactionLineIndex < 0 || this._lines.length <= transactionLineIndex) {
|
|
453
|
+
throw logger.throwing(new scp_component_store_selling_core_1.PosError(`Cannot replace a line that is not in the transaction ` +
|
|
454
|
+
`(index ${transactionLineIndex} out of bounds 0...${this._lines.length - 1}).`, ErrorCodes_1.SSF_TRANSACTION_ERROR_CODE), logEntryMessage, scp_component_logging_1.LogLevel.DEBUG);
|
|
455
|
+
}
|
|
456
|
+
const transaction = this.clone();
|
|
457
|
+
transaction._lines = this._lines.map((lineInTransaction, index) => index === transactionLineIndex ? transactionLine : lineInTransaction);
|
|
458
|
+
return logger.traceExit(logEntryMessage, transaction);
|
|
459
|
+
}
|
|
460
|
+
get transactionStateValues() {
|
|
461
|
+
return new Map([
|
|
462
|
+
["transaction.id", this._transactionId],
|
|
463
|
+
["transaction.number", this._transactionNumber],
|
|
464
|
+
["transaction.type", this._transactionType],
|
|
465
|
+
["transaction.startDateTime", this._startDateTime],
|
|
466
|
+
["transaction.endDateTime", this._endDateTime],
|
|
467
|
+
["transaction.timezoneOffsetInMinutes", this._timezoneOffsetInMinutes],
|
|
468
|
+
["transaction.performingUser.username", this._performingUser && this._performingUser.username],
|
|
469
|
+
["transaction.performingUser.firstName", this._performingUser && this._performingUser.firstName],
|
|
470
|
+
["transaction.performingUser.lastName", this._performingUser && this._performingUser.lastName],
|
|
471
|
+
["transaction.performingUser.middleName", this._performingUser && this._performingUser.middleName],
|
|
472
|
+
[
|
|
473
|
+
"transaction.performingUser.preferredLanguage",
|
|
474
|
+
this._performingUser && this._performingUser.preferredLanguage,
|
|
475
|
+
],
|
|
476
|
+
["transaction.performingUser.displayName", this._performingUser && this._performingUser.displayName],
|
|
477
|
+
["transaction.selfService", this._selfService],
|
|
478
|
+
["transaction.open", this.isOpen()],
|
|
479
|
+
["transaction.waiting", this.isWaiting()],
|
|
480
|
+
["transaction.waitingToClose", this.isWaitingToClose()],
|
|
481
|
+
["transaction.closed", this.isClosed()],
|
|
482
|
+
["transaction.voided", this.isVoided()],
|
|
483
|
+
["transaction.postVoid", this.isPostVoid()],
|
|
484
|
+
["transaction.resuming", this.isResuming()],
|
|
485
|
+
["transaction.closingState", this._closingState],
|
|
486
|
+
["transaction.cashDrawerKey", this._cashDrawerKey],
|
|
487
|
+
["transaction.cashDrawerInputSource", this._cashDrawerInputSource],
|
|
488
|
+
["transaction.tillAccountabilityMode", this._tillAccountabilityMode],
|
|
489
|
+
["transaction.cashDrawerAccessMode", this._cashDrawerAccessMode],
|
|
490
|
+
["transaction.taxFreeFormKey", this._taxFreeFormKey],
|
|
491
|
+
["transaction.tillKey", this._tillKey],
|
|
492
|
+
]);
|
|
493
|
+
}
|
|
494
|
+
loadFromJsonObject(transactionJsonObj, transactionLineFactory) {
|
|
495
|
+
// Note: _transactionId, _deviceIdentity, _businessDayDate, _transactionNumber, _referenceNumber, _transactionType
|
|
496
|
+
// and _performingUser are set by the constructor.
|
|
497
|
+
this._startDateTime = new Date(transactionJsonObj._startDateTime);
|
|
498
|
+
this._endDateTime = transactionJsonObj._endDateTime
|
|
499
|
+
? new Date(transactionJsonObj._endDateTime)
|
|
500
|
+
: undefined;
|
|
501
|
+
this._timezoneOffsetInMinutes = transactionJsonObj._timezoneOffsetInMinutes;
|
|
502
|
+
this._lines = this.loadTransactionLinesFromJsonObject(transactionJsonObj._lines, transactionLineFactory);
|
|
503
|
+
this._state = findRetailTransactionState(transactionJsonObj._state);
|
|
504
|
+
this._voided = transactionJsonObj._voided;
|
|
505
|
+
this._closingState = findMerchandiseTransactionClosingState(transactionJsonObj._closingState);
|
|
506
|
+
this._resumeToken = transactionJsonObj._resumeToken;
|
|
507
|
+
this._originalTransactionDetails = transactionJsonObj._originalTransactionDetails;
|
|
508
|
+
this._cashDrawerKey = transactionJsonObj._cashDrawerKey;
|
|
509
|
+
this._cashDrawerInputSource = transactionJsonObj._cashDrawerInputSource;
|
|
510
|
+
this._tillAccountabilityMode = transactionJsonObj._tillAccountabilityMode;
|
|
511
|
+
this._cashDrawerAccessMode = transactionJsonObj._cashDrawerAccessMode;
|
|
512
|
+
this._taxFreeFormKey = transactionJsonObj._taxFreeFormKey;
|
|
513
|
+
this._taxFreeInvoiceNumber = transactionJsonObj._taxFreeInvoiceNumber;
|
|
514
|
+
this._taxFreeInvoiceSequenceNumber = transactionJsonObj._taxFreeInvoiceSequenceNumber;
|
|
515
|
+
this._taxFreeInvoiceSequenceNumberGenerator = transactionJsonObj._taxFreeInvoiceSequenceNumberGenerator;
|
|
516
|
+
this._taxFreeCreditNoteNumber = transactionJsonObj._taxFreeCreditNoteNumber;
|
|
517
|
+
this._taxFreeCreditNoteSequenceNumber = transactionJsonObj._taxFreeCreditNoteSequenceNumber;
|
|
518
|
+
this._taxFreeCreditNoteSequenceNumberGenerator =
|
|
519
|
+
transactionJsonObj._taxFreeCreditNoteSequenceNumberGenerator;
|
|
520
|
+
this._tillKey = transactionJsonObj._tillKey;
|
|
521
|
+
}
|
|
522
|
+
static generateTransactionId() {
|
|
523
|
+
return uuid.v4();
|
|
524
|
+
}
|
|
525
|
+
loadTransactionLinesFromJsonObject(linesFromJson, transactionLineFactory) {
|
|
526
|
+
const transactionLines = [];
|
|
527
|
+
for (const lineFromJson of linesFromJson) {
|
|
528
|
+
const transactionLine = transactionLineFactory.createTransactionLineFromJsonObj(lineFromJson);
|
|
529
|
+
transactionLines.push(transactionLine);
|
|
530
|
+
}
|
|
531
|
+
return transactionLines;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
exports.RetailTransaction = RetailTransaction;
|
|
535
|
+
function isRetailTransaction(transaction) {
|
|
536
|
+
return (transaction instanceof RetailTransaction ||
|
|
537
|
+
transaction.transactionType !== undefined);
|
|
538
|
+
// Note: To be more robust, this should also check for the presence of other required properties.
|
|
539
|
+
}
|
|
540
|
+
exports.isRetailTransaction = isRetailTransaction;
|
|
541
|
+
function findMerchandiseTransactionClosingState(state) {
|
|
542
|
+
switch (state) {
|
|
543
|
+
case "Completed":
|
|
544
|
+
return scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.Completed;
|
|
545
|
+
case "Suspended":
|
|
546
|
+
return scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.Suspended;
|
|
547
|
+
case "Voided":
|
|
548
|
+
return scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.Voided;
|
|
549
|
+
case "PostVoidCompleted":
|
|
550
|
+
return scp_types_commerce_transaction_1.MerchandiseTransactionClosingState.PostVoidCompleted;
|
|
551
|
+
default:
|
|
552
|
+
logger.debug(`Unable to determine MerchandiseTransactionClosingState for state: ${state}`);
|
|
553
|
+
return undefined;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
//# sourceMappingURL=RetailTransaction.js.map
|