@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.
Files changed (776) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +96 -0
  3. package/lib/config/DiTypes.d.ts +6 -0
  4. package/lib/config/DiTypes.js +10 -0
  5. package/lib/config/ErrorCodes.d.ts +10 -0
  6. package/lib/config/ErrorCodes.js +14 -0
  7. package/lib/config/index.d.ts +3 -0
  8. package/lib/config/index.js +9 -0
  9. package/lib/config/inversify/binding-helpers.d.ts +3 -0
  10. package/lib/config/inversify/binding-helpers.js +7 -0
  11. package/lib/config/inversify/index.d.ts +3 -0
  12. package/lib/config/inversify/index.js +9 -0
  13. package/lib/config/inversify/inversify.app.config.d.ts +19 -0
  14. package/lib/config/inversify/inversify.app.config.js +45 -0
  15. package/lib/config/inversify/inversify.terminal.config/index.d.ts +1 -0
  16. package/lib/config/inversify/inversify.terminal.config/index.js +7 -0
  17. package/lib/config/inversify/inversify.terminal.config/transaction-services.config.d.ts +11 -0
  18. package/lib/config/inversify/inversify.terminal.config/transaction-services.config.js +30 -0
  19. package/lib/domain/UIBusinessEventTypes.d.ts +305 -0
  20. package/lib/domain/UIBusinessEventTypes.js +313 -0
  21. package/lib/domain/index.d.ts +5 -0
  22. package/lib/domain/index.js +10 -0
  23. package/lib/domain/model/AddressVerification.d.ts +21 -0
  24. package/lib/domain/model/AddressVerification.js +3 -0
  25. package/lib/domain/model/ApplicationControlTransaction.d.ts +13 -0
  26. package/lib/domain/model/ApplicationControlTransaction.js +47 -0
  27. package/lib/domain/model/AtcudCodePrefixData.d.ts +19 -0
  28. package/lib/domain/model/AtcudCodePrefixData.js +3 -0
  29. package/lib/domain/model/BaseLineDecorator.d.ts +83 -0
  30. package/lib/domain/model/BaseLineDecorator.js +216 -0
  31. package/lib/domain/model/BaseTransactionLine.d.ts +71 -0
  32. package/lib/domain/model/BaseTransactionLine.js +183 -0
  33. package/lib/domain/model/CashDrawerDetail.d.ts +21 -0
  34. package/lib/domain/model/CashDrawerDetail.js +3 -0
  35. package/lib/domain/model/Constants.d.ts +977 -0
  36. package/lib/domain/model/Constants.js +985 -0
  37. package/lib/domain/model/CorruptedTransaction.d.ts +16 -0
  38. package/lib/domain/model/CorruptedTransaction.js +58 -0
  39. package/lib/domain/model/Coupon.d.ts +8 -0
  40. package/lib/domain/model/Coupon.js +3 -0
  41. package/lib/domain/model/CreateEinvoiceLine.d.ts +32 -0
  42. package/lib/domain/model/CreateEinvoiceLine.js +71 -0
  43. package/lib/domain/model/Customer.d.ts +387 -0
  44. package/lib/domain/model/Customer.js +320 -0
  45. package/lib/domain/model/CustomerServiceTransaction.d.ts +12 -0
  46. package/lib/domain/model/CustomerServiceTransaction.js +39 -0
  47. package/lib/domain/model/Department.d.ts +15 -0
  48. package/lib/domain/model/Department.js +3 -0
  49. package/lib/domain/model/EmailVerification.d.ts +24 -0
  50. package/lib/domain/model/EmailVerification.js +35 -0
  51. package/lib/domain/model/Employee.d.ts +80 -0
  52. package/lib/domain/model/Employee.js +73 -0
  53. package/lib/domain/model/EndOfTransactionTenderingSession.d.ts +39 -0
  54. package/lib/domain/model/EndOfTransactionTenderingSession.js +89 -0
  55. package/lib/domain/model/ExchangeRates.d.ts +13 -0
  56. package/lib/domain/model/ExchangeRates.js +8 -0
  57. package/lib/domain/model/FiscalControlTransaction.d.ts +12 -0
  58. package/lib/domain/model/FiscalControlTransaction.js +43 -0
  59. package/lib/domain/model/FulfillmentGroup.d.ts +35 -0
  60. package/lib/domain/model/FulfillmentGroup.js +137 -0
  61. package/lib/domain/model/IAppLocalFeaturesStorage.d.ts +78 -0
  62. package/lib/domain/model/IAppLocalFeaturesStorage.js +3 -0
  63. package/lib/domain/model/ICreateEinvoiceLine.d.ts +9 -0
  64. package/lib/domain/model/ICreateEinvoiceLine.js +3 -0
  65. package/lib/domain/model/IEmployeeDiscount.d.ts +15 -0
  66. package/lib/domain/model/IEmployeeDiscount.js +3 -0
  67. package/lib/domain/model/IFiscalTransactionNumberMaintainer.d.ts +10 -0
  68. package/lib/domain/model/IFiscalTransactionNumberMaintainer.js +8 -0
  69. package/lib/domain/model/IInvoiceOperation.d.ts +10 -0
  70. package/lib/domain/model/IInvoiceOperation.js +8 -0
  71. package/lib/domain/model/ILastRetailTransactionInfo.d.ts +13 -0
  72. package/lib/domain/model/ILastRetailTransactionInfo.js +3 -0
  73. package/lib/domain/model/ILastTransactionStatus.d.ts +5 -0
  74. package/lib/domain/model/ILastTransactionStatus.js +3 -0
  75. package/lib/domain/model/ILoyaltyVoucher.d.ts +28 -0
  76. package/lib/domain/model/ILoyaltyVoucher.js +9 -0
  77. package/lib/domain/model/IPrinterInfo.d.ts +6 -0
  78. package/lib/domain/model/IPrinterInfo.js +3 -0
  79. package/lib/domain/model/ISequence.d.ts +8 -0
  80. package/lib/domain/model/ISequence.js +3 -0
  81. package/lib/domain/model/IServiceResultLine.d.ts +4 -0
  82. package/lib/domain/model/IServiceResultLine.js +3 -0
  83. package/lib/domain/model/ISingleUseCoupon.d.ts +22 -0
  84. package/lib/domain/model/ISingleUseCoupon.js +38 -0
  85. package/lib/domain/model/ITransactionMetadataPersistanceObject.d.ts +12 -0
  86. package/lib/domain/model/ITransactionMetadataPersistanceObject.js +3 -0
  87. package/lib/domain/model/Inventory.d.ts +156 -0
  88. package/lib/domain/model/Inventory.js +78 -0
  89. package/lib/domain/model/ItemHandlingSession.d.ts +40 -0
  90. package/lib/domain/model/ItemHandlingSession.js +131 -0
  91. package/lib/domain/model/LoyaltyMembership.d.ts +153 -0
  92. package/lib/domain/model/LoyaltyMembership.js +23 -0
  93. package/lib/domain/model/MerchandiseTransaction.d.ts +310 -0
  94. package/lib/domain/model/MerchandiseTransaction.js +1299 -0
  95. package/lib/domain/model/MetricsLogs.d.ts +41 -0
  96. package/lib/domain/model/MetricsLogs.js +3 -0
  97. package/lib/domain/model/MunicipalFiscalCode.d.ts +25 -0
  98. package/lib/domain/model/MunicipalFiscalCode.js +3 -0
  99. package/lib/domain/model/NoSaleTransaction.d.ts +13 -0
  100. package/lib/domain/model/NoSaleTransaction.js +49 -0
  101. package/lib/domain/model/Order.d.ts +67 -0
  102. package/lib/domain/model/Order.js +190 -0
  103. package/lib/domain/model/OrderTotals.d.ts +44 -0
  104. package/lib/domain/model/OrderTotals.js +76 -0
  105. package/lib/domain/model/Organization.d.ts +99 -0
  106. package/lib/domain/model/Organization.js +3 -0
  107. package/lib/domain/model/PrepaidTender.d.ts +14 -0
  108. package/lib/domain/model/PrepaidTender.js +3 -0
  109. package/lib/domain/model/ReceiptSession.d.ts +87 -0
  110. package/lib/domain/model/ReceiptSession.js +206 -0
  111. package/lib/domain/model/ReprintReceiptTransaction.d.ts +49 -0
  112. package/lib/domain/model/ReprintReceiptTransaction.js +179 -0
  113. package/lib/domain/model/ResumeTransactionSession.d.ts +22 -0
  114. package/lib/domain/model/ResumeTransactionSession.js +56 -0
  115. package/lib/domain/model/RetailTransaction.d.ts +127 -0
  116. package/lib/domain/model/RetailTransaction.js +556 -0
  117. package/lib/domain/model/Sendsale.d.ts +4 -0
  118. package/lib/domain/model/Sendsale.js +3 -0
  119. package/lib/domain/model/StoreItem.d.ts +175 -0
  120. package/lib/domain/model/StoreItem.js +750 -0
  121. package/lib/domain/model/StoredValueCardSession.d.ts +29 -0
  122. package/lib/domain/model/StoredValueCardSession.js +65 -0
  123. package/lib/domain/model/StoredValueCertificateSession.d.ts +47 -0
  124. package/lib/domain/model/StoredValueCertificateSession.js +153 -0
  125. package/lib/domain/model/SubscriptionTokenSession.d.ts +22 -0
  126. package/lib/domain/model/SubscriptionTokenSession.js +60 -0
  127. package/lib/domain/model/Subscriptions.d.ts +12 -0
  128. package/lib/domain/model/Subscriptions.js +3 -0
  129. package/lib/domain/model/TaxRefundControlTransaction.d.ts +13 -0
  130. package/lib/domain/model/TaxRefundControlTransaction.js +50 -0
  131. package/lib/domain/model/TenderAuthorizationSession.d.ts +102 -0
  132. package/lib/domain/model/TenderAuthorizationSession.js +337 -0
  133. package/lib/domain/model/TenderControlTransaction.d.ts +30 -0
  134. package/lib/domain/model/TenderControlTransaction.js +138 -0
  135. package/lib/domain/model/TenderHandlingSession.d.ts +100 -0
  136. package/lib/domain/model/TenderHandlingSession.js +379 -0
  137. package/lib/domain/model/TenderType.d.ts +161 -0
  138. package/lib/domain/model/TenderType.js +1317 -0
  139. package/lib/domain/model/TerminalControlTransaction.d.ts +14 -0
  140. package/lib/domain/model/TerminalControlTransaction.js +55 -0
  141. package/lib/domain/model/TerminalSession.d.ts +49 -0
  142. package/lib/domain/model/TerminalSession.js +122 -0
  143. package/lib/domain/model/TillControlTransaction.d.ts +20 -0
  144. package/lib/domain/model/TillControlTransaction.js +79 -0
  145. package/lib/domain/model/TillSession.d.ts +67 -0
  146. package/lib/domain/model/TillSession.js +222 -0
  147. package/lib/domain/model/TransactionFlowState.d.ts +26 -0
  148. package/lib/domain/model/TransactionFlowState.js +72 -0
  149. package/lib/domain/model/TransactionReferenceLine.d.ts +112 -0
  150. package/lib/domain/model/TransactionReferenceLine.js +323 -0
  151. package/lib/domain/model/User.d.ts +115 -0
  152. package/lib/domain/model/User.js +210 -0
  153. package/lib/domain/model/UserSession.d.ts +36 -0
  154. package/lib/domain/model/UserSession.js +186 -0
  155. package/lib/domain/model/UserTransaction.d.ts +12 -0
  156. package/lib/domain/model/UserTransaction.js +38 -0
  157. package/lib/domain/model/VoidInterfaces.d.ts +15 -0
  158. package/lib/domain/model/VoidInterfaces.js +23 -0
  159. package/lib/domain/model/cashDrawer/CashDrawerRequestLine.d.ts +17 -0
  160. package/lib/domain/model/cashDrawer/CashDrawerRequestLine.js +50 -0
  161. package/lib/domain/model/cashDrawer/CashDrawerSession.d.ts +67 -0
  162. package/lib/domain/model/cashDrawer/CashDrawerSession.js +211 -0
  163. package/lib/domain/model/cashDrawer/CashDrawerStatusChangeLine.d.ts +30 -0
  164. package/lib/domain/model/cashDrawer/CashDrawerStatusChangeLine.js +86 -0
  165. package/lib/domain/model/cashDrawer/ICashDrawerRequestLine.d.ts +6 -0
  166. package/lib/domain/model/cashDrawer/ICashDrawerRequestLine.js +3 -0
  167. package/lib/domain/model/cashDrawer/ICashDrawerStatusChangeLine.d.ts +13 -0
  168. package/lib/domain/model/cashDrawer/ICashDrawerStatusChangeLine.js +3 -0
  169. package/lib/domain/model/cashDrawer/index.d.ts +5 -0
  170. package/lib/domain/model/cashDrawer/index.js +9 -0
  171. package/lib/domain/model/configuration/ConfigurationUtils.d.ts +3 -0
  172. package/lib/domain/model/configuration/ConfigurationUtils.js +8 -0
  173. package/lib/domain/model/configuration/DataEntryRule.d.ts +31 -0
  174. package/lib/domain/model/configuration/DataEntryRule.js +303 -0
  175. package/lib/domain/model/configuration/I18nReceiptFormattingInterface.d.ts +38 -0
  176. package/lib/domain/model/configuration/I18nReceiptFormattingInterface.js +3 -0
  177. package/lib/domain/model/configuration/I18nTaxFreeConfig.d.ts +11 -0
  178. package/lib/domain/model/configuration/I18nTaxFreeConfig.js +3 -0
  179. package/lib/domain/model/configuration/IAccessPolicyConfig.d.ts +5 -0
  180. package/lib/domain/model/configuration/IAccessPolicyConfig.js +3 -0
  181. package/lib/domain/model/configuration/IAdapterPoliciesConfig.d.ts +24 -0
  182. package/lib/domain/model/configuration/IAdapterPoliciesConfig.js +13 -0
  183. package/lib/domain/model/configuration/IConditionalAttributeBehaviorRuleConfig.d.ts +32 -0
  184. package/lib/domain/model/configuration/IConditionalAttributeBehaviorRuleConfig.js +8 -0
  185. package/lib/domain/model/configuration/ICustomerConfig.d.ts +31 -0
  186. package/lib/domain/model/configuration/ICustomerConfig.js +15 -0
  187. package/lib/domain/model/configuration/IDataEntryRuleConfig.d.ts +66 -0
  188. package/lib/domain/model/configuration/IDataEntryRuleConfig.js +22 -0
  189. package/lib/domain/model/configuration/IDiscountAttributesConfig .d.ts +26 -0
  190. package/lib/domain/model/configuration/IDiscountAttributesConfig .js +8 -0
  191. package/lib/domain/model/configuration/IDiscountBehaviorsConfig.d.ts +27 -0
  192. package/lib/domain/model/configuration/IDiscountBehaviorsConfig.js +21 -0
  193. package/lib/domain/model/configuration/IDonationBehaviorsConfig.d.ts +9 -0
  194. package/lib/domain/model/configuration/IDonationBehaviorsConfig.js +3 -0
  195. package/lib/domain/model/configuration/IFeatureAccessConfig.d.ts +186 -0
  196. package/lib/domain/model/configuration/IFeatureAccessConfig.js +51 -0
  197. package/lib/domain/model/configuration/IFeesConfig.d.ts +109 -0
  198. package/lib/domain/model/configuration/IFeesConfig.js +86 -0
  199. package/lib/domain/model/configuration/IPrinterTypeConfig.d.ts +25 -0
  200. package/lib/domain/model/configuration/IPrinterTypeConfig.js +3 -0
  201. package/lib/domain/model/configuration/IProductInquiryBehaviorsConfig.d.ts +8 -0
  202. package/lib/domain/model/configuration/IProductInquiryBehaviorsConfig.js +8 -0
  203. package/lib/domain/model/configuration/IReasonCodesConfig.d.ts +16 -0
  204. package/lib/domain/model/configuration/IReasonCodesConfig.js +3 -0
  205. package/lib/domain/model/configuration/IReceiptConfig.d.ts +64 -0
  206. package/lib/domain/model/configuration/IReceiptConfig.js +24 -0
  207. package/lib/domain/model/configuration/IReceiptFormattingConfig.d.ts +155 -0
  208. package/lib/domain/model/configuration/IReceiptFormattingConfig.js +27 -0
  209. package/lib/domain/model/configuration/IReceiptStylingConfig.d.ts +52 -0
  210. package/lib/domain/model/configuration/IReceiptStylingConfig.js +18 -0
  211. package/lib/domain/model/configuration/IReserveInventoryConfig.d.ts +4 -0
  212. package/lib/domain/model/configuration/IReserveInventoryConfig.js +8 -0
  213. package/lib/domain/model/configuration/ISelfCheckoutModeBehaviorsConfig.d.ts +14 -0
  214. package/lib/domain/model/configuration/ISelfCheckoutModeBehaviorsConfig.js +3 -0
  215. package/lib/domain/model/configuration/ISequenceConfig.d.ts +44 -0
  216. package/lib/domain/model/configuration/ISequenceConfig.js +26 -0
  217. package/lib/domain/model/configuration/IStoreOperationsBehavior.d.ts +7 -0
  218. package/lib/domain/model/configuration/IStoreOperationsBehavior.js +8 -0
  219. package/lib/domain/model/configuration/IStoreShippingMethodConfig.d.ts +21 -0
  220. package/lib/domain/model/configuration/IStoreShippingMethodConfig.js +3 -0
  221. package/lib/domain/model/configuration/ITaxBehaviorConfig.d.ts +14 -0
  222. package/lib/domain/model/configuration/ITaxBehaviorConfig.js +3 -0
  223. package/lib/domain/model/configuration/ITaxRefundConfig.d.ts +8 -0
  224. package/lib/domain/model/configuration/ITaxRefundConfig.js +3 -0
  225. package/lib/domain/model/configuration/ITendersConfig.d.ts +88 -0
  226. package/lib/domain/model/configuration/ITendersConfig.js +22 -0
  227. package/lib/domain/model/configuration/Ii18n.d.ts +4 -0
  228. package/lib/domain/model/configuration/Ii18n.js +3 -0
  229. package/lib/domain/model/configuration/TaxLottery.d.ts +4 -0
  230. package/lib/domain/model/configuration/TaxLottery.js +8 -0
  231. package/lib/domain/model/configuration/index.d.ts +30 -0
  232. package/lib/domain/model/configuration/index.js +25 -0
  233. package/lib/domain/model/customer/CreateCustomerLine.d.ts +151 -0
  234. package/lib/domain/model/customer/CreateCustomerLine.js +312 -0
  235. package/lib/domain/model/customer/CustomerLine.d.ts +43 -0
  236. package/lib/domain/model/customer/CustomerLine.js +109 -0
  237. package/lib/domain/model/customer/ICreateCustomerLine.d.ts +16 -0
  238. package/lib/domain/model/customer/ICreateCustomerLine.js +3 -0
  239. package/lib/domain/model/customer/ICustomerI18nFormats.d.ts +126 -0
  240. package/lib/domain/model/customer/ICustomerI18nFormats.js +67 -0
  241. package/lib/domain/model/customer/ICustomerLine.d.ts +8 -0
  242. package/lib/domain/model/customer/ICustomerLine.js +3 -0
  243. package/lib/domain/model/customer/ITaxCustomerLine.d.ts +46 -0
  244. package/lib/domain/model/customer/ITaxCustomerLine.js +3 -0
  245. package/lib/domain/model/customer/IUpdateCustomerLine.d.ts +30 -0
  246. package/lib/domain/model/customer/IUpdateCustomerLine.js +3 -0
  247. package/lib/domain/model/customer/TaxCustomerLine.d.ts +105 -0
  248. package/lib/domain/model/customer/TaxCustomerLine.js +252 -0
  249. package/lib/domain/model/customer/UpdateCustomerLine.d.ts +148 -0
  250. package/lib/domain/model/customer/UpdateCustomerLine.js +296 -0
  251. package/lib/domain/model/customer/index.d.ts +9 -0
  252. package/lib/domain/model/customer/index.js +11 -0
  253. package/lib/domain/model/digitalSignature/DigitalSignatureFailureLine.d.ts +11 -0
  254. package/lib/domain/model/digitalSignature/DigitalSignatureFailureLine.js +33 -0
  255. package/lib/domain/model/digitalSignature/index.d.ts +1 -0
  256. package/lib/domain/model/digitalSignature/index.js +7 -0
  257. package/lib/domain/model/discounts/BaseManualDiscountLine.d.ts +119 -0
  258. package/lib/domain/model/discounts/BaseManualDiscountLine.js +435 -0
  259. package/lib/domain/model/discounts/BaseManualDiscountLineDecorator.d.ts +42 -0
  260. package/lib/domain/model/discounts/BaseManualDiscountLineDecorator.js +107 -0
  261. package/lib/domain/model/discounts/BasePromotionCouponLine.d.ts +22 -0
  262. package/lib/domain/model/discounts/BasePromotionCouponLine.js +45 -0
  263. package/lib/domain/model/discounts/BasePromotionCouponLineDecorator.d.ts +15 -0
  264. package/lib/domain/model/discounts/BasePromotionCouponLineDecorator.js +38 -0
  265. package/lib/domain/model/discounts/ExpiredCouponOverrideLine.d.ts +27 -0
  266. package/lib/domain/model/discounts/ExpiredCouponOverrideLine.js +54 -0
  267. package/lib/domain/model/discounts/IManualDiscountLine.d.ts +33 -0
  268. package/lib/domain/model/discounts/IManualDiscountLine.js +3 -0
  269. package/lib/domain/model/discounts/IPromotionCouponLine.d.ts +10 -0
  270. package/lib/domain/model/discounts/IPromotionCouponLine.js +3 -0
  271. package/lib/domain/model/discounts/LoyaltyActivityDiscountLineTotalDecorator.d.ts +15 -0
  272. package/lib/domain/model/discounts/LoyaltyActivityDiscountLineTotalDecorator.js +32 -0
  273. package/lib/domain/model/discounts/LoyaltyDiscountLine.d.ts +52 -0
  274. package/lib/domain/model/discounts/LoyaltyDiscountLine.js +131 -0
  275. package/lib/domain/model/discounts/LoyaltyDiscountLineTotalDecorator.d.ts +26 -0
  276. package/lib/domain/model/discounts/LoyaltyDiscountLineTotalDecorator.js +66 -0
  277. package/lib/domain/model/discounts/ManualDiscountLineModificationDecorator.d.ts +49 -0
  278. package/lib/domain/model/discounts/ManualDiscountLineModificationDecorator.js +143 -0
  279. package/lib/domain/model/discounts/ManualDiscountLineTotalDecorator.d.ts +15 -0
  280. package/lib/domain/model/discounts/ManualDiscountLineTotalDecorator.js +32 -0
  281. package/lib/domain/model/discounts/ManualItemDiscountLine.d.ts +27 -0
  282. package/lib/domain/model/discounts/ManualItemDiscountLine.js +53 -0
  283. package/lib/domain/model/discounts/ManualTransactionDiscountLine.d.ts +22 -0
  284. package/lib/domain/model/discounts/ManualTransactionDiscountLine.js +40 -0
  285. package/lib/domain/model/discounts/ModifyManualDiscountLine.d.ts +29 -0
  286. package/lib/domain/model/discounts/ModifyManualDiscountLine.js +62 -0
  287. package/lib/domain/model/discounts/PromotionCouponLine.d.ts +22 -0
  288. package/lib/domain/model/discounts/PromotionCouponLine.js +59 -0
  289. package/lib/domain/model/discounts/VoidedDiscountLineDecorator.d.ts +15 -0
  290. package/lib/domain/model/discounts/VoidedDiscountLineDecorator.js +38 -0
  291. package/lib/domain/model/discounts/VoidedLoyaltyDiscountLineDecorator.d.ts +18 -0
  292. package/lib/domain/model/discounts/VoidedLoyaltyDiscountLineDecorator.js +46 -0
  293. package/lib/domain/model/discounts/VoidedPromotionCouponLineDecorator.d.ts +13 -0
  294. package/lib/domain/model/discounts/VoidedPromotionCouponLineDecorator.js +32 -0
  295. package/lib/domain/model/discounts/employee/EmployeeDiscountLine.d.ts +17 -0
  296. package/lib/domain/model/discounts/employee/EmployeeDiscountLine.js +43 -0
  297. package/lib/domain/model/discounts/employee/index.d.ts +1 -0
  298. package/lib/domain/model/discounts/employee/index.js +7 -0
  299. package/lib/domain/model/discounts/index.d.ts +19 -0
  300. package/lib/domain/model/discounts/index.js +23 -0
  301. package/lib/domain/model/discounts/lineTypes.d.ts +12 -0
  302. package/lib/domain/model/discounts/lineTypes.js +30 -0
  303. package/lib/domain/model/donation/BaseDonationLineDecorator.d.ts +16 -0
  304. package/lib/domain/model/donation/BaseDonationLineDecorator.js +38 -0
  305. package/lib/domain/model/donation/DonationLine.d.ts +43 -0
  306. package/lib/domain/model/donation/DonationLine.js +102 -0
  307. package/lib/domain/model/donation/IDonationLine.d.ts +9 -0
  308. package/lib/domain/model/donation/IDonationLine.js +3 -0
  309. package/lib/domain/model/donation/VoidedDonationLineDecorator.d.ts +17 -0
  310. package/lib/domain/model/donation/VoidedDonationLineDecorator.js +43 -0
  311. package/lib/domain/model/donation/index.d.ts +4 -0
  312. package/lib/domain/model/donation/index.js +9 -0
  313. package/lib/domain/model/employeeCustomer/BaseEmployeeCustomerLineDecorator.d.ts +13 -0
  314. package/lib/domain/model/employeeCustomer/BaseEmployeeCustomerLineDecorator.js +32 -0
  315. package/lib/domain/model/employeeCustomer/EmployeeCustomerLine.d.ts +39 -0
  316. package/lib/domain/model/employeeCustomer/EmployeeCustomerLine.js +98 -0
  317. package/lib/domain/model/employeeCustomer/IEmployeeCustomerLine.d.ts +8 -0
  318. package/lib/domain/model/employeeCustomer/IEmployeeCustomerLine.js +3 -0
  319. package/lib/domain/model/employeeCustomer/VoidedEmployeeCustomerLineDecorator.d.ts +15 -0
  320. package/lib/domain/model/employeeCustomer/VoidedEmployeeCustomerLineDecorator.js +38 -0
  321. package/lib/domain/model/employeeCustomer/index.d.ts +4 -0
  322. package/lib/domain/model/employeeCustomer/index.js +9 -0
  323. package/lib/domain/model/extensibilityForm/ExtensibilityFormDataLine.d.ts +26 -0
  324. package/lib/domain/model/extensibilityForm/ExtensibilityFormDataLine.js +74 -0
  325. package/lib/domain/model/extensibilityForm/IExtensibilityForm.d.ts +8 -0
  326. package/lib/domain/model/extensibilityForm/IExtensibilityForm.js +3 -0
  327. package/lib/domain/model/extensibilityForm/index.d.ts +2 -0
  328. package/lib/domain/model/extensibilityForm/index.js +7 -0
  329. package/lib/domain/model/fee/BaseFeeLineDecorator.d.ts +68 -0
  330. package/lib/domain/model/fee/BaseFeeLineDecorator.js +194 -0
  331. package/lib/domain/model/fee/FeeLine.d.ts +179 -0
  332. package/lib/domain/model/fee/FeeLine.js +660 -0
  333. package/lib/domain/model/fee/FeeLineBaseTaxAdjustmentDecorator.d.ts +18 -0
  334. package/lib/domain/model/fee/FeeLineBaseTaxAdjustmentDecorator.js +52 -0
  335. package/lib/domain/model/fee/FeeLineChangeQuantityDecorator.d.ts +14 -0
  336. package/lib/domain/model/fee/FeeLineChangeQuantityDecorator.js +35 -0
  337. package/lib/domain/model/fee/FeeLineExtendedAmountDecorator.d.ts +38 -0
  338. package/lib/domain/model/fee/FeeLineExtendedAmountDecorator.js +134 -0
  339. package/lib/domain/model/fee/FeeLineOriginalPricingAdjustmentDecorator.d.ts +22 -0
  340. package/lib/domain/model/fee/FeeLineOriginalPricingAdjustmentDecorator.js +82 -0
  341. package/lib/domain/model/fee/FeeLinePricingExtendedAmountDecorator.d.ts +22 -0
  342. package/lib/domain/model/fee/FeeLinePricingExtendedAmountDecorator.js +82 -0
  343. package/lib/domain/model/fee/FeeLineTaxExemptDecorator.d.ts +24 -0
  344. package/lib/domain/model/fee/FeeLineTaxExemptDecorator.js +67 -0
  345. package/lib/domain/model/fee/FeeLineTaxOverrideDecorator.d.ts +21 -0
  346. package/lib/domain/model/fee/FeeLineTaxOverrideDecorator.js +63 -0
  347. package/lib/domain/model/fee/FeeQuantityChangeLine.d.ts +19 -0
  348. package/lib/domain/model/fee/FeeQuantityChangeLine.js +52 -0
  349. package/lib/domain/model/fee/IFeeLine.d.ts +104 -0
  350. package/lib/domain/model/fee/IFeeLine.js +3 -0
  351. package/lib/domain/model/fee/VoidedFeeLineDecorator.d.ts +15 -0
  352. package/lib/domain/model/fee/VoidedFeeLineDecorator.js +38 -0
  353. package/lib/domain/model/fee/index.d.ts +12 -0
  354. package/lib/domain/model/fee/index.js +17 -0
  355. package/lib/domain/model/fiscalDevice/FiscalDeviceManagementLine.d.ts +34 -0
  356. package/lib/domain/model/fiscalDevice/FiscalDeviceManagementLine.js +69 -0
  357. package/lib/domain/model/fiscalDevice/FiscalDeviceManagementRetryLine.d.ts +15 -0
  358. package/lib/domain/model/fiscalDevice/FiscalDeviceManagementRetryLine.js +45 -0
  359. package/lib/domain/model/fiscalDevice/FiscalDeviceStatusLine.d.ts +35 -0
  360. package/lib/domain/model/fiscalDevice/FiscalDeviceStatusLine.js +87 -0
  361. package/lib/domain/model/fiscalDevice/index.d.ts +3 -0
  362. package/lib/domain/model/fiscalDevice/index.js +9 -0
  363. package/lib/domain/model/foreignCurrency/ExchangeRateManualEntryLine.d.ts +29 -0
  364. package/lib/domain/model/foreignCurrency/ExchangeRateManualEntryLine.js +67 -0
  365. package/lib/domain/model/foreignCurrency/index.d.ts +1 -0
  366. package/lib/domain/model/foreignCurrency/index.js +7 -0
  367. package/lib/domain/model/geoLocation.d.ts +23 -0
  368. package/lib/domain/model/geoLocation.js +3 -0
  369. package/lib/domain/model/giftCard/BalanceInquiryLine.d.ts +34 -0
  370. package/lib/domain/model/giftCard/BalanceInquiryLine.js +86 -0
  371. package/lib/domain/model/giftCard/index.d.ts +1 -0
  372. package/lib/domain/model/giftCard/index.js +7 -0
  373. package/lib/domain/model/index.d.ts +108 -0
  374. package/lib/domain/model/index.js +95 -0
  375. package/lib/domain/model/inventory/ReserveInventoryLine.d.ts +32 -0
  376. package/lib/domain/model/inventory/ReserveInventoryLine.js +76 -0
  377. package/lib/domain/model/inventory/index.d.ts +1 -0
  378. package/lib/domain/model/inventory/index.js +7 -0
  379. package/lib/domain/model/item/BaseItemLineDecorator.d.ts +148 -0
  380. package/lib/domain/model/item/BaseItemLineDecorator.js +400 -0
  381. package/lib/domain/model/item/BasePriceChangeLineDecorator.d.ts +20 -0
  382. package/lib/domain/model/item/BasePriceChangeLineDecorator.js +50 -0
  383. package/lib/domain/model/item/IAllLinePricingAdjustments.d.ts +32 -0
  384. package/lib/domain/model/item/IAllLinePricingAdjustments.js +66 -0
  385. package/lib/domain/model/item/IHardSoftStopItemInfo.d.ts +11 -0
  386. package/lib/domain/model/item/IHardSoftStopItemInfo.js +3 -0
  387. package/lib/domain/model/item/IItemLine.d.ts +313 -0
  388. package/lib/domain/model/item/IItemLine.js +7 -0
  389. package/lib/domain/model/item/ISerializedPriceCalculationResultsWithSource.d.ts +45 -0
  390. package/lib/domain/model/item/ISerializedPriceCalculationResultsWithSource.js +3 -0
  391. package/lib/domain/model/item/ItemLine.d.ts +303 -0
  392. package/lib/domain/model/item/ItemLine.js +1169 -0
  393. package/lib/domain/model/item/ItemLineBaseDiscountDecorator.d.ts +75 -0
  394. package/lib/domain/model/item/ItemLineBaseDiscountDecorator.js +178 -0
  395. package/lib/domain/model/item/ItemLineBaseTaxAdjustmentDecorator.d.ts +19 -0
  396. package/lib/domain/model/item/ItemLineBaseTaxAdjustmentDecorator.js +51 -0
  397. package/lib/domain/model/item/ItemLineCommentReceiptDecorator.d.ts +17 -0
  398. package/lib/domain/model/item/ItemLineCommentReceiptDecorator.js +40 -0
  399. package/lib/domain/model/item/ItemLineExtendedAmountDecorator.d.ts +30 -0
  400. package/lib/domain/model/item/ItemLineExtendedAmountDecorator.js +124 -0
  401. package/lib/domain/model/item/ItemLineExtensibilityFormDataDecorator.d.ts +18 -0
  402. package/lib/domain/model/item/ItemLineExtensibilityFormDataDecorator.js +43 -0
  403. package/lib/domain/model/item/ItemLineGiftIssueDecorator.d.ts +17 -0
  404. package/lib/domain/model/item/ItemLineGiftIssueDecorator.js +53 -0
  405. package/lib/domain/model/item/ItemLineGiftReceiptDecorator.d.ts +15 -0
  406. package/lib/domain/model/item/ItemLineGiftReceiptDecorator.js +37 -0
  407. package/lib/domain/model/item/ItemLineManualDiscountDecorator.d.ts +57 -0
  408. package/lib/domain/model/item/ItemLineManualDiscountDecorator.js +198 -0
  409. package/lib/domain/model/item/ItemLineNonFinancialRewardDecorator.d.ts +40 -0
  410. package/lib/domain/model/item/ItemLineNonFinancialRewardDecorator.js +116 -0
  411. package/lib/domain/model/item/ItemLineOriginalAdjustmentDecorator.d.ts +13 -0
  412. package/lib/domain/model/item/ItemLineOriginalAdjustmentDecorator.js +54 -0
  413. package/lib/domain/model/item/ItemLinePriceChangeDecorator.d.ts +18 -0
  414. package/lib/domain/model/item/ItemLinePriceChangeDecorator.js +47 -0
  415. package/lib/domain/model/item/ItemLinePromotionDecorator.d.ts +45 -0
  416. package/lib/domain/model/item/ItemLinePromotionDecorator.js +142 -0
  417. package/lib/domain/model/item/ItemLineQuantityChangeDecorator.d.ts +18 -0
  418. package/lib/domain/model/item/ItemLineQuantityChangeDecorator.js +57 -0
  419. package/lib/domain/model/item/ItemLineReasonCodeChangeDecorator.d.ts +16 -0
  420. package/lib/domain/model/item/ItemLineReasonCodeChangeDecorator.js +49 -0
  421. package/lib/domain/model/item/ItemLineRegularPriceDecorator.d.ts +21 -0
  422. package/lib/domain/model/item/ItemLineRegularPriceDecorator.js +58 -0
  423. package/lib/domain/model/item/ItemLineReserveInventoryDecorator.d.ts +17 -0
  424. package/lib/domain/model/item/ItemLineReserveInventoryDecorator.js +42 -0
  425. package/lib/domain/model/item/ItemLineRewardDecorator.d.ts +39 -0
  426. package/lib/domain/model/item/ItemLineRewardDecorator.js +115 -0
  427. package/lib/domain/model/item/ItemLineSalePriceDecorator.d.ts +19 -0
  428. package/lib/domain/model/item/ItemLineSalePriceDecorator.js +51 -0
  429. package/lib/domain/model/item/ItemLineSalespersonDecorator.d.ts +17 -0
  430. package/lib/domain/model/item/ItemLineSalespersonDecorator.js +44 -0
  431. package/lib/domain/model/item/ItemLineSendSaleDecorator.d.ts +16 -0
  432. package/lib/domain/model/item/ItemLineSendSaleDecorator.js +39 -0
  433. package/lib/domain/model/item/ItemLineSubscriptionDecorator.d.ts +17 -0
  434. package/lib/domain/model/item/ItemLineSubscriptionDecorator.js +40 -0
  435. package/lib/domain/model/item/ItemLineTaxExemptDecorator.d.ts +21 -0
  436. package/lib/domain/model/item/ItemLineTaxExemptDecorator.js +64 -0
  437. package/lib/domain/model/item/ItemLineTaxOverrideDecorator.d.ts +19 -0
  438. package/lib/domain/model/item/ItemLineTaxOverrideDecorator.js +59 -0
  439. package/lib/domain/model/item/ItemOrderCancellationLine.d.ts +27 -0
  440. package/lib/domain/model/item/ItemOrderCancellationLine.js +65 -0
  441. package/lib/domain/model/item/ItemPriceChangeLine.d.ts +44 -0
  442. package/lib/domain/model/item/ItemPriceChangeLine.js +131 -0
  443. package/lib/domain/model/item/ItemQuantityChangeLine.d.ts +31 -0
  444. package/lib/domain/model/item/ItemQuantityChangeLine.js +93 -0
  445. package/lib/domain/model/item/ReasonCodeChangeLine.d.ts +32 -0
  446. package/lib/domain/model/item/ReasonCodeChangeLine.js +83 -0
  447. package/lib/domain/model/item/ReservedOrderItemLineCancellationDecorator.d.ts +19 -0
  448. package/lib/domain/model/item/ReservedOrderItemLineCancellationDecorator.js +52 -0
  449. package/lib/domain/model/item/VoidedItemLineDecorator.d.ts +28 -0
  450. package/lib/domain/model/item/VoidedItemLineDecorator.js +65 -0
  451. package/lib/domain/model/item/VoidedPriceChangeLineDecorator.d.ts +15 -0
  452. package/lib/domain/model/item/VoidedPriceChangeLineDecorator.js +38 -0
  453. package/lib/domain/model/item/index.d.ts +37 -0
  454. package/lib/domain/model/item/index.js +41 -0
  455. package/lib/domain/model/lottery/TaxLotteryAddLine.d.ts +24 -0
  456. package/lib/domain/model/lottery/TaxLotteryAddLine.js +54 -0
  457. package/lib/domain/model/lottery/TaxLotteryModificationLine.d.ts +26 -0
  458. package/lib/domain/model/lottery/TaxLotteryModificationLine.js +61 -0
  459. package/lib/domain/model/lottery/TaxLotteryVoidLine.d.ts +28 -0
  460. package/lib/domain/model/lottery/TaxLotteryVoidLine.js +66 -0
  461. package/lib/domain/model/lottery/index.d.ts +3 -0
  462. package/lib/domain/model/lottery/index.js +9 -0
  463. package/lib/domain/model/loyaltyMembership/LoyaltyEnrollmentLine.d.ts +46 -0
  464. package/lib/domain/model/loyaltyMembership/LoyaltyEnrollmentLine.js +105 -0
  465. package/lib/domain/model/loyaltyMembership/LoyaltyMembershipLine.d.ts +34 -0
  466. package/lib/domain/model/loyaltyMembership/LoyaltyMembershipLine.js +117 -0
  467. package/lib/domain/model/loyaltyMembership/index.d.ts +2 -0
  468. package/lib/domain/model/loyaltyMembership/index.js +8 -0
  469. package/lib/domain/model/mixedBasket/IMixedBasket.d.ts +4 -0
  470. package/lib/domain/model/mixedBasket/IMixedBasket.js +3 -0
  471. package/lib/domain/model/mixedBasket/MixedBasketSession.d.ts +21 -0
  472. package/lib/domain/model/mixedBasket/MixedBasketSession.js +55 -0
  473. package/lib/domain/model/mixedBasket/index.d.ts +2 -0
  474. package/lib/domain/model/mixedBasket/index.js +7 -0
  475. package/lib/domain/model/noSale/NoSaleLine.d.ts +32 -0
  476. package/lib/domain/model/noSale/NoSaleLine.js +75 -0
  477. package/lib/domain/model/noSale/StartNoSaleLine.d.ts +33 -0
  478. package/lib/domain/model/noSale/StartNoSaleLine.js +75 -0
  479. package/lib/domain/model/noSale/index.d.ts +2 -0
  480. package/lib/domain/model/noSale/index.js +8 -0
  481. package/lib/domain/model/order/IOrderTotalsAccumulator.d.ts +23 -0
  482. package/lib/domain/model/order/IOrderTotalsAccumulator.js +3 -0
  483. package/lib/domain/model/order/OrderDeliveryAssignmentLine.d.ts +20 -0
  484. package/lib/domain/model/order/OrderDeliveryAssignmentLine.js +64 -0
  485. package/lib/domain/model/order/OrderItemReference.d.ts +5 -0
  486. package/lib/domain/model/order/OrderItemReference.js +3 -0
  487. package/lib/domain/model/order/OrderTotalsAccumulator.d.ts +39 -0
  488. package/lib/domain/model/order/OrderTotalsAccumulator.js +48 -0
  489. package/lib/domain/model/order/index.d.ts +4 -0
  490. package/lib/domain/model/order/index.js +8 -0
  491. package/lib/domain/model/paidOperation/PaidOperationLine.d.ts +23 -0
  492. package/lib/domain/model/paidOperation/PaidOperationLine.js +65 -0
  493. package/lib/domain/model/paidOperation/PaidOperationSignatureLine.d.ts +27 -0
  494. package/lib/domain/model/paidOperation/PaidOperationSignatureLine.js +58 -0
  495. package/lib/domain/model/paidOperation/StartPaidOperationLine.d.ts +34 -0
  496. package/lib/domain/model/paidOperation/StartPaidOperationLine.js +75 -0
  497. package/lib/domain/model/paidOperation/index.d.ts +3 -0
  498. package/lib/domain/model/paidOperation/index.js +9 -0
  499. package/lib/domain/model/paymentDevice/IUploadDeviceLogsLine.d.ts +6 -0
  500. package/lib/domain/model/paymentDevice/IUploadDeviceLogsLine.js +3 -0
  501. package/lib/domain/model/paymentDevice/UploadDeviceLogLine.d.ts +28 -0
  502. package/lib/domain/model/paymentDevice/UploadDeviceLogLine.js +57 -0
  503. package/lib/domain/model/paymentDevice/index.d.ts +1 -0
  504. package/lib/domain/model/paymentDevice/index.js +7 -0
  505. package/lib/domain/model/print/PrintStatusLine.d.ts +27 -0
  506. package/lib/domain/model/print/PrintStatusLine.js +55 -0
  507. package/lib/domain/model/print/index.d.ts +1 -0
  508. package/lib/domain/model/print/index.js +7 -0
  509. package/lib/domain/model/receipt/BaseReceiptLineDecorator.d.ts +49 -0
  510. package/lib/domain/model/receipt/BaseReceiptLineDecorator.js +115 -0
  511. package/lib/domain/model/receipt/FiscalReceiptLine.d.ts +63 -0
  512. package/lib/domain/model/receipt/FiscalReceiptLine.js +170 -0
  513. package/lib/domain/model/receipt/GiftReceiptLine.d.ts +17 -0
  514. package/lib/domain/model/receipt/GiftReceiptLine.js +51 -0
  515. package/lib/domain/model/receipt/IPrintRetryLine.d.ts +4 -0
  516. package/lib/domain/model/receipt/IPrintRetryLine.js +3 -0
  517. package/lib/domain/model/receipt/IReceiptLine.d.ts +37 -0
  518. package/lib/domain/model/receipt/IReceiptLine.js +3 -0
  519. package/lib/domain/model/receipt/IReceiptRefundMessage.d.ts +4 -0
  520. package/lib/domain/model/receipt/IReceiptRefundMessage.js +3 -0
  521. package/lib/domain/model/receipt/ItemCommentLine.d.ts +16 -0
  522. package/lib/domain/model/receipt/ItemCommentLine.js +50 -0
  523. package/lib/domain/model/receipt/PrintRetryLine.d.ts +14 -0
  524. package/lib/domain/model/receipt/PrintRetryLine.js +43 -0
  525. package/lib/domain/model/receipt/PrintRetryLineDecorator.d.ts +12 -0
  526. package/lib/domain/model/receipt/PrintRetryLineDecorator.js +28 -0
  527. package/lib/domain/model/receipt/PrinterStatusReceiptLineDecorator.d.ts +12 -0
  528. package/lib/domain/model/receipt/PrinterStatusReceiptLineDecorator.js +38 -0
  529. package/lib/domain/model/receipt/ReceiptDestinationReceiptLineDecorator.d.ts +18 -0
  530. package/lib/domain/model/receipt/ReceiptDestinationReceiptLineDecorator.js +44 -0
  531. package/lib/domain/model/receipt/ReceiptLine.d.ts +88 -0
  532. package/lib/domain/model/receipt/ReceiptLine.js +236 -0
  533. package/lib/domain/model/receipt/ReceiptOptionLine.d.ts +44 -0
  534. package/lib/domain/model/receipt/ReceiptOptionLine.js +107 -0
  535. package/lib/domain/model/receipt/index.d.ts +12 -0
  536. package/lib/domain/model/receipt/index.js +15 -0
  537. package/lib/domain/model/reprint/ReprintTransactionLine.d.ts +30 -0
  538. package/lib/domain/model/reprint/ReprintTransactionLine.js +64 -0
  539. package/lib/domain/model/reprint/index.d.ts +1 -0
  540. package/lib/domain/model/reprint/index.js +7 -0
  541. package/lib/domain/model/salesperson/SalespersonLine.d.ts +27 -0
  542. package/lib/domain/model/salesperson/SalespersonLine.js +60 -0
  543. package/lib/domain/model/salesperson/index.d.ts +1 -0
  544. package/lib/domain/model/salesperson/index.js +7 -0
  545. package/lib/domain/model/sendsale/SendSaleConversionLine.d.ts +25 -0
  546. package/lib/domain/model/sendsale/SendSaleConversionLine.js +50 -0
  547. package/lib/domain/model/sendsale/index.d.ts +1 -0
  548. package/lib/domain/model/sendsale/index.js +7 -0
  549. package/lib/domain/model/shipping/ShippingFeeChangeLine.d.ts +39 -0
  550. package/lib/domain/model/shipping/ShippingFeeChangeLine.js +95 -0
  551. package/lib/domain/model/shipping/ShippingFeeLineChangeDecorator.d.ts +26 -0
  552. package/lib/domain/model/shipping/ShippingFeeLineChangeDecorator.js +81 -0
  553. package/lib/domain/model/shipping/index.d.ts +2 -0
  554. package/lib/domain/model/shipping/index.js +8 -0
  555. package/lib/domain/model/subscription/AddSubscriptionLine.d.ts +31 -0
  556. package/lib/domain/model/subscription/AddSubscriptionLine.js +69 -0
  557. package/lib/domain/model/subscription/ModifySubscriptionLine.d.ts +31 -0
  558. package/lib/domain/model/subscription/ModifySubscriptionLine.js +69 -0
  559. package/lib/domain/model/subscription/RemoveSubscriptionLine.d.ts +25 -0
  560. package/lib/domain/model/subscription/RemoveSubscriptionLine.js +50 -0
  561. package/lib/domain/model/subscription/index.d.ts +3 -0
  562. package/lib/domain/model/subscription/index.js +9 -0
  563. package/lib/domain/model/supervisorOverride/ISupervisorCredentials.d.ts +4 -0
  564. package/lib/domain/model/supervisorOverride/ISupervisorCredentials.js +3 -0
  565. package/lib/domain/model/supervisorOverride/SupervisorOverrideLine.d.ts +24 -0
  566. package/lib/domain/model/supervisorOverride/SupervisorOverrideLine.js +51 -0
  567. package/lib/domain/model/supervisorOverride/index.d.ts +2 -0
  568. package/lib/domain/model/supervisorOverride/index.js +7 -0
  569. package/lib/domain/model/taxExempt/BaseTaxExemptLine.d.ts +53 -0
  570. package/lib/domain/model/taxExempt/BaseTaxExemptLine.js +187 -0
  571. package/lib/domain/model/taxExempt/BaseTaxExemptLineDecorator.d.ts +27 -0
  572. package/lib/domain/model/taxExempt/BaseTaxExemptLineDecorator.js +74 -0
  573. package/lib/domain/model/taxExempt/ITaxExemptLine.d.ts +22 -0
  574. package/lib/domain/model/taxExempt/ITaxExemptLine.js +3 -0
  575. package/lib/domain/model/taxExempt/ItemTaxExemptLine.d.ts +23 -0
  576. package/lib/domain/model/taxExempt/ItemTaxExemptLine.js +47 -0
  577. package/lib/domain/model/taxExempt/ItemTaxExemptLineModificationDecorator.d.ts +32 -0
  578. package/lib/domain/model/taxExempt/ItemTaxExemptLineModificationDecorator.js +91 -0
  579. package/lib/domain/model/taxExempt/ModifyItemTaxExemptLine.d.ts +28 -0
  580. package/lib/domain/model/taxExempt/ModifyItemTaxExemptLine.js +62 -0
  581. package/lib/domain/model/taxExempt/ModifyTransactionTaxExemptLine.d.ts +28 -0
  582. package/lib/domain/model/taxExempt/ModifyTransactionTaxExemptLine.js +62 -0
  583. package/lib/domain/model/taxExempt/TransactionTaxExemptLine.d.ts +23 -0
  584. package/lib/domain/model/taxExempt/TransactionTaxExemptLine.js +47 -0
  585. package/lib/domain/model/taxExempt/TransactionTaxExemptLineModificationDecorator.d.ts +32 -0
  586. package/lib/domain/model/taxExempt/TransactionTaxExemptLineModificationDecorator.js +93 -0
  587. package/lib/domain/model/taxExempt/VoidedItemTaxExemptLineDecorator.d.ts +15 -0
  588. package/lib/domain/model/taxExempt/VoidedItemTaxExemptLineDecorator.js +38 -0
  589. package/lib/domain/model/taxExempt/VoidedTransactionTaxExemptLineDecorator.d.ts +15 -0
  590. package/lib/domain/model/taxExempt/VoidedTransactionTaxExemptLineDecorator.js +38 -0
  591. package/lib/domain/model/taxExempt/index.d.ts +11 -0
  592. package/lib/domain/model/taxExempt/index.js +16 -0
  593. package/lib/domain/model/taxLottery/TaxLotteryLine.d.ts +24 -0
  594. package/lib/domain/model/taxLottery/TaxLotteryLine.js +49 -0
  595. package/lib/domain/model/taxLottery/index.d.ts +1 -0
  596. package/lib/domain/model/taxLottery/index.js +7 -0
  597. package/lib/domain/model/taxOverride/BaseTaxOverrideLine.d.ts +40 -0
  598. package/lib/domain/model/taxOverride/BaseTaxOverrideLine.js +153 -0
  599. package/lib/domain/model/taxOverride/BaseTaxOverrideLineDecorator.d.ts +21 -0
  600. package/lib/domain/model/taxOverride/BaseTaxOverrideLineDecorator.js +54 -0
  601. package/lib/domain/model/taxOverride/ITaxOverrideLine.d.ts +19 -0
  602. package/lib/domain/model/taxOverride/ITaxOverrideLine.js +3 -0
  603. package/lib/domain/model/taxOverride/ModifyTaxOverrideLine.d.ts +31 -0
  604. package/lib/domain/model/taxOverride/ModifyTaxOverrideLine.js +70 -0
  605. package/lib/domain/model/taxOverride/TaxOverrideLine.d.ts +15 -0
  606. package/lib/domain/model/taxOverride/TaxOverrideLine.js +49 -0
  607. package/lib/domain/model/taxOverride/TaxOverrideLineModificationDecorator.d.ts +14 -0
  608. package/lib/domain/model/taxOverride/TaxOverrideLineModificationDecorator.js +39 -0
  609. package/lib/domain/model/taxOverride/VoidedTaxOverrideLineDecorator.d.ts +15 -0
  610. package/lib/domain/model/taxOverride/VoidedTaxOverrideLineDecorator.js +38 -0
  611. package/lib/domain/model/taxOverride/index.d.ts +7 -0
  612. package/lib/domain/model/taxOverride/index.js +12 -0
  613. package/lib/domain/model/taxRecord/ITaxRecordLine.d.ts +90 -0
  614. package/lib/domain/model/taxRecord/ITaxRecordLine.js +3 -0
  615. package/lib/domain/model/taxRecord/TaxRecordLine.d.ts +67 -0
  616. package/lib/domain/model/taxRecord/TaxRecordLine.js +175 -0
  617. package/lib/domain/model/taxRecord/index.d.ts +2 -0
  618. package/lib/domain/model/taxRecord/index.js +7 -0
  619. package/lib/domain/model/taxRefund/ReprintTaxRefundLine.d.ts +30 -0
  620. package/lib/domain/model/taxRefund/ReprintTaxRefundLine.js +64 -0
  621. package/lib/domain/model/taxRefund/StartTaxRefundLine.d.ts +29 -0
  622. package/lib/domain/model/taxRefund/StartTaxRefundLine.js +62 -0
  623. package/lib/domain/model/taxRefund/TaxRefundInterfaces.d.ts +229 -0
  624. package/lib/domain/model/taxRefund/TaxRefundInterfaces.js +36 -0
  625. package/lib/domain/model/taxRefund/TaxRefundLine.d.ts +34 -0
  626. package/lib/domain/model/taxRefund/TaxRefundLine.js +73 -0
  627. package/lib/domain/model/taxRefund/TaxRefundSession.d.ts +84 -0
  628. package/lib/domain/model/taxRefund/TaxRefundSession.js +214 -0
  629. package/lib/domain/model/taxRefund/VoidTaxRefundLine.d.ts +30 -0
  630. package/lib/domain/model/taxRefund/VoidTaxRefundLine.js +71 -0
  631. package/lib/domain/model/taxRefund/index.d.ts +6 -0
  632. package/lib/domain/model/taxRefund/index.js +12 -0
  633. package/lib/domain/model/tender/BaseTenderLineDecorator.d.ts +47 -0
  634. package/lib/domain/model/tender/BaseTenderLineDecorator.js +110 -0
  635. package/lib/domain/model/tender/CancelSubscriptionTokenLine.d.ts +11 -0
  636. package/lib/domain/model/tender/CancelSubscriptionTokenLine.js +32 -0
  637. package/lib/domain/model/tender/ITenderLine.d.ts +45 -0
  638. package/lib/domain/model/tender/ITenderLine.js +3 -0
  639. package/lib/domain/model/tender/OfflineAuthorization.d.ts +17 -0
  640. package/lib/domain/model/tender/OfflineAuthorization.js +47 -0
  641. package/lib/domain/model/tender/RefundedTenderLineDecorator.d.ts +12 -0
  642. package/lib/domain/model/tender/RefundedTenderLineDecorator.js +42 -0
  643. package/lib/domain/model/tender/TenderAuthorizationStatusLine.d.ts +65 -0
  644. package/lib/domain/model/tender/TenderAuthorizationStatusLine.js +220 -0
  645. package/lib/domain/model/tender/TenderChangeCancelLine.d.ts +25 -0
  646. package/lib/domain/model/tender/TenderChangeCancelLine.js +51 -0
  647. package/lib/domain/model/tender/TenderLine.d.ts +113 -0
  648. package/lib/domain/model/tender/TenderLine.js +385 -0
  649. package/lib/domain/model/tender/TenderSignatureLine.d.ts +29 -0
  650. package/lib/domain/model/tender/TenderSignatureLine.js +66 -0
  651. package/lib/domain/model/tender/TenderTaxLineDecorator.d.ts +12 -0
  652. package/lib/domain/model/tender/TenderTaxLineDecorator.js +29 -0
  653. package/lib/domain/model/tender/TenderUtils.d.ts +9 -0
  654. package/lib/domain/model/tender/TenderUtils.js +43 -0
  655. package/lib/domain/model/tender/VoidedTenderLineDecorator.d.ts +13 -0
  656. package/lib/domain/model/tender/VoidedTenderLineDecorator.js +43 -0
  657. package/lib/domain/model/tender/exchange/StartTenderExchangeLine.d.ts +28 -0
  658. package/lib/domain/model/tender/exchange/StartTenderExchangeLine.js +56 -0
  659. package/lib/domain/model/tender/exchange/index.d.ts +1 -0
  660. package/lib/domain/model/tender/exchange/index.js +7 -0
  661. package/lib/domain/model/tender/index.d.ts +16 -0
  662. package/lib/domain/model/tender/index.js +21 -0
  663. package/lib/domain/model/tender/reversals/Interfaces.d.ts +25 -0
  664. package/lib/domain/model/tender/reversals/Interfaces.js +10 -0
  665. package/lib/domain/model/tender/reversals/index.d.ts +1 -0
  666. package/lib/domain/model/tender/reversals/index.js +7 -0
  667. package/lib/domain/model/tender/valueCard/Interfaces.d.ts +84 -0
  668. package/lib/domain/model/tender/valueCard/Interfaces.js +104 -0
  669. package/lib/domain/model/tender/valueCard/index.d.ts +1 -0
  670. package/lib/domain/model/tender/valueCard/index.js +7 -0
  671. package/lib/domain/model/tender/valueCertificate/Interfaces.d.ts +228 -0
  672. package/lib/domain/model/tender/valueCertificate/Interfaces.js +78 -0
  673. package/lib/domain/model/tender/valueCertificate/index.d.ts +1 -0
  674. package/lib/domain/model/tender/valueCertificate/index.js +7 -0
  675. package/lib/domain/model/terminal/FiscalPrinterAbortLineType.d.ts +21 -0
  676. package/lib/domain/model/terminal/FiscalPrinterAbortLineType.js +45 -0
  677. package/lib/domain/model/terminal/FiscalPrinterReportLineType.d.ts +34 -0
  678. package/lib/domain/model/terminal/FiscalPrinterReportLineType.js +85 -0
  679. package/lib/domain/model/terminal/FiscalPrinterStatusLineType.d.ts +24 -0
  680. package/lib/domain/model/terminal/FiscalPrinterStatusLineType.js +55 -0
  681. package/lib/domain/model/terminal/FiscalPrinterSyncLineType.d.ts +28 -0
  682. package/lib/domain/model/terminal/FiscalPrinterSyncLineType.js +67 -0
  683. package/lib/domain/model/terminal/TerminalStateChangeLine.d.ts +27 -0
  684. package/lib/domain/model/terminal/TerminalStateChangeLine.js +61 -0
  685. package/lib/domain/model/terminal/index.d.ts +5 -0
  686. package/lib/domain/model/terminal/index.js +11 -0
  687. package/lib/domain/model/till/StartTillLine.d.ts +58 -0
  688. package/lib/domain/model/till/StartTillLine.js +119 -0
  689. package/lib/domain/model/till/TenderTransferLine.d.ts +33 -0
  690. package/lib/domain/model/till/TenderTransferLine.js +140 -0
  691. package/lib/domain/model/till/TillAdjustmentLine.d.ts +21 -0
  692. package/lib/domain/model/till/TillAdjustmentLine.js +64 -0
  693. package/lib/domain/model/till/TillCountLine.d.ts +27 -0
  694. package/lib/domain/model/till/TillCountLine.js +96 -0
  695. package/lib/domain/model/till/TillFloatLine.d.ts +29 -0
  696. package/lib/domain/model/till/TillFloatLine.js +90 -0
  697. package/lib/domain/model/till/TillStateChangeLine.d.ts +26 -0
  698. package/lib/domain/model/till/TillStateChangeLine.js +78 -0
  699. package/lib/domain/model/till/index.d.ts +6 -0
  700. package/lib/domain/model/till/index.js +12 -0
  701. package/lib/domain/model/transaction/AttachmentLine.d.ts +17 -0
  702. package/lib/domain/model/transaction/AttachmentLine.js +45 -0
  703. package/lib/domain/model/transaction/CloseTransactionLine.d.ts +22 -0
  704. package/lib/domain/model/transaction/CloseTransactionLine.js +44 -0
  705. package/lib/domain/model/transaction/IPostVoidSearchResult.d.ts +7 -0
  706. package/lib/domain/model/transaction/IPostVoidSearchResult.js +4 -0
  707. package/lib/domain/model/transaction/RecordTransactionLine.d.ts +29 -0
  708. package/lib/domain/model/transaction/RecordTransactionLine.js +60 -0
  709. package/lib/domain/model/transaction/SignatureLine.d.ts +30 -0
  710. package/lib/domain/model/transaction/SignatureLine.js +67 -0
  711. package/lib/domain/model/transaction/SuspendTransactionLine.d.ts +24 -0
  712. package/lib/domain/model/transaction/SuspendTransactionLine.js +52 -0
  713. package/lib/domain/model/transaction/TotalTransactionLine.d.ts +26 -0
  714. package/lib/domain/model/transaction/TotalTransactionLine.js +55 -0
  715. package/lib/domain/model/transaction/TransactionResumeCompleteLine.d.ts +22 -0
  716. package/lib/domain/model/transaction/TransactionResumeCompleteLine.js +44 -0
  717. package/lib/domain/model/transaction/TransactionResumeStartLine.d.ts +25 -0
  718. package/lib/domain/model/transaction/TransactionResumeStartLine.js +55 -0
  719. package/lib/domain/model/transaction/TransactionReturnModeLine.d.ts +23 -0
  720. package/lib/domain/model/transaction/TransactionReturnModeLine.js +45 -0
  721. package/lib/domain/model/transaction/fiscal/FiscalTransactionLine.d.ts +27 -0
  722. package/lib/domain/model/transaction/fiscal/FiscalTransactionLine.js +61 -0
  723. package/lib/domain/model/transaction/fiscal/index.d.ts +1 -0
  724. package/lib/domain/model/transaction/fiscal/index.js +7 -0
  725. package/lib/domain/model/transaction/index.d.ts +12 -0
  726. package/lib/domain/model/transaction/index.js +18 -0
  727. package/lib/domain/model/transaction/order/ItemFulfillmentReferenceLine.d.ts +25 -0
  728. package/lib/domain/model/transaction/order/ItemFulfillmentReferenceLine.js +51 -0
  729. package/lib/domain/model/transaction/order/ItemPickupSignatureLine.d.ts +28 -0
  730. package/lib/domain/model/transaction/order/ItemPickupSignatureLine.js +63 -0
  731. package/lib/domain/model/transaction/order/OrderReferenceLine.d.ts +25 -0
  732. package/lib/domain/model/transaction/order/OrderReferenceLine.js +50 -0
  733. package/lib/domain/model/transaction/order/index.d.ts +3 -0
  734. package/lib/domain/model/transaction/order/index.js +9 -0
  735. package/lib/domain/model/user/AuthenticationFailedLine.d.ts +16 -0
  736. package/lib/domain/model/user/AuthenticationFailedLine.js +45 -0
  737. package/lib/domain/model/user/IPasswordExpiration.d.ts +4 -0
  738. package/lib/domain/model/user/IPasswordExpiration.js +3 -0
  739. package/lib/domain/model/user/PasswordExpiration.d.ts +10 -0
  740. package/lib/domain/model/user/PasswordExpiration.js +38 -0
  741. package/lib/domain/model/user/UserLine.d.ts +33 -0
  742. package/lib/domain/model/user/UserLine.js +84 -0
  743. package/lib/domain/model/user/index.d.ts +4 -0
  744. package/lib/domain/model/user/index.js +9 -0
  745. package/lib/domain/model/void/LineVoidLine.d.ts +50 -0
  746. package/lib/domain/model/void/LineVoidLine.js +158 -0
  747. package/lib/domain/model/void/TransactionVoidLine.d.ts +34 -0
  748. package/lib/domain/model/void/TransactionVoidLine.js +86 -0
  749. package/lib/domain/model/void/VoidedLineDecorator.d.ts +10 -0
  750. package/lib/domain/model/void/VoidedLineDecorator.js +40 -0
  751. package/lib/domain/model/void/index.d.ts +3 -0
  752. package/lib/domain/model/void/index.js +9 -0
  753. package/lib/domain/processing/PosBusinessAction.d.ts +9 -0
  754. package/lib/domain/processing/PosBusinessAction.js +55 -0
  755. package/lib/domain/processing/index.d.ts +1 -0
  756. package/lib/domain/processing/index.js +7 -0
  757. package/lib/domain/service/IReceiptFormattingService.d.ts +48 -0
  758. package/lib/domain/service/IReceiptFormattingService.js +3 -0
  759. package/lib/domain/service/ITransactionAccountingService.d.ts +6 -0
  760. package/lib/domain/service/ITransactionAccountingService.js +3 -0
  761. package/lib/domain/service/ITransactionReferenceFormatter.d.ts +4 -0
  762. package/lib/domain/service/ITransactionReferenceFormatter.js +3 -0
  763. package/lib/domain/service/index.d.ts +3 -0
  764. package/lib/domain/service/index.js +3 -0
  765. package/lib/domain/utility/index.d.ts +3 -0
  766. package/lib/domain/utility/index.js +9 -0
  767. package/lib/domain/utility/orderUtils.d.ts +6 -0
  768. package/lib/domain/utility/orderUtils.js +47 -0
  769. package/lib/domain/utility/supervisorOverride.d.ts +28 -0
  770. package/lib/domain/utility/supervisorOverride.js +298 -0
  771. package/lib/domain/utility/utils.d.ts +12 -0
  772. package/lib/domain/utility/utils.js +128 -0
  773. package/lib/index.d.ts +2 -0
  774. package/lib/index.js +8 -0
  775. package/package.json +194 -0
  776. package/types/es-symbol/index.d.ts +4 -0
@@ -0,0 +1,750 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _ = require("lodash");
4
+ const scp_component_business_core_1 = require("@aptos-scp/scp-component-business-core");
5
+ const scp_component_logging_1 = require("@aptos-scp/scp-component-logging");
6
+ const scp_component_store_items_1 = require("@aptos-scp/scp-component-store-items");
7
+ const scp_component_store_selling_core_1 = require("@aptos-scp/scp-component-store-selling-core");
8
+ const scp_types_commerce_transaction_1 = require("@aptos-scp/scp-types-commerce-transaction");
9
+ const ErrorCodes_1 = require("../../config/ErrorCodes");
10
+ const utils_1 = require("../utility/utils");
11
+ const logger = scp_component_logging_1.LogManager.getLogger("com.aptos.storesellingfeatures.domain.model.StoreItem");
12
+ var SourceType;
13
+ (function (SourceType) {
14
+ SourceType["local"] = "Local";
15
+ SourceType["remote"] = "Remote";
16
+ SourceType["notOnFile"] = "NotOnFile";
17
+ })(SourceType = exports.SourceType || (exports.SourceType = {}));
18
+ var SelectedUnitPrice;
19
+ (function (SelectedUnitPrice) {
20
+ SelectedUnitPrice["PermanentPrice"] = "PermanentPrice";
21
+ SelectedUnitPrice["TemporaryPrice"] = "TemporaryPrice";
22
+ SelectedUnitPrice["FullPrice"] = "FullPrice";
23
+ })(SelectedUnitPrice = exports.SelectedUnitPrice || (exports.SelectedUnitPrice = {}));
24
+ function findSourceType(type) {
25
+ switch (type) {
26
+ case "Local":
27
+ return SourceType.local;
28
+ case "Remote":
29
+ return SourceType.remote;
30
+ case "NotOnFile":
31
+ return SourceType.notOnFile;
32
+ default:
33
+ throw new scp_component_store_selling_core_1.PosError(`Cannot find SourceType for type: ${type}`, ErrorCodes_1.SSF_DATA_ERROR_CODE);
34
+ }
35
+ }
36
+ exports.findSourceType = findSourceType;
37
+ function findItemType(type) {
38
+ switch (type) {
39
+ case "Merchandise":
40
+ return scp_types_commerce_transaction_1.ItemType.Merchandise;
41
+ case "NonMerch":
42
+ return scp_types_commerce_transaction_1.ItemType.NonMerch;
43
+ case "Service":
44
+ return scp_types_commerce_transaction_1.ItemType.Service;
45
+ case "ValueCard":
46
+ return scp_types_commerce_transaction_1.ItemType.ValueCard;
47
+ case "ValueCertificate":
48
+ return scp_types_commerce_transaction_1.ItemType.ValueCertificate;
49
+ default:
50
+ throw new scp_component_store_selling_core_1.PosError(`Cannot find ItemType for type: ${type}`, ErrorCodes_1.SSF_DATA_ERROR_CODE);
51
+ }
52
+ }
53
+ exports.findItemType = findItemType;
54
+ class ItemLookupKey {
55
+ constructor(type, value) {
56
+ this.type = type;
57
+ this.value = value;
58
+ }
59
+ static createFromJsonObj(itemLookupKeyFromJson) {
60
+ return (itemLookupKeyFromJson && new ItemLookupKey(itemLookupKeyFromJson.type, itemLookupKeyFromJson.value));
61
+ }
62
+ }
63
+ exports.ItemLookupKey = ItemLookupKey;
64
+ class HierarchyNodeId {
65
+ constructor(levelId, nodeIdInLevel, groupId) {
66
+ this.levelId = levelId;
67
+ this.nodeIdInLevel = nodeIdInLevel;
68
+ this.groupId = groupId;
69
+ }
70
+ static createFromJsonObj(hierarchyNodeIdFromJson) {
71
+ if (hierarchyNodeIdFromJson) {
72
+ return new HierarchyNodeId(hierarchyNodeIdFromJson.levelId, hierarchyNodeIdFromJson.nodeIdInLevel, hierarchyNodeIdFromJson.groupId);
73
+ }
74
+ return undefined;
75
+ }
76
+ }
77
+ exports.HierarchyNodeId = HierarchyNodeId;
78
+ class HierarchyNode {
79
+ constructor(nodeId, parentId) {
80
+ this.nodeId = nodeId;
81
+ this.parentId = parentId;
82
+ }
83
+ static createFromJsonObj(hierarchyNodeFromJson) {
84
+ return new HierarchyNode(HierarchyNodeId.createFromJsonObj(hierarchyNodeFromJson.nodeId), HierarchyNodeId.createFromJsonObj(hierarchyNodeFromJson.parentId));
85
+ }
86
+ }
87
+ exports.HierarchyNode = HierarchyNode;
88
+ class SalePrice {
89
+ static createFromJsonObject(salePriceFromJson) {
90
+ let salePrice = undefined;
91
+ if (salePriceFromJson) {
92
+ salePrice = new SalePrice();
93
+ salePrice.price = scp_component_business_core_1.Price.fromJSON(salePriceFromJson.price);
94
+ salePrice.shortDescription = salePriceFromJson.shortDescription;
95
+ salePrice.startDateTime = new Date(Date.parse(salePriceFromJson.startDateTime));
96
+ salePrice.endDateTime = salePriceFromJson.endDateTime
97
+ ? new Date(Date.parse(salePriceFromJson.endDateTime))
98
+ : undefined;
99
+ }
100
+ else if (salePriceFromJson === null) {
101
+ salePrice = null;
102
+ }
103
+ return salePrice;
104
+ }
105
+ }
106
+ exports.SalePrice = SalePrice;
107
+ function getProductAttribute(productAttributes, attributeType) {
108
+ if (!productAttributes) {
109
+ return undefined;
110
+ }
111
+ return productAttributes.find((attribute) => attribute.attributeType === attributeType);
112
+ }
113
+ exports.getProductAttribute = getProductAttribute;
114
+ function getProductAttributeTranslation(attribute, locale = "en") {
115
+ if (!attribute.translations) {
116
+ return undefined;
117
+ }
118
+ const localeToUse = utils_1.getLocaleCodeForTranslationSet(attribute.translations, locale);
119
+ let translation = localeToUse && attribute.translations[localeToUse];
120
+ if (!translation) {
121
+ const defaultLocale = "en";
122
+ translation = attribute.translations[defaultLocale];
123
+ }
124
+ return translation;
125
+ }
126
+ exports.getProductAttributeTranslation = getProductAttributeTranslation;
127
+ function getMerchandiseHierarchyNodeNameTranslation(node, locale = "en") {
128
+ if (!node.translations) {
129
+ return { name: node.nodeInLevelId };
130
+ }
131
+ const localeToUse = utils_1.getLocaleCodeForTranslationSet(node.translations, locale);
132
+ let translation = localeToUse && node.translations[localeToUse];
133
+ if (!translation) {
134
+ const defaultLocale = "en";
135
+ translation = node.translations[defaultLocale];
136
+ }
137
+ if (!translation) {
138
+ translation = { name: node.nodeInLevelId };
139
+ }
140
+ return translation;
141
+ }
142
+ exports.getMerchandiseHierarchyNodeNameTranslation = getMerchandiseHierarchyNodeNameTranslation;
143
+ /**
144
+ * @deprecated change to use productAttributes property of StoreItem instead
145
+ */
146
+ class ItemAttributes {
147
+ static createFromJsonObject(attributes, locale) {
148
+ let itemAttributes = undefined;
149
+ if (attributes) {
150
+ itemAttributes = new ItemAttributes();
151
+ attributes.forEach((attribute) => {
152
+ switch (attribute.attributeType) {
153
+ case "Color":
154
+ itemAttributes.color = new ColorAttribute(attribute, locale);
155
+ return;
156
+ case "Size":
157
+ itemAttributes.size = new SizeAttribute(attribute, locale);
158
+ return;
159
+ case "Style":
160
+ itemAttributes.style = new StyleAttribute(attribute, locale);
161
+ return;
162
+ default:
163
+ return;
164
+ }
165
+ });
166
+ }
167
+ else {
168
+ itemAttributes = null;
169
+ }
170
+ return itemAttributes;
171
+ }
172
+ }
173
+ exports.ItemAttributes = ItemAttributes;
174
+ /**
175
+ * @deprecated change to use productAttributes property of StoreItem instead
176
+ */
177
+ class ColorAttribute {
178
+ constructor(attribute, locale) {
179
+ this.id = attribute.id;
180
+ this.code = attribute.code;
181
+ const localeCodeToUse = attribute.translations && utils_1.getLocaleCodeForTranslationSet(attribute.translations, locale);
182
+ const translations = localeCodeToUse && attribute.translations[localeCodeToUse];
183
+ if (translations) {
184
+ this.name = translations.name;
185
+ this.description = translations.description;
186
+ }
187
+ }
188
+ }
189
+ exports.ColorAttribute = ColorAttribute;
190
+ /**
191
+ * @deprecated change to use productAttributes property of StoreItem instead
192
+ */
193
+ class StyleAttribute {
194
+ constructor(attribute, locale) {
195
+ this.id = attribute.id;
196
+ this.code = attribute.code;
197
+ const localeCodeToUse = attribute.translations && utils_1.getLocaleCodeForTranslationSet(attribute.translations, locale);
198
+ const translations = localeCodeToUse && attribute.translations[localeCodeToUse];
199
+ if (translations) {
200
+ this.name = translations.name;
201
+ this.description = translations.description;
202
+ }
203
+ }
204
+ }
205
+ exports.StyleAttribute = StyleAttribute;
206
+ /**
207
+ * @deprecated change to use productAttributes property of StoreItem instead
208
+ */
209
+ class SizeAttribute {
210
+ constructor(attribute, locale) {
211
+ this.id = attribute.id;
212
+ this.code = attribute.code;
213
+ this.subcode = attribute.subcode;
214
+ const localeCodeToUse = attribute.translations && utils_1.getLocaleCodeForTranslationSet(attribute.translations, locale);
215
+ const translations = localeCodeToUse && attribute.translations[localeCodeToUse];
216
+ if (translations) {
217
+ this.name = translations.name;
218
+ this.description = translations.description;
219
+ }
220
+ }
221
+ }
222
+ exports.SizeAttribute = SizeAttribute;
223
+ class StoreItem {
224
+ constructor() {
225
+ // We initialize these optional fields, so that the de-serialized form matches the pre-serialized form.
226
+ this.additionalDescription = undefined;
227
+ this.longDescription = undefined;
228
+ this.itemPermanentPrice = undefined;
229
+ this.itemPermanentPriceSource = undefined;
230
+ this.itemTemporaryPrice = undefined;
231
+ this.itemTemporaryPriceSource = undefined;
232
+ this.itemFullPrice = undefined;
233
+ this.itemFullPriceSource = undefined;
234
+ this.itemSelectedUnitPrice = undefined;
235
+ this.itemEmployeeDiscountPercent = undefined;
236
+ this.manufacturerSuggestedPrice = undefined;
237
+ this.unitCost = undefined;
238
+ this.defaultReturnPrice = undefined;
239
+ }
240
+ static createFromJsonObject(storeItemJsonObj) {
241
+ const storeItem = new StoreItem();
242
+ storeItem.id = StoreItem.getStringFromJsonObject(storeItemJsonObj.id);
243
+ storeItem.uniqueId = StoreItem.getStringFromJsonObject(storeItemJsonObj.uniqueId);
244
+ storeItem.retailLocationIdentity = scp_component_store_selling_core_1.RetailLocationIdentity.createFromJsonObject(storeItemJsonObj.retailLocationIdentity);
245
+ storeItem.itemLookupKeys = StoreItem.createItemLookupKeysFromJsonObject(storeItemJsonObj.itemLookupKeys);
246
+ storeItem.itemGroupId = StoreItem.getStringFromJsonObject(storeItemJsonObj.itemGroupId);
247
+ storeItem.itemType = scp_types_commerce_transaction_1.ItemType[StoreItem.getStringFromJsonObject(storeItemJsonObj.itemType)];
248
+ storeItem.imageUrl = StoreItem.getStringFromJsonObject(storeItemJsonObj.imageUrl);
249
+ storeItem.shortDescription = StoreItem.getStringFromJsonObject(storeItemJsonObj.shortDescription);
250
+ storeItem.additionalDescription = StoreItem.getStringFromJsonObject(storeItemJsonObj.additionalDescription);
251
+ storeItem.longDescription = StoreItem.getStringFromJsonObject(storeItemJsonObj.longDescription);
252
+ storeItem.enteredLookupType = StoreItem.getStringFromJsonObject(storeItemJsonObj.enteredLookupType);
253
+ storeItem.taxGroupId = StoreItem.getStringFromJsonObject(storeItemJsonObj.taxGroupId);
254
+ storeItem.price = scp_component_business_core_1.Price.fromJSON(storeItemJsonObj.price);
255
+ storeItem.salePrice = SalePrice.createFromJsonObject(storeItemJsonObj.salePrice);
256
+ storeItem.stopStatusMessage = StoreItem.getStringFromJsonObject(storeItemJsonObj.stopStatusMessage);
257
+ if (storeItemJsonObj.itemPermanentPrice) {
258
+ storeItem.itemPermanentPrice = scp_component_business_core_1.Price.fromJSON(storeItemJsonObj.itemPermanentPrice);
259
+ }
260
+ if (storeItemJsonObj.itemPermanentPriceSource) {
261
+ storeItem.itemPermanentPriceSource = storeItemJsonObj.itemPermanentPriceSource;
262
+ }
263
+ if (storeItemJsonObj.itemTemporaryPrice) {
264
+ storeItem.itemTemporaryPrice = scp_component_business_core_1.Price.fromJSON(storeItemJsonObj.itemTemporaryPrice);
265
+ }
266
+ if (storeItemJsonObj.itemTemporaryPriceSource) {
267
+ storeItem.itemTemporaryPriceSource = storeItemJsonObj.itemTemporaryPriceSource;
268
+ }
269
+ if (storeItemJsonObj.temporaryPriceEffectiveDateTime) {
270
+ storeItem.temporaryPriceEffectiveDateTime = StoreItem.getStringFromJsonObject(storeItemJsonObj.temporaryPriceEffectiveDateTime);
271
+ }
272
+ if (storeItemJsonObj.temporaryPriceExpirationDateTime) {
273
+ storeItem.temporaryPriceExpirationDateTime = StoreItem.getStringFromJsonObject(storeItemJsonObj.temporaryPriceExpirationDateTime);
274
+ }
275
+ if (storeItemJsonObj.itemSelectedUnitPrice) {
276
+ storeItem.itemSelectedUnitPrice = storeItemJsonObj.itemSelectedUnitPrice;
277
+ }
278
+ if (storeItemJsonObj.itemFullPrice) {
279
+ storeItem.itemFullPrice = scp_component_business_core_1.Price.fromJSON(storeItemJsonObj.itemFullPrice);
280
+ }
281
+ if (storeItemJsonObj.itemFullPriceSource) {
282
+ storeItem.itemFullPriceSource = storeItemJsonObj.itemFullPriceSource;
283
+ }
284
+ if (storeItemJsonObj.itemEmployeeDiscountPercent) {
285
+ storeItem.itemEmployeeDiscountPercent = storeItemJsonObj.itemEmployeeDiscountPercent;
286
+ }
287
+ if (storeItemJsonObj.merchandiseHierarchy) {
288
+ storeItem.merchandiseHierarchy = StoreItem.createHierarchyNodeFromJsonObject(storeItemJsonObj.merchandiseHierarchy);
289
+ }
290
+ // From ISourceIndication
291
+ if (storeItemJsonObj.source || storeItemJsonObj.source === 0) {
292
+ storeItem.source = findSourceType(storeItemJsonObj.source);
293
+ }
294
+ if (storeItemJsonObj.manufacturerSuggestedPrice) {
295
+ storeItem.manufacturerSuggestedPrice = scp_component_business_core_1.Price.fromIPrice(storeItemJsonObj.manufacturerSuggestedPrice);
296
+ }
297
+ if (storeItemJsonObj.defaultReturnPrice) {
298
+ storeItem.defaultReturnPrice = scp_component_business_core_1.Price.fromIPrice(storeItemJsonObj.defaultReturnPrice);
299
+ }
300
+ if (storeItemJsonObj.unitCost) {
301
+ storeItem.unitCost = scp_component_business_core_1.Money.fromIMoney(storeItemJsonObj.unitCost);
302
+ }
303
+ if (storeItemJsonObj.externalIds) {
304
+ storeItem.externalIds = storeItemJsonObj.externalIds;
305
+ }
306
+ if (storeItemJsonObj.treatmentRules) {
307
+ storeItem.treatmentRules = storeItemJsonObj.treatmentRules;
308
+ }
309
+ if (storeItemJsonObj.attributes) {
310
+ storeItem.attributes = storeItemJsonObj.attributes;
311
+ }
312
+ if (storeItemJsonObj.productAttributes) {
313
+ storeItem.productAttributes = storeItemJsonObj.productAttributes;
314
+ }
315
+ if (storeItemJsonObj.images) {
316
+ storeItem.images = storeItemJsonObj.images;
317
+ }
318
+ if (storeItemJsonObj.status) {
319
+ storeItem.status = scp_component_store_items_1.Status[StoreItem.getStringFromJsonObject(storeItemJsonObj.status)];
320
+ }
321
+ if (storeItemJsonObj.subscriptionFrequencyCodes) {
322
+ storeItem.subscriptionFrequencyCodes = storeItemJsonObj.subscriptionFrequencyCodes;
323
+ }
324
+ storeItem.departmentGroupId = StoreItem.getStringFromJsonObject(storeItemJsonObj.departmentGroupId);
325
+ return storeItem;
326
+ }
327
+ static convertStoreItemComponentIPriceToPrice(value) {
328
+ return value ? new scp_component_business_core_1.Price(new scp_component_business_core_1.Money(value.amount, value.currency)) : undefined;
329
+ }
330
+ //TODO: Move createFromItemObject into the adapter.storeitem module, since it is web service API specific.
331
+ // See ZSPFLD-2346
332
+ // Moving this removes the dependency of the domain object on API-specific classes, which separates concerns and
333
+ // avoids circular dependencies between modules, which can be hard to resolve.
334
+ // If it needs to be shared between the repository and the adapter, then we need to decide, which has precedence, but
335
+ // the needs of those modules should not bleed-through into the domain model module.
336
+ // FIXME: this method needs to have its complexity cleaned-up.
337
+ // eslint-disable-next-line complexity
338
+ static createFromItemObject(configurationManager, retailLocationIdentity, accountingCurrency, itemToConvert, locale, sourceIndicator) {
339
+ var _a, _b;
340
+ const entryMessage = logger.traceEntry("createFromItemObject", itemToConvert, retailLocationIdentity);
341
+ const storeItem = new StoreItem();
342
+ try {
343
+ // Update the price and the tax group with the group or location information if it exist
344
+ const { retailStoreItem, storeGroupItem } = StoreItem.extractRetailLocationSpecificItemData(itemToConvert, retailLocationIdentity);
345
+ const item = Object.assign({}, itemToConvert, storeGroupItem, retailStoreItem);
346
+ // id
347
+ storeItem.id = item.id;
348
+ storeItem.uniqueId = item.uniqueId;
349
+ // retailLocationIdentity
350
+ storeItem.retailLocationIdentity = retailLocationIdentity;
351
+ // itemLookupKeys
352
+ storeItem.itemLookupKeys = [];
353
+ for (const lookupKeyAttribute of item.lookupKeys) {
354
+ const lookupKey = new ItemLookupKey(lookupKeyAttribute.keyType, lookupKeyAttribute.value);
355
+ storeItem.itemLookupKeys.push(lookupKey);
356
+ }
357
+ // itemType
358
+ storeItem.itemType = findItemType(item.type);
359
+ //sourceIndicator
360
+ storeItem.source = sourceIndicator;
361
+ // imageUrl
362
+ const lineItemImageConfiguration = configurationManager.getFunctionalBehaviorValues().lineItemImage;
363
+ const getImageUrl = (imageSource) => {
364
+ switch (imageSource) {
365
+ case "ImageFromItemData":
366
+ let imageUrl = undefined;
367
+ if (item.images && item.images.length > 0) {
368
+ const primaryImages = item.images.filter((x) => x.primaryImage === true);
369
+ imageUrl = (primaryImages.length > 0 ? primaryImages : item.images)[0].imageUrl;
370
+ }
371
+ return imageUrl;
372
+ case "ImageFromUrlPattern":
373
+ let urlPattern = lineItemImageConfiguration.urlPattern;
374
+ const aSkuKey = item.lookupKeys.find((aKey) => aKey.keyType === scp_component_store_items_1.KeyType.SKU);
375
+ if (aSkuKey) {
376
+ urlPattern = urlPattern.replace(/{{SKU}}/g, aSkuKey.value);
377
+ }
378
+ return urlPattern;
379
+ default:
380
+ return undefined;
381
+ }
382
+ };
383
+ storeItem.imageUrl = getImageUrl(lineItemImageConfiguration.imageSource);
384
+ if (lineItemImageConfiguration.imageSource === "ImageFromItemData" &&
385
+ item.images &&
386
+ item.images.length > 0) {
387
+ storeItem.images = item.images;
388
+ }
389
+ else {
390
+ storeItem.images = [{ imageUrl: storeItem.imageUrl, primaryImage: true }];
391
+ }
392
+ storeItem.status = item.status;
393
+ storeItem.productAttributes = item.attributes;
394
+ // shortDescription, additionalDescription, and longDescription
395
+ StoreItem.updateLocalizableTextsFromItemAttributeObject(storeItem, item, locale);
396
+ // taxGroupId
397
+ storeItem.taxGroupId = item.taxGroup;
398
+ // price
399
+ const itemPermanentPrice = StoreItem.calculatePermanentPrice(itemToConvert, storeGroupItem, retailStoreItem, accountingCurrency);
400
+ if (itemPermanentPrice) {
401
+ storeItem.itemPermanentPrice = itemPermanentPrice.price;
402
+ storeItem.itemPermanentPriceSource = itemPermanentPrice.source;
403
+ storeItem.itemSelectedUnitPrice = SelectedUnitPrice.PermanentPrice;
404
+ }
405
+ const itemTemporaryPrice = StoreItem.calculateTemporaryPrice(itemToConvert, storeGroupItem, retailStoreItem, accountingCurrency);
406
+ if (itemTemporaryPrice) {
407
+ storeItem.itemTemporaryPrice = itemTemporaryPrice.price;
408
+ storeItem.itemTemporaryPriceSource = itemTemporaryPrice.source;
409
+ storeItem.itemSelectedUnitPrice = SelectedUnitPrice.TemporaryPrice;
410
+ }
411
+ const itemFullPrice = StoreItem.calculateFullPrice(itemToConvert, storeGroupItem, retailStoreItem, accountingCurrency);
412
+ if (itemFullPrice) {
413
+ storeItem.itemFullPrice = itemFullPrice.price;
414
+ storeItem.itemFullPriceSource = itemFullPrice.source;
415
+ }
416
+ storeItem.price = storeItem.itemTemporaryPrice || storeItem.itemPermanentPrice;
417
+ if (!storeItem.price && item.type === scp_types_commerce_transaction_1.ItemType.ValueCard) {
418
+ storeItem.price = new scp_component_business_core_1.Price(new scp_component_business_core_1.Money("0", accountingCurrency));
419
+ }
420
+ storeItem.temporaryPriceEffectiveDateTime = StoreItem.temporaryPriceEffectiveDateTime(itemToConvert, storeGroupItem, retailStoreItem);
421
+ storeItem.temporaryPriceExpirationDateTime = StoreItem.temporaryPriceExpirationDateTime(itemToConvert, storeGroupItem, retailStoreItem);
422
+ storeItem.itemEmployeeDiscountPercent = item.employeeDiscountPercent;
423
+ // merchandiseHierarchy
424
+ if (item.merchandiseHierarchy && item.merchandiseHierarchy.length > 0) {
425
+ storeItem.merchandiseHierarchy = [];
426
+ for (const hierarchyNodeAttribute of item.merchandiseHierarchy) {
427
+ if (((_a = hierarchyNodeAttribute) === null || _a === void 0 ? void 0 : _a.nodeId) || ((_b = hierarchyNodeAttribute) === null || _b === void 0 ? void 0 : _b.parentId)) {
428
+ let nodeId;
429
+ if (hierarchyNodeAttribute.nodeId &&
430
+ (hierarchyNodeAttribute.nodeId.levelId ||
431
+ hierarchyNodeAttribute.nodeId.nodeIdInLevel ||
432
+ hierarchyNodeAttribute.nodeId.groupId)) {
433
+ nodeId = new HierarchyNodeId(hierarchyNodeAttribute.nodeId.levelId, hierarchyNodeAttribute.nodeId.nodeIdInLevel, hierarchyNodeAttribute.nodeId.groupId);
434
+ }
435
+ let parentId;
436
+ if (hierarchyNodeAttribute.parentId &&
437
+ (hierarchyNodeAttribute.parentId.levelId || hierarchyNodeAttribute.parentId.nodeIdInLevel)) {
438
+ parentId = new HierarchyNodeId(hierarchyNodeAttribute.parentId.levelId, hierarchyNodeAttribute.parentId.nodeIdInLevel);
439
+ }
440
+ const hierarchyNode = new HierarchyNode(nodeId, parentId);
441
+ storeItem.merchandiseHierarchy.push(hierarchyNode);
442
+ }
443
+ }
444
+ }
445
+ // ManufacturerSuggestedPrice & UnitCost
446
+ if (item.manufacturerSuggestedPrice) {
447
+ storeItem.manufacturerSuggestedPrice = StoreItem.getPriceFromStoreItemPrice(item.manufacturerSuggestedPrice, accountingCurrency);
448
+ }
449
+ if (item.unitCost) {
450
+ storeItem.unitCost = scp_component_business_core_1.Money.fromIMoney(item.unitCost);
451
+ }
452
+ if (item.externalIds) {
453
+ storeItem.externalIds = item.externalIds;
454
+ }
455
+ const TREATMENT_RULE_DEFAULTS = {
456
+ eligibleForSendSale: true,
457
+ };
458
+ if (item.treatmentRules) {
459
+ storeItem.treatmentRules = Object.assign(Object.assign({}, TREATMENT_RULE_DEFAULTS), item.treatmentRules);
460
+ }
461
+ if (!storeItem.price || !storeItem.price.amount) {
462
+ const units = storeItem.price ? storeItem.price.units : undefined;
463
+ const quantity = storeItem.price ? storeItem.price.quantity : undefined;
464
+ storeItem.price = new scp_component_business_core_1.Price(new scp_component_business_core_1.Money(0, accountingCurrency), units, quantity);
465
+ }
466
+ else {
467
+ //verify currency code for finalized item price
468
+ StoreItem.verifyCurrencyCode(storeItem, accountingCurrency);
469
+ }
470
+ if (item.defaultReturnPrice) {
471
+ storeItem.defaultReturnPrice = new scp_component_business_core_1.Price(new scp_component_business_core_1.Money(item.defaultReturnPrice.amount, item.defaultReturnPrice.currency || accountingCurrency));
472
+ }
473
+ if (item.subscriptionFrequencyCodes) {
474
+ storeItem.subscriptionFrequencyCodes = item.subscriptionFrequencyCodes;
475
+ }
476
+ }
477
+ catch (err) {
478
+ logger.catching(err, entryMessage);
479
+ throw logger.throwing(new scp_component_store_selling_core_1.PosError(`Error caught while populating StoreItem, ` +
480
+ `message: ${err.message ? err.message : err}, item: ${JSON.stringify(itemToConvert)}`, ErrorCodes_1.SSF_ERROR_POPULATING_STORE_ITEM_ERROR_CODE, err), entryMessage);
481
+ }
482
+ return logger.traceExit(entryMessage, storeItem);
483
+ }
484
+ lookupKeyByType(type) {
485
+ let itemLookupKey;
486
+ const itemLookupKeys = this.itemLookupKeys.slice();
487
+ const keys = itemLookupKeys.sort((a, b) => (a.value > b.value ? 1 : -1));
488
+ itemLookupKey = keys.find((lookupKeyToCheck) => lookupKeyToCheck.type === type);
489
+ if (!itemLookupKey && this.productAttributes) {
490
+ this.productAttributes.forEach((attribute) => {
491
+ if (type === attribute.attributeType) {
492
+ itemLookupKey = new ItemLookupKey(attribute.attributeType, attribute.code);
493
+ }
494
+ });
495
+ }
496
+ return itemLookupKey;
497
+ }
498
+ isManualItemDiscountAllowed() {
499
+ return (!this.treatmentRules ||
500
+ this.treatmentRules.manualItemDiscount === scp_component_store_items_1.DiscountTreatmentRuleValueType.Allowed);
501
+ }
502
+ isManualTransactionDiscountAllowed() {
503
+ return (!this.treatmentRules ||
504
+ this.treatmentRules.manualTransactionDiscount === scp_component_store_items_1.DiscountTreatmentRuleValueType.Allowed);
505
+ }
506
+ isEmployeeDiscountAllowed() {
507
+ return (!this.treatmentRules || this.treatmentRules.employeeDiscount === scp_component_store_items_1.DiscountTreatmentRuleValueType.Allowed);
508
+ }
509
+ static extractRetailLocationSpecificItemData(item, retailLocationIdentity) {
510
+ let storeGroupItem = {};
511
+ let retailStoreItem = {};
512
+ if (item.retailLocations && item.retailLocations.length > 0) {
513
+ storeGroupItem = _.find(item.retailLocations, StoreItem.isStoreGroupItem);
514
+ retailStoreItem = _.find(item.retailLocations, (retailLocationItem) => retailLocationItem.retailLocationId === retailLocationIdentity.retailLocationId);
515
+ }
516
+ return { storeGroupItem, retailStoreItem };
517
+ }
518
+ static calculatePermanentPrice(itemToConvert, storeGroupItem, retailStoreItem, accountingCurrency) {
519
+ let permanentPrice = StoreItem.calculatePermanentPriceAtLevel(retailStoreItem, accountingCurrency);
520
+ if (permanentPrice) {
521
+ return {
522
+ price: permanentPrice.price,
523
+ source: {
524
+ organizationScope: scp_component_store_items_1.OrganizationScope.OneRetailLocation,
525
+ changeScope: permanentPrice.changeScope,
526
+ },
527
+ };
528
+ }
529
+ permanentPrice = StoreItem.calculatePermanentPriceAtLevel(storeGroupItem, accountingCurrency);
530
+ if (permanentPrice) {
531
+ return {
532
+ price: permanentPrice.price,
533
+ source: {
534
+ organizationScope: scp_component_store_items_1.OrganizationScope.RetailLocationsGroup,
535
+ changeScope: permanentPrice.changeScope,
536
+ },
537
+ };
538
+ }
539
+ permanentPrice = StoreItem.calculatePermanentPriceAtLevel(itemToConvert, accountingCurrency);
540
+ if (permanentPrice) {
541
+ return {
542
+ price: permanentPrice.price,
543
+ source: {
544
+ organizationScope: scp_component_store_items_1.OrganizationScope.AllRetailLocations,
545
+ changeScope: permanentPrice.changeScope,
546
+ },
547
+ };
548
+ }
549
+ }
550
+ static calculatePermanentPriceAtLevel(item, accountingCurrency) {
551
+ var _a, _b;
552
+ if (accountingCurrency && item) {
553
+ if (item.effectivePricing) {
554
+ const price1 = item.effectivePricing.permanentPrice;
555
+ if (accountingCurrency && ((_a = price1) === null || _a === void 0 ? void 0 : _a.currency) === accountingCurrency) {
556
+ const price = StoreItem.convertStoreItemComponentIPriceToPrice(price1);
557
+ return { price, changeScope: item.effectivePricing.permanentPriceSource };
558
+ }
559
+ }
560
+ const price2 = item.permanentPrice;
561
+ if (((_b = price2) === null || _b === void 0 ? void 0 : _b.currency) === accountingCurrency) {
562
+ const price = StoreItem.convertStoreItemComponentIPriceToPrice(price2);
563
+ return { price, changeScope: scp_component_store_items_1.PriceChangeLevelType.Item };
564
+ }
565
+ }
566
+ return undefined;
567
+ }
568
+ static calculateTemporaryPrice(itemToConvert, storeGroupItem, retailStoreItem, accountingCurrency) {
569
+ let temporaryPrice = StoreItem.calculateTemporaryPriceAtLevel(retailStoreItem, accountingCurrency);
570
+ if (temporaryPrice) {
571
+ return {
572
+ price: temporaryPrice.price,
573
+ source: {
574
+ organizationScope: scp_component_store_items_1.OrganizationScope.OneRetailLocation,
575
+ changeScope: temporaryPrice.changeScope,
576
+ },
577
+ };
578
+ }
579
+ temporaryPrice = StoreItem.calculateTemporaryPriceAtLevel(storeGroupItem, accountingCurrency);
580
+ if (temporaryPrice) {
581
+ return {
582
+ price: temporaryPrice.price,
583
+ source: {
584
+ organizationScope: scp_component_store_items_1.OrganizationScope.RetailLocationsGroup,
585
+ changeScope: temporaryPrice.changeScope,
586
+ },
587
+ };
588
+ }
589
+ temporaryPrice = StoreItem.calculateTemporaryPriceAtLevel(itemToConvert, accountingCurrency);
590
+ if (temporaryPrice) {
591
+ return {
592
+ price: temporaryPrice.price,
593
+ source: {
594
+ organizationScope: scp_component_store_items_1.OrganizationScope.AllRetailLocations,
595
+ changeScope: temporaryPrice.changeScope,
596
+ },
597
+ };
598
+ }
599
+ }
600
+ static calculateTemporaryPriceAtLevel(item, accountingCurrency) {
601
+ var _a, _b;
602
+ if (accountingCurrency && ((_a = item) === null || _a === void 0 ? void 0 : _a.effectivePricing)) {
603
+ const effectiveTemporaryPrice = item.effectivePricing.temporaryPrice;
604
+ if (((_b = effectiveTemporaryPrice) === null || _b === void 0 ? void 0 : _b.currency) === accountingCurrency) {
605
+ const price = StoreItem.convertStoreItemComponentIPriceToPrice(effectiveTemporaryPrice);
606
+ return { price, changeScope: item.effectivePricing.temporaryPriceSource };
607
+ }
608
+ }
609
+ return undefined;
610
+ }
611
+ static temporaryPriceEffectiveDateTime(itemToConvert, storeGroupItem, retailStoreItem) {
612
+ var _a, _b, _c, _d, _e, _f;
613
+ return (((_b = (_a = retailStoreItem) === null || _a === void 0 ? void 0 : _a.effectivePricing) === null || _b === void 0 ? void 0 : _b.temporaryPriceEffectiveDateTime) || ((_d = (_c = storeGroupItem) === null || _c === void 0 ? void 0 : _c.effectivePricing) === null || _d === void 0 ? void 0 : _d.temporaryPriceEffectiveDateTime) || ((_f = (_e = itemToConvert) === null || _e === void 0 ? void 0 : _e.effectivePricing) === null || _f === void 0 ? void 0 : _f.temporaryPriceEffectiveDateTime));
614
+ }
615
+ static temporaryPriceExpirationDateTime(itemToConvert, storeGroupItem, retailStoreItem) {
616
+ var _a, _b, _c, _d, _e, _f;
617
+ return (((_b = (_a = retailStoreItem) === null || _a === void 0 ? void 0 : _a.effectivePricing) === null || _b === void 0 ? void 0 : _b.temporaryPriceExpirationDateTime) || ((_d = (_c = storeGroupItem) === null || _c === void 0 ? void 0 : _c.effectivePricing) === null || _d === void 0 ? void 0 : _d.temporaryPriceExpirationDateTime) || ((_f = (_e = itemToConvert) === null || _e === void 0 ? void 0 : _e.effectivePricing) === null || _f === void 0 ? void 0 : _f.temporaryPriceExpirationDateTime));
618
+ }
619
+ static calculateFullPrice(itemToConvert, storeGroupItem, retailStoreItem, accountingCurrency) {
620
+ let fullPrice = StoreItem.calculateFullPriceAtLevel(retailStoreItem, accountingCurrency);
621
+ if (fullPrice) {
622
+ return {
623
+ price: fullPrice.price,
624
+ source: {
625
+ organizationScope: scp_component_store_items_1.OrganizationScope.OneRetailLocation,
626
+ changeScope: fullPrice.changeScope,
627
+ },
628
+ };
629
+ }
630
+ fullPrice = StoreItem.calculateFullPriceAtLevel(storeGroupItem, accountingCurrency);
631
+ if (fullPrice) {
632
+ return {
633
+ price: fullPrice.price,
634
+ source: {
635
+ organizationScope: scp_component_store_items_1.OrganizationScope.RetailLocationsGroup,
636
+ changeScope: fullPrice.changeScope,
637
+ },
638
+ };
639
+ }
640
+ fullPrice = StoreItem.calculateFullPriceAtLevel(itemToConvert, accountingCurrency);
641
+ if (fullPrice) {
642
+ return {
643
+ price: fullPrice.price,
644
+ source: {
645
+ organizationScope: scp_component_store_items_1.OrganizationScope.AllRetailLocations,
646
+ changeScope: fullPrice.changeScope,
647
+ },
648
+ };
649
+ }
650
+ }
651
+ static calculateFullPriceAtLevel(item, accountingCurrency) {
652
+ var _a;
653
+ if (accountingCurrency && item) {
654
+ const price2 = item.fullPrice;
655
+ if (((_a = price2) === null || _a === void 0 ? void 0 : _a.currency) === accountingCurrency) {
656
+ const price = StoreItem.convertStoreItemComponentIPriceToPrice(price2);
657
+ return { price, changeScope: scp_component_store_items_1.PriceChangeLevelType.Item };
658
+ }
659
+ }
660
+ return undefined;
661
+ }
662
+ static createItemLookupKeysFromJsonObject(itemLookupKeysFromJson) {
663
+ const itemLookupKeys = [];
664
+ if (itemLookupKeysFromJson) {
665
+ for (const itemLookupKeyFromJson of itemLookupKeysFromJson) {
666
+ const itemLookupKey = ItemLookupKey.createFromJsonObj(itemLookupKeyFromJson);
667
+ itemLookupKeys.push(itemLookupKey);
668
+ }
669
+ }
670
+ return itemLookupKeys;
671
+ }
672
+ static getStringFromJsonObject(propertyFromJsonObject) {
673
+ let property = undefined;
674
+ if (propertyFromJsonObject) {
675
+ property = propertyFromJsonObject;
676
+ }
677
+ else if (propertyFromJsonObject === null) {
678
+ property = null;
679
+ }
680
+ return property;
681
+ }
682
+ static getPriceFromStoreItemPrice(storeItem, accountingCurrency) {
683
+ return scp_component_business_core_1.Price.fromIPrice({
684
+ amount: storeItem.amount,
685
+ currency: storeItem.currency || accountingCurrency,
686
+ quantity: storeItem.quantity,
687
+ units: storeItem.unitOfMeasure,
688
+ });
689
+ }
690
+ static createHierarchyNodeFromJsonObject(hierarchyNodesFromJson) {
691
+ if (!hierarchyNodesFromJson) {
692
+ return undefined;
693
+ }
694
+ const hierarchyNodes = [];
695
+ for (const hierarchyNodeFromJson of hierarchyNodesFromJson) {
696
+ const hierarchyNode = HierarchyNode.createFromJsonObj(hierarchyNodeFromJson);
697
+ hierarchyNodes.push(hierarchyNode);
698
+ }
699
+ return hierarchyNodes;
700
+ }
701
+ static updateLocalizableTextsFromItemAttributeObject(storeItem, sourceItem, locale) {
702
+ let useDefaultValues = true;
703
+ if (!!locale && locale !== sourceItem.language && sourceItem.translations) {
704
+ const localeToUse = utils_1.getLocaleCodeForTranslationSet(sourceItem.translations, locale);
705
+ if (localeToUse) {
706
+ // ... language-specific values
707
+ const itemTranslationAttribute = sourceItem.translations[localeToUse];
708
+ storeItem.shortDescription = itemTranslationAttribute.shortDescription || "";
709
+ storeItem.additionalDescription = itemTranslationAttribute.additionalDescription || "";
710
+ storeItem.longDescription = itemTranslationAttribute.longDescription || "";
711
+ storeItem.name = itemTranslationAttribute.name || "";
712
+ storeItem.stopStatusMessage = itemTranslationAttribute.stopStatusMessage || "";
713
+ useDefaultValues = false;
714
+ }
715
+ }
716
+ if (useDefaultValues) {
717
+ // ... default values
718
+ storeItem.shortDescription = sourceItem.shortDescription || "";
719
+ storeItem.additionalDescription = sourceItem.additionalDescription || "";
720
+ storeItem.longDescription = sourceItem.longDescription || "";
721
+ storeItem.name = sourceItem.name || "";
722
+ storeItem.stopStatusMessage = sourceItem.stopStatusMessage || "";
723
+ }
724
+ storeItem.attributes = ItemAttributes.createFromJsonObject(sourceItem.attributes, locale);
725
+ }
726
+ static verifyCurrencyCode(storeItem, accountingCurrency) {
727
+ if (storeItem.price && storeItem.price.amount) {
728
+ if (accountingCurrency !== storeItem.price.amount.currency) {
729
+ throw new scp_component_store_selling_core_1.PosError(`Item ${storeItem.uniqueId} pricing currency code ${storeItem.price.amount.currency} ` +
730
+ `does not match accountingCurrency ${accountingCurrency} set on retailLocation`, ErrorCodes_1.SSF_CURRENCY_MISMATCH_I18N_CODE);
731
+ }
732
+ }
733
+ else {
734
+ throw new scp_component_store_selling_core_1.PosError(`Pricing not found for Item ${storeItem.uniqueId}`, ErrorCodes_1.SSF_PRICE_NOT_FOUND_I18N_CODE);
735
+ }
736
+ }
737
+ static isStoreGroupItem(retailLocationItem) {
738
+ return retailLocationItem && !_.isEmpty(retailLocationItem.retailLocationGroupId);
739
+ }
740
+ }
741
+ exports.StoreItem = StoreItem;
742
+ class PriceInquiry extends StoreItem {
743
+ constructor() {
744
+ super(...arguments);
745
+ this.finalPrice = undefined;
746
+ this.promos = undefined;
747
+ }
748
+ }
749
+ exports.PriceInquiry = PriceInquiry;
750
+ //# sourceMappingURL=StoreItem.js.map