@unchainedshop/plugins 1.1.3 → 1.1.7

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 (332) hide show
  1. package/lib/delivery/pick-mup.d.ts +1 -0
  2. package/lib/delivery/pick-mup.js +98 -0
  3. package/lib/delivery/pick-mup.js.map +1 -0
  4. package/lib/delivery/post.d.ts +1 -0
  5. package/lib/delivery/post.js +23 -0
  6. package/lib/delivery/post.js.map +1 -0
  7. package/lib/delivery/send-message.d.ts +1 -0
  8. package/lib/delivery/send-message.js +41 -0
  9. package/lib/delivery/send-message.js.map +1 -0
  10. package/lib/delivery/stores.d.ts +1 -0
  11. package/lib/delivery/stores.js +39 -0
  12. package/lib/delivery/stores.js.map +1 -0
  13. package/lib/enrollments/licensed.d.ts +1 -0
  14. package/lib/enrollments/licensed.js +40 -0
  15. package/lib/enrollments/licensed.js.map +1 -0
  16. package/lib/files/gridfs/gridfs-adapter.js +1 -1
  17. package/lib/files/gridfs/gridfs-adapter.js.map +1 -1
  18. package/lib/files/gridfs/gridfs-webhook.js +2 -2
  19. package/lib/files/gridfs/gridfs-webhook.js.map +1 -1
  20. package/lib/files/minio/minio-webhook.js +1 -1
  21. package/lib/files/minio/minio-webhook.js.map +1 -1
  22. package/lib/filters/local-search.d.ts +3 -0
  23. package/lib/filters/local-search.js +84 -0
  24. package/lib/filters/local-search.js.map +1 -0
  25. package/lib/filters/strict-equal.d.ts +1 -0
  26. package/lib/filters/strict-equal.js +25 -0
  27. package/lib/filters/strict-equal.js.map +1 -0
  28. package/lib/payment/apple-iap/adapter.d.ts +1 -0
  29. package/lib/payment/apple-iap/adapter.js +284 -0
  30. package/lib/payment/apple-iap/adapter.js.map +1 -0
  31. package/lib/payment/apple-iap/db/AppleTransactionsCollection.d.ts +7 -0
  32. package/lib/payment/apple-iap/db/AppleTransactionsCollection.js +5 -0
  33. package/lib/payment/apple-iap/db/AppleTransactionsCollection.js.map +1 -0
  34. package/lib/payment/apple-iap/index.d.ts +2 -0
  35. package/lib/payment/apple-iap/index.js +3 -0
  36. package/lib/payment/apple-iap/index.js.map +1 -0
  37. package/lib/payment/apple-iap/module/configureAppleTransactionsModule.d.ts +9 -0
  38. package/lib/payment/apple-iap/module/configureAppleTransactionsModule.js +18 -0
  39. package/lib/payment/apple-iap/module/configureAppleTransactionsModule.js.map +1 -0
  40. package/lib/payment/bity/adapter.d.ts +1 -0
  41. package/lib/payment/bity/adapter.js +316 -0
  42. package/lib/payment/bity/adapter.js.map +1 -0
  43. package/lib/payment/bity/db/BityCredentialsCollection.d.ts +11 -0
  44. package/lib/payment/bity/db/BityCredentialsCollection.js +5 -0
  45. package/lib/payment/bity/db/BityCredentialsCollection.js.map +1 -0
  46. package/lib/payment/bity/index.d.ts +2 -0
  47. package/lib/payment/bity/index.js +3 -0
  48. package/lib/payment/bity/index.js.map +1 -0
  49. package/lib/payment/bity/module/configureBityModule.d.ts +11 -0
  50. package/lib/payment/bity/module/configureBityModule.js +33 -0
  51. package/lib/payment/bity/module/configureBityModule.js.map +1 -0
  52. package/lib/payment/braintree.d.ts +1 -0
  53. package/lib/payment/braintree.js +129 -0
  54. package/lib/payment/braintree.js.map +1 -0
  55. package/lib/payment/cryptopay.d.ts +1 -0
  56. package/lib/payment/cryptopay.js +159 -0
  57. package/lib/payment/cryptopay.js.map +1 -0
  58. package/lib/payment/datatrans-v2/api/authorize.d.ts +2 -0
  59. package/lib/payment/datatrans-v2/api/authorize.js +12 -0
  60. package/lib/payment/datatrans-v2/api/authorize.js.map +1 -0
  61. package/lib/payment/datatrans-v2/api/authorizeAuthenticated.d.ts +2 -0
  62. package/lib/payment/datatrans-v2/api/authorizeAuthenticated.js +11 -0
  63. package/lib/payment/datatrans-v2/api/authorizeAuthenticated.js.map +1 -0
  64. package/lib/payment/datatrans-v2/api/cancel.d.ts +2 -0
  65. package/lib/payment/datatrans-v2/api/cancel.js +10 -0
  66. package/lib/payment/datatrans-v2/api/cancel.js.map +1 -0
  67. package/lib/payment/datatrans-v2/api/index.d.ts +19 -0
  68. package/lib/payment/datatrans-v2/api/index.js +24 -0
  69. package/lib/payment/datatrans-v2/api/index.js.map +1 -0
  70. package/lib/payment/datatrans-v2/api/init.d.ts +2 -0
  71. package/lib/payment/datatrans-v2/api/init.js +31 -0
  72. package/lib/payment/datatrans-v2/api/init.js.map +1 -0
  73. package/lib/payment/datatrans-v2/api/makeFetcher.d.ts +2 -0
  74. package/lib/payment/datatrans-v2/api/makeFetcher.js +41 -0
  75. package/lib/payment/datatrans-v2/api/makeFetcher.js.map +1 -0
  76. package/lib/payment/datatrans-v2/api/secureFields.d.ts +2 -0
  77. package/lib/payment/datatrans-v2/api/secureFields.js +14 -0
  78. package/lib/payment/datatrans-v2/api/secureFields.js.map +1 -0
  79. package/lib/payment/datatrans-v2/api/settle.d.ts +2 -0
  80. package/lib/payment/datatrans-v2/api/settle.js +10 -0
  81. package/lib/payment/datatrans-v2/api/settle.js.map +1 -0
  82. package/lib/payment/datatrans-v2/api/status.d.ts +2 -0
  83. package/lib/payment/datatrans-v2/api/status.js +7 -0
  84. package/lib/payment/datatrans-v2/api/status.js.map +1 -0
  85. package/lib/payment/datatrans-v2/api/validate.d.ts +2 -0
  86. package/lib/payment/datatrans-v2/api/validate.js +10 -0
  87. package/lib/payment/datatrans-v2/api/validate.js.map +1 -0
  88. package/lib/payment/datatrans-v2/generateSignature.d.ts +10 -0
  89. package/lib/payment/datatrans-v2/generateSignature.js +19 -0
  90. package/lib/payment/datatrans-v2/generateSignature.js.map +1 -0
  91. package/lib/payment/datatrans-v2/getPaths.d.ts +9 -0
  92. package/lib/payment/datatrans-v2/getPaths.js +9 -0
  93. package/lib/payment/datatrans-v2/getPaths.js.map +1 -0
  94. package/lib/payment/datatrans-v2/index.d.ts +1 -0
  95. package/lib/payment/datatrans-v2/index.js +384 -0
  96. package/lib/payment/datatrans-v2/index.js.map +1 -0
  97. package/lib/payment/datatrans-v2/middleware.d.ts +1 -0
  98. package/lib/payment/datatrans-v2/middleware.js +111 -0
  99. package/lib/payment/datatrans-v2/middleware.js.map +1 -0
  100. package/lib/payment/datatrans-v2/parseRegistrationData.d.ts +11 -0
  101. package/lib/payment/datatrans-v2/parseRegistrationData.js +26 -0
  102. package/lib/payment/datatrans-v2/parseRegistrationData.js.map +1 -0
  103. package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts +7 -0
  104. package/lib/payment/datatrans-v2/roundedAmountFromOrder.js +10 -0
  105. package/lib/payment/datatrans-v2/roundedAmountFromOrder.js.map +1 -0
  106. package/lib/payment/datatrans-v2/splitProperties.d.ts +8 -0
  107. package/lib/payment/datatrans-v2/splitProperties.js +58 -0
  108. package/lib/payment/datatrans-v2/splitProperties.js.map +1 -0
  109. package/lib/payment/invoice-prepaid.d.ts +1 -0
  110. package/lib/payment/invoice-prepaid.js +30 -0
  111. package/lib/payment/invoice-prepaid.js.map +1 -0
  112. package/lib/payment/invoice.d.ts +1 -0
  113. package/lib/payment/invoice.js +27 -0
  114. package/lib/payment/invoice.js.map +1 -0
  115. package/lib/payment/paypal-checkout.d.ts +1 -0
  116. package/lib/payment/paypal-checkout.js +82 -0
  117. package/lib/payment/paypal-checkout.js.map +1 -0
  118. package/lib/payment/postfinance-checkout/api.d.ts +11 -0
  119. package/lib/payment/postfinance-checkout/api.js +109 -0
  120. package/lib/payment/postfinance-checkout/api.js.map +1 -0
  121. package/lib/payment/postfinance-checkout/index.d.ts +1 -0
  122. package/lib/payment/postfinance-checkout/index.js +186 -0
  123. package/lib/payment/postfinance-checkout/index.js.map +1 -0
  124. package/lib/payment/postfinance-checkout/middleware.d.ts +1 -0
  125. package/lib/payment/postfinance-checkout/middleware.js +42 -0
  126. package/lib/payment/postfinance-checkout/middleware.js.map +1 -0
  127. package/lib/payment/postfinance-checkout/types.d.ts +23 -0
  128. package/lib/payment/postfinance-checkout/types.js +12 -0
  129. package/lib/payment/postfinance-checkout/types.js.map +1 -0
  130. package/lib/payment/postfinance-checkout/utils.d.ts +4 -0
  131. package/lib/payment/postfinance-checkout/utils.js +20 -0
  132. package/lib/payment/postfinance-checkout/utils.js.map +1 -0
  133. package/lib/payment/stripe.d.ts +1 -0
  134. package/lib/payment/stripe.js +214 -0
  135. package/lib/payment/stripe.js.map +1 -0
  136. package/lib/payment/worldline-saferpay/index.d.ts +1 -0
  137. package/lib/payment/worldline-saferpay/index.js +112 -0
  138. package/lib/payment/worldline-saferpay/index.js.map +1 -0
  139. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayClient.d.ts +14 -0
  140. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayClient.js +29 -0
  141. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayClient.js.map +1 -0
  142. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayConnection.d.ts +9 -0
  143. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayConnection.js +28 -0
  144. package/lib/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayConnection.js.map +1 -0
  145. package/lib/payment/worldline-saferpay/worldline-saferpay-client/index.d.ts +4 -0
  146. package/lib/payment/worldline-saferpay/worldline-saferpay-client/index.js +2 -0
  147. package/lib/payment/worldline-saferpay/worldline-saferpay-client/index.js.map +1 -0
  148. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentMethods.d.ts +1 -0
  149. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentMethods.js +2 -0
  150. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentMethods.js.map +1 -0
  151. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageAssert.d.ts +73 -0
  152. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageAssert.js +2 -0
  153. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageAssert.js.map +1 -0
  154. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageInitialize.d.ts +53 -0
  155. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageInitialize.js +2 -0
  156. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageInitialize.js.map +1 -0
  157. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Request.d.ts +13 -0
  158. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Request.js +2 -0
  159. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Request.js.map +1 -0
  160. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Response.d.ts +9 -0
  161. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Response.js +2 -0
  162. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Response.js.map +1 -0
  163. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Transaction.d.ts +5 -0
  164. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Transaction.js +2 -0
  165. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/Transaction.js.map +1 -0
  166. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/TransactionCancel.d.ts +13 -0
  167. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/TransactionCancel.js +2 -0
  168. package/lib/payment/worldline-saferpay/worldline-saferpay-client/models/TransactionCancel.js.map +1 -0
  169. package/lib/pricing/delivery-swiss-tax.d.ts +15 -0
  170. package/lib/pricing/delivery-swiss-tax.js +98 -0
  171. package/lib/pricing/delivery-swiss-tax.js.map +1 -0
  172. package/lib/pricing/discount-100-off.d.ts +1 -0
  173. package/lib/pricing/discount-100-off.js +34 -0
  174. package/lib/pricing/discount-100-off.js.map +1 -0
  175. package/lib/pricing/discount-half-price-manual.d.ts +1 -0
  176. package/lib/pricing/discount-half-price-manual.js +34 -0
  177. package/lib/pricing/discount-half-price-manual.js.map +1 -0
  178. package/lib/pricing/discount-half-price.d.ts +1 -0
  179. package/lib/pricing/discount-half-price.js +37 -0
  180. package/lib/pricing/discount-half-price.js.map +1 -0
  181. package/lib/pricing/free-delivery.d.ts +2 -0
  182. package/lib/pricing/free-delivery.js +26 -0
  183. package/lib/pricing/free-delivery.js.map +1 -0
  184. package/lib/pricing/free-payment.d.ts +2 -0
  185. package/lib/pricing/free-payment.js +26 -0
  186. package/lib/pricing/free-payment.js.map +1 -0
  187. package/lib/pricing/order-delivery.d.ts +1 -0
  188. package/lib/pricing/order-delivery.js +33 -0
  189. package/lib/pricing/order-delivery.js.map +1 -0
  190. package/lib/pricing/order-discount.d.ts +1 -0
  191. package/lib/pricing/order-discount.js +110 -0
  192. package/lib/pricing/order-discount.js.map +1 -0
  193. package/lib/pricing/order-items-discount.d.ts +1 -0
  194. package/lib/pricing/order-items-discount.js +88 -0
  195. package/lib/pricing/order-items-discount.js.map +1 -0
  196. package/lib/pricing/order-items.d.ts +1 -0
  197. package/lib/pricing/order-items.js +44 -0
  198. package/lib/pricing/order-items.js.map +1 -0
  199. package/lib/pricing/order-payment.d.ts +1 -0
  200. package/lib/pricing/order-payment.js +33 -0
  201. package/lib/pricing/order-payment.js.map +1 -0
  202. package/lib/pricing/product-catalog-price.d.ts +1 -0
  203. package/lib/pricing/product-catalog-price.js +37 -0
  204. package/lib/pricing/product-catalog-price.js.map +1 -0
  205. package/lib/pricing/product-discount.d.ts +1 -0
  206. package/lib/pricing/product-discount.js +55 -0
  207. package/lib/pricing/product-discount.js.map +1 -0
  208. package/lib/pricing/product-price-ECB-interbank-exchange.d.ts +1 -0
  209. package/lib/pricing/product-price-ECB-interbank-exchange.js +90 -0
  210. package/lib/pricing/product-price-ECB-interbank-exchange.js.map +1 -0
  211. package/lib/pricing/product-price-coinbase-exchange.d.ts +1 -0
  212. package/lib/pricing/product-price-coinbase-exchange.js +60 -0
  213. package/lib/pricing/product-price-coinbase-exchange.js.map +1 -0
  214. package/lib/pricing/product-price-cryptopay.d.ts +1 -0
  215. package/lib/pricing/product-price-cryptopay.js +21 -0
  216. package/lib/pricing/product-price-cryptopay.js.map +1 -0
  217. package/lib/pricing/product-price-rateconversion.d.ts +1 -0
  218. package/lib/pricing/product-price-rateconversion.js +51 -0
  219. package/lib/pricing/product-price-rateconversion.js.map +1 -0
  220. package/lib/pricing/product-price-round.d.ts +11 -0
  221. package/lib/pricing/product-price-round.js +54 -0
  222. package/lib/pricing/product-price-round.js.map +1 -0
  223. package/lib/pricing/product-swiss-tax.d.ts +13 -0
  224. package/lib/pricing/product-swiss-tax.js +102 -0
  225. package/lib/pricing/product-swiss-tax.js.map +1 -0
  226. package/lib/pricing/utils/cache.d.ts +8 -0
  227. package/lib/pricing/utils/cache.js +28 -0
  228. package/lib/pricing/utils/cache.js.map +1 -0
  229. package/lib/quotations/manual.d.ts +1 -0
  230. package/lib/quotations/manual.js +21 -0
  231. package/lib/quotations/manual.js.map +1 -0
  232. package/lib/warehousing/google-sheets.d.ts +1 -0
  233. package/lib/warehousing/google-sheets.js +153 -0
  234. package/lib/warehousing/google-sheets.js.map +1 -0
  235. package/lib/warehousing/store.d.ts +1 -0
  236. package/lib/warehousing/store.js +33 -0
  237. package/lib/warehousing/store.js.map +1 -0
  238. package/lib/worker/BulkImportWorker.js +3 -3
  239. package/lib/worker/BulkImportWorker.js.map +1 -1
  240. package/lib/worker/GenerateOrderWorker.js +1 -1
  241. package/lib/worker/GenerateOrderWorker.js.map +1 -1
  242. package/lib/worker/ZombieKillerWorker.js.map +1 -1
  243. package/lib/worker/email.js +55 -4
  244. package/lib/worker/email.js.map +1 -1
  245. package/license +274 -0
  246. package/package.json +29 -12
  247. package/src/delivery/pick-mup.ts +119 -0
  248. package/src/delivery/post.ts +30 -0
  249. package/src/delivery/send-message.ts +54 -0
  250. package/src/delivery/stores.ts +49 -0
  251. package/src/enrollments/licensed.ts +49 -0
  252. package/src/files/gridfs/gridfs-adapter.ts +1 -1
  253. package/src/files/gridfs/gridfs-webhook.js +2 -2
  254. package/src/files/minio/minio-webhook.js +1 -1
  255. package/src/filters/local-search.ts +105 -0
  256. package/src/filters/strict-equal.ts +31 -0
  257. package/src/payment/apple-iap/adapter.ts +390 -0
  258. package/src/payment/apple-iap/db/AppleTransactionsCollection.ts +13 -0
  259. package/src/payment/apple-iap/index.ts +3 -0
  260. package/src/payment/apple-iap/module/configureAppleTransactionsModule.ts +31 -0
  261. package/src/payment/bity/adapter.ts +417 -0
  262. package/src/payment/bity/db/BityCredentialsCollection.ts +17 -0
  263. package/src/payment/bity/index.ts +3 -0
  264. package/src/payment/bity/module/configureBityModule.ts +46 -0
  265. package/src/payment/braintree.ts +147 -0
  266. package/src/payment/cryptopay.ts +195 -0
  267. package/src/payment/datatrans-v2/api/authorize.ts +17 -0
  268. package/src/payment/datatrans-v2/api/authorizeAuthenticated.ts +20 -0
  269. package/src/payment/datatrans-v2/api/cancel.ts +13 -0
  270. package/src/payment/datatrans-v2/api/index.ts +24 -0
  271. package/src/payment/datatrans-v2/api/init.ts +40 -0
  272. package/src/payment/datatrans-v2/api/makeFetcher.ts +49 -0
  273. package/src/payment/datatrans-v2/api/secureFields.ts +19 -0
  274. package/src/payment/datatrans-v2/api/settle.ts +13 -0
  275. package/src/payment/datatrans-v2/api/status.ts +8 -0
  276. package/src/payment/datatrans-v2/api/types.d.ts +378 -0
  277. package/src/payment/datatrans-v2/api/validate.ts +13 -0
  278. package/src/payment/datatrans-v2/generateSignature.ts +24 -0
  279. package/src/payment/datatrans-v2/getPaths.ts +24 -0
  280. package/src/payment/datatrans-v2/index.ts +476 -0
  281. package/src/payment/datatrans-v2/middleware.ts +147 -0
  282. package/src/payment/datatrans-v2/parseRegistrationData.ts +32 -0
  283. package/src/payment/datatrans-v2/roundedAmountFromOrder.ts +16 -0
  284. package/src/payment/datatrans-v2/splitProperties.ts +63 -0
  285. package/src/payment/invoice-prepaid.ts +40 -0
  286. package/src/payment/invoice.ts +36 -0
  287. package/src/payment/paypal-checkout.ts +107 -0
  288. package/src/payment/postfinance-checkout/api.ts +142 -0
  289. package/src/payment/postfinance-checkout/index.ts +241 -0
  290. package/src/payment/postfinance-checkout/middleware.ts +54 -0
  291. package/src/payment/postfinance-checkout/types.ts +27 -0
  292. package/src/payment/postfinance-checkout/utils.ts +35 -0
  293. package/src/payment/stripe.ts +278 -0
  294. package/src/payment/worldline-saferpay/index.ts +140 -0
  295. package/src/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayClient.ts +54 -0
  296. package/src/payment/worldline-saferpay/worldline-saferpay-client/api/SaferpayConnection.ts +36 -0
  297. package/src/payment/worldline-saferpay/worldline-saferpay-client/index.ts +8 -0
  298. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentMethods.ts +26 -0
  299. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageAssert.ts +75 -0
  300. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/PaymentPageInitialize.ts +55 -0
  301. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/Request.ts +14 -0
  302. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/Response.ts +9 -0
  303. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/Transaction.ts +6 -0
  304. package/src/payment/worldline-saferpay/worldline-saferpay-client/models/TransactionCancel.ts +15 -0
  305. package/src/pricing/delivery-swiss-tax.ts +115 -0
  306. package/src/pricing/discount-100-off.ts +44 -0
  307. package/src/pricing/discount-half-price-manual.ts +43 -0
  308. package/src/pricing/discount-half-price.ts +46 -0
  309. package/src/pricing/free-delivery.ts +31 -0
  310. package/src/pricing/free-payment.ts +32 -0
  311. package/src/pricing/order-delivery.ts +45 -0
  312. package/src/pricing/order-discount.ts +158 -0
  313. package/src/pricing/order-items-discount.ts +116 -0
  314. package/src/pricing/order-items.ts +61 -0
  315. package/src/pricing/order-payment.ts +46 -0
  316. package/src/pricing/product-catalog-price.ts +56 -0
  317. package/src/pricing/product-discount.ts +69 -0
  318. package/src/pricing/product-price-ECB-interbank-exchange.ts +108 -0
  319. package/src/pricing/product-price-coinbase-exchange.ts +82 -0
  320. package/src/pricing/product-price-cryptopay.ts +25 -0
  321. package/src/pricing/product-price-rateconversion.ts +73 -0
  322. package/src/pricing/product-price-round.ts +78 -0
  323. package/src/pricing/product-swiss-tax.ts +117 -0
  324. package/src/pricing/utils/cache.js +32 -0
  325. package/src/quotations/manual.ts +27 -0
  326. package/src/warehousing/google-sheets.ts +165 -0
  327. package/src/warehousing/store.ts +47 -0
  328. package/src/worker/BulkImportWorker.ts +3 -3
  329. package/src/worker/GenerateOrderWorker.ts +1 -1
  330. package/src/worker/ZombieKillerWorker.ts +5 -5
  331. package/src/worker/email.ts +56 -4
  332. package/lib/worker/MessageWorker.d.ts +0 -10
@@ -0,0 +1,116 @@
1
+ import { IOrderPricingAdapter, OrderPricingRowCategory } from '@unchainedshop/types/orders.pricing';
2
+ import { OrderPricingDirector, OrderPricingAdapter } from '@unchainedshop/core-orders';
3
+
4
+ const resolveRatioAndTaxDivisorForPricingSheet = (pricing, total) => {
5
+ if (total === 0 || !pricing) {
6
+ return {
7
+ ratio: 1,
8
+ taxDivisor: 1,
9
+ };
10
+ }
11
+ const tax = pricing.taxSum();
12
+ const gross = pricing.gross();
13
+ return {
14
+ ratio: gross / total,
15
+ taxDivisor: gross / (gross - tax),
16
+ };
17
+ };
18
+
19
+ const resolveAmountAndTax = ({ ratio, taxDivisor }, amount) => {
20
+ const shareAmount = Number.isFinite(ratio) ? amount * ratio : 0;
21
+ const shareTaxAmount = Number.isFinite(taxDivisor) ? shareAmount - shareAmount / taxDivisor : 0;
22
+ return [shareAmount, shareTaxAmount];
23
+ };
24
+
25
+ const applyDiscountToMultipleShares = (shares, amount) => {
26
+ return shares.reduce(
27
+ ([currentDiscountAmount, currentTaxAmount], share) => {
28
+ const [shareAmount, shareTaxAmount] = resolveAmountAndTax(share, amount);
29
+ return [currentDiscountAmount + shareAmount, currentTaxAmount + shareTaxAmount];
30
+ },
31
+ [0, 0],
32
+ );
33
+ };
34
+
35
+ const calculateAmountToSplit = (configuration, amount) => {
36
+ const deductionAmount = configuration.rate
37
+ ? amount * configuration.rate
38
+ : Math.min(configuration.fixedRate, amount);
39
+
40
+ return Math.max(0, deductionAmount - (configuration.alreadyDeducted || 0));
41
+ };
42
+
43
+ const OrderItemsDiscount: IOrderPricingAdapter = {
44
+ ...OrderPricingAdapter,
45
+
46
+ key: 'shop.unchained.pricing.order-items-discount',
47
+ version: '1.0',
48
+ label: 'Apply Discounts on Total Value Of Goods',
49
+ orderIndex: 89,
50
+
51
+ isActivatedFor: () => {
52
+ return true;
53
+ },
54
+
55
+ actions: (params) => {
56
+ const pricingAdapter = OrderPricingAdapter.actions(params);
57
+ const { order, orderPositions, modules } = params.context;
58
+
59
+ return {
60
+ ...pricingAdapter,
61
+
62
+ calculate: async () => {
63
+ // discounts need to provide a *fixedRate*
64
+ // if you want to add percentual discounts,
65
+ // add it to the order item calculation
66
+
67
+ const totalAmountOfItems = params.calculationSheet.sum({
68
+ category: OrderPricingRowCategory.Items,
69
+ });
70
+
71
+ const itemShares = orderPositions.map((orderPosition) =>
72
+ resolveRatioAndTaxDivisorForPricingSheet(
73
+ modules.orders.positions.pricingSheet(orderPosition, order.currency, params.context),
74
+ totalAmountOfItems,
75
+ ),
76
+ );
77
+
78
+ let alreadyDeducted = 0;
79
+
80
+ params.discounts.forEach(({ configuration, discountId }) => {
81
+ // First, we deduce the discount from the items
82
+ const [itemsDiscountAmount, itemsTaxAmount] = applyDiscountToMultipleShares(
83
+ itemShares,
84
+ calculateAmountToSplit({ ...configuration, alreadyDeducted }, totalAmountOfItems),
85
+ );
86
+ alreadyDeducted = +itemsDiscountAmount;
87
+
88
+ const discountAmount = itemsDiscountAmount;
89
+ const taxAmount = itemsTaxAmount;
90
+ if (discountAmount) {
91
+ pricingAdapter.resultSheet().addDiscount({
92
+ amount: discountAmount * -1,
93
+ discountId,
94
+ meta: {
95
+ adapter: OrderItemsDiscount.key,
96
+ },
97
+ });
98
+ if (taxAmount !== 0) {
99
+ pricingAdapter.resultSheet().addTax({
100
+ amount: taxAmount * -1,
101
+ meta: {
102
+ discountId,
103
+ adapter: OrderItemsDiscount.key,
104
+ },
105
+ });
106
+ }
107
+ }
108
+ });
109
+
110
+ return pricingAdapter.calculate();
111
+ },
112
+ };
113
+ },
114
+ };
115
+
116
+ OrderPricingDirector.registerAdapter(OrderItemsDiscount);
@@ -0,0 +1,61 @@
1
+ import { IOrderPricingAdapter } from '@unchainedshop/types/orders.pricing';
2
+ import { OrderPricingDirector, OrderPricingAdapter } from '@unchainedshop/core-orders';
3
+
4
+ const OrderItems: IOrderPricingAdapter = {
5
+ ...OrderPricingAdapter,
6
+
7
+ key: 'shop.unchained.pricing.order-items',
8
+ version: '1.0',
9
+ label: 'Add Total Value Of Goods to Order',
10
+ orderIndex: 0,
11
+
12
+ isActivatedFor: () => {
13
+ return true;
14
+ },
15
+
16
+ actions: (params) => {
17
+ const pricingAdapter = OrderPricingAdapter.actions(params);
18
+ const { order, orderPositions, modules } = params.context;
19
+
20
+ return {
21
+ ...pricingAdapter,
22
+
23
+ calculate: async () => {
24
+ // just sum up all products items prices, taxes & fees
25
+ const totalAndTaxesOfAllItems = orderPositions.reduce(
26
+ (current, orderPosition) => {
27
+ const pricing = modules.orders.positions.pricingSheet(
28
+ orderPosition,
29
+ order.currency,
30
+ params.context,
31
+ );
32
+ const tax = pricing.taxSum();
33
+ const items = pricing.gross();
34
+ return {
35
+ taxes: current.taxes + tax,
36
+ items: current.items + items,
37
+ };
38
+ },
39
+ {
40
+ taxes: 0,
41
+ items: 0,
42
+ },
43
+ );
44
+
45
+ pricingAdapter.resultSheet().addItems({
46
+ amount: totalAndTaxesOfAllItems.items,
47
+ });
48
+
49
+ if (totalAndTaxesOfAllItems.taxes !== 0) {
50
+ pricingAdapter.resultSheet().addTax({
51
+ amount: totalAndTaxesOfAllItems.taxes,
52
+ });
53
+ }
54
+
55
+ return pricingAdapter.calculate();
56
+ },
57
+ };
58
+ },
59
+ };
60
+
61
+ OrderPricingDirector.registerAdapter(OrderItems);
@@ -0,0 +1,46 @@
1
+ import { IOrderPricingAdapter } from '@unchainedshop/types/orders.pricing';
2
+ import { OrderPricingDirector, OrderPricingAdapter } from '@unchainedshop/core-orders';
3
+
4
+ const OrderPayment: IOrderPricingAdapter = {
5
+ ...OrderPricingAdapter,
6
+
7
+ key: 'shop.unchained.pricing.order-payment',
8
+ version: '1.0',
9
+ label: 'Add Payment Fees to Order',
10
+ orderIndex: 20,
11
+
12
+ isActivatedFor: () => {
13
+ return true;
14
+ },
15
+
16
+ actions: (params) => {
17
+ const pricingAdapter = OrderPricingAdapter.actions(params);
18
+ const { order, orderPayment, modules } = params.context;
19
+
20
+ return {
21
+ ...pricingAdapter,
22
+
23
+ calculate: async () => {
24
+ // just add tax + net price to order pricing
25
+ if (!orderPayment) return null;
26
+
27
+ const pricing = modules.orders.payments.pricingSheet(
28
+ orderPayment,
29
+ order.currency,
30
+ params.context,
31
+ );
32
+ const tax = pricing.taxSum();
33
+ const paymentFees = pricing.gross();
34
+
35
+ pricingAdapter.resultSheet().addPayment({ amount: paymentFees });
36
+ if (tax !== 0) {
37
+ pricingAdapter.resultSheet().addTax({ amount: tax });
38
+ }
39
+
40
+ return pricingAdapter.calculate();
41
+ },
42
+ };
43
+ },
44
+ };
45
+
46
+ OrderPricingDirector.registerAdapter(OrderPayment);
@@ -0,0 +1,56 @@
1
+ import { IProductPricingAdapter } from '@unchainedshop/types/products.pricing';
2
+ import { ProductPricingDirector, ProductPricingAdapter } from '@unchainedshop/core-products';
3
+
4
+ const ProductPrice: IProductPricingAdapter = {
5
+ ...ProductPricingAdapter,
6
+
7
+ key: 'shop.unchained.pricing.product-price',
8
+ version: '1.0',
9
+ label: 'Add Gross Price to Product',
10
+ orderIndex: 0,
11
+
12
+ isActivatedFor: () => {
13
+ return true;
14
+ },
15
+
16
+ actions: (params) => {
17
+ const pricingAdapter = ProductPricingAdapter.actions(params);
18
+
19
+ return {
20
+ ...pricingAdapter,
21
+
22
+ calculate: async () => {
23
+ const {
24
+ product,
25
+ country,
26
+ currency: forcedCurrency,
27
+ quantity,
28
+ modules,
29
+ services,
30
+ } = params.context;
31
+ const currency =
32
+ forcedCurrency ||
33
+ (await services.countries.resolveDefaultCurrencyCode(
34
+ {
35
+ isoCode: country,
36
+ },
37
+ params.context,
38
+ ));
39
+ const price = await modules.products.prices.price(product, { country, currency, quantity });
40
+ if (price) {
41
+ const itemTotal = price.amount * quantity;
42
+ pricingAdapter.resultSheet().addItem({
43
+ amount: itemTotal,
44
+ isTaxable: price.isTaxable,
45
+ isNetPrice: price.isNetPrice,
46
+ meta: { adapter: ProductPrice.key },
47
+ });
48
+ }
49
+
50
+ return pricingAdapter.calculate();
51
+ },
52
+ };
53
+ },
54
+ };
55
+
56
+ ProductPricingDirector.registerAdapter(ProductPrice);
@@ -0,0 +1,69 @@
1
+ import { Discount, DiscountConfiguration } from '@unchainedshop/types/discount';
2
+ import {
3
+ IProductPricingAdapter,
4
+ ProductPricingRowCategory,
5
+ } from '@unchainedshop/types/products.pricing';
6
+ import { ProductPricingDirector, ProductPricingAdapter } from '@unchainedshop/core-products';
7
+
8
+ const applyRate = (configuration: DiscountConfiguration, amount) => {
9
+ const { rate, fixedRate } = configuration;
10
+ return rate ? amount * rate : Math.min(fixedRate, amount);
11
+ };
12
+ const ProductDiscount: IProductPricingAdapter = {
13
+ ...ProductPricingAdapter,
14
+
15
+ key: 'shop.unchained.pricing.product-discount',
16
+ version: '1.0',
17
+ label: 'Apply Discounts on Product Price',
18
+ orderIndex: 10,
19
+
20
+ isActivatedFor: () => {
21
+ return true;
22
+ },
23
+
24
+ actions: (params) => {
25
+ const pricingAdapter = ProductPricingAdapter.actions(params);
26
+
27
+ const addDiscount = (discount: Discount, total: number, isTaxable: boolean) => {
28
+ const { configuration, discountId } = discount;
29
+ const { isNetPrice = false, ...meta } = configuration;
30
+ const amount = applyRate(configuration, total);
31
+
32
+ pricingAdapter.resultSheet().addDiscount({
33
+ amount: amount * -1,
34
+ discountId,
35
+ isNetPrice,
36
+ isTaxable,
37
+ meta: { adapter: ProductDiscount.key, ...meta },
38
+ });
39
+ };
40
+
41
+ return {
42
+ ...pricingAdapter,
43
+
44
+ calculate: async () => {
45
+ const taxableTotal = params.calculationSheet.sum({
46
+ category: ProductPricingRowCategory.Item,
47
+ isTaxable: true,
48
+ });
49
+ const nonTaxableTotal = params.calculationSheet.sum({
50
+ category: ProductPricingRowCategory.Item,
51
+ isTaxable: false,
52
+ });
53
+
54
+ params.discounts.forEach((discount) => {
55
+ if (taxableTotal !== 0) {
56
+ addDiscount(discount, taxableTotal, true);
57
+ }
58
+ if (nonTaxableTotal !== 0) {
59
+ addDiscount(discount, nonTaxableTotal, false);
60
+ }
61
+ });
62
+
63
+ return pricingAdapter.calculate();
64
+ },
65
+ };
66
+ },
67
+ };
68
+
69
+ ProductPricingDirector.registerAdapter(ProductDiscount);
@@ -0,0 +1,108 @@
1
+ import { IProductPricingAdapter } from '@unchainedshop/types/products.pricing';
2
+ import fetch from 'isomorphic-unfetch';
3
+ import { ProductPricingDirector, ProductPricingAdapter } from '@unchainedshop/core-products';
4
+
5
+ import Cache from './utils/cache';
6
+
7
+ const CACHE_PERIOD = 60 * 60 * 24; // 1 day
8
+
9
+ const SUPPORTED_CURRENCIES = [
10
+ 'USD',
11
+ 'JPY',
12
+ 'BGN',
13
+ 'CZK',
14
+ 'DKK',
15
+ 'GBP',
16
+ 'HUF',
17
+ 'PLN',
18
+ 'RON',
19
+ 'SEK',
20
+ 'CHF',
21
+ 'ISK',
22
+ 'NOK',
23
+ 'HRK',
24
+ 'RUB',
25
+ 'TRY',
26
+ 'AUD',
27
+ 'BRL',
28
+ 'CAD',
29
+ 'CNY',
30
+ 'HKD',
31
+ 'IDR',
32
+ 'ILS',
33
+ 'INR',
34
+ 'KRW',
35
+ 'MXN',
36
+ 'MYR',
37
+ 'NZD',
38
+ 'PHP',
39
+ 'SGD',
40
+ 'THB',
41
+ 'ZAR',
42
+ ];
43
+
44
+ const cache = new Cache(CACHE_PERIOD);
45
+ const xmlJs = require('xml-js'); // eslint-disable-line
46
+
47
+ const getEURexchangeRateForCurrency = async (currency) => {
48
+ const response = cache.get(currency, () =>
49
+ fetch(`https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml`, {
50
+ method: 'GET',
51
+ })
52
+ .then((res) => res.text())
53
+ .then((text) => JSON.parse(xmlJs.xml2json(text)))
54
+ .then(
55
+ (json) =>
56
+ json.elements?.[0]?.elements
57
+ .filter((e) => e.name.toLowerCase() === 'cube')[0]
58
+ ?.elements[0]?.elements.filter((a) => a.attributes.currency === currency)?.[0]?.attributes,
59
+ ),
60
+ );
61
+ return response;
62
+ };
63
+
64
+ const ProductPriceECBIntraBankExchange: IProductPricingAdapter = {
65
+ ...ProductPricingAdapter,
66
+
67
+ key: 'shop.unchained.pricing.price-ECB-intrabank-exchange',
68
+ version: '1.0',
69
+ label: 'Convert EUR to X with current exchange rate',
70
+ orderIndex: 1,
71
+
72
+ isActivatedFor: (context) => {
73
+ return SUPPORTED_CURRENCIES.indexOf(context.currency) !== -1;
74
+ },
75
+
76
+ actions: (params) => {
77
+ const pricingAdapter = ProductPricingAdapter.actions(params);
78
+
79
+ return {
80
+ ...pricingAdapter,
81
+
82
+ calculate: async () => {
83
+ const { product, country, quantity, currency, modules } = params.context;
84
+ const { calculation = [] } = params.calculationSheet;
85
+ const EURprice = await modules.products.prices.price(product, {
86
+ country,
87
+ currency: 'EUR',
88
+ quantity,
89
+ });
90
+ if (!EURprice || !EURprice?.amount || calculation?.length) return pricingAdapter.calculate();
91
+
92
+ const exchange = await getEURexchangeRateForCurrency(currency);
93
+ const convertedAmount = EURprice.amount * exchange.rate;
94
+ pricingAdapter.resultSheet().resetCalculation(params.calculationSheet);
95
+ pricingAdapter.resultSheet().addItem({
96
+ amount: convertedAmount * quantity,
97
+ isTaxable: EURprice.isTaxable,
98
+ isNetPrice: EURprice.isNetPrice,
99
+ meta: { adapter: ProductPriceECBIntraBankExchange.key },
100
+ });
101
+
102
+ return pricingAdapter.calculate();
103
+ },
104
+ };
105
+ },
106
+ };
107
+
108
+ ProductPricingDirector.registerAdapter(ProductPriceECBIntraBankExchange);
@@ -0,0 +1,82 @@
1
+ import { IProductPricingAdapter } from '@unchainedshop/types/products.pricing';
2
+ import fetch from 'isomorphic-unfetch';
3
+ import { ProductPricingDirector, ProductPricingAdapter } from '@unchainedshop/core-products';
4
+
5
+ import Cache from './utils/cache';
6
+
7
+ const CACHE_PERIOD = 60 * 60 * 0.1; // 10 minutes
8
+ const SUPPORTED_CURRENCIES = ['BTC', 'ETH', 'XRP', 'USDT', 'BCH', 'BSV', 'LTC', 'EOS', 'BNB', 'XTZ'];
9
+ const cache = new Cache(CACHE_PERIOD);
10
+
11
+ const getFiatexchangeRateForCrypto = async (base, target) => {
12
+ const { data } = await cache.get(`${base}-${target}`, () =>
13
+ fetch(`https://api.coinbase.com/v2/exchange-rates?currency=${base}`, {
14
+ method: 'GET',
15
+ }).then((res) => res.json()),
16
+ );
17
+ return data?.rates?.[target];
18
+ };
19
+
20
+ const ProductPriceCoinbaseExchange: IProductPricingAdapter = {
21
+ ...ProductPricingAdapter,
22
+
23
+ key: 'shop.unchained.pricing.price-coinbase-exchange',
24
+ version: '1.0',
25
+ label: 'Convert fiat/crypto to crypto with current exchange rate',
26
+ orderIndex: 1,
27
+
28
+ isActivatedFor: (context) => {
29
+ return SUPPORTED_CURRENCIES.indexOf(context.currency.toUpperCase()) !== -1;
30
+ },
31
+
32
+ actions: (params) => {
33
+ const pricingAdapter = ProductPricingAdapter.actions(params);
34
+ const { services, modules } = params.context;
35
+ return {
36
+ ...pricingAdapter,
37
+
38
+ calculate: async () => {
39
+ const { product, country, quantity, currency } = params.context;
40
+ const defaultCurrency = await services.countries.resolveDefaultCurrencyCode(
41
+ {
42
+ isoCode: country,
43
+ },
44
+ params.context,
45
+ );
46
+
47
+ const productPrice = await modules.products.prices.price(product, {
48
+ country,
49
+ currency: defaultCurrency,
50
+ quantity,
51
+ });
52
+
53
+ const { calculation = [] } = params.calculationSheet;
54
+
55
+ if (
56
+ !productPrice ||
57
+ !productPrice?.amount ||
58
+ calculation?.length ||
59
+ defaultCurrency === currency
60
+ )
61
+ return pricingAdapter.calculate();
62
+
63
+ const rate = await getFiatexchangeRateForCrypto(defaultCurrency, currency);
64
+
65
+ if (rate > 0) {
66
+ const convertedAmount = productPrice.amount * rate;
67
+ pricingAdapter.resultSheet().resetCalculation(params.calculationSheet);
68
+ pricingAdapter.resultSheet().addItem({
69
+ amount: convertedAmount * quantity,
70
+ isTaxable: productPrice?.isTaxable,
71
+ isNetPrice: productPrice?.isNetPrice,
72
+ meta: { adapter: ProductPriceCoinbaseExchange.key },
73
+ });
74
+ }
75
+
76
+ return pricingAdapter.calculate();
77
+ },
78
+ };
79
+ },
80
+ };
81
+
82
+ ProductPricingDirector.registerAdapter(ProductPriceCoinbaseExchange);
@@ -0,0 +1,25 @@
1
+ import { Context } from '@unchainedshop/types/api';
2
+ import { ProductPriceRate } from '@unchainedshop/types/products.pricing';
3
+ import bodyParser from 'body-parser';
4
+ import { useMiddlewareWithCurrentContext } from '@unchainedshop/api';
5
+
6
+ const { CRYPTOPAY_SECRET, CRYPTOPAY_PRICING_WEBHOOK_PATH = '/graphql/cryptopay-pricing' } = process.env;
7
+
8
+ useMiddlewareWithCurrentContext(CRYPTOPAY_PRICING_WEBHOOK_PATH, bodyParser.json());
9
+
10
+ useMiddlewareWithCurrentContext(CRYPTOPAY_PRICING_WEBHOOK_PATH, async (request, response) => {
11
+ const resolvedContext = request.unchainedContext as Context;
12
+ const { baseCurrency, token, rate, timestamp, secret } = request.body;
13
+ if (secret !== CRYPTOPAY_SECRET) {
14
+ response.end(JSON.stringify({ success: false }));
15
+ return;
16
+ }
17
+ const rateData: ProductPriceRate = {
18
+ baseCurrency,
19
+ quoteCurrency: token,
20
+ rate,
21
+ timestamp,
22
+ };
23
+ const success = await resolvedContext.modules.products.prices.rates.updateRate(rateData);
24
+ response.end(JSON.stringify({ success }));
25
+ });
@@ -0,0 +1,73 @@
1
+ import { IProductPricingAdapter } from '@unchainedshop/types/products.pricing';
2
+ import { ProductPricingDirector, ProductPricingAdapter } from '@unchainedshop/core-products';
3
+
4
+ const { RATECONVERSION_MAX_AGE = '360' } = process.env;
5
+
6
+ const MAX_RATE_AGE = parseInt(RATECONVERSION_MAX_AGE, 10);
7
+
8
+ const ProductPriceRateConversion: IProductPricingAdapter = {
9
+ ...ProductPricingAdapter,
10
+
11
+ key: 'shop.unchained.pricing.rate-conversion',
12
+ version: '1.0',
13
+ label: 'Generic rate conversion plugin that converts between rates if entry in DB exists.',
14
+ orderIndex: 1,
15
+
16
+ isActivatedFor: () => {
17
+ return true;
18
+ },
19
+
20
+ actions: (params) => {
21
+ const pricingAdapter = ProductPricingAdapter.actions(params);
22
+ const { services, modules } = params.context;
23
+ return {
24
+ ...pricingAdapter,
25
+
26
+ calculate: async () => {
27
+ const { product, country, quantity, currency } = params.context;
28
+ const defaultCurrency = await services.countries.resolveDefaultCurrencyCode(
29
+ {
30
+ isoCode: country,
31
+ },
32
+ params.context,
33
+ );
34
+
35
+ const productPrice = await modules.products.prices.price(product, {
36
+ country,
37
+ currency: defaultCurrency,
38
+ quantity,
39
+ });
40
+
41
+ const { calculation = [] } = params.calculationSheet;
42
+ if (
43
+ !productPrice ||
44
+ !productPrice?.amount ||
45
+ calculation?.length ||
46
+ defaultCurrency === currency
47
+ )
48
+ return pricingAdapter.calculate();
49
+
50
+ const rate = await modules.products.prices.rates.getRate(
51
+ defaultCurrency,
52
+ currency,
53
+ MAX_RATE_AGE,
54
+ );
55
+
56
+ if (rate > 0) {
57
+ const convertedAmount = productPrice.amount * rate;
58
+ pricingAdapter.resultSheet().resetCalculation(params.calculationSheet);
59
+ pricingAdapter.resultSheet().addItem({
60
+ amount: convertedAmount * quantity,
61
+ isTaxable: productPrice?.isTaxable,
62
+ isNetPrice: productPrice?.isNetPrice,
63
+ meta: { adapter: ProductPriceRateConversion.key },
64
+ });
65
+ }
66
+
67
+ return pricingAdapter.calculate();
68
+ },
69
+ };
70
+ },
71
+ };
72
+
73
+ ProductPricingDirector.registerAdapter(ProductPriceRateConversion);