@reachu/database 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +28 -0
- package/.env.test +50 -0
- package/.eslintrc.json +23 -0
- package/.nvmrc +1 -0
- package/.prettierrc +6 -0
- package/.vscode/launch.json +13 -0
- package/.vscode/settings.json +3 -0
- package/README.md +17 -0
- package/dist/config/connect.d.ts +2 -0
- package/dist/config/connect.js +34 -0
- package/dist/config/connect.js.map +1 -0
- package/dist/entity/Address.d.ts +9 -0
- package/dist/entity/Address.js +44 -0
- package/dist/entity/Address.js.map +1 -0
- package/dist/entity/ApiCredential.d.ts +8 -0
- package/dist/entity/ApiCredential.js +41 -0
- package/dist/entity/ApiCredential.js.map +1 -0
- package/dist/entity/AuditedModel.d.ts +4 -0
- package/dist/entity/AuditedModel.js +24 -0
- package/dist/entity/AuditedModel.js.map +1 -0
- package/dist/entity/BankAccount.d.ts +11 -0
- package/dist/entity/BankAccount.js +55 -0
- package/dist/entity/BankAccount.js.map +1 -0
- package/dist/entity/Business.d.ts +21 -0
- package/dist/entity/Business.js +83 -0
- package/dist/entity/Business.js.map +1 -0
- package/dist/entity/BusinessProducts.d.ts +6 -0
- package/dist/entity/BusinessProducts.js +32 -0
- package/dist/entity/BusinessProducts.js.map +1 -0
- package/dist/entity/CardRegistration.d.ts +10 -0
- package/dist/entity/CardRegistration.js +51 -0
- package/dist/entity/CardRegistration.js.map +1 -0
- package/dist/entity/Category.d.ts +7 -0
- package/dist/entity/Category.js +36 -0
- package/dist/entity/Category.js.map +1 -0
- package/dist/entity/Channel.d.ts +12 -0
- package/dist/entity/Channel.js +56 -0
- package/dist/entity/Channel.js.map +1 -0
- package/dist/entity/ChannelGroup.d.ts +15 -0
- package/dist/entity/ChannelGroup.js +77 -0
- package/dist/entity/ChannelGroup.js.map +1 -0
- package/dist/entity/ChannelUser.d.ts +13 -0
- package/dist/entity/ChannelUser.js +59 -0
- package/dist/entity/ChannelUser.js.map +1 -0
- package/dist/entity/ChannelUserProductSync.d.ts +12 -0
- package/dist/entity/ChannelUserProductSync.js +63 -0
- package/dist/entity/ChannelUserProductSync.js.map +1 -0
- package/dist/entity/Check.d.ts +5 -0
- package/dist/entity/Check.js +28 -0
- package/dist/entity/Check.js.map +1 -0
- package/dist/entity/CheckoutMetadata.d.ts +6 -0
- package/dist/entity/CheckoutMetadata.js +35 -0
- package/dist/entity/CheckoutMetadata.js.map +1 -0
- package/dist/entity/Collection.d.ts +16 -0
- package/dist/entity/Collection.js +73 -0
- package/dist/entity/Collection.js.map +1 -0
- package/dist/entity/CollectionItem.d.ts +10 -0
- package/dist/entity/CollectionItem.js +47 -0
- package/dist/entity/CollectionItem.js.map +1 -0
- package/dist/entity/CollectionShared.d.ts +11 -0
- package/dist/entity/CollectionShared.js +51 -0
- package/dist/entity/CollectionShared.js.map +1 -0
- package/dist/entity/Contact.d.ts +9 -0
- package/dist/entity/Contact.js +44 -0
- package/dist/entity/Contact.js.map +1 -0
- package/dist/entity/Country.d.ts +7 -0
- package/dist/entity/Country.js +36 -0
- package/dist/entity/Country.js.map +1 -0
- package/dist/entity/Courier.d.ts +7 -0
- package/dist/entity/Courier.js +39 -0
- package/dist/entity/Courier.js.map +1 -0
- package/dist/entity/Currency.d.ts +7 -0
- package/dist/entity/Currency.js +39 -0
- package/dist/entity/Currency.js.map +1 -0
- package/dist/entity/CustomProduct.d.ts +22 -0
- package/dist/entity/CustomProduct.js +95 -0
- package/dist/entity/CustomProduct.js.map +1 -0
- package/dist/entity/CustomProductImage.d.ts +10 -0
- package/dist/entity/CustomProductImage.js +51 -0
- package/dist/entity/CustomProductImage.js.map +1 -0
- package/dist/entity/CustomVariant.d.ts +13 -0
- package/dist/entity/CustomVariant.js +59 -0
- package/dist/entity/CustomVariant.js.map +1 -0
- package/dist/entity/ExchangeRate.d.ts +8 -0
- package/dist/entity/ExchangeRate.js +43 -0
- package/dist/entity/ExchangeRate.js.map +1 -0
- package/dist/entity/FlatRate.d.ts +9 -0
- package/dist/entity/FlatRate.js +45 -0
- package/dist/entity/FlatRate.js.map +1 -0
- package/dist/entity/FlatRateCountry.d.ts +7 -0
- package/dist/entity/FlatRateCountry.js +39 -0
- package/dist/entity/FlatRateCountry.js.map +1 -0
- package/dist/entity/Fulfillment.d.ts +5 -0
- package/dist/entity/Fulfillment.js +28 -0
- package/dist/entity/Fulfillment.js.map +1 -0
- package/dist/entity/Image.d.ts +10 -0
- package/dist/entity/Image.js +49 -0
- package/dist/entity/Image.js.map +1 -0
- package/dist/entity/ImportedProduct.d.ts +14 -0
- package/dist/entity/ImportedProduct.js +66 -0
- package/dist/entity/ImportedProduct.js.map +1 -0
- package/dist/entity/MagentoConnection.entity.d.ts +13 -0
- package/dist/entity/MagentoConnection.entity.js +65 -0
- package/dist/entity/MagentoConnection.entity.js.map +1 -0
- package/dist/entity/MetricActiveUser.d.ts +8 -0
- package/dist/entity/MetricActiveUser.js +43 -0
- package/dist/entity/MetricActiveUser.js.map +1 -0
- package/dist/entity/Notification.d.ts +20 -0
- package/dist/entity/Notification.js +58 -0
- package/dist/entity/Notification.js.map +1 -0
- package/dist/entity/Option.d.ts +9 -0
- package/dist/entity/Option.js +45 -0
- package/dist/entity/Option.js.map +1 -0
- package/dist/entity/Order.d.ts +29 -0
- package/dist/entity/Order.js +106 -0
- package/dist/entity/Order.js.map +1 -0
- package/dist/entity/OrderCustomer.d.ts +17 -0
- package/dist/entity/OrderCustomer.js +76 -0
- package/dist/entity/OrderCustomer.js.map +1 -0
- package/dist/entity/OrderItem.d.ts +36 -0
- package/dist/entity/OrderItem.js +159 -0
- package/dist/entity/OrderItem.js.map +1 -0
- package/dist/entity/OrderShipping.d.ts +12 -0
- package/dist/entity/OrderShipping.js +69 -0
- package/dist/entity/OrderShipping.js.map +1 -0
- package/dist/entity/OrderTracking.d.ts +16 -0
- package/dist/entity/OrderTracking.js +73 -0
- package/dist/entity/OrderTracking.js.map +1 -0
- package/dist/entity/Payment.d.ts +19 -0
- package/dist/entity/Payment.js +85 -0
- package/dist/entity/Payment.js.map +1 -0
- package/dist/entity/PaymentMethod.d.ts +9 -0
- package/dist/entity/PaymentMethod.js +48 -0
- package/dist/entity/PaymentMethod.js.map +1 -0
- package/dist/entity/PaymentShopify.d.ts +7 -0
- package/dist/entity/PaymentShopify.js +39 -0
- package/dist/entity/PaymentShopify.js.map +1 -0
- package/dist/entity/Permission.d.ts +5 -0
- package/dist/entity/Permission.js +31 -0
- package/dist/entity/Permission.js.map +1 -0
- package/dist/entity/Price.entity.d.ts +5 -0
- package/dist/entity/Price.entity.js +29 -0
- package/dist/entity/Price.entity.js.map +1 -0
- package/dist/entity/Product.entity.d.ts +63 -0
- package/dist/entity/Product.entity.js +256 -0
- package/dist/entity/Product.entity.js.map +1 -0
- package/dist/entity/Request.d.ts +8 -0
- package/dist/entity/Request.js +42 -0
- package/dist/entity/Request.js.map +1 -0
- package/dist/entity/Return.d.ts +8 -0
- package/dist/entity/Return.js +40 -0
- package/dist/entity/Return.js.map +1 -0
- package/dist/entity/ReturnAddress.d.ts +10 -0
- package/dist/entity/ReturnAddress.js +48 -0
- package/dist/entity/ReturnAddress.js.map +1 -0
- package/dist/entity/Role.d.ts +7 -0
- package/dist/entity/Role.js +42 -0
- package/dist/entity/Role.js.map +1 -0
- package/dist/entity/RolePermission.d.ts +8 -0
- package/dist/entity/RolePermission.js +40 -0
- package/dist/entity/RolePermission.js.map +1 -0
- package/dist/entity/ShippingPackage.d.ts +7 -0
- package/dist/entity/ShippingPackage.js +39 -0
- package/dist/entity/ShippingPackage.js.map +1 -0
- package/dist/entity/ShopifyConnection.d.ts +13 -0
- package/dist/entity/ShopifyConnection.js +65 -0
- package/dist/entity/ShopifyConnection.js.map +1 -0
- package/dist/entity/Subcategory.d.ts +7 -0
- package/dist/entity/Subcategory.js +36 -0
- package/dist/entity/Subcategory.js.map +1 -0
- package/dist/entity/User.d.ts +87 -0
- package/dist/entity/User.js +321 -0
- package/dist/entity/User.js.map +1 -0
- package/dist/entity/UserChannelApiKey.d.ts +10 -0
- package/dist/entity/UserChannelApiKey.js +47 -0
- package/dist/entity/UserChannelApiKey.js.map +1 -0
- package/dist/entity/UserRole.d.ts +8 -0
- package/dist/entity/UserRole.js +40 -0
- package/dist/entity/UserRole.js.map +1 -0
- package/dist/entity/UserSettings.d.ts +12 -0
- package/dist/entity/UserSettings.js +54 -0
- package/dist/entity/UserSettings.js.map +1 -0
- package/dist/entity/UserTokenWolt.d.ts +8 -0
- package/dist/entity/UserTokenWolt.js +41 -0
- package/dist/entity/UserTokenWolt.js.map +1 -0
- package/dist/entity/Variant.d.ts +17 -0
- package/dist/entity/Variant.js +75 -0
- package/dist/entity/Variant.js.map +1 -0
- package/dist/entity/Wallet.d.ts +6 -0
- package/dist/entity/Wallet.js +35 -0
- package/dist/entity/Wallet.js.map +1 -0
- package/dist/entity/WooConnection.d.ts +9 -0
- package/dist/entity/WooConnection.js +48 -0
- package/dist/entity/WooConnection.js.map +1 -0
- package/dist/entity/index.d.ts +71 -0
- package/dist/entity/index.js +148 -0
- package/dist/entity/index.js.map +1 -0
- package/dist/entity/modules/shipping/ProductShipping.d.ts +10 -0
- package/dist/entity/modules/shipping/ProductShipping.js +53 -0
- package/dist/entity/modules/shipping/ProductShipping.js.map +1 -0
- package/dist/entity/modules/shipping/Shipping.d.ts +15 -0
- package/dist/entity/modules/shipping/Shipping.js +70 -0
- package/dist/entity/modules/shipping/Shipping.js.map +1 -0
- package/dist/entity/modules/shipping/ShippingCountry.d.ts +10 -0
- package/dist/entity/modules/shipping/ShippingCountry.js +52 -0
- package/dist/entity/modules/shipping/ShippingCountry.js.map +1 -0
- package/dist/entity/modules/shopcart/Cart.d.ts +14 -0
- package/dist/entity/modules/shopcart/Cart.js +60 -0
- package/dist/entity/modules/shopcart/Cart.js.map +1 -0
- package/dist/entity/modules/shopcart/CartItem.d.ts +13 -0
- package/dist/entity/modules/shopcart/CartItem.js +57 -0
- package/dist/entity/modules/shopcart/CartItem.js.map +1 -0
- package/dist/entity/modules/shopcart/Checkout.d.ts +23 -0
- package/dist/entity/modules/shopcart/Checkout.js +99 -0
- package/dist/entity/modules/shopcart/Checkout.js.map +1 -0
- package/dist/entity/modules/shopcart/CheckoutBillingAddress.d.ts +18 -0
- package/dist/entity/modules/shopcart/CheckoutBillingAddress.js +84 -0
- package/dist/entity/modules/shopcart/CheckoutBillingAddress.js.map +1 -0
- package/dist/entity/modules/shopcart/CheckoutShippingAddress.d.ts +18 -0
- package/dist/entity/modules/shopcart/CheckoutShippingAddress.js +84 -0
- package/dist/entity/modules/shopcart/CheckoutShippingAddress.js.map +1 -0
- package/dist/entity/modules/shopcart/PriceData.d.ts +8 -0
- package/dist/entity/modules/shopcart/PriceData.js +44 -0
- package/dist/entity/modules/shopcart/PriceData.js.map +1 -0
- package/dist/examples/app01.d.ts +1 -0
- package/dist/examples/app01.js +23 -0
- package/dist/examples/app01.js.map +1 -0
- package/dist/helpers/index.d.ts +5 -0
- package/dist/helpers/index.js +31 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/order/index.d.ts +28 -0
- package/dist/helpers/order/index.js +47 -0
- package/dist/helpers/order/index.js.map +1 -0
- package/dist/helpers/products/index.d.ts +2 -0
- package/dist/helpers/products/index.js +25 -0
- package/dist/helpers/products/index.js.map +1 -0
- package/dist/helpers/products/storage/index.d.ts +2 -0
- package/dist/helpers/products/storage/index.js +25 -0
- package/dist/helpers/products/storage/index.js.map +1 -0
- package/dist/helpers/products/storage/search.d.ts +52 -0
- package/dist/helpers/products/storage/search.js +181 -0
- package/dist/helpers/products/storage/search.js.map +1 -0
- package/dist/helpers/returns/index.d.ts +2 -0
- package/dist/helpers/returns/index.js +25 -0
- package/dist/helpers/returns/index.js.map +1 -0
- package/dist/helpers/returns/storage.d.ts +3 -0
- package/dist/helpers/returns/storage.js +23 -0
- package/dist/helpers/returns/storage.js.map +1 -0
- package/dist/helpers/statistics/connections.d.ts +6 -0
- package/dist/helpers/statistics/connections.js +78 -0
- package/dist/helpers/statistics/connections.js.map +1 -0
- package/dist/helpers/statistics/index.d.ts +2 -0
- package/dist/helpers/statistics/index.js +25 -0
- package/dist/helpers/statistics/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/interface/connectionConfig.d.ts +16 -0
- package/dist/interface/connectionConfig.js +3 -0
- package/dist/interface/connectionConfig.js.map +1 -0
- package/dist/migrations/1628474597284-InitialSchema.d.ts +6 -0
- package/dist/migrations/1628474597284-InitialSchema.js +203 -0
- package/dist/migrations/1628474597284-InitialSchema.js.map +1 -0
- package/dist/migrations/1630077596132-RemoveMangopay.d.ts +6 -0
- package/dist/migrations/1630077596132-RemoveMangopay.js +53 -0
- package/dist/migrations/1630077596132-RemoveMangopay.js.map +1 -0
- package/dist/migrations/1633444449026-MagentoIntegration.d.ts +6 -0
- package/dist/migrations/1633444449026-MagentoIntegration.js +42 -0
- package/dist/migrations/1633444449026-MagentoIntegration.js.map +1 -0
- package/dist/migrations/1634070448072-MagentoIntegrationExternalChannelOrder.d.ts +6 -0
- package/dist/migrations/1634070448072-MagentoIntegrationExternalChannelOrder.js +31 -0
- package/dist/migrations/1634070448072-MagentoIntegrationExternalChannelOrder.js.map +1 -0
- package/dist/migrations/1635811861541-SSCCOrderGenerator.d.ts +6 -0
- package/dist/migrations/1635811861541-SSCCOrderGenerator.js +29 -0
- package/dist/migrations/1635811861541-SSCCOrderGenerator.js.map +1 -0
- package/dist/migrations/1638447028594-RolesFeature.d.ts +6 -0
- package/dist/migrations/1638447028594-RolesFeature.js +47 -0
- package/dist/migrations/1638447028594-RolesFeature.js.map +1 -0
- package/dist/migrations/1638493697631-ProductCurrencyPrice.d.ts +6 -0
- package/dist/migrations/1638493697631-ProductCurrencyPrice.js +35 -0
- package/dist/migrations/1638493697631-ProductCurrencyPrice.js.map +1 -0
- package/dist/migrations/1646797095632-UpdateWooTrackingNumber.d.ts +6 -0
- package/dist/migrations/1646797095632-UpdateWooTrackingNumber.js +33 -0
- package/dist/migrations/1646797095632-UpdateWooTrackingNumber.js.map +1 -0
- package/dist/migrations/1648526519546-AddedUserSettings.d.ts +6 -0
- package/dist/migrations/1648526519546-AddedUserSettings.js +37 -0
- package/dist/migrations/1648526519546-AddedUserSettings.js.map +1 -0
- package/dist/migrations/1651206194365-Wolt.d.ts +6 -0
- package/dist/migrations/1651206194365-Wolt.js +52 -0
- package/dist/migrations/1651206194365-Wolt.js.map +1 -0
- package/dist/migrations/1663227133335-shop-cart.d.ts +6 -0
- package/dist/migrations/1663227133335-shop-cart.js +62 -0
- package/dist/migrations/1663227133335-shop-cart.js.map +1 -0
- package/dist/migrations/1664160721396-collection.d.ts +6 -0
- package/dist/migrations/1664160721396-collection.js +43 -0
- package/dist/migrations/1664160721396-collection.js.map +1 -0
- package/dist/migrations/1664222251306-update-collection.d.ts +6 -0
- package/dist/migrations/1664222251306-update-collection.js +37 -0
- package/dist/migrations/1664222251306-update-collection.js.map +1 -0
- package/dist/migrations/1665757388450-channel.d.ts +6 -0
- package/dist/migrations/1665757388450-channel.js +59 -0
- package/dist/migrations/1665757388450-channel.js.map +1 -0
- package/dist/migrations/1666098098114-prod-22-10-18.d.ts +6 -0
- package/dist/migrations/1666098098114-prod-22-10-18.js +110 -0
- package/dist/migrations/1666098098114-prod-22-10-18.js.map +1 -0
- package/dist/migrations/1666631086586-user-channel-api-key-and-currency.d.ts +6 -0
- package/dist/migrations/1666631086586-user-channel-api-key-and-currency.js +39 -0
- package/dist/migrations/1666631086586-user-channel-api-key-and-currency.js.map +1 -0
- package/dist/migrations/1666632054252-user-channel-api-key-and-currency-update.d.ts +6 -0
- package/dist/migrations/1666632054252-user-channel-api-key-and-currency-update.js +35 -0
- package/dist/migrations/1666632054252-user-channel-api-key-and-currency-update.js.map +1 -0
- package/dist/migrations/1666752877685-checkout-and-usser-settings.d.ts +6 -0
- package/dist/migrations/1666752877685-checkout-and-usser-settings.js +39 -0
- package/dist/migrations/1666752877685-checkout-and-usser-settings.js.map +1 -0
- package/dist/migrations/1666846907205-update-user-settings.d.ts +6 -0
- package/dist/migrations/1666846907205-update-user-settings.js +31 -0
- package/dist/migrations/1666846907205-update-user-settings.js.map +1 -0
- package/dist/migrations/1667259333252-prod-22-10-31.d.ts +6 -0
- package/dist/migrations/1667259333252-prod-22-10-31.js +43 -0
- package/dist/migrations/1667259333252-prod-22-10-31.js.map +1 -0
- package/dist/migrations/1667518502388-product-update.d.ts +6 -0
- package/dist/migrations/1667518502388-product-update.js +31 -0
- package/dist/migrations/1667518502388-product-update.js.map +1 -0
- package/dist/migrations/1668571948507-ExchangeRate.d.ts +6 -0
- package/dist/migrations/1668571948507-ExchangeRate.js +29 -0
- package/dist/migrations/1668571948507-ExchangeRate.js.map +1 -0
- package/dist/migrations/1668580085818-update-ExchangeRate.d.ts +6 -0
- package/dist/migrations/1668580085818-update-ExchangeRate.js +31 -0
- package/dist/migrations/1668580085818-update-ExchangeRate.js.map +1 -0
- package/dist/migrations/1669318273596-update-oder-notification.d.ts +6 -0
- package/dist/migrations/1669318273596-update-oder-notification.js +33 -0
- package/dist/migrations/1669318273596-update-oder-notification.js.map +1 -0
- package/dist/migrations/1669737769669-option.d.ts +6 -0
- package/dist/migrations/1669737769669-option.js +29 -0
- package/dist/migrations/1669737769669-option.js.map +1 -0
- package/dist/migrations/1669912111945-shipping.d.ts +6 -0
- package/dist/migrations/1669912111945-shipping.js +39 -0
- package/dist/migrations/1669912111945-shipping.js.map +1 -0
- package/dist/migrations/1670258127812-price.d.ts +6 -0
- package/dist/migrations/1670258127812-price.js +31 -0
- package/dist/migrations/1670258127812-price.js.map +1 -0
- package/dist/migrations/1670952109146-variant.d.ts +6 -0
- package/dist/migrations/1670952109146-variant.js +29 -0
- package/dist/migrations/1670952109146-variant.js.map +1 -0
- package/dist/migrations/1671409580304-order.d.ts +6 -0
- package/dist/migrations/1671409580304-order.js +33 -0
- package/dist/migrations/1671409580304-order.js.map +1 -0
- package/dist/migrations/1672239194236-user-shipping.d.ts +6 -0
- package/dist/migrations/1672239194236-user-shipping.js +31 -0
- package/dist/migrations/1672239194236-user-shipping.js.map +1 -0
- package/dist/migrations/1673628218703-promote_to_production_2023_13_01.d.ts +6 -0
- package/dist/migrations/1673628218703-promote_to_production_2023_13_01.js +67 -0
- package/dist/migrations/1673628218703-promote_to_production_2023_13_01.js.map +1 -0
- package/dist/migrations/1674016904315-exchangeRate_2023_13_01.d.ts +6 -0
- package/dist/migrations/1674016904315-exchangeRate_2023_13_01.js +29 -0
- package/dist/migrations/1674016904315-exchangeRate_2023_13_01.js.map +1 -0
- package/dist/migrations/1674743576475-promote_to_production_2023_26_01.d.ts +6 -0
- package/dist/migrations/1674743576475-promote_to_production_2023_26_01.js +29 -0
- package/dist/migrations/1674743576475-promote_to_production_2023_26_01.js.map +1 -0
- package/dist/migrations/1675452256156-task-1062.d.ts +6 -0
- package/dist/migrations/1675452256156-task-1062.js +39 -0
- package/dist/migrations/1675452256156-task-1062.js.map +1 -0
- package/dist/migrations/1676057445311-task-1062V2.d.ts +6 -0
- package/dist/migrations/1676057445311-task-1062V2.js +29 -0
- package/dist/migrations/1676057445311-task-1062V2.js.map +1 -0
- package/dist/migrations/1676060390524-task-1062V3.d.ts +6 -0
- package/dist/migrations/1676060390524-task-1062V3.js +31 -0
- package/dist/migrations/1676060390524-task-1062V3.js.map +1 -0
- package/dist/migrations/1676389900564-task-1062V4.d.ts +6 -0
- package/dist/migrations/1676389900564-task-1062V4.js +29 -0
- package/dist/migrations/1676389900564-task-1062V4.js.map +1 -0
- package/dist/migrations/1676558804200-task-1074V1.d.ts +6 -0
- package/dist/migrations/1676558804200-task-1074V1.js +29 -0
- package/dist/migrations/1676558804200-task-1074V1.js.map +1 -0
- package/dist/migrations/1676656657956-task-1084V1.d.ts +6 -0
- package/dist/migrations/1676656657956-task-1084V1.js +29 -0
- package/dist/migrations/1676656657956-task-1084V1.js.map +1 -0
- package/dist/migrations/execute/index.d.ts +1 -0
- package/dist/migrations/execute/index.js +9 -0
- package/dist/migrations/execute/index.js.map +1 -0
- package/dist/migrations/index.d.ts +11 -0
- package/dist/migrations/index.js +24 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/repositories/index.d.ts +158 -0
- package/dist/repositories/index.js +383 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/repositories/shipping/index.d.ts +10 -0
- package/dist/repositories/shipping/index.js +35 -0
- package/dist/repositories/shipping/index.js.map +1 -0
- package/dist/repositories/shopcart/index.d.ts +19 -0
- package/dist/repositories/shopcart/index.js +56 -0
- package/dist/repositories/shopcart/index.js.map +1 -0
- package/dist/staticData/ChannelName.d.ts +9 -0
- package/dist/staticData/ChannelName.js +11 -0
- package/dist/staticData/ChannelName.js.map +1 -0
- package/dist/staticData/ConnectionType.d.ts +5 -0
- package/dist/staticData/ConnectionType.js +7 -0
- package/dist/staticData/ConnectionType.js.map +1 -0
- package/dist/staticData/Currency.d.ts +9 -0
- package/dist/staticData/Currency.js +14 -0
- package/dist/staticData/Currency.js.map +1 -0
- package/dist/staticData/OrderStatus.d.ts +18 -0
- package/dist/staticData/OrderStatus.js +44 -0
- package/dist/staticData/OrderStatus.js.map +1 -0
- package/dist/staticData/PaymentProcessor.d.ts +8 -0
- package/dist/staticData/PaymentProcessor.js +12 -0
- package/dist/staticData/PaymentProcessor.js.map +1 -0
- package/dist/staticData/ProductOrigin.d.ts +10 -0
- package/dist/staticData/ProductOrigin.js +18 -0
- package/dist/staticData/ProductOrigin.js.map +1 -0
- package/dist/staticData/TrackingProcessor.d.ts +7 -0
- package/dist/staticData/TrackingProcessor.js +11 -0
- package/dist/staticData/TrackingProcessor.js.map +1 -0
- package/dist/staticData/VippsPaymentStatus.d.ts +15 -0
- package/dist/staticData/VippsPaymentStatus.js +41 -0
- package/dist/staticData/VippsPaymentStatus.js.map +1 -0
- package/dist/staticData/index.d.ts +9 -0
- package/dist/staticData/index.js +23 -0
- package/dist/staticData/index.js.map +1 -0
- package/dist/subscribers/ProductSubscriber.d.ts +8 -0
- package/dist/subscribers/ProductSubscriber.js +46 -0
- package/dist/subscribers/ProductSubscriber.js.map +1 -0
- package/dist/subscribers/UserSubscriber.d.ts +8 -0
- package/dist/subscribers/UserSubscriber.js +46 -0
- package/dist/subscribers/UserSubscriber.js.map +1 -0
- package/dist/subscribers/index.d.ts +3 -0
- package/dist/subscribers/index.js +8 -0
- package/dist/subscribers/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +8681 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +109 -0
- package/dist/utils/index.js.map +1 -0
- package/docs/notas.txt +1 -0
- package/jsconfig.json +5 -0
- package/nodemon.json +5 -0
- package/package.json +76 -0
- package/src/config/connect.ts +28 -0
- package/src/entity/Address.ts +24 -0
- package/src/entity/ApiCredential.ts +19 -0
- package/src/entity/AuditedModel.ts +9 -0
- package/src/entity/BankAccount.ts +29 -0
- package/src/entity/Business.ts +51 -0
- package/src/entity/BusinessProducts.ts +15 -0
- package/src/entity/CardRegistration.ts +26 -0
- package/src/entity/Category.ts +16 -0
- package/src/entity/Channel.ts +44 -0
- package/src/entity/ChannelGroup.ts +52 -0
- package/src/entity/ChannelUser.ts +46 -0
- package/src/entity/ChannelUserProductSync.ts +46 -0
- package/src/entity/Check.ts +12 -0
- package/src/entity/CheckoutMetadata.ts +16 -0
- package/src/entity/Collection.ts +55 -0
- package/src/entity/CollectionItem.ts +31 -0
- package/src/entity/CollectionShared.ts +35 -0
- package/src/entity/Contact.ts +24 -0
- package/src/entity/Country.ts +18 -0
- package/src/entity/Courier.ts +17 -0
- package/src/entity/Currency.ts +17 -0
- package/src/entity/CustomProduct.ts +85 -0
- package/src/entity/CustomProductImage.ts +36 -0
- package/src/entity/CustomVariant.ts +40 -0
- package/src/entity/ExchangeRate.ts +20 -0
- package/src/entity/FlatRate.ts +29 -0
- package/src/entity/FlatRateCountry.ts +17 -0
- package/src/entity/Fulfillment.ts +12 -0
- package/src/entity/Image.ts +34 -0
- package/src/entity/ImportedProduct.ts +45 -0
- package/src/entity/MagentoConnection.entity.ts +36 -0
- package/src/entity/MetricActiveUser.ts +25 -0
- package/src/entity/Notification.ts +46 -0
- package/src/entity/Option.ts +31 -0
- package/src/entity/Order.ts +80 -0
- package/src/entity/OrderCustomer.ts +48 -0
- package/src/entity/OrderItem.ts +118 -0
- package/src/entity/OrderShipping.ts +47 -0
- package/src/entity/OrderTracking.ts +50 -0
- package/src/entity/Payment.ts +52 -0
- package/src/entity/PaymentMethod.ts +32 -0
- package/src/entity/PaymentShopify.ts +17 -0
- package/src/entity/Permission.ts +13 -0
- package/src/entity/Price.entity.ts +12 -0
- package/src/entity/Product.entity.ts +200 -0
- package/src/entity/Request.ts +23 -0
- package/src/entity/Return.ts +19 -0
- package/src/entity/ReturnAddress.ts +27 -0
- package/src/entity/Role.ts +20 -0
- package/src/entity/RolePermission.ts +19 -0
- package/src/entity/ShippingPackage.ts +19 -0
- package/src/entity/ShopifyConnection.ts +37 -0
- package/src/entity/Subcategory.ts +16 -0
- package/src/entity/User.ts +261 -0
- package/src/entity/UserChannelApiKey.ts +32 -0
- package/src/entity/UserRole.ts +19 -0
- package/src/entity/UserSettings.ts +37 -0
- package/src/entity/UserTokenWolt.ts +19 -0
- package/src/entity/Variant.ts +53 -0
- package/src/entity/Wallet.ts +14 -0
- package/src/entity/WooConnection.ts +24 -0
- package/src/entity/index.ts +148 -0
- package/src/entity/modules/shipping/ProductShipping.ts +37 -0
- package/src/entity/modules/shipping/Shipping.ts +54 -0
- package/src/entity/modules/shipping/ShippingCountry.ts +35 -0
- package/src/entity/modules/shopcart/Cart.ts +43 -0
- package/src/entity/modules/shopcart/CartItem.ts +40 -0
- package/src/entity/modules/shopcart/Checkout.ts +74 -0
- package/src/entity/modules/shopcart/CheckoutBillingAddress.ts +50 -0
- package/src/entity/modules/shopcart/CheckoutShippingAddress.ts +50 -0
- package/src/entity/modules/shopcart/PriceData.ts +20 -0
- package/src/examples/app01.ts +9 -0
- package/src/helpers/index.ts +6 -0
- package/src/helpers/order/index.ts +47 -0
- package/src/helpers/products/index.ts +2 -0
- package/src/helpers/products/storage/index.ts +2 -0
- package/src/helpers/products/storage/search.ts +249 -0
- package/src/helpers/returns/index.ts +2 -0
- package/src/helpers/returns/storage.ts +9 -0
- package/src/helpers/statistics/connections.ts +70 -0
- package/src/helpers/statistics/index.ts +2 -0
- package/src/index.ts +8 -0
- package/src/interface/connectionConfig.ts +17 -0
- package/src/migrations/1628474597284-InitialSchema.ts +471 -0
- package/src/migrations/1630077596132-RemoveMangopay.ts +79 -0
- package/src/migrations/1633444449026-MagentoIntegration.ts +50 -0
- package/src/migrations/1634070448072-MagentoIntegrationExternalChannelOrder.ts +23 -0
- package/src/migrations/1635811861541-SSCCOrderGenerator.ts +13 -0
- package/src/migrations/1638447028594-RolesFeature.ts +59 -0
- package/src/migrations/1638493697631-ProductCurrencyPrice.ts +31 -0
- package/src/migrations/1646797095632-UpdateWooTrackingNumber.ts +27 -0
- package/src/migrations/1648526519546-AddedUserSettings.ts +35 -0
- package/src/migrations/1651206194365-Wolt.ts +37 -0
- package/src/migrations/1663227133335-shop-cart.ts +47 -0
- package/src/migrations/1664160721396-collection.ts +28 -0
- package/src/migrations/1664222251306-update-collection.ts +22 -0
- package/src/migrations/1665757388450-channel.ts +44 -0
- package/src/migrations/1666098098114-prod-22-10-18.ts +95 -0
- package/src/migrations/1666631086586-user-channel-api-key-and-currency.ts +24 -0
- package/src/migrations/1666632054252-user-channel-api-key-and-currency-update.ts +20 -0
- package/src/migrations/1666752877685-checkout-and-usser-settings.ts +24 -0
- package/src/migrations/1666846907205-update-user-settings.ts +16 -0
- package/src/migrations/1667259333252-prod-22-10-31.ts +28 -0
- package/src/migrations/1667518502388-product-update.ts +16 -0
- package/src/migrations/1668571948507-ExchangeRate.ts +14 -0
- package/src/migrations/1668580085818-update-ExchangeRate.ts +16 -0
- package/src/migrations/1669318273596-update-oder-notification.ts +18 -0
- package/src/migrations/1669737769669-option.ts +14 -0
- package/src/migrations/1669912111945-shipping.ts +24 -0
- package/src/migrations/1670258127812-price.ts +16 -0
- package/src/migrations/1670952109146-variant.ts +14 -0
- package/src/migrations/1671409580304-order.ts +18 -0
- package/src/migrations/1672239194236-user-shipping.ts +16 -0
- package/src/migrations/1673628218703-promote_to_production_2023_13_01.ts +52 -0
- package/src/migrations/1674016904315-exchangeRate_2023_13_01.ts +14 -0
- package/src/migrations/1674743576475-promote_to_production_2023_26_01.ts +14 -0
- package/src/migrations/1675452256156-task-1062.ts +24 -0
- package/src/migrations/1676057445311-task-1062V2.ts +14 -0
- package/src/migrations/1676060390524-task-1062V3.ts +16 -0
- package/src/migrations/1676389900564-task-1062V4.ts +14 -0
- package/src/migrations/1676558804200-task-1074V1.ts +14 -0
- package/src/migrations/1676656657956-task-1084V1.ts +14 -0
- package/src/migrations/execute/index.ts +3 -0
- package/src/migrations/index.ts +23 -0
- package/src/repositories/index.ts +233 -0
- package/src/repositories/shipping/index.ts +15 -0
- package/src/repositories/shopcart/index.ts +25 -0
- package/src/staticData/ChannelName.ts +8 -0
- package/src/staticData/ConnectionType.ts +4 -0
- package/src/staticData/Currency.ts +11 -0
- package/src/staticData/OrderStatus.ts +41 -0
- package/src/staticData/PaymentProcessor.ts +9 -0
- package/src/staticData/ProductOrigin.ts +19 -0
- package/src/staticData/TrackingProcessor.ts +8 -0
- package/src/staticData/VippsPaymentStatus.ts +41 -0
- package/src/staticData/index.ts +20 -0
- package/src/subscribers/ProductSubscriber.ts +25 -0
- package/src/subscribers/UserSubscriber.ts +23 -0
- package/src/subscribers/index.ts +4 -0
- package/src/utils/index.ts +88 -0
- package/test/setup.ts +4 -0
- package/test/staticData/OrderStatus.test.ts +0 -0
- package/test/staticData/VippsPaymentStatus.test.ts +0 -0
- package/test/utils.test.ts +22 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import Address from './Address';
|
|
2
|
+
import ApiCredential from './ApiCredential';
|
|
3
|
+
import AuditedModel from './AuditedModel';
|
|
4
|
+
import BankAccount from './BankAccount';
|
|
5
|
+
import Business from './Business';
|
|
6
|
+
import BusinessProducts from './BusinessProducts';
|
|
7
|
+
import CardRegistration from './CardRegistration';
|
|
8
|
+
import Category from './Category';
|
|
9
|
+
import Channel from './Channel';
|
|
10
|
+
import Check from './Check';
|
|
11
|
+
import CheckoutMetadata from './CheckoutMetadata';
|
|
12
|
+
import Contact from './Contact';
|
|
13
|
+
import Country from './Country';
|
|
14
|
+
import Courier from './Courier';
|
|
15
|
+
import FlatRate from './FlatRate';
|
|
16
|
+
import FlatRateCountry from './FlatRateCountry';
|
|
17
|
+
import Fulfillment from './Fulfillment';
|
|
18
|
+
import Image from './Image';
|
|
19
|
+
import ImportedProduct from './ImportedProduct';
|
|
20
|
+
import { MagentoConnection } from './MagentoConnection.entity';
|
|
21
|
+
import MetricActiveUser from './MetricActiveUser';
|
|
22
|
+
import Notification from './Notification';
|
|
23
|
+
import Option from './Option';
|
|
24
|
+
import Order from './Order';
|
|
25
|
+
import OrderCustomer from './OrderCustomer';
|
|
26
|
+
import OrderItem from './OrderItem';
|
|
27
|
+
import OrderShipping from './OrderShipping';
|
|
28
|
+
import OrderTracking from './OrderTracking';
|
|
29
|
+
import Payment from './Payment';
|
|
30
|
+
import PaymentShopify from './PaymentShopify';
|
|
31
|
+
import Permission from './Permission';
|
|
32
|
+
import { Price } from './Price.entity';
|
|
33
|
+
import { Product } from './Product.entity';
|
|
34
|
+
import Request from './Request';
|
|
35
|
+
import Return from './Return';
|
|
36
|
+
import ReturnAddress from './ReturnAddress';
|
|
37
|
+
import Role from './Role';
|
|
38
|
+
import RolePermission from './RolePermission';
|
|
39
|
+
import ShippingPackage from './ShippingPackage';
|
|
40
|
+
import ShopifyConnection from './ShopifyConnection';
|
|
41
|
+
import Subcategory from './Subcategory';
|
|
42
|
+
import User from './User';
|
|
43
|
+
import UserRole from './UserRole';
|
|
44
|
+
import Variant from './Variant';
|
|
45
|
+
import Wallet from './Wallet';
|
|
46
|
+
import WooConnection from './WooConnection';
|
|
47
|
+
import UserTokenWolt from './UserTokenWolt';
|
|
48
|
+
import UserSettings from './UserSettings';
|
|
49
|
+
import PaymentMethod from './PaymentMethod';
|
|
50
|
+
import Collection from './Collection';
|
|
51
|
+
import CollectionItem from './CollectionItem';
|
|
52
|
+
import CollectionShared from './CollectionShared';
|
|
53
|
+
import ChannelGroup from './ChannelGroup';
|
|
54
|
+
import ChannelUser from './ChannelUser';
|
|
55
|
+
import ChannelUserProductSync from './ChannelUserProductSync';
|
|
56
|
+
import UserChannelApiKey from './UserChannelApiKey';
|
|
57
|
+
import Currency from './Currency';
|
|
58
|
+
import ExchangeRate from './ExchangeRate';
|
|
59
|
+
|
|
60
|
+
//shopCart
|
|
61
|
+
import Cart from './modules/shopcart/Cart';
|
|
62
|
+
import CartItem from './modules/shopcart/CartItem';
|
|
63
|
+
import Checkout from './modules/shopcart/Checkout';
|
|
64
|
+
import { CheckoutBillingAddress } from './modules/shopcart/CheckoutBillingAddress';
|
|
65
|
+
import { CheckoutShippingAddress } from './modules/shopcart/CheckoutShippingAddress';
|
|
66
|
+
import { PriceData } from './modules/shopcart/PriceData';
|
|
67
|
+
|
|
68
|
+
//shipping
|
|
69
|
+
import ProductShipping from './modules/shipping/ProductShipping';
|
|
70
|
+
import Shipping from './modules/shipping/Shipping';
|
|
71
|
+
import ShippingCountry from './modules/shipping/ShippingCountry';
|
|
72
|
+
|
|
73
|
+
import CustomVariant from './CustomVariant';
|
|
74
|
+
import { CustomProduct } from './CustomProduct';
|
|
75
|
+
import CustomProductImage from './CustomProductImage';
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
CustomVariant,
|
|
79
|
+
CustomProduct,
|
|
80
|
+
CustomProductImage,
|
|
81
|
+
Cart,
|
|
82
|
+
CartItem,
|
|
83
|
+
Checkout,
|
|
84
|
+
CheckoutBillingAddress,
|
|
85
|
+
CheckoutShippingAddress,
|
|
86
|
+
PriceData,
|
|
87
|
+
ProductShipping,
|
|
88
|
+
Shipping,
|
|
89
|
+
ShippingCountry,
|
|
90
|
+
Address,
|
|
91
|
+
ApiCredential,
|
|
92
|
+
AuditedModel,
|
|
93
|
+
BankAccount,
|
|
94
|
+
Business,
|
|
95
|
+
BusinessProducts,
|
|
96
|
+
CardRegistration,
|
|
97
|
+
Category,
|
|
98
|
+
Channel,
|
|
99
|
+
Check,
|
|
100
|
+
CheckoutMetadata,
|
|
101
|
+
Contact,
|
|
102
|
+
Country,
|
|
103
|
+
Courier,
|
|
104
|
+
FlatRate,
|
|
105
|
+
FlatRateCountry,
|
|
106
|
+
Fulfillment,
|
|
107
|
+
Image,
|
|
108
|
+
ImportedProduct,
|
|
109
|
+
MagentoConnection,
|
|
110
|
+
MetricActiveUser,
|
|
111
|
+
Notification,
|
|
112
|
+
Option,
|
|
113
|
+
Order,
|
|
114
|
+
OrderCustomer,
|
|
115
|
+
OrderItem,
|
|
116
|
+
OrderShipping,
|
|
117
|
+
OrderTracking,
|
|
118
|
+
Payment,
|
|
119
|
+
PaymentShopify,
|
|
120
|
+
Permission,
|
|
121
|
+
Price,
|
|
122
|
+
Product,
|
|
123
|
+
Request,
|
|
124
|
+
Return,
|
|
125
|
+
ReturnAddress,
|
|
126
|
+
Role,
|
|
127
|
+
RolePermission,
|
|
128
|
+
ShippingPackage,
|
|
129
|
+
ShopifyConnection,
|
|
130
|
+
Subcategory,
|
|
131
|
+
User,
|
|
132
|
+
UserRole,
|
|
133
|
+
Variant,
|
|
134
|
+
Wallet,
|
|
135
|
+
WooConnection,
|
|
136
|
+
UserTokenWolt,
|
|
137
|
+
UserSettings,
|
|
138
|
+
PaymentMethod,
|
|
139
|
+
Collection,
|
|
140
|
+
CollectionItem,
|
|
141
|
+
CollectionShared,
|
|
142
|
+
ChannelGroup,
|
|
143
|
+
ChannelUser,
|
|
144
|
+
ChannelUserProductSync,
|
|
145
|
+
UserChannelApiKey,
|
|
146
|
+
Currency,
|
|
147
|
+
ExchangeRate,
|
|
148
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Product } from '../../Product.entity';
|
|
2
|
+
import {
|
|
3
|
+
Entity,
|
|
4
|
+
PrimaryGeneratedColumn,
|
|
5
|
+
DeleteDateColumn,
|
|
6
|
+
Column,
|
|
7
|
+
ManyToOne,
|
|
8
|
+
JoinColumn,
|
|
9
|
+
} from 'typeorm';
|
|
10
|
+
import AuditedModel from '../../AuditedModel';
|
|
11
|
+
import Shipping from './Shipping';
|
|
12
|
+
|
|
13
|
+
@Entity()
|
|
14
|
+
export default class ProductShipping extends AuditedModel {
|
|
15
|
+
@PrimaryGeneratedColumn('uuid')
|
|
16
|
+
id: string;
|
|
17
|
+
|
|
18
|
+
@Column('varchar', { nullable: true })
|
|
19
|
+
description?: string;
|
|
20
|
+
|
|
21
|
+
@DeleteDateColumn()
|
|
22
|
+
deletedAt: Date;
|
|
23
|
+
|
|
24
|
+
@ManyToOne(() => Shipping, (shipping: Shipping) => shipping.shippingCountry, {
|
|
25
|
+
eager: true,
|
|
26
|
+
onDelete: 'CASCADE',
|
|
27
|
+
})
|
|
28
|
+
@JoinColumn()
|
|
29
|
+
shipping: Shipping;
|
|
30
|
+
|
|
31
|
+
@ManyToOne(() => Product, (product: Product) => product.productShipping, {
|
|
32
|
+
eager: true,
|
|
33
|
+
onDelete: 'CASCADE',
|
|
34
|
+
})
|
|
35
|
+
@JoinColumn()
|
|
36
|
+
product: Product;
|
|
37
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
DeleteDateColumn,
|
|
5
|
+
Column,
|
|
6
|
+
OneToMany,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
ManyToOne,
|
|
9
|
+
} from 'typeorm';
|
|
10
|
+
import AuditedModel from '../../AuditedModel';
|
|
11
|
+
import ShippingCountry from './ShippingCountry';
|
|
12
|
+
import User from '../../User';
|
|
13
|
+
|
|
14
|
+
@Entity()
|
|
15
|
+
export default class Shipping extends AuditedModel {
|
|
16
|
+
@PrimaryGeneratedColumn('uuid')
|
|
17
|
+
id: string;
|
|
18
|
+
|
|
19
|
+
@Column('decimal', { precision: 10, scale: 2, default: 0 })
|
|
20
|
+
amount?: number;
|
|
21
|
+
|
|
22
|
+
@Column('boolean', { default: false })
|
|
23
|
+
customPriceEnabled: boolean;
|
|
24
|
+
|
|
25
|
+
@Column('varchar', { nullable: true })
|
|
26
|
+
name?: string;
|
|
27
|
+
|
|
28
|
+
@Column('varchar', { nullable: true })
|
|
29
|
+
description?: string;
|
|
30
|
+
|
|
31
|
+
@DeleteDateColumn()
|
|
32
|
+
deletedAt: Date;
|
|
33
|
+
|
|
34
|
+
@Column('varchar', { nullable: true })
|
|
35
|
+
currencyCode?: string;
|
|
36
|
+
|
|
37
|
+
@OneToMany(
|
|
38
|
+
() => ShippingCountry,
|
|
39
|
+
(shippingCountry: ShippingCountry) => shippingCountry.shipping,
|
|
40
|
+
{ cascade: true },
|
|
41
|
+
)
|
|
42
|
+
@JoinColumn()
|
|
43
|
+
shippingCountry: ShippingCountry[];
|
|
44
|
+
|
|
45
|
+
@ManyToOne(() => User, (user: User) => user.shipping, {
|
|
46
|
+
eager: true,
|
|
47
|
+
onDelete: 'CASCADE',
|
|
48
|
+
})
|
|
49
|
+
@JoinColumn()
|
|
50
|
+
user: User;
|
|
51
|
+
|
|
52
|
+
@Column('boolean', { default: false })
|
|
53
|
+
default: boolean;
|
|
54
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
DeleteDateColumn,
|
|
5
|
+
Column,
|
|
6
|
+
ManyToOne,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
} from 'typeorm';
|
|
9
|
+
import AuditedModel from '../../AuditedModel';
|
|
10
|
+
import Shipping from './Shipping';
|
|
11
|
+
|
|
12
|
+
@Entity()
|
|
13
|
+
export default class ShippingCountry extends AuditedModel {
|
|
14
|
+
@PrimaryGeneratedColumn('uuid')
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
@Column('decimal', { precision: 10, scale: 2, default: 0 })
|
|
18
|
+
amount?: number;
|
|
19
|
+
|
|
20
|
+
@Column('varchar', { nullable: true })
|
|
21
|
+
country?: string;
|
|
22
|
+
|
|
23
|
+
@DeleteDateColumn()
|
|
24
|
+
deletedAt: Date;
|
|
25
|
+
|
|
26
|
+
@Column('varchar', { nullable: true })
|
|
27
|
+
currencyCode?: string;
|
|
28
|
+
|
|
29
|
+
@ManyToOne(() => Shipping, (shipping: Shipping) => shipping.shippingCountry, {
|
|
30
|
+
eager: true,
|
|
31
|
+
onDelete: 'CASCADE',
|
|
32
|
+
})
|
|
33
|
+
@JoinColumn()
|
|
34
|
+
shipping: Shipping;
|
|
35
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
OneToMany,
|
|
5
|
+
DeleteDateColumn,
|
|
6
|
+
JoinColumn,
|
|
7
|
+
Column,
|
|
8
|
+
OneToOne,
|
|
9
|
+
ManyToOne,
|
|
10
|
+
} from 'typeorm';
|
|
11
|
+
import AuditedModel from '../../AuditedModel';
|
|
12
|
+
import CartItem from './CartItem';
|
|
13
|
+
import Checkout from './Checkout';
|
|
14
|
+
import User from '../../User';
|
|
15
|
+
|
|
16
|
+
@Entity()
|
|
17
|
+
export default class Cart extends AuditedModel {
|
|
18
|
+
@PrimaryGeneratedColumn('uuid')
|
|
19
|
+
id: string;
|
|
20
|
+
|
|
21
|
+
@Column('varchar', { nullable: true })
|
|
22
|
+
customer_session_id: string;
|
|
23
|
+
|
|
24
|
+
@Column('varchar', { nullable: true })
|
|
25
|
+
currency?: string;
|
|
26
|
+
|
|
27
|
+
@Column('decimal', { precision: 10, scale: 2, default: 0 })
|
|
28
|
+
total_amount?: number;
|
|
29
|
+
|
|
30
|
+
@DeleteDateColumn()
|
|
31
|
+
deletedAt: Date;
|
|
32
|
+
|
|
33
|
+
@ManyToOne(() => User, (user: User) => user.id, { eager: true, onDelete: 'CASCADE' })
|
|
34
|
+
@JoinColumn()
|
|
35
|
+
user: User;
|
|
36
|
+
|
|
37
|
+
@OneToMany(() => CartItem, (item: CartItem) => item.cart, { cascade: true })
|
|
38
|
+
@JoinColumn()
|
|
39
|
+
line_items: CartItem[];
|
|
40
|
+
|
|
41
|
+
@OneToMany(() => Checkout, (checkout: Checkout) => checkout.cart, { cascade: true })
|
|
42
|
+
checkout_items: Checkout[];
|
|
43
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
DeleteDateColumn,
|
|
6
|
+
ManyToOne,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
OneToOne,
|
|
9
|
+
} from 'typeorm';
|
|
10
|
+
import AuditedModel from '../../AuditedModel';
|
|
11
|
+
import { PriceData } from './PriceData';
|
|
12
|
+
import Cart from './Cart';
|
|
13
|
+
import { Product } from '../../Product.entity';
|
|
14
|
+
|
|
15
|
+
@Entity()
|
|
16
|
+
export default class CartItem extends AuditedModel {
|
|
17
|
+
@PrimaryGeneratedColumn('uuid')
|
|
18
|
+
id: string;
|
|
19
|
+
|
|
20
|
+
@DeleteDateColumn()
|
|
21
|
+
deletedAt: Date;
|
|
22
|
+
|
|
23
|
+
@ManyToOne(() => Product, (product) => product.id, { eager: true, onDelete: 'CASCADE' })
|
|
24
|
+
@JoinColumn()
|
|
25
|
+
product: Product;
|
|
26
|
+
|
|
27
|
+
@Column('integer', { nullable: true })
|
|
28
|
+
variantId?: number;
|
|
29
|
+
|
|
30
|
+
@Column('integer', { default: 0 })
|
|
31
|
+
quantity?: number;
|
|
32
|
+
|
|
33
|
+
@OneToOne(() => PriceData, (priceData) => priceData.cartItem)
|
|
34
|
+
@JoinColumn()
|
|
35
|
+
priceData: PriceData;
|
|
36
|
+
|
|
37
|
+
@ManyToOne(() => Cart, (cart: Cart) => cart.line_items, { eager: true, onDelete: 'CASCADE' })
|
|
38
|
+
@JoinColumn()
|
|
39
|
+
cart: Cart;
|
|
40
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
DeleteDateColumn,
|
|
5
|
+
Column,
|
|
6
|
+
OneToOne,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
ManyToOne,
|
|
9
|
+
} from 'typeorm';
|
|
10
|
+
import AuditedModel from '../../AuditedModel';
|
|
11
|
+
import Cart from './Cart';
|
|
12
|
+
import { CheckoutBillingAddress } from './CheckoutBillingAddress';
|
|
13
|
+
import { CheckoutShippingAddress } from './CheckoutShippingAddress';
|
|
14
|
+
import Order from '../../Order';
|
|
15
|
+
|
|
16
|
+
@Entity()
|
|
17
|
+
export default class Checkout extends AuditedModel {
|
|
18
|
+
@PrimaryGeneratedColumn('uuid')
|
|
19
|
+
id: string;
|
|
20
|
+
|
|
21
|
+
@DeleteDateColumn()
|
|
22
|
+
deletedAt: Date;
|
|
23
|
+
|
|
24
|
+
@Column('varchar', { nullable: true })
|
|
25
|
+
success_url?: string;
|
|
26
|
+
|
|
27
|
+
@Column('varchar', { nullable: true })
|
|
28
|
+
cancel_url?: string;
|
|
29
|
+
|
|
30
|
+
@Column('varchar', { nullable: true })
|
|
31
|
+
payment_method?: string;
|
|
32
|
+
|
|
33
|
+
@Column('varchar', { nullable: true })
|
|
34
|
+
email?: string;
|
|
35
|
+
|
|
36
|
+
@Column('varchar', { nullable: true })
|
|
37
|
+
status?: string;
|
|
38
|
+
|
|
39
|
+
@OneToOne(() => CheckoutBillingAddress, (billing_address) => billing_address.Checkout)
|
|
40
|
+
@JoinColumn()
|
|
41
|
+
billing_address: CheckoutBillingAddress;
|
|
42
|
+
|
|
43
|
+
@OneToOne(() => CheckoutShippingAddress, (shipping_address) => shipping_address.Checkout)
|
|
44
|
+
@JoinColumn()
|
|
45
|
+
shipping_address: CheckoutShippingAddress;
|
|
46
|
+
|
|
47
|
+
@ManyToOne(() => Order, (order: Order) => order.id, {
|
|
48
|
+
eager: true,
|
|
49
|
+
onDelete: 'CASCADE',
|
|
50
|
+
nullable: true,
|
|
51
|
+
})
|
|
52
|
+
@JoinColumn()
|
|
53
|
+
order: Order;
|
|
54
|
+
|
|
55
|
+
@Column('varchar', { nullable: true })
|
|
56
|
+
checkout_url?: string;
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@Column('varchar', { nullable: true })
|
|
60
|
+
origin_payment_id?: string;
|
|
61
|
+
|
|
62
|
+
@ManyToOne(() => Cart, (cart: Cart) => cart.checkout_items, { eager: true, onDelete: 'CASCADE' })
|
|
63
|
+
@JoinColumn()
|
|
64
|
+
cart: Cart;
|
|
65
|
+
|
|
66
|
+
@Column('decimal', { precision: 10, scale: 2, default: 0 })
|
|
67
|
+
total_price?: number;
|
|
68
|
+
|
|
69
|
+
@Column('decimal', { precision: 10, scale: 2, default: 0 })
|
|
70
|
+
total_tax?: number;
|
|
71
|
+
|
|
72
|
+
@Column('integer', { default: 0 })
|
|
73
|
+
total_line_items_price?: number;
|
|
74
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
import Checkout from './Checkout';
|
|
3
|
+
|
|
4
|
+
@Entity()
|
|
5
|
+
export class CheckoutBillingAddress {
|
|
6
|
+
@PrimaryGeneratedColumn('uuid')
|
|
7
|
+
id: string;
|
|
8
|
+
|
|
9
|
+
@Column('varchar', { nullable: true })
|
|
10
|
+
first_name?: string;
|
|
11
|
+
|
|
12
|
+
@Column('varchar', { nullable: true })
|
|
13
|
+
last_name?: string;
|
|
14
|
+
|
|
15
|
+
@Column('varchar', { nullable: true })
|
|
16
|
+
phone_code?: string;
|
|
17
|
+
|
|
18
|
+
@Column('integer', { nullable: true })
|
|
19
|
+
phone?: number;
|
|
20
|
+
|
|
21
|
+
@Column('varchar', { nullable: true })
|
|
22
|
+
company?: string;
|
|
23
|
+
|
|
24
|
+
@Column('varchar', { nullable: true })
|
|
25
|
+
address1?: string;
|
|
26
|
+
|
|
27
|
+
@Column('varchar', { nullable: true })
|
|
28
|
+
address2?: string;
|
|
29
|
+
|
|
30
|
+
@Column('varchar', { nullable: true })
|
|
31
|
+
city?: string;
|
|
32
|
+
|
|
33
|
+
@Column('varchar', { nullable: true })
|
|
34
|
+
province?: string;
|
|
35
|
+
|
|
36
|
+
@Column('varchar', { nullable: true })
|
|
37
|
+
province_code?: string;
|
|
38
|
+
|
|
39
|
+
@Column('varchar', { nullable: true })
|
|
40
|
+
country?: string;
|
|
41
|
+
|
|
42
|
+
@Column('varchar', { nullable: true })
|
|
43
|
+
country_code?: string;
|
|
44
|
+
|
|
45
|
+
@Column('varchar', { nullable: true })
|
|
46
|
+
zip?: number;
|
|
47
|
+
|
|
48
|
+
@OneToOne(() => Checkout, (checkout) => checkout.shipping_address, { eager: true })
|
|
49
|
+
Checkout: Checkout;
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
import Checkout from './Checkout';
|
|
3
|
+
|
|
4
|
+
@Entity()
|
|
5
|
+
export class CheckoutShippingAddress {
|
|
6
|
+
@PrimaryGeneratedColumn('uuid')
|
|
7
|
+
id: string;
|
|
8
|
+
|
|
9
|
+
@Column('varchar', { nullable: true })
|
|
10
|
+
first_name?: string;
|
|
11
|
+
|
|
12
|
+
@Column('varchar', { nullable: true })
|
|
13
|
+
last_name?: string;
|
|
14
|
+
|
|
15
|
+
@Column('varchar', { nullable: true })
|
|
16
|
+
phone_code?: string;
|
|
17
|
+
|
|
18
|
+
@Column('integer', { nullable: true })
|
|
19
|
+
phone?: number;
|
|
20
|
+
|
|
21
|
+
@Column('varchar', { nullable: true })
|
|
22
|
+
company?: string;
|
|
23
|
+
|
|
24
|
+
@Column('varchar', { nullable: true })
|
|
25
|
+
address1?: string;
|
|
26
|
+
|
|
27
|
+
@Column('varchar', { nullable: true })
|
|
28
|
+
address2?: string;
|
|
29
|
+
|
|
30
|
+
@Column('varchar', { nullable: true })
|
|
31
|
+
city?: string;
|
|
32
|
+
|
|
33
|
+
@Column('varchar', { nullable: true })
|
|
34
|
+
province?: string;
|
|
35
|
+
|
|
36
|
+
@Column('varchar', { nullable: true })
|
|
37
|
+
province_code?: string;
|
|
38
|
+
|
|
39
|
+
@Column('varchar', { nullable: true })
|
|
40
|
+
country?: string;
|
|
41
|
+
|
|
42
|
+
@Column('varchar', { nullable: true })
|
|
43
|
+
country_code?: string;
|
|
44
|
+
|
|
45
|
+
@Column('varchar', { nullable: true })
|
|
46
|
+
zip?: number;
|
|
47
|
+
|
|
48
|
+
@OneToOne(() => Checkout, (checkout) => checkout.shipping_address, { eager: true })
|
|
49
|
+
Checkout: Checkout;
|
|
50
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
import CartItem from './CartItem';
|
|
3
|
+
|
|
4
|
+
@Entity()
|
|
5
|
+
export class PriceData {
|
|
6
|
+
@PrimaryGeneratedColumn('uuid')
|
|
7
|
+
id: string;
|
|
8
|
+
|
|
9
|
+
@Column('decimal', { precision: 10, scale: 2, default: 0 })
|
|
10
|
+
unitPrice?: number;
|
|
11
|
+
|
|
12
|
+
@Column('decimal', { precision: 10, scale: 2, default: 0 })
|
|
13
|
+
tax?: number;
|
|
14
|
+
|
|
15
|
+
@Column('varchar', { nullable: true })
|
|
16
|
+
currency?: string;
|
|
17
|
+
|
|
18
|
+
@OneToOne(() => CartItem, (cartItem) => cartItem.priceData, { eager: true })
|
|
19
|
+
cartItem: CartItem;
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getRepository } from 'typeorm';
|
|
2
|
+
import database from '../config/connect';
|
|
3
|
+
import { Channel } from '../entity';
|
|
4
|
+
|
|
5
|
+
database().then(async () => {
|
|
6
|
+
console.info('Entro a la aplicación');
|
|
7
|
+
const channels = await getRepository(Channel).find();
|
|
8
|
+
console.info('Fin de la a la aplicación', channels);
|
|
9
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Order from '../../entity/Order';
|
|
2
|
+
|
|
3
|
+
const SYMBOL_CURRENCY = {
|
|
4
|
+
EUR: '€',
|
|
5
|
+
NOK: 'kr',
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const buildOdaVariablesEmail = (order: Order, receiver: string) => {
|
|
9
|
+
const { reseller, items, paymentProcessor, shippingItems } = order;
|
|
10
|
+
const subtotalPrice = items.reduce((acc, item) => acc + item.price * item.quantity, 0);
|
|
11
|
+
const shippingPrice = shippingItems.reduce((acc, item) => acc + Number(item.price), 0);
|
|
12
|
+
const shippingTitles = shippingItems.map((item) => item.title);
|
|
13
|
+
const products = items.map((item) => {
|
|
14
|
+
const [image0, image1] = item.product.images.sort((a, b) => a.order - b.order);
|
|
15
|
+
return {
|
|
16
|
+
title: item.product.title,
|
|
17
|
+
variantTitle: item.variantTitle,
|
|
18
|
+
price: `${item.price} ${SYMBOL_CURRENCY[order.currency]}`,
|
|
19
|
+
sku: item.product.sku,
|
|
20
|
+
quantity: item.quantity,
|
|
21
|
+
image: image1?.url || image0?.url,
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
const symbol = SYMBOL_CURRENCY[order.currency];
|
|
25
|
+
const variables = {
|
|
26
|
+
orderId: order.id,
|
|
27
|
+
receiver,
|
|
28
|
+
username: reseller.username,
|
|
29
|
+
customerName: order.customer.fullName,
|
|
30
|
+
brandEmail: 'kundeservice@oda.com',
|
|
31
|
+
brandName: 'ODA',
|
|
32
|
+
orderTotal: `${subtotalPrice + shippingPrice} ${symbol}`,
|
|
33
|
+
subtotalPrice: `${subtotalPrice} ${symbol}`,
|
|
34
|
+
shippingPrice: `${shippingPrice} ${symbol}`,
|
|
35
|
+
shippingAddress: order.customer.shippingAddress,
|
|
36
|
+
shippingCity: order.customer.shippingCity,
|
|
37
|
+
shippingPostalCode: order.customer.shippingZip,
|
|
38
|
+
shippingName: order.customer.shippingContactName,
|
|
39
|
+
paymentMethod: paymentProcessor,
|
|
40
|
+
shippingCountry: order.customer.shippingCountry.toUpperCase(),
|
|
41
|
+
shippingMethod: shippingTitles.join(' / '),
|
|
42
|
+
products,
|
|
43
|
+
};
|
|
44
|
+
return variables;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { buildOdaVariablesEmail };
|