@infrab4a/connect 0.17.1-beta.2 → 1.0.0-beta.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/README.md +24 -24
- package/bundles/infrab4a-connect.umd.js +2261 -2463
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/infrab4a-connect.js +5 -5
- package/esm2015/lib/domain/catalog/index.js +3 -0
- package/esm2015/lib/domain/catalog/models/category.js +7 -0
- package/esm2015/lib/domain/catalog/models/enums/index.js +2 -0
- package/esm2015/lib/domain/catalog/models/enums/shops.enum.js +6 -0
- package/esm2015/lib/domain/catalog/models/index.js +6 -0
- package/esm2015/lib/domain/catalog/models/product.js +11 -0
- package/esm2015/lib/domain/catalog/models/types/category-condition.type.js +2 -0
- package/esm2015/lib/domain/catalog/models/types/category-filter.type.js +2 -0
- package/esm2015/lib/domain/catalog/models/types/index.js +8 -0
- package/esm2015/lib/domain/catalog/models/types/product-review.type.js +2 -0
- package/esm2015/lib/domain/catalog/models/types/shops-description.type.js +2 -0
- package/esm2015/lib/domain/catalog/models/types/shops-price.type.js +2 -0
- package/esm2015/lib/domain/catalog/models/types/stock.type.js +2 -0
- package/esm2015/lib/domain/catalog/models/types/variant-grade.type.js +2 -0
- package/esm2015/lib/domain/catalog/models/variant.js +7 -0
- package/esm2015/lib/domain/catalog/repositories/category.repository.js +2 -0
- package/esm2015/lib/domain/catalog/repositories/index.js +5 -0
- package/esm2015/lib/domain/catalog/repositories/product.repository.js +2 -0
- package/esm2015/lib/domain/catalog/repositories/subscription-product.repository.js +2 -0
- package/esm2015/lib/domain/catalog/repositories/variant.repository.js +2 -0
- package/esm2015/lib/domain/general/index.js +3 -0
- package/esm2015/lib/domain/general/model/base-model-with-identifier-fields.js +2 -0
- package/esm2015/lib/domain/general/model/base.model.js +13 -0
- package/esm2015/lib/domain/general/model/identifier-fields.js +2 -0
- package/esm2015/lib/domain/general/model/index.js +5 -0
- package/esm2015/lib/domain/general/model/types/base-model-builder.type.js +2 -0
- package/esm2015/lib/domain/general/model/types/index.js +4 -0
- package/esm2015/lib/domain/general/model/types/non-function-properties.type.js +2 -0
- package/esm2015/lib/domain/general/model/types/non-function-property-name.type.js +2 -0
- package/esm2015/lib/domain/general/repository/create.repository.js +2 -0
- package/esm2015/lib/domain/general/repository/crud.repository.js +2 -0
- package/esm2015/lib/domain/general/repository/delete.repository.js +2 -0
- package/esm2015/lib/domain/general/repository/enums/index.js +3 -0
- package/esm2015/lib/domain/general/repository/enums/update-option-actions.enum.js +9 -0
- package/esm2015/lib/domain/general/repository/enums/where.enum.js +12 -0
- package/esm2015/lib/domain/general/repository/find.repository.js +2 -0
- package/esm2015/lib/domain/general/repository/get.repository.js +2 -0
- package/esm2015/lib/domain/general/repository/index.js +10 -0
- package/esm2015/lib/domain/general/repository/read.repository.js +2 -0
- package/esm2015/lib/domain/general/repository/types/index.js +6 -0
- package/esm2015/lib/domain/general/repository/types/repository-find-filters.type.js +2 -0
- package/esm2015/lib/domain/general/repository/types/repository-find-result.type.js +2 -0
- package/esm2015/lib/domain/general/repository/types/repository-limit-options.type.js +2 -0
- package/esm2015/lib/domain/general/repository/types/repository-order-by-list.type.js +2 -0
- package/esm2015/lib/domain/general/repository/types/repository-update-params.type.js +2 -0
- package/esm2015/lib/domain/general/repository/update.repository.js +2 -0
- package/esm2015/lib/domain/index.js +7 -0
- package/esm2015/lib/domain/location/index.js +2 -0
- package/esm2015/lib/domain/location/models/address.js +4 -0
- package/esm2015/lib/domain/location/models/index.js +3 -0
- package/esm2015/lib/domain/location/models/types/index.js +4 -0
- package/esm2015/lib/domain/location/models/types/location-bound.type.js +2 -0
- package/esm2015/lib/domain/location/models/types/location-geometry.type.js +2 -0
- package/esm2015/lib/domain/location/models/types/location-lat-lng.type.js +2 -0
- package/esm2015/lib/domain/shop-settings/enums/filter-type.enum.js +21 -0
- package/esm2015/lib/domain/shop-settings/enums/index.js +3 -0
- package/esm2015/lib/domain/shop-settings/enums/questions-filters.enum.js +21 -0
- package/esm2015/lib/domain/shop-settings/helpers/beauty-questions.helper.js +46 -0
- package/esm2015/lib/domain/shop-settings/helpers/index.js +2 -0
- package/esm2015/lib/domain/shop-settings/index.js +5 -0
- package/esm2015/lib/domain/shop-settings/models/home.js +7 -0
- package/esm2015/lib/domain/shop-settings/models/index.js +4 -0
- package/esm2015/lib/domain/shop-settings/models/shop-menu.js +7 -0
- package/esm2015/lib/domain/shop-settings/models/types/banner.type.js +2 -0
- package/esm2015/lib/domain/shop-settings/models/types/benefit.type.js +2 -0
- package/esm2015/lib/domain/shop-settings/models/types/index.js +5 -0
- package/esm2015/lib/domain/shop-settings/models/types/menu-nav.type.js +2 -0
- package/esm2015/lib/domain/shop-settings/models/types/sub-menu.type.js +2 -0
- package/esm2015/lib/domain/shop-settings/repositories/home.repository.js +2 -0
- package/esm2015/lib/domain/shop-settings/repositories/index.js +3 -0
- package/esm2015/lib/domain/shop-settings/repositories/shop-menu.repository.js +2 -0
- package/esm2015/lib/domain/shopping/index.js +3 -0
- package/esm2015/lib/domain/shopping/models/buy-2-win.js +14 -0
- package/esm2015/lib/domain/shopping/models/checkout.js +38 -0
- package/esm2015/lib/domain/shopping/models/coupons/club-coupon.js +23 -0
- package/esm2015/lib/domain/shopping/models/coupons/coupon.js +23 -0
- package/esm2015/lib/domain/shopping/models/coupons/enums/discount-type.enum.js +7 -0
- package/esm2015/lib/domain/shopping/models/coupons/enums/exclusivities.enum.js +7 -0
- package/esm2015/lib/domain/shopping/models/coupons/enums/index.js +3 -0
- package/esm2015/lib/domain/shopping/models/coupons/index.js +5 -0
- package/esm2015/lib/domain/shopping/models/coupons/store-coupon.js +23 -0
- package/esm2015/lib/domain/shopping/models/enums/checkout-types.enum.js +6 -0
- package/esm2015/lib/domain/shopping/models/enums/index.js +3 -0
- package/esm2015/lib/domain/shopping/models/enums/order-status.enum.js +12 -0
- package/esm2015/lib/domain/shopping/models/index.js +12 -0
- package/esm2015/lib/domain/shopping/models/line-item.js +4 -0
- package/esm2015/lib/domain/shopping/models/order.js +11 -0
- package/esm2015/lib/domain/shopping/models/payment.js +169 -0
- package/esm2015/lib/domain/shopping/models/shipping-method.js +7 -0
- package/esm2015/lib/domain/shopping/models/subscription/checkout.js +28 -0
- package/esm2015/lib/domain/shopping/models/subscription/index.js +3 -0
- package/esm2015/lib/domain/shopping/models/subscription/plan.js +7 -0
- package/esm2015/lib/domain/shopping/models/types/index.js +8 -0
- package/esm2015/lib/domain/shopping/models/types/payment-address.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-billing.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-card.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-customer.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-document.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-item.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-shipping.type.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/buy-2-win.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/checkout.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/coupon.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/index.js +8 -0
- package/esm2015/lib/domain/shopping/repositories/legacy-order.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/order.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/payment.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/subscription/checkout.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/subscription/index.js +3 -0
- package/esm2015/lib/domain/shopping/repositories/subscription/plan.repository.js +2 -0
- package/esm2015/lib/domain/users/errors/index.js +4 -0
- package/esm2015/lib/domain/users/errors/unauthorized.error.js +7 -0
- package/esm2015/lib/domain/users/errors/user-already-registered.error.js +7 -0
- package/esm2015/lib/domain/users/errors/weak-password.error.js +7 -0
- package/esm2015/lib/domain/users/index.js +6 -0
- package/esm2015/lib/domain/users/models/beauty-profile.js +12 -0
- package/esm2015/lib/domain/users/models/enums/accessory-importances.enum.js +7 -0
- package/esm2015/lib/domain/users/models/enums/area.enum.js +13 -0
- package/esm2015/lib/domain/users/models/enums/beard-problems.enum.js +11 -0
- package/esm2015/lib/domain/users/models/enums/beard-sizes.enum.js +9 -0
- package/esm2015/lib/domain/users/models/enums/beauty-product-importances.enum.js +8 -0
- package/esm2015/lib/domain/users/models/enums/body-problems.enum.js +13 -0
- package/esm2015/lib/domain/users/models/enums/body-shapes.enum.js +9 -0
- package/esm2015/lib/domain/users/models/enums/body-tattoos.enum.js +7 -0
- package/esm2015/lib/domain/users/models/enums/face-skin-oilinesses.enum.js +9 -0
- package/esm2015/lib/domain/users/models/enums/face-skin-problems.enum.js +12 -0
- package/esm2015/lib/domain/users/models/enums/face-skin-tones.enum.js +10 -0
- package/esm2015/lib/domain/users/models/enums/family-incomes.enum.js +10 -0
- package/esm2015/lib/domain/users/models/enums/fragrance-importances.enum.js +7 -0
- package/esm2015/lib/domain/users/models/enums/hair-colors.enum.js +12 -0
- package/esm2015/lib/domain/users/models/enums/hair-problems.enum.js +12 -0
- package/esm2015/lib/domain/users/models/enums/hair-strands.enum.js +10 -0
- package/esm2015/lib/domain/users/models/enums/hair-types.enum.js +9 -0
- package/esm2015/lib/domain/users/models/enums/index.js +21 -0
- package/esm2015/lib/domain/users/models/enums/office-position.enum.js +8 -0
- package/esm2015/lib/domain/users/models/enums/product-spents.enum.js +10 -0
- package/esm2015/lib/domain/users/models/enums/user-type.enum.js +10 -0
- package/esm2015/lib/domain/users/models/index.js +8 -0
- package/esm2015/lib/domain/users/models/lead.js +7 -0
- package/esm2015/lib/domain/users/models/subscription/edition.js +7 -0
- package/esm2015/lib/domain/users/models/subscription/enums/billing-status.enum.js +5 -0
- package/esm2015/lib/domain/users/models/subscription/enums/edition-status.enum.js +6 -0
- package/esm2015/lib/domain/users/models/subscription/enums/index.js +5 -0
- package/esm2015/lib/domain/users/models/subscription/enums/payment-type.enum.js +7 -0
- package/esm2015/lib/domain/users/models/subscription/enums/status.enum.js +6 -0
- package/esm2015/lib/domain/users/models/subscription/index.js +5 -0
- package/esm2015/lib/domain/users/models/subscription/payment.js +14 -0
- package/esm2015/lib/domain/users/models/subscription/subscription.js +43 -0
- package/esm2015/lib/domain/users/models/user-address.js +7 -0
- package/esm2015/lib/domain/users/models/user-payment-method.js +7 -0
- package/esm2015/lib/domain/users/models/user.js +26 -0
- package/esm2015/lib/domain/users/repositories/beauty-profile.repository.js +2 -0
- package/esm2015/lib/domain/users/repositories/edition.repository.js +2 -0
- package/esm2015/lib/domain/users/repositories/index.js +9 -0
- package/esm2015/lib/domain/users/repositories/lead.repository.js +2 -0
- package/esm2015/lib/domain/users/repositories/subscription-payment.repository.js +2 -0
- package/esm2015/lib/domain/users/repositories/subscription.repository.js +2 -0
- package/esm2015/lib/domain/users/repositories/user-address.repository.js +2 -0
- package/esm2015/lib/domain/users/repositories/user-payment-method.repository.js +2 -0
- package/esm2015/lib/domain/users/repositories/user.repository.js +2 -0
- package/esm2015/lib/domain/users/services/authentication.service.js +2 -0
- package/esm2015/lib/domain/users/services/index.js +4 -0
- package/esm2015/lib/domain/users/services/register.service.js +2 -0
- package/esm2015/lib/domain/users/services/types/basic-user-data.type.js +2 -0
- package/esm2015/lib/domain/users/services/types/index.js +2 -0
- package/esm2015/lib/domain/users/use-cases/authentication.js +40 -0
- package/esm2015/lib/domain/users/use-cases/index.js +4 -0
- package/esm2015/lib/domain/users/use-cases/register.js +34 -0
- package/esm2015/lib/domain/users/use-cases/signout.js +12 -0
- package/esm2015/lib/errors/duplicated-results.error.js +7 -0
- package/esm2015/lib/errors/index.js +5 -0
- package/esm2015/lib/errors/invalid-argument.error.js +7 -0
- package/esm2015/lib/errors/not-found.error.js +7 -0
- package/esm2015/lib/errors/required-argument.error.js +8 -0
- package/esm2015/lib/index.js +5 -0
- package/esm2015/lib/infra/firebase/auth/authentication-firebase-auth.service.js +47 -0
- package/esm2015/lib/infra/firebase/auth/index.js +3 -0
- package/esm2015/lib/infra/firebase/auth/register-firebase-auth.service.js +26 -0
- package/esm2015/lib/infra/firebase/auth/types/firebase-user-with-id.type.js +2 -0
- package/esm2015/lib/infra/firebase/firestore/index.js +4 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/index.js +10 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +31 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +10 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +18 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +76 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-firestore.mixin.js +26 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +24 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-helpers.mixin.js +17 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +11 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +45 -0
- package/esm2015/lib/infra/firebase/firestore/models/user-search.js +7 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +78 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/index.js +5 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +23 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/index.js +5 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/index.js +3 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +39 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/index.js +9 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +9 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/index.js +10 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +14 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +14 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +14 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.js +70 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +14 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/types/firestore-sub.repository.type.js +2 -0
- package/esm2015/lib/infra/firebase/firestore/types/firestore.helpers.type.js +2 -0
- package/esm2015/lib/infra/firebase/firestore/types/firestore.repository.type.js +2 -0
- package/esm2015/lib/infra/firebase/firestore/types/index.js +4 -0
- package/esm2015/lib/infra/firebase/index.js +3 -0
- package/esm2015/lib/infra/index.js +2 -0
- package/esm2015/lib/utils/index.js +5 -0
- package/esm2015/lib/utils/mixins/base.mixin.js +6 -0
- package/esm2015/lib/utils/mixins/index.js +3 -0
- package/esm2015/lib/utils/mixins/mixin-ctor.type.js +2 -0
- package/esm2015/lib/utils/types/index.js +2 -0
- package/esm2015/lib/utils/types/prop.type.js +2 -0
- package/esm2015/public-api.js +3 -0
- package/fesm2015/infrab4a-connect.js +1541 -1687
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infrab4a-connect.d.ts +5 -5
- package/lib/domain/catalog/index.d.ts +2 -0
- package/lib/domain/catalog/models/category.d.ts +22 -0
- package/lib/domain/catalog/models/enums/index.d.ts +1 -0
- package/lib/domain/catalog/models/enums/shops.enum.d.ts +4 -0
- package/lib/domain/catalog/models/index.d.ts +5 -0
- package/lib/domain/catalog/models/product.d.ts +33 -0
- package/lib/domain/catalog/models/types/category-condition.type.d.ts +4 -0
- package/lib/domain/catalog/models/types/category-filter.type.d.ts +4 -0
- package/lib/domain/catalog/models/types/index.d.ts +7 -0
- package/lib/domain/catalog/models/types/product-review.type.d.ts +14 -0
- package/lib/domain/catalog/models/types/shops-description.type.d.ts +7 -0
- package/lib/domain/catalog/models/types/shops-price.type.d.ts +10 -0
- package/lib/domain/catalog/models/types/stock.type.d.ts +3 -0
- package/lib/domain/catalog/models/types/variant-grade.type.d.ts +4 -0
- package/lib/domain/catalog/models/variant.d.ts +14 -0
- package/lib/domain/catalog/repositories/category.repository.d.ts +12 -0
- package/lib/domain/catalog/repositories/index.d.ts +4 -0
- package/lib/domain/catalog/repositories/product.repository.d.ts +5 -0
- package/lib/domain/catalog/repositories/subscription-product.repository.d.ts +4 -0
- package/lib/domain/catalog/repositories/variant.repository.d.ts +4 -0
- package/lib/domain/general/index.d.ts +2 -0
- package/lib/domain/general/model/base-model-with-identifier-fields.d.ts +3 -0
- package/lib/domain/general/model/base.model.d.ts +6 -0
- package/lib/domain/general/model/identifier-fields.d.ts +4 -0
- package/lib/domain/general/model/index.d.ts +4 -0
- package/lib/domain/general/model/types/base-model-builder.type.d.ts +5 -0
- package/lib/domain/general/model/types/index.d.ts +3 -0
- package/lib/domain/general/model/types/non-function-properties.type.d.ts +2 -0
- package/lib/domain/general/model/types/non-function-property-name.type.d.ts +3 -0
- package/lib/domain/general/repository/create.repository.d.ts +5 -0
- package/lib/domain/general/repository/crud.repository.d.ts +7 -0
- package/lib/domain/general/repository/delete.repository.d.ts +5 -0
- package/lib/domain/general/repository/enums/index.d.ts +2 -0
- package/lib/domain/general/repository/enums/update-option-actions.enum.d.ts +7 -0
- package/lib/domain/general/repository/enums/where.enum.d.ts +10 -0
- package/lib/domain/general/repository/find.repository.d.ts +5 -0
- package/lib/domain/general/repository/get.repository.d.ts +5 -0
- package/lib/domain/general/repository/index.d.ts +9 -0
- package/lib/domain/general/repository/read.repository.d.ts +5 -0
- package/lib/domain/general/repository/types/index.d.ts +5 -0
- package/lib/domain/general/repository/types/repository-find-filters.type.d.ts +14 -0
- package/lib/domain/general/repository/types/repository-find-result.type.d.ts +4 -0
- package/lib/domain/general/repository/types/repository-limit-options.type.d.ts +4 -0
- package/lib/domain/general/repository/types/repository-order-by-list.type.d.ts +5 -0
- package/lib/domain/general/repository/types/repository-update-params.type.d.ts +11 -0
- package/lib/domain/general/repository/update.repository.d.ts +5 -0
- package/lib/domain/index.d.ts +6 -0
- package/lib/domain/location/index.d.ts +1 -0
- package/lib/domain/location/models/address.d.ts +21 -0
- package/lib/domain/location/models/index.d.ts +2 -0
- package/lib/domain/location/models/types/index.d.ts +3 -0
- package/lib/domain/location/models/types/location-bound.type.d.ts +6 -0
- package/lib/domain/location/models/types/location-geometry.type.d.ts +7 -0
- package/lib/domain/location/models/types/location-lat-lng.type.d.ts +4 -0
- package/lib/domain/shop-settings/enums/filter-type.enum.d.ts +19 -0
- package/lib/domain/shop-settings/enums/index.d.ts +2 -0
- package/lib/domain/shop-settings/enums/questions-filters.enum.d.ts +19 -0
- package/lib/domain/shop-settings/helpers/beauty-questions.helper.d.ts +9 -0
- package/lib/domain/shop-settings/helpers/index.d.ts +1 -0
- package/lib/domain/shop-settings/index.d.ts +4 -0
- package/lib/domain/shop-settings/models/home.d.ts +17 -0
- package/lib/domain/shop-settings/models/index.d.ts +3 -0
- package/lib/domain/shop-settings/models/shop-menu.d.ts +7 -0
- package/lib/domain/shop-settings/models/types/banner.type.d.ts +6 -0
- package/lib/domain/shop-settings/models/types/benefit.type.d.ts +5 -0
- package/lib/domain/shop-settings/models/types/index.d.ts +4 -0
- package/lib/domain/shop-settings/models/types/menu-nav.type.d.ts +8 -0
- package/lib/domain/shop-settings/models/types/sub-menu.type.d.ts +8 -0
- package/lib/domain/shop-settings/repositories/home.repository.d.ts +4 -0
- package/lib/domain/shop-settings/repositories/index.d.ts +2 -0
- package/lib/domain/shop-settings/repositories/shop-menu.repository.d.ts +4 -0
- package/lib/domain/shopping/index.d.ts +2 -0
- package/lib/domain/shopping/models/buy-2-win.d.ts +18 -0
- package/lib/domain/shopping/models/checkout.d.ts +28 -0
- package/lib/domain/shopping/models/coupons/club-coupon.d.ts +9 -0
- package/lib/domain/shopping/models/coupons/coupon.d.ts +27 -0
- package/lib/domain/shopping/models/coupons/enums/discount-type.enum.d.ts +5 -0
- package/lib/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +5 -0
- package/lib/domain/shopping/models/coupons/enums/index.d.ts +2 -0
- package/lib/domain/shopping/models/coupons/index.d.ts +4 -0
- package/lib/domain/shopping/models/coupons/store-coupon.d.ts +8 -0
- package/lib/domain/shopping/models/enums/checkout-types.enum.d.ts +4 -0
- package/lib/domain/shopping/models/enums/index.d.ts +2 -0
- package/lib/domain/shopping/models/enums/order-status.enum.d.ts +10 -0
- package/lib/domain/shopping/models/index.d.ts +11 -0
- package/lib/domain/shopping/models/line-item.d.ts +8 -0
- package/lib/domain/shopping/models/order.d.ts +9 -0
- package/lib/domain/shopping/models/payment.d.ts +69 -0
- package/lib/domain/shopping/models/shipping-method.d.ts +18 -0
- package/lib/domain/shopping/models/subscription/checkout.d.ts +23 -0
- package/lib/domain/shopping/models/subscription/index.d.ts +2 -0
- package/lib/domain/shopping/models/subscription/plan.d.ts +12 -0
- package/lib/domain/shopping/models/types/index.d.ts +7 -0
- package/lib/domain/shopping/models/types/payment-address.type.d.ts +12 -0
- package/lib/domain/shopping/models/types/payment-billing.type.d.ts +7 -0
- package/lib/domain/shopping/models/types/payment-card.type.d.ts +14 -0
- package/lib/domain/shopping/models/types/payment-customer.type.d.ts +18 -0
- package/lib/domain/shopping/models/types/payment-document.type.d.ts +6 -0
- package/lib/domain/shopping/models/types/payment-item.type.d.ts +11 -0
- package/lib/domain/shopping/models/types/payment-shipping.type.d.ts +10 -0
- package/lib/domain/shopping/repositories/buy-2-win.repository.d.ts +4 -0
- package/lib/domain/shopping/repositories/checkout.repository.d.ts +4 -0
- package/lib/domain/shopping/repositories/coupon.repository.d.ts +4 -0
- package/lib/domain/shopping/repositories/index.d.ts +7 -0
- package/lib/domain/shopping/repositories/legacy-order.repository.d.ts +3 -0
- package/lib/domain/shopping/repositories/order.repository.d.ts +4 -0
- package/lib/domain/shopping/repositories/payment.repository.d.ts +4 -0
- package/lib/domain/shopping/repositories/subscription/checkout.repository.d.ts +4 -0
- package/lib/domain/shopping/repositories/subscription/index.d.ts +2 -0
- package/lib/domain/shopping/repositories/subscription/plan.repository.d.ts +4 -0
- package/lib/domain/users/errors/index.d.ts +3 -0
- package/lib/domain/users/errors/unauthorized.error.d.ts +4 -0
- package/lib/domain/users/errors/user-already-registered.error.d.ts +4 -0
- package/lib/domain/users/errors/weak-password.error.d.ts +4 -0
- package/lib/domain/users/index.d.ts +5 -0
- package/lib/domain/users/models/beauty-profile.d.ts +12 -0
- package/lib/domain/users/models/enums/accessory-importances.enum.d.ts +5 -0
- package/lib/domain/users/models/enums/area.enum.d.ts +11 -0
- package/lib/domain/users/models/enums/beard-problems.enum.d.ts +9 -0
- package/lib/domain/users/models/enums/beard-sizes.enum.d.ts +7 -0
- package/lib/domain/users/models/enums/beauty-product-importances.enum.d.ts +6 -0
- package/lib/domain/users/models/enums/body-problems.enum.d.ts +11 -0
- package/lib/domain/users/models/enums/body-shapes.enum.d.ts +7 -0
- package/lib/domain/users/models/enums/body-tattoos.enum.d.ts +5 -0
- package/lib/domain/users/models/enums/face-skin-oilinesses.enum.d.ts +7 -0
- package/lib/domain/users/models/enums/face-skin-problems.enum.d.ts +10 -0
- package/lib/domain/users/models/enums/face-skin-tones.enum.d.ts +8 -0
- package/lib/domain/users/models/enums/family-incomes.enum.d.ts +8 -0
- package/lib/domain/users/models/enums/fragrance-importances.enum.d.ts +5 -0
- package/lib/domain/users/models/enums/hair-colors.enum.d.ts +10 -0
- package/lib/domain/users/models/enums/hair-problems.enum.d.ts +10 -0
- package/lib/domain/users/models/enums/hair-strands.enum.d.ts +8 -0
- package/lib/domain/users/models/enums/hair-types.enum.d.ts +7 -0
- package/lib/domain/users/models/enums/index.d.ts +20 -0
- package/lib/domain/users/models/enums/office-position.enum.d.ts +6 -0
- package/lib/domain/users/models/enums/product-spents.enum.d.ts +8 -0
- package/lib/domain/users/models/enums/user-type.enum.d.ts +8 -0
- package/lib/domain/users/models/index.d.ts +7 -0
- package/lib/domain/users/models/lead.d.ts +9 -0
- package/lib/domain/users/models/subscription/edition.d.ts +15 -0
- package/lib/domain/users/models/subscription/enums/billing-status.enum.d.ts +3 -0
- package/lib/domain/users/models/subscription/enums/edition-status.enum.d.ts +4 -0
- package/lib/domain/users/models/subscription/enums/index.d.ts +4 -0
- package/lib/domain/users/models/subscription/enums/payment-type.enum.d.ts +5 -0
- package/lib/domain/users/models/subscription/enums/status.enum.d.ts +4 -0
- package/lib/domain/users/models/subscription/index.d.ts +4 -0
- package/lib/domain/users/models/subscription/payment.d.ts +14 -0
- package/lib/domain/users/models/subscription/subscription.d.ts +30 -0
- package/lib/domain/users/models/user-address.d.ts +7 -0
- package/lib/domain/users/models/user-payment-method.d.ts +13 -0
- package/lib/domain/users/models/user.d.ts +24 -0
- package/lib/domain/users/repositories/beauty-profile.repository.d.ts +4 -0
- package/lib/domain/users/repositories/edition.repository.d.ts +4 -0
- package/lib/domain/users/repositories/index.d.ts +8 -0
- package/lib/domain/users/repositories/lead.repository.d.ts +4 -0
- package/lib/domain/users/repositories/subscription-payment.repository.d.ts +4 -0
- package/lib/domain/users/repositories/subscription.repository.d.ts +4 -0
- package/lib/domain/users/repositories/user-address.repository.d.ts +4 -0
- package/lib/domain/users/repositories/user-payment-method.repository.d.ts +4 -0
- package/lib/domain/users/repositories/user.repository.d.ts +6 -0
- package/lib/domain/users/services/authentication.service.d.ts +11 -0
- package/lib/domain/users/services/index.d.ts +3 -0
- package/lib/domain/users/services/register.service.d.ts +7 -0
- package/lib/domain/users/services/types/basic-user-data.type.d.ts +4 -0
- package/lib/domain/users/services/types/index.d.ts +1 -0
- package/lib/domain/users/use-cases/authentication.d.ts +21 -0
- package/lib/domain/users/use-cases/index.d.ts +3 -0
- package/lib/domain/users/use-cases/register.d.ts +13 -0
- package/lib/domain/users/use-cases/signout.d.ts +6 -0
- package/lib/errors/duplicated-results.error.d.ts +4 -0
- package/lib/errors/index.d.ts +4 -0
- package/lib/errors/invalid-argument.error.d.ts +4 -0
- package/lib/errors/not-found.error.d.ts +4 -0
- package/lib/errors/required-argument.error.d.ts +5 -0
- package/lib/index.d.ts +4 -0
- package/lib/infra/firebase/auth/authentication-firebase-auth.service.d.ts +11 -0
- package/lib/infra/firebase/auth/index.d.ts +2 -0
- package/lib/infra/firebase/auth/register-firebase-auth.service.d.ts +8 -0
- package/lib/infra/firebase/auth/types/firebase-user-with-id.type.d.ts +3 -0
- package/lib/infra/firebase/firestore/index.d.ts +3 -0
- package/lib/infra/firebase/firestore/mixins/index.d.ts +9 -0
- package/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +17 -0
- package/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +29 -0
- package/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +15 -0
- package/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +20 -0
- package/lib/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +15 -0
- package/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +15 -0
- package/lib/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +10 -0
- package/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +14 -0
- package/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +16 -0
- package/lib/infra/firebase/firestore/models/user-search.d.ts +9 -0
- package/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +55 -0
- package/lib/infra/firebase/firestore/repositories/catalog/index.d.ts +4 -0
- package/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +50 -0
- package/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +60 -0
- package/lib/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/index.d.ts +4 -0
- package/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/shop-settings/index.d.ts +2 -0
- package/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +53 -0
- package/lib/infra/firebase/firestore/repositories/shopping/index.d.ts +8 -0
- package/lib/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +7 -0
- package/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/users/index.d.ts +9 -0
- package/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +60 -0
- package/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +49 -0
- package/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +60 -0
- package/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +60 -0
- package/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +60 -0
- package/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +60 -0
- package/lib/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +60 -0
- package/lib/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +50 -0
- package/lib/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +6 -0
- package/lib/infra/firebase/firestore/types/firestore.helpers.type.d.ts +8 -0
- package/lib/infra/firebase/firestore/types/firestore.repository.type.d.ts +8 -0
- package/lib/infra/firebase/firestore/types/index.d.ts +3 -0
- package/lib/infra/firebase/index.d.ts +2 -0
- package/lib/infra/index.d.ts +1 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/mixins/base.mixin.d.ts +3 -0
- package/lib/utils/mixins/index.d.ts +2 -0
- package/lib/utils/mixins/mixin-ctor.type.d.ts +1 -0
- package/lib/utils/types/index.d.ts +1 -0
- package/lib/utils/types/prop.type.d.ts +1 -0
- package/package.json +1 -3
- package/public-api.d.ts +2 -0
- package/domain/catalog/index.d.ts +0 -2
- package/domain/catalog/models/category.d.ts +0 -22
- package/domain/catalog/models/enums/index.d.ts +0 -1
- package/domain/catalog/models/enums/shops.enum.d.ts +0 -5
- package/domain/catalog/models/index.d.ts +0 -5
- package/domain/catalog/models/product.d.ts +0 -35
- package/domain/catalog/models/types/category-condition.type.d.ts +0 -4
- package/domain/catalog/models/types/category-filter.type.d.ts +0 -4
- package/domain/catalog/models/types/index.d.ts +0 -7
- package/domain/catalog/models/types/product-review.type.d.ts +0 -15
- package/domain/catalog/models/types/shops-description.type.d.ts +0 -7
- package/domain/catalog/models/types/shops-price.type.d.ts +0 -10
- package/domain/catalog/models/types/stock.type.d.ts +0 -3
- package/domain/catalog/models/types/variant-grade.type.d.ts +0 -4
- package/domain/catalog/models/variant.d.ts +0 -14
- package/domain/catalog/repositories/category.repository.d.ts +0 -15
- package/domain/catalog/repositories/index.d.ts +0 -4
- package/domain/catalog/repositories/product.repository.d.ts +0 -5
- package/domain/catalog/repositories/subscription-product.repository.d.ts +0 -4
- package/domain/catalog/repositories/variant.repository.d.ts +0 -4
- package/domain/general/index.d.ts +0 -2
- package/domain/general/model/base-model-with-identifier-fields.d.ts +0 -3
- package/domain/general/model/base.model.d.ts +0 -6
- package/domain/general/model/identifier-fields.d.ts +0 -4
- package/domain/general/model/index.d.ts +0 -4
- package/domain/general/model/types/base-model-builder.type.d.ts +0 -5
- package/domain/general/model/types/index.d.ts +0 -3
- package/domain/general/model/types/non-function-properties.type.d.ts +0 -2
- package/domain/general/model/types/non-function-property-name.type.d.ts +0 -3
- package/domain/general/repository/create.repository.d.ts +0 -5
- package/domain/general/repository/crud.repository.d.ts +0 -7
- package/domain/general/repository/delete.repository.d.ts +0 -5
- package/domain/general/repository/enums/index.d.ts +0 -2
- package/domain/general/repository/enums/update-option-actions.enum.d.ts +0 -7
- package/domain/general/repository/enums/where.enum.d.ts +0 -10
- package/domain/general/repository/find.repository.d.ts +0 -5
- package/domain/general/repository/get.repository.d.ts +0 -5
- package/domain/general/repository/index.d.ts +0 -9
- package/domain/general/repository/read.repository.d.ts +0 -5
- package/domain/general/repository/types/index.d.ts +0 -5
- package/domain/general/repository/types/repository-find-filters.type.d.ts +0 -14
- package/domain/general/repository/types/repository-find-result.type.d.ts +0 -4
- package/domain/general/repository/types/repository-limit-options.type.d.ts +0 -4
- package/domain/general/repository/types/repository-order-by-list.type.d.ts +0 -5
- package/domain/general/repository/types/repository-update-params.type.d.ts +0 -11
- package/domain/general/repository/update.repository.d.ts +0 -5
- package/domain/index.d.ts +0 -6
- package/domain/location/index.d.ts +0 -1
- package/domain/location/models/address.d.ts +0 -21
- package/domain/location/models/index.d.ts +0 -2
- package/domain/location/models/types/index.d.ts +0 -3
- package/domain/location/models/types/location-bound.type.d.ts +0 -6
- package/domain/location/models/types/location-geometry.type.d.ts +0 -7
- package/domain/location/models/types/location-lat-lng.type.d.ts +0 -4
- package/domain/shop-settings/enums/filter-type.enum.d.ts +0 -19
- package/domain/shop-settings/enums/index.d.ts +0 -2
- package/domain/shop-settings/enums/questions-filters.enum.d.ts +0 -19
- package/domain/shop-settings/helpers/beauty-questions.helper.d.ts +0 -9
- package/domain/shop-settings/helpers/index.d.ts +0 -1
- package/domain/shop-settings/index.d.ts +0 -4
- package/domain/shop-settings/models/home.d.ts +0 -17
- package/domain/shop-settings/models/index.d.ts +0 -4
- package/domain/shop-settings/models/shop-menu.d.ts +0 -7
- package/domain/shop-settings/models/shop-settings.d.ts +0 -6
- package/domain/shop-settings/models/types/banner.type.d.ts +0 -6
- package/domain/shop-settings/models/types/benefit.type.d.ts +0 -5
- package/domain/shop-settings/models/types/home-data.type.d.ts +0 -15
- package/domain/shop-settings/models/types/index.d.ts +0 -5
- package/domain/shop-settings/models/types/menu-nav.type.d.ts +0 -8
- package/domain/shop-settings/models/types/sub-menu.type.d.ts +0 -8
- package/domain/shop-settings/repositories/home.repository.d.ts +0 -4
- package/domain/shop-settings/repositories/index.d.ts +0 -3
- package/domain/shop-settings/repositories/shop-menu.repository.d.ts +0 -4
- package/domain/shop-settings/repositories/shop-settings.repository.d.ts +0 -4
- package/domain/shopping/index.d.ts +0 -2
- package/domain/shopping/models/buy-2-win.d.ts +0 -18
- package/domain/shopping/models/checkout.d.ts +0 -29
- package/domain/shopping/models/coupons/coupon.d.ts +0 -28
- package/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +0 -4
- package/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +0 -6
- package/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +0 -5
- package/domain/shopping/models/coupons/enums/index.d.ts +0 -3
- package/domain/shopping/models/coupons/financial-coupon.d.ts +0 -9
- package/domain/shopping/models/coupons/index.d.ts +0 -3
- package/domain/shopping/models/enums/checkout-types.enum.d.ts +0 -4
- package/domain/shopping/models/enums/index.d.ts +0 -2
- package/domain/shopping/models/enums/order-status.enum.d.ts +0 -10
- package/domain/shopping/models/index.d.ts +0 -11
- package/domain/shopping/models/line-item.d.ts +0 -8
- package/domain/shopping/models/order.d.ts +0 -9
- package/domain/shopping/models/payment.d.ts +0 -69
- package/domain/shopping/models/shipping-method.d.ts +0 -18
- package/domain/shopping/models/subscription/checkout.d.ts +0 -23
- package/domain/shopping/models/subscription/index.d.ts +0 -2
- package/domain/shopping/models/subscription/plan.d.ts +0 -12
- package/domain/shopping/models/types/index.d.ts +0 -7
- package/domain/shopping/models/types/payment-address.type.d.ts +0 -12
- package/domain/shopping/models/types/payment-billing.type.d.ts +0 -7
- package/domain/shopping/models/types/payment-card.type.d.ts +0 -14
- package/domain/shopping/models/types/payment-customer.type.d.ts +0 -18
- package/domain/shopping/models/types/payment-document.type.d.ts +0 -6
- package/domain/shopping/models/types/payment-item.type.d.ts +0 -11
- package/domain/shopping/models/types/payment-shipping.type.d.ts +0 -10
- package/domain/shopping/repositories/buy-2-win.repository.d.ts +0 -4
- package/domain/shopping/repositories/checkout.repository.d.ts +0 -4
- package/domain/shopping/repositories/coupon.repository.d.ts +0 -4
- package/domain/shopping/repositories/index.d.ts +0 -7
- package/domain/shopping/repositories/legacy-order.repository.d.ts +0 -3
- package/domain/shopping/repositories/order.repository.d.ts +0 -4
- package/domain/shopping/repositories/payment.repository.d.ts +0 -4
- package/domain/shopping/repositories/subscription/checkout.repository.d.ts +0 -4
- package/domain/shopping/repositories/subscription/index.d.ts +0 -2
- package/domain/shopping/repositories/subscription/plan.repository.d.ts +0 -4
- package/domain/users/errors/index.d.ts +0 -3
- package/domain/users/errors/unauthorized.error.d.ts +0 -4
- package/domain/users/errors/user-already-registered.error.d.ts +0 -4
- package/domain/users/errors/weak-password.error.d.ts +0 -4
- package/domain/users/index.d.ts +0 -5
- package/domain/users/models/beauty-profile.d.ts +0 -12
- package/domain/users/models/enums/accessory-importances.enum.d.ts +0 -5
- package/domain/users/models/enums/area.enum.d.ts +0 -11
- package/domain/users/models/enums/beard-problems.enum.d.ts +0 -9
- package/domain/users/models/enums/beard-sizes.enum.d.ts +0 -7
- package/domain/users/models/enums/beauty-product-importances.enum.d.ts +0 -6
- package/domain/users/models/enums/body-problems.enum.d.ts +0 -11
- package/domain/users/models/enums/body-shapes.enum.d.ts +0 -7
- package/domain/users/models/enums/body-tattoos.enum.d.ts +0 -5
- package/domain/users/models/enums/face-skin-oilinesses.enum.d.ts +0 -7
- package/domain/users/models/enums/face-skin-problems.enum.d.ts +0 -10
- package/domain/users/models/enums/face-skin-tones.enum.d.ts +0 -8
- package/domain/users/models/enums/family-incomes.enum.d.ts +0 -8
- package/domain/users/models/enums/fragrance-importances.enum.d.ts +0 -5
- package/domain/users/models/enums/hair-colors.enum.d.ts +0 -10
- package/domain/users/models/enums/hair-problems.enum.d.ts +0 -10
- package/domain/users/models/enums/hair-strands.enum.d.ts +0 -8
- package/domain/users/models/enums/hair-types.enum.d.ts +0 -7
- package/domain/users/models/enums/index.d.ts +0 -20
- package/domain/users/models/enums/office-position.enum.d.ts +0 -6
- package/domain/users/models/enums/product-spents.enum.d.ts +0 -8
- package/domain/users/models/enums/user-type.enum.d.ts +0 -8
- package/domain/users/models/index.d.ts +0 -7
- package/domain/users/models/lead.d.ts +0 -9
- package/domain/users/models/subscription/edition.d.ts +0 -17
- package/domain/users/models/subscription/enums/billing-status.enum.d.ts +0 -3
- package/domain/users/models/subscription/enums/edition-status.enum.d.ts +0 -4
- package/domain/users/models/subscription/enums/index.d.ts +0 -4
- package/domain/users/models/subscription/enums/payment-type.enum.d.ts +0 -5
- package/domain/users/models/subscription/enums/status.enum.d.ts +0 -4
- package/domain/users/models/subscription/index.d.ts +0 -4
- package/domain/users/models/subscription/payment.d.ts +0 -14
- package/domain/users/models/subscription/subscription.d.ts +0 -30
- package/domain/users/models/user-address.d.ts +0 -7
- package/domain/users/models/user-payment-method.d.ts +0 -14
- package/domain/users/models/user.d.ts +0 -25
- package/domain/users/repositories/beauty-profile.repository.d.ts +0 -4
- package/domain/users/repositories/edition.repository.d.ts +0 -4
- package/domain/users/repositories/index.d.ts +0 -8
- package/domain/users/repositories/lead.repository.d.ts +0 -4
- package/domain/users/repositories/subscription-payment.repository.d.ts +0 -4
- package/domain/users/repositories/subscription.repository.d.ts +0 -4
- package/domain/users/repositories/user-address.repository.d.ts +0 -4
- package/domain/users/repositories/user-payment-method.repository.d.ts +0 -4
- package/domain/users/repositories/user.repository.d.ts +0 -6
- package/domain/users/services/authentication.service.d.ts +0 -12
- package/domain/users/services/index.d.ts +0 -3
- package/domain/users/services/register.service.d.ts +0 -7
- package/domain/users/services/types/basic-user-data.type.d.ts +0 -4
- package/domain/users/services/types/index.d.ts +0 -1
- package/domain/users/use-cases/authentication.d.ts +0 -21
- package/domain/users/use-cases/index.d.ts +0 -4
- package/domain/users/use-cases/recovery-password.d.ts +0 -6
- package/domain/users/use-cases/register.d.ts +0 -13
- package/domain/users/use-cases/signout.d.ts +0 -6
- package/errors/duplicated-results.error.d.ts +0 -4
- package/errors/index.d.ts +0 -4
- package/errors/invalid-argument.error.d.ts +0 -4
- package/errors/not-found.error.d.ts +0 -4
- package/errors/required-argument.error.d.ts +0 -5
- package/esm2015/domain/catalog/index.js +0 -3
- package/esm2015/domain/catalog/models/category.js +0 -7
- package/esm2015/domain/catalog/models/enums/index.js +0 -2
- package/esm2015/domain/catalog/models/enums/shops.enum.js +0 -7
- package/esm2015/domain/catalog/models/index.js +0 -6
- package/esm2015/domain/catalog/models/product.js +0 -11
- package/esm2015/domain/catalog/models/types/category-condition.type.js +0 -2
- package/esm2015/domain/catalog/models/types/category-filter.type.js +0 -2
- package/esm2015/domain/catalog/models/types/index.js +0 -8
- package/esm2015/domain/catalog/models/types/product-review.type.js +0 -2
- package/esm2015/domain/catalog/models/types/shops-description.type.js +0 -2
- package/esm2015/domain/catalog/models/types/shops-price.type.js +0 -2
- package/esm2015/domain/catalog/models/types/stock.type.js +0 -2
- package/esm2015/domain/catalog/models/types/variant-grade.type.js +0 -2
- package/esm2015/domain/catalog/models/variant.js +0 -7
- package/esm2015/domain/catalog/repositories/category.repository.js +0 -2
- package/esm2015/domain/catalog/repositories/index.js +0 -5
- package/esm2015/domain/catalog/repositories/product.repository.js +0 -2
- package/esm2015/domain/catalog/repositories/subscription-product.repository.js +0 -2
- package/esm2015/domain/catalog/repositories/variant.repository.js +0 -2
- package/esm2015/domain/general/index.js +0 -3
- package/esm2015/domain/general/model/base-model-with-identifier-fields.js +0 -2
- package/esm2015/domain/general/model/base.model.js +0 -13
- package/esm2015/domain/general/model/identifier-fields.js +0 -2
- package/esm2015/domain/general/model/index.js +0 -5
- package/esm2015/domain/general/model/types/base-model-builder.type.js +0 -2
- package/esm2015/domain/general/model/types/index.js +0 -4
- package/esm2015/domain/general/model/types/non-function-properties.type.js +0 -2
- package/esm2015/domain/general/model/types/non-function-property-name.type.js +0 -2
- package/esm2015/domain/general/repository/create.repository.js +0 -2
- package/esm2015/domain/general/repository/crud.repository.js +0 -2
- package/esm2015/domain/general/repository/delete.repository.js +0 -2
- package/esm2015/domain/general/repository/enums/index.js +0 -3
- package/esm2015/domain/general/repository/enums/update-option-actions.enum.js +0 -9
- package/esm2015/domain/general/repository/enums/where.enum.js +0 -12
- package/esm2015/domain/general/repository/find.repository.js +0 -2
- package/esm2015/domain/general/repository/get.repository.js +0 -2
- package/esm2015/domain/general/repository/index.js +0 -10
- package/esm2015/domain/general/repository/read.repository.js +0 -2
- package/esm2015/domain/general/repository/types/index.js +0 -6
- package/esm2015/domain/general/repository/types/repository-find-filters.type.js +0 -2
- package/esm2015/domain/general/repository/types/repository-find-result.type.js +0 -2
- package/esm2015/domain/general/repository/types/repository-limit-options.type.js +0 -2
- package/esm2015/domain/general/repository/types/repository-order-by-list.type.js +0 -2
- package/esm2015/domain/general/repository/types/repository-update-params.type.js +0 -2
- package/esm2015/domain/general/repository/update.repository.js +0 -2
- package/esm2015/domain/index.js +0 -7
- package/esm2015/domain/location/index.js +0 -2
- package/esm2015/domain/location/models/address.js +0 -4
- package/esm2015/domain/location/models/index.js +0 -3
- package/esm2015/domain/location/models/types/index.js +0 -4
- package/esm2015/domain/location/models/types/location-bound.type.js +0 -2
- package/esm2015/domain/location/models/types/location-geometry.type.js +0 -2
- package/esm2015/domain/location/models/types/location-lat-lng.type.js +0 -2
- package/esm2015/domain/shop-settings/enums/filter-type.enum.js +0 -21
- package/esm2015/domain/shop-settings/enums/index.js +0 -3
- package/esm2015/domain/shop-settings/enums/questions-filters.enum.js +0 -21
- package/esm2015/domain/shop-settings/helpers/beauty-questions.helper.js +0 -46
- package/esm2015/domain/shop-settings/helpers/index.js +0 -2
- package/esm2015/domain/shop-settings/index.js +0 -5
- package/esm2015/domain/shop-settings/models/home.js +0 -7
- package/esm2015/domain/shop-settings/models/index.js +0 -5
- package/esm2015/domain/shop-settings/models/shop-menu.js +0 -7
- package/esm2015/domain/shop-settings/models/shop-settings.js +0 -7
- package/esm2015/domain/shop-settings/models/types/banner.type.js +0 -2
- package/esm2015/domain/shop-settings/models/types/benefit.type.js +0 -2
- package/esm2015/domain/shop-settings/models/types/home-data.type.js +0 -2
- package/esm2015/domain/shop-settings/models/types/index.js +0 -6
- package/esm2015/domain/shop-settings/models/types/menu-nav.type.js +0 -2
- package/esm2015/domain/shop-settings/models/types/sub-menu.type.js +0 -2
- package/esm2015/domain/shop-settings/repositories/home.repository.js +0 -2
- package/esm2015/domain/shop-settings/repositories/index.js +0 -4
- package/esm2015/domain/shop-settings/repositories/shop-menu.repository.js +0 -2
- package/esm2015/domain/shop-settings/repositories/shop-settings.repository.js +0 -2
- package/esm2015/domain/shopping/index.js +0 -3
- package/esm2015/domain/shopping/models/buy-2-win.js +0 -14
- package/esm2015/domain/shopping/models/checkout.js +0 -38
- package/esm2015/domain/shopping/models/coupons/coupon.js +0 -23
- package/esm2015/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +0 -6
- package/esm2015/domain/shopping/models/coupons/enums/coupon-types.enum.js +0 -8
- package/esm2015/domain/shopping/models/coupons/enums/exclusivities.enum.js +0 -7
- package/esm2015/domain/shopping/models/coupons/enums/index.js +0 -4
- package/esm2015/domain/shopping/models/coupons/financial-coupon.js +0 -28
- package/esm2015/domain/shopping/models/coupons/index.js +0 -4
- package/esm2015/domain/shopping/models/enums/checkout-types.enum.js +0 -6
- package/esm2015/domain/shopping/models/enums/index.js +0 -3
- package/esm2015/domain/shopping/models/enums/order-status.enum.js +0 -12
- package/esm2015/domain/shopping/models/index.js +0 -12
- package/esm2015/domain/shopping/models/line-item.js +0 -4
- package/esm2015/domain/shopping/models/order.js +0 -11
- package/esm2015/domain/shopping/models/payment.js +0 -169
- package/esm2015/domain/shopping/models/shipping-method.js +0 -7
- package/esm2015/domain/shopping/models/subscription/checkout.js +0 -28
- package/esm2015/domain/shopping/models/subscription/index.js +0 -3
- package/esm2015/domain/shopping/models/subscription/plan.js +0 -7
- package/esm2015/domain/shopping/models/types/index.js +0 -8
- package/esm2015/domain/shopping/models/types/payment-address.type.js +0 -2
- package/esm2015/domain/shopping/models/types/payment-billing.type.js +0 -2
- package/esm2015/domain/shopping/models/types/payment-card.type.js +0 -2
- package/esm2015/domain/shopping/models/types/payment-customer.type.js +0 -2
- package/esm2015/domain/shopping/models/types/payment-document.type.js +0 -2
- package/esm2015/domain/shopping/models/types/payment-item.type.js +0 -2
- package/esm2015/domain/shopping/models/types/payment-shipping.type.js +0 -2
- package/esm2015/domain/shopping/repositories/buy-2-win.repository.js +0 -2
- package/esm2015/domain/shopping/repositories/checkout.repository.js +0 -2
- package/esm2015/domain/shopping/repositories/coupon.repository.js +0 -2
- package/esm2015/domain/shopping/repositories/index.js +0 -8
- package/esm2015/domain/shopping/repositories/legacy-order.repository.js +0 -2
- package/esm2015/domain/shopping/repositories/order.repository.js +0 -2
- package/esm2015/domain/shopping/repositories/payment.repository.js +0 -2
- package/esm2015/domain/shopping/repositories/subscription/checkout.repository.js +0 -2
- package/esm2015/domain/shopping/repositories/subscription/index.js +0 -3
- package/esm2015/domain/shopping/repositories/subscription/plan.repository.js +0 -2
- package/esm2015/domain/users/errors/index.js +0 -4
- package/esm2015/domain/users/errors/unauthorized.error.js +0 -7
- package/esm2015/domain/users/errors/user-already-registered.error.js +0 -7
- package/esm2015/domain/users/errors/weak-password.error.js +0 -7
- package/esm2015/domain/users/index.js +0 -6
- package/esm2015/domain/users/models/beauty-profile.js +0 -12
- package/esm2015/domain/users/models/enums/accessory-importances.enum.js +0 -7
- package/esm2015/domain/users/models/enums/area.enum.js +0 -13
- package/esm2015/domain/users/models/enums/beard-problems.enum.js +0 -11
- package/esm2015/domain/users/models/enums/beard-sizes.enum.js +0 -9
- package/esm2015/domain/users/models/enums/beauty-product-importances.enum.js +0 -8
- package/esm2015/domain/users/models/enums/body-problems.enum.js +0 -13
- package/esm2015/domain/users/models/enums/body-shapes.enum.js +0 -9
- package/esm2015/domain/users/models/enums/body-tattoos.enum.js +0 -7
- package/esm2015/domain/users/models/enums/face-skin-oilinesses.enum.js +0 -9
- package/esm2015/domain/users/models/enums/face-skin-problems.enum.js +0 -12
- package/esm2015/domain/users/models/enums/face-skin-tones.enum.js +0 -10
- package/esm2015/domain/users/models/enums/family-incomes.enum.js +0 -10
- package/esm2015/domain/users/models/enums/fragrance-importances.enum.js +0 -7
- package/esm2015/domain/users/models/enums/hair-colors.enum.js +0 -12
- package/esm2015/domain/users/models/enums/hair-problems.enum.js +0 -12
- package/esm2015/domain/users/models/enums/hair-strands.enum.js +0 -10
- package/esm2015/domain/users/models/enums/hair-types.enum.js +0 -9
- package/esm2015/domain/users/models/enums/index.js +0 -21
- package/esm2015/domain/users/models/enums/office-position.enum.js +0 -8
- package/esm2015/domain/users/models/enums/product-spents.enum.js +0 -10
- package/esm2015/domain/users/models/enums/user-type.enum.js +0 -10
- package/esm2015/domain/users/models/index.js +0 -8
- package/esm2015/domain/users/models/lead.js +0 -7
- package/esm2015/domain/users/models/subscription/edition.js +0 -7
- package/esm2015/domain/users/models/subscription/enums/billing-status.enum.js +0 -5
- package/esm2015/domain/users/models/subscription/enums/edition-status.enum.js +0 -6
- package/esm2015/domain/users/models/subscription/enums/index.js +0 -5
- package/esm2015/domain/users/models/subscription/enums/payment-type.enum.js +0 -7
- package/esm2015/domain/users/models/subscription/enums/status.enum.js +0 -6
- package/esm2015/domain/users/models/subscription/index.js +0 -5
- package/esm2015/domain/users/models/subscription/payment.js +0 -14
- package/esm2015/domain/users/models/subscription/subscription.js +0 -43
- package/esm2015/domain/users/models/user-address.js +0 -7
- package/esm2015/domain/users/models/user-payment-method.js +0 -7
- package/esm2015/domain/users/models/user.js +0 -26
- package/esm2015/domain/users/repositories/beauty-profile.repository.js +0 -2
- package/esm2015/domain/users/repositories/edition.repository.js +0 -2
- package/esm2015/domain/users/repositories/index.js +0 -9
- package/esm2015/domain/users/repositories/lead.repository.js +0 -2
- package/esm2015/domain/users/repositories/subscription-payment.repository.js +0 -2
- package/esm2015/domain/users/repositories/subscription.repository.js +0 -2
- package/esm2015/domain/users/repositories/user-address.repository.js +0 -2
- package/esm2015/domain/users/repositories/user-payment-method.repository.js +0 -2
- package/esm2015/domain/users/repositories/user.repository.js +0 -2
- package/esm2015/domain/users/services/authentication.service.js +0 -2
- package/esm2015/domain/users/services/index.js +0 -4
- package/esm2015/domain/users/services/register.service.js +0 -2
- package/esm2015/domain/users/services/types/basic-user-data.type.js +0 -2
- package/esm2015/domain/users/services/types/index.js +0 -2
- package/esm2015/domain/users/use-cases/authentication.js +0 -40
- package/esm2015/domain/users/use-cases/index.js +0 -5
- package/esm2015/domain/users/use-cases/recovery-password.js +0 -12
- package/esm2015/domain/users/use-cases/register.js +0 -34
- package/esm2015/domain/users/use-cases/signout.js +0 -12
- package/esm2015/errors/duplicated-results.error.js +0 -7
- package/esm2015/errors/index.js +0 -5
- package/esm2015/errors/invalid-argument.error.js +0 -7
- package/esm2015/errors/not-found.error.js +0 -7
- package/esm2015/errors/required-argument.error.js +0 -8
- package/esm2015/index.js +0 -6
- package/esm2015/infra/elasticsearch/adapters/axios.adapter.js +0 -22
- package/esm2015/infra/elasticsearch/adapters/elastic-search.adapter.js +0 -2
- package/esm2015/infra/elasticsearch/adapters/index.js +0 -3
- package/esm2015/infra/elasticsearch/index.js +0 -4
- package/esm2015/infra/elasticsearch/indexes/index.js +0 -2
- package/esm2015/infra/elasticsearch/indexes/products-index.js +0 -59
- package/esm2015/infra/elasticsearch/types/elastic-search-result.js +0 -2
- package/esm2015/infra/elasticsearch/types/index.js +0 -2
- package/esm2015/infra/firebase/auth/authentication-firebase-auth.service.js +0 -52
- package/esm2015/infra/firebase/auth/index.js +0 -3
- package/esm2015/infra/firebase/auth/register-firebase-auth.service.js +0 -26
- package/esm2015/infra/firebase/auth/types/firebase-user-with-id.type.js +0 -2
- package/esm2015/infra/firebase/firestore/index.js +0 -4
- package/esm2015/infra/firebase/firestore/mixins/index.js +0 -10
- package/esm2015/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +0 -31
- package/esm2015/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +0 -10
- package/esm2015/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +0 -18
- package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +0 -87
- package/esm2015/infra/firebase/firestore/mixins/with-firestore.mixin.js +0 -26
- package/esm2015/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +0 -24
- package/esm2015/infra/firebase/firestore/mixins/with-helpers.mixin.js +0 -17
- package/esm2015/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +0 -11
- package/esm2015/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +0 -45
- package/esm2015/infra/firebase/firestore/models/user-search.js +0 -7
- package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +0 -72
- package/esm2015/infra/firebase/firestore/repositories/catalog/index.js +0 -5
- package/esm2015/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +0 -23
- package/esm2015/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +0 -14
- package/esm2015/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/index.js +0 -5
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +0 -56
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/index.js +0 -4
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/shop-settings-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +0 -29
- package/esm2015/infra/firebase/firestore/repositories/shopping/index.js +0 -9
- package/esm2015/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +0 -9
- package/esm2015/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/users/index.js +0 -10
- package/esm2015/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +0 -14
- package/esm2015/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +0 -14
- package/esm2015/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +0 -14
- package/esm2015/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +0 -14
- package/esm2015/infra/firebase/firestore/repositories/users/user-firestore.repository.js +0 -70
- package/esm2015/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +0 -14
- package/esm2015/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +0 -12
- package/esm2015/infra/firebase/firestore/types/firestore-sub.repository.type.js +0 -2
- package/esm2015/infra/firebase/firestore/types/firestore.helpers.type.js +0 -2
- package/esm2015/infra/firebase/firestore/types/firestore.repository.type.js +0 -2
- package/esm2015/infra/firebase/firestore/types/index.js +0 -4
- package/esm2015/infra/firebase/index.js +0 -3
- package/esm2015/infra/index.js +0 -3
- package/esm2015/utils/index.js +0 -6
- package/esm2015/utils/mixins/base.mixin.js +0 -6
- package/esm2015/utils/mixins/index.js +0 -3
- package/esm2015/utils/mixins/mixin-ctor.type.js +0 -2
- package/esm2015/utils/types/index.js +0 -2
- package/esm2015/utils/types/prop.type.js +0 -2
- package/index.d.ts +0 -5
- package/infra/elasticsearch/adapters/axios.adapter.d.ts +0 -11
- package/infra/elasticsearch/adapters/elastic-search.adapter.d.ts +0 -4
- package/infra/elasticsearch/adapters/index.d.ts +0 -2
- package/infra/elasticsearch/index.d.ts +0 -3
- package/infra/elasticsearch/indexes/index.d.ts +0 -1
- package/infra/elasticsearch/indexes/products-index.d.ts +0 -11
- package/infra/elasticsearch/types/elastic-search-result.d.ts +0 -7
- package/infra/elasticsearch/types/index.d.ts +0 -1
- package/infra/firebase/auth/authentication-firebase-auth.service.d.ts +0 -12
- package/infra/firebase/auth/index.d.ts +0 -2
- package/infra/firebase/auth/register-firebase-auth.service.d.ts +0 -8
- package/infra/firebase/auth/types/firebase-user-with-id.type.d.ts +0 -3
- package/infra/firebase/firestore/index.d.ts +0 -3
- package/infra/firebase/firestore/mixins/index.d.ts +0 -9
- package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +0 -17
- package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +0 -29
- package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +0 -15
- package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +0 -20
- package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +0 -15
- package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +0 -15
- package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +0 -10
- package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +0 -14
- package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +0 -16
- package/infra/firebase/firestore/models/user-search.d.ts +0 -9
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +0 -58
- package/infra/firebase/firestore/repositories/catalog/index.d.ts +0 -4
- package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +0 -50
- package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +0 -60
- package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/index.d.ts +0 -4
- package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +0 -57
- package/infra/firebase/firestore/repositories/shop-settings/index.d.ts +0 -3
- package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/shop-settings/shop-settings-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +0 -53
- package/infra/firebase/firestore/repositories/shopping/index.d.ts +0 -8
- package/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +0 -7
- package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/users/index.d.ts +0 -9
- package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +0 -60
- package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +0 -49
- package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +0 -60
- package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +0 -60
- package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +0 -60
- package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +0 -60
- package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +0 -60
- package/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +0 -50
- package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +0 -6
- package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +0 -8
- package/infra/firebase/firestore/types/firestore.repository.type.d.ts +0 -8
- package/infra/firebase/firestore/types/index.d.ts +0 -3
- package/infra/firebase/index.d.ts +0 -2
- package/infra/index.d.ts +0 -2
- package/utils/index.d.ts +0 -6
- package/utils/mixins/base.mixin.d.ts +0 -3
- package/utils/mixins/index.d.ts +0 -2
- package/utils/mixins/mixin-ctor.type.d.ts +0 -1
- package/utils/types/index.d.ts +0 -1
- package/utils/types/prop.type.d.ts +0 -1
|
@@ -1,1798 +1,1652 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import { plainToClass, classToPlain, Expose, Type } from 'class-transformer';
|
|
3
3
|
import { __decorate, __metadata, __awaiter } from 'tslib';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { chunk, get, isDate, isEmpty, isNil, isNumber, isObject, isString, pick, set } from 'lodash';
|
|
7
|
-
import { Md5 } from 'ts-md5';
|
|
8
|
-
import axios from 'axios';
|
|
4
|
+
import { isNil, isObject, isNumber, isString, isEmpty } from 'lodash';
|
|
5
|
+
export { chunk, isEmpty, isNil, isNumber, isObject, isString, pick } from 'lodash';
|
|
9
6
|
import firebase from 'firebase';
|
|
10
7
|
import firebase$1 from 'firebase/app';
|
|
11
8
|
|
|
12
|
-
class BaseModel {
|
|
13
|
-
constructor(args) {
|
|
14
|
-
Object.assign(this, args);
|
|
15
|
-
}
|
|
16
|
-
static toInstance(data) {
|
|
17
|
-
return plainToClass(this, data);
|
|
18
|
-
}
|
|
19
|
-
toPlain() {
|
|
20
|
-
return classToPlain(this, { exposeUnsetFields: false });
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var Where;
|
|
25
|
-
(function (Where) {
|
|
26
|
-
Where["EQUALS"] = "==";
|
|
27
|
-
Where["NOTEQUALS"] = "!=";
|
|
28
|
-
Where["GT"] = ">";
|
|
29
|
-
Where["GTE"] = ">=";
|
|
30
|
-
Where["IN"] = "in";
|
|
31
|
-
Where["LT"] = "<";
|
|
32
|
-
Where["LTE"] = "<=";
|
|
33
|
-
Where["LIKE"] = "like";
|
|
9
|
+
class BaseModel {
|
|
10
|
+
constructor(args) {
|
|
11
|
+
Object.assign(this, args);
|
|
12
|
+
}
|
|
13
|
+
static toInstance(data) {
|
|
14
|
+
return plainToClass(this, data);
|
|
15
|
+
}
|
|
16
|
+
toPlain() {
|
|
17
|
+
return classToPlain(this, { exposeUnsetFields: false });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var Where;
|
|
22
|
+
(function (Where) {
|
|
23
|
+
Where["EQUALS"] = "==";
|
|
24
|
+
Where["NOTEQUALS"] = "!=";
|
|
25
|
+
Where["GT"] = ">";
|
|
26
|
+
Where["GTE"] = ">=";
|
|
27
|
+
Where["IN"] = "in";
|
|
28
|
+
Where["LT"] = "<";
|
|
29
|
+
Where["LTE"] = "<=";
|
|
30
|
+
Where["LIKE"] = "like";
|
|
34
31
|
})(Where || (Where = {}));
|
|
35
32
|
|
|
36
|
-
var UpdateOptionActions;
|
|
37
|
-
(function (UpdateOptionActions) {
|
|
38
|
-
UpdateOptionActions["UPDATE"] = "update";
|
|
39
|
-
UpdateOptionActions["MERGE"] = "merge";
|
|
40
|
-
UpdateOptionActions["REMOVE"] = "remove";
|
|
41
|
-
UpdateOptionActions["REMOVE_FIELD"] = "removeField";
|
|
42
|
-
UpdateOptionActions["NULL"] = "null";
|
|
33
|
+
var UpdateOptionActions;
|
|
34
|
+
(function (UpdateOptionActions) {
|
|
35
|
+
UpdateOptionActions["UPDATE"] = "update";
|
|
36
|
+
UpdateOptionActions["MERGE"] = "merge";
|
|
37
|
+
UpdateOptionActions["REMOVE"] = "remove";
|
|
38
|
+
UpdateOptionActions["REMOVE_FIELD"] = "removeField";
|
|
39
|
+
UpdateOptionActions["NULL"] = "null";
|
|
43
40
|
})(UpdateOptionActions || (UpdateOptionActions = {}));
|
|
44
41
|
|
|
45
|
-
var AccessoryImportances;
|
|
46
|
-
(function (AccessoryImportances) {
|
|
47
|
-
AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
48
|
-
AccessoryImportances["LIKE_RARELY_USE"] = "Gosto, mas uso poucos";
|
|
49
|
-
AccessoryImportances["LIKE_ALWAYS_FOLLOW_FASHION"] = "Gosto muito de acess\u00F3rios e sempre procuro acompanhar a moda";
|
|
42
|
+
var AccessoryImportances;
|
|
43
|
+
(function (AccessoryImportances) {
|
|
44
|
+
AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
45
|
+
AccessoryImportances["LIKE_RARELY_USE"] = "Gosto, mas uso poucos";
|
|
46
|
+
AccessoryImportances["LIKE_ALWAYS_FOLLOW_FASHION"] = "Gosto muito de acess\u00F3rios e sempre procuro acompanhar a moda";
|
|
50
47
|
})(AccessoryImportances || (AccessoryImportances = {}));
|
|
51
48
|
|
|
52
|
-
var Area;
|
|
53
|
-
(function (Area) {
|
|
54
|
-
Area["GP"] = "Geral";
|
|
55
|
-
Area["CRM"] = "CRM";
|
|
56
|
-
Area["MediaProd"] = "Media Production";
|
|
57
|
-
Area["Tech"] = "Tecnologia";
|
|
58
|
-
Area["Transactional"] = "Transacional";
|
|
59
|
-
Area["Operations"] = "Opera\u00E7\u00F5es";
|
|
60
|
-
Area["Sales"] = "Comercial";
|
|
61
|
-
Area["Finantial"] = "Financeiro";
|
|
62
|
-
Area["HR"] = "RH";
|
|
49
|
+
var Area;
|
|
50
|
+
(function (Area) {
|
|
51
|
+
Area["GP"] = "Geral";
|
|
52
|
+
Area["CRM"] = "CRM";
|
|
53
|
+
Area["MediaProd"] = "Media Production";
|
|
54
|
+
Area["Tech"] = "Tecnologia";
|
|
55
|
+
Area["Transactional"] = "Transacional";
|
|
56
|
+
Area["Operations"] = "Opera\u00E7\u00F5es";
|
|
57
|
+
Area["Sales"] = "Comercial";
|
|
58
|
+
Area["Finantial"] = "Financeiro";
|
|
59
|
+
Area["HR"] = "RH";
|
|
63
60
|
})(Area || (Area = {}));
|
|
64
61
|
|
|
65
|
-
var BeardProblems;
|
|
66
|
-
(function (BeardProblems) {
|
|
67
|
-
BeardProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
68
|
-
BeardProblems["DRY"] = "Barba Seca";
|
|
69
|
-
BeardProblems["OILY"] = "Barba Oleaosa";
|
|
70
|
-
BeardProblems["DANCRUFF"] = "Barba com Caspa";
|
|
71
|
-
BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
|
|
72
|
-
BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
|
|
73
|
-
BeardProblems["SPARSE_BEARD"] = "Barba Rala";
|
|
62
|
+
var BeardProblems;
|
|
63
|
+
(function (BeardProblems) {
|
|
64
|
+
BeardProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
65
|
+
BeardProblems["DRY"] = "Barba Seca";
|
|
66
|
+
BeardProblems["OILY"] = "Barba Oleaosa";
|
|
67
|
+
BeardProblems["DANCRUFF"] = "Barba com Caspa";
|
|
68
|
+
BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
|
|
69
|
+
BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
|
|
70
|
+
BeardProblems["SPARSE_BEARD"] = "Barba Rala";
|
|
74
71
|
})(BeardProblems || (BeardProblems = {}));
|
|
75
72
|
|
|
76
|
-
var BeardSizes;
|
|
77
|
-
(function (BeardSizes) {
|
|
78
|
-
BeardSizes["BIG"] = "Grande";
|
|
79
|
-
BeardSizes["MEDIUM"] = "M\u00E9dia";
|
|
80
|
-
BeardSizes["SHORT"] = "Curta";
|
|
81
|
-
BeardSizes["MUSTACHE"] = "Bigode";
|
|
82
|
-
BeardSizes["NOTHING"] = "Sem Barba";
|
|
73
|
+
var BeardSizes;
|
|
74
|
+
(function (BeardSizes) {
|
|
75
|
+
BeardSizes["BIG"] = "Grande";
|
|
76
|
+
BeardSizes["MEDIUM"] = "M\u00E9dia";
|
|
77
|
+
BeardSizes["SHORT"] = "Curta";
|
|
78
|
+
BeardSizes["MUSTACHE"] = "Bigode";
|
|
79
|
+
BeardSizes["NOTHING"] = "Sem Barba";
|
|
83
80
|
})(BeardSizes || (BeardSizes = {}));
|
|
84
81
|
|
|
85
|
-
var BeautyProductImportances;
|
|
86
|
-
(function (BeautyProductImportances) {
|
|
87
|
-
BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
|
|
88
|
-
BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
|
|
89
|
-
BeautyProductImportances["GOOD_CARE_MYSELF"] = "Me considero um homem que se cuida bem. Conhe\u00E7o sobre produtos especializados e me preocupo em ter uma rotina de cuidados";
|
|
90
|
-
BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
|
|
82
|
+
var BeautyProductImportances;
|
|
83
|
+
(function (BeautyProductImportances) {
|
|
84
|
+
BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
|
|
85
|
+
BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
|
|
86
|
+
BeautyProductImportances["GOOD_CARE_MYSELF"] = "Me considero um homem que se cuida bem. Conhe\u00E7o sobre produtos especializados e me preocupo em ter uma rotina de cuidados";
|
|
87
|
+
BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
|
|
91
88
|
})(BeautyProductImportances || (BeautyProductImportances = {}));
|
|
92
89
|
|
|
93
|
-
var BodyProblems;
|
|
94
|
-
(function (BodyProblems) {
|
|
95
|
-
BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
|
|
96
|
-
BodyProblems["FLACCIDITY"] = "Flacidez";
|
|
97
|
-
BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
|
|
98
|
-
BodyProblems["STRETCH_MARKS"] = "Estrias";
|
|
99
|
-
BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
|
|
100
|
-
BodyProblems["DRY_SKIN"] = "Pele Seca";
|
|
101
|
-
BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
|
|
102
|
-
BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
|
|
103
|
-
BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
|
|
90
|
+
var BodyProblems;
|
|
91
|
+
(function (BodyProblems) {
|
|
92
|
+
BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
|
|
93
|
+
BodyProblems["FLACCIDITY"] = "Flacidez";
|
|
94
|
+
BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
|
|
95
|
+
BodyProblems["STRETCH_MARKS"] = "Estrias";
|
|
96
|
+
BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
|
|
97
|
+
BodyProblems["DRY_SKIN"] = "Pele Seca";
|
|
98
|
+
BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
|
|
99
|
+
BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
|
|
100
|
+
BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
|
|
104
101
|
})(BodyProblems || (BodyProblems = {}));
|
|
105
102
|
|
|
106
|
-
var BodyShapes;
|
|
107
|
-
(function (BodyShapes) {
|
|
108
|
-
BodyShapes["LEAN"] = "Magro";
|
|
109
|
-
BodyShapes["REGULAR"] = "Regular";
|
|
110
|
-
BodyShapes["OVERWEIGHT"] = "Acima do Peso";
|
|
111
|
-
BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
|
|
112
|
-
BodyShapes["MUSCULAR"] = "Musculoso";
|
|
103
|
+
var BodyShapes;
|
|
104
|
+
(function (BodyShapes) {
|
|
105
|
+
BodyShapes["LEAN"] = "Magro";
|
|
106
|
+
BodyShapes["REGULAR"] = "Regular";
|
|
107
|
+
BodyShapes["OVERWEIGHT"] = "Acima do Peso";
|
|
108
|
+
BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
|
|
109
|
+
BodyShapes["MUSCULAR"] = "Musculoso";
|
|
113
110
|
})(BodyShapes || (BodyShapes = {}));
|
|
114
111
|
|
|
115
|
-
var BodyTattoos;
|
|
116
|
-
(function (BodyTattoos) {
|
|
117
|
-
BodyTattoos["NONE"] = "Nenhuma";
|
|
118
|
-
BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
|
|
119
|
-
BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
|
|
112
|
+
var BodyTattoos;
|
|
113
|
+
(function (BodyTattoos) {
|
|
114
|
+
BodyTattoos["NONE"] = "Nenhuma";
|
|
115
|
+
BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
|
|
116
|
+
BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
|
|
120
117
|
})(BodyTattoos || (BodyTattoos = {}));
|
|
121
118
|
|
|
122
|
-
var FaceSkinOilinesses;
|
|
123
|
-
(function (FaceSkinOilinesses) {
|
|
124
|
-
FaceSkinOilinesses["DRY"] = "Seca";
|
|
125
|
-
FaceSkinOilinesses["OILY"] = "Oleaosa";
|
|
126
|
-
FaceSkinOilinesses["MIXED"] = "Mista";
|
|
127
|
-
FaceSkinOilinesses["NORMAL"] = "Normal";
|
|
128
|
-
FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
|
|
119
|
+
var FaceSkinOilinesses;
|
|
120
|
+
(function (FaceSkinOilinesses) {
|
|
121
|
+
FaceSkinOilinesses["DRY"] = "Seca";
|
|
122
|
+
FaceSkinOilinesses["OILY"] = "Oleaosa";
|
|
123
|
+
FaceSkinOilinesses["MIXED"] = "Mista";
|
|
124
|
+
FaceSkinOilinesses["NORMAL"] = "Normal";
|
|
125
|
+
FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
|
|
129
126
|
})(FaceSkinOilinesses || (FaceSkinOilinesses = {}));
|
|
130
127
|
|
|
131
|
-
var FaceSkinProblems;
|
|
132
|
-
(function (FaceSkinProblems) {
|
|
133
|
-
FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
134
|
-
FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
|
|
135
|
-
FaceSkinProblems["WRINKLES"] = "Rugas";
|
|
136
|
-
FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
|
|
137
|
-
FaceSkinProblems["STAINS"] = "Manchas";
|
|
138
|
-
FaceSkinProblems["FRECKLES"] = "Sardas";
|
|
139
|
-
FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
|
|
140
|
-
FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
|
|
128
|
+
var FaceSkinProblems;
|
|
129
|
+
(function (FaceSkinProblems) {
|
|
130
|
+
FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
131
|
+
FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
|
|
132
|
+
FaceSkinProblems["WRINKLES"] = "Rugas";
|
|
133
|
+
FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
|
|
134
|
+
FaceSkinProblems["STAINS"] = "Manchas";
|
|
135
|
+
FaceSkinProblems["FRECKLES"] = "Sardas";
|
|
136
|
+
FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
|
|
137
|
+
FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
|
|
141
138
|
})(FaceSkinProblems || (FaceSkinProblems = {}));
|
|
142
139
|
|
|
143
|
-
var FaceSkinTones;
|
|
144
|
-
(function (FaceSkinTones) {
|
|
145
|
-
FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
|
|
146
|
-
FaceSkinTones["CLEAR"] = "Clara";
|
|
147
|
-
FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
|
|
148
|
-
FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
|
|
149
|
-
FaceSkinTones["DARK"] = "Escura";
|
|
150
|
-
FaceSkinTones["VERY_DARK"] = "Muito Escura";
|
|
140
|
+
var FaceSkinTones;
|
|
141
|
+
(function (FaceSkinTones) {
|
|
142
|
+
FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
|
|
143
|
+
FaceSkinTones["CLEAR"] = "Clara";
|
|
144
|
+
FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
|
|
145
|
+
FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
|
|
146
|
+
FaceSkinTones["DARK"] = "Escura";
|
|
147
|
+
FaceSkinTones["VERY_DARK"] = "Muito Escura";
|
|
151
148
|
})(FaceSkinTones || (FaceSkinTones = {}));
|
|
152
149
|
|
|
153
|
-
var FamilyIncomes;
|
|
154
|
-
(function (FamilyIncomes) {
|
|
155
|
-
FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
|
|
156
|
-
FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
|
|
157
|
-
FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
|
|
158
|
-
FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
|
|
159
|
-
FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
|
|
160
|
-
FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
|
|
150
|
+
var FamilyIncomes;
|
|
151
|
+
(function (FamilyIncomes) {
|
|
152
|
+
FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
|
|
153
|
+
FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
|
|
154
|
+
FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
|
|
155
|
+
FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
|
|
156
|
+
FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
|
|
157
|
+
FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
|
|
161
158
|
})(FamilyIncomes || (FamilyIncomes = {}));
|
|
162
159
|
|
|
163
|
-
var FragranceImportances;
|
|
164
|
-
(function (FragranceImportances) {
|
|
165
|
-
FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
166
|
-
FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
|
|
167
|
-
FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
|
|
160
|
+
var FragranceImportances;
|
|
161
|
+
(function (FragranceImportances) {
|
|
162
|
+
FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
163
|
+
FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
|
|
164
|
+
FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
|
|
168
165
|
})(FragranceImportances || (FragranceImportances = {}));
|
|
169
166
|
|
|
170
|
-
var HairColors;
|
|
171
|
-
(function (HairColors) {
|
|
172
|
-
HairColors["BLACK"] = "Preto";
|
|
173
|
-
HairColors["DARK_BROWN"] = "Castanho Escuro";
|
|
174
|
-
HairColors["LIGHT_BROWN"] = "Castanho Claro";
|
|
175
|
-
HairColors["DARK_BLONDE"] = "Loiro Escuro";
|
|
176
|
-
HairColors["LIGHT_BLONDE"] = "Loiro Claro";
|
|
177
|
-
HairColors["WHITE_GRAY"] = "Branco/Grisalho";
|
|
178
|
-
HairColors["REDHEAD"] = "Ruivo";
|
|
179
|
-
HairColors["OTHER"] = "RuiOutroo";
|
|
167
|
+
var HairColors;
|
|
168
|
+
(function (HairColors) {
|
|
169
|
+
HairColors["BLACK"] = "Preto";
|
|
170
|
+
HairColors["DARK_BROWN"] = "Castanho Escuro";
|
|
171
|
+
HairColors["LIGHT_BROWN"] = "Castanho Claro";
|
|
172
|
+
HairColors["DARK_BLONDE"] = "Loiro Escuro";
|
|
173
|
+
HairColors["LIGHT_BLONDE"] = "Loiro Claro";
|
|
174
|
+
HairColors["WHITE_GRAY"] = "Branco/Grisalho";
|
|
175
|
+
HairColors["REDHEAD"] = "Ruivo";
|
|
176
|
+
HairColors["OTHER"] = "RuiOutroo";
|
|
180
177
|
})(HairColors || (HairColors = {}));
|
|
181
178
|
|
|
182
|
-
var HairProblems;
|
|
183
|
-
(function (HairProblems) {
|
|
184
|
-
HairProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
185
|
-
HairProblems["DANCRUFF"] = "Caspa";
|
|
186
|
-
HairProblems["LOSS"] = "Queda";
|
|
187
|
-
HairProblems["OILY"] = "Oleosidade";
|
|
188
|
-
HairProblems["DRYNESS"] = "Ressecamento";
|
|
189
|
-
HairProblems["CHEMICAL"] = "Quimica";
|
|
190
|
-
HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
|
|
191
|
-
HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
|
|
179
|
+
var HairProblems;
|
|
180
|
+
(function (HairProblems) {
|
|
181
|
+
HairProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
182
|
+
HairProblems["DANCRUFF"] = "Caspa";
|
|
183
|
+
HairProblems["LOSS"] = "Queda";
|
|
184
|
+
HairProblems["OILY"] = "Oleosidade";
|
|
185
|
+
HairProblems["DRYNESS"] = "Ressecamento";
|
|
186
|
+
HairProblems["CHEMICAL"] = "Quimica";
|
|
187
|
+
HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
|
|
188
|
+
HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
|
|
192
189
|
})(HairProblems || (HairProblems = {}));
|
|
193
190
|
|
|
194
|
-
var HairStrands;
|
|
195
|
-
(function (HairStrands) {
|
|
196
|
-
HairStrands["NORMAL"] = "Fio Normal";
|
|
197
|
-
HairStrands["DRY"] = "Fio Seco";
|
|
198
|
-
HairStrands["OILY"] = "Fio Oleoso";
|
|
199
|
-
HairStrands["MIXED"] = "Fio Misto";
|
|
200
|
-
HairStrands["FINE"] = "Fio Fino";
|
|
201
|
-
HairStrands["THICK"] = "Fio Grosso";
|
|
191
|
+
var HairStrands;
|
|
192
|
+
(function (HairStrands) {
|
|
193
|
+
HairStrands["NORMAL"] = "Fio Normal";
|
|
194
|
+
HairStrands["DRY"] = "Fio Seco";
|
|
195
|
+
HairStrands["OILY"] = "Fio Oleoso";
|
|
196
|
+
HairStrands["MIXED"] = "Fio Misto";
|
|
197
|
+
HairStrands["FINE"] = "Fio Fino";
|
|
198
|
+
HairStrands["THICK"] = "Fio Grosso";
|
|
202
199
|
})(HairStrands || (HairStrands = {}));
|
|
203
200
|
|
|
204
|
-
var HairTypes;
|
|
205
|
-
(function (HairTypes) {
|
|
206
|
-
HairTypes["Smooth"] = "Liso";
|
|
207
|
-
HairTypes["WAVY"] = "Ondulado";
|
|
208
|
-
HairTypes["CURLY"] = "Cacheado";
|
|
209
|
-
HairTypes["FRIZZY"] = "Crespo";
|
|
210
|
-
HairTypes["BALD"] = "Sou careca";
|
|
201
|
+
var HairTypes;
|
|
202
|
+
(function (HairTypes) {
|
|
203
|
+
HairTypes["Smooth"] = "Liso";
|
|
204
|
+
HairTypes["WAVY"] = "Ondulado";
|
|
205
|
+
HairTypes["CURLY"] = "Cacheado";
|
|
206
|
+
HairTypes["FRIZZY"] = "Crespo";
|
|
207
|
+
HairTypes["BALD"] = "Sou careca";
|
|
211
208
|
})(HairTypes || (HairTypes = {}));
|
|
212
209
|
|
|
213
|
-
var OfficePosition;
|
|
214
|
-
(function (OfficePosition) {
|
|
215
|
-
OfficePosition["Intern"] = "Estagi\u00E1rio";
|
|
216
|
-
OfficePosition["Analyst"] = "Analista";
|
|
217
|
-
OfficePosition["Manager"] = "Gerente";
|
|
218
|
-
OfficePosition["Director"] = "Diretor";
|
|
210
|
+
var OfficePosition;
|
|
211
|
+
(function (OfficePosition) {
|
|
212
|
+
OfficePosition["Intern"] = "Estagi\u00E1rio";
|
|
213
|
+
OfficePosition["Analyst"] = "Analista";
|
|
214
|
+
OfficePosition["Manager"] = "Gerente";
|
|
215
|
+
OfficePosition["Director"] = "Diretor";
|
|
219
216
|
})(OfficePosition || (OfficePosition = {}));
|
|
220
217
|
|
|
221
|
-
var ProductSpents;
|
|
222
|
-
(function (ProductSpents) {
|
|
223
|
-
ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
|
|
224
|
-
ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
|
|
225
|
-
ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
|
|
226
|
-
ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
|
|
227
|
-
ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
|
|
228
|
-
ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
|
|
218
|
+
var ProductSpents;
|
|
219
|
+
(function (ProductSpents) {
|
|
220
|
+
ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
|
|
221
|
+
ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
|
|
222
|
+
ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
|
|
223
|
+
ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
|
|
224
|
+
ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
|
|
225
|
+
ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
|
|
229
226
|
})(ProductSpents || (ProductSpents = {}));
|
|
230
227
|
|
|
231
|
-
var UserType;
|
|
232
|
-
(function (UserType) {
|
|
233
|
-
UserType["B2C"] = "Cliente Transacional";
|
|
234
|
-
UserType["GlamGirl"] = "Glamgirl";
|
|
235
|
-
UserType["MensBoy"] = "Mensboy";
|
|
236
|
-
UserType["B2B"] = "Company";
|
|
237
|
-
UserType["Collaborator"] = "Funcion\u00E1rio";
|
|
238
|
-
UserType["Influencer"] = "Influencer";
|
|
228
|
+
var UserType;
|
|
229
|
+
(function (UserType) {
|
|
230
|
+
UserType["B2C"] = "Cliente Transacional";
|
|
231
|
+
UserType["GlamGirl"] = "Glamgirl";
|
|
232
|
+
UserType["MensBoy"] = "Mensboy";
|
|
233
|
+
UserType["B2B"] = "Company";
|
|
234
|
+
UserType["Collaborator"] = "Funcion\u00E1rio";
|
|
235
|
+
UserType["Influencer"] = "Influencer";
|
|
239
236
|
})(UserType || (UserType = {}));
|
|
240
237
|
|
|
241
|
-
var BillingStatus;
|
|
242
|
-
(function (BillingStatus) {
|
|
243
|
-
BillingStatus["PAYED"] = "PAGO";
|
|
238
|
+
var BillingStatus;
|
|
239
|
+
(function (BillingStatus) {
|
|
240
|
+
BillingStatus["PAYED"] = "PAGO";
|
|
244
241
|
})(BillingStatus || (BillingStatus = {}));
|
|
245
242
|
|
|
246
|
-
var EditionStatus;
|
|
247
|
-
(function (EditionStatus) {
|
|
248
|
-
EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
|
|
249
|
-
EditionStatus["SHIPPED"] = "Enviado";
|
|
243
|
+
var EditionStatus;
|
|
244
|
+
(function (EditionStatus) {
|
|
245
|
+
EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
|
|
246
|
+
EditionStatus["SHIPPED"] = "Enviado";
|
|
250
247
|
})(EditionStatus || (EditionStatus = {}));
|
|
251
248
|
|
|
252
|
-
var PaymentType;
|
|
253
|
-
(function (PaymentType) {
|
|
254
|
-
PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
|
|
255
|
-
PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
|
|
256
|
-
PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
|
|
249
|
+
var PaymentType;
|
|
250
|
+
(function (PaymentType) {
|
|
251
|
+
PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
|
|
252
|
+
PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
|
|
253
|
+
PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
|
|
257
254
|
})(PaymentType || (PaymentType = {}));
|
|
258
255
|
|
|
259
|
-
var Status;
|
|
260
|
-
(function (Status) {
|
|
261
|
-
Status["ACTIVE"] = "active";
|
|
262
|
-
Status["CANCELLED"] = "Cancelado";
|
|
256
|
+
var Status;
|
|
257
|
+
(function (Status) {
|
|
258
|
+
Status["ACTIVE"] = "active";
|
|
259
|
+
Status["CANCELLED"] = "Cancelado";
|
|
263
260
|
})(Status || (Status = {}));
|
|
264
261
|
|
|
265
|
-
class Edition extends BaseModel {
|
|
266
|
-
identifierFields() {
|
|
267
|
-
return ['id'];
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
class Payment extends BaseModel {
|
|
272
|
-
identifierFields() {
|
|
273
|
-
return ['id'];
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
__decorate([
|
|
277
|
-
Expose({ name: 'refuse_reason' }),
|
|
278
|
-
__metadata("design:type", String)
|
|
279
|
-
], Payment.prototype, "refuseReason", void 0);
|
|
280
|
-
__decorate([
|
|
281
|
-
Expose({ name: 'status_reason' }),
|
|
282
|
-
__metadata("design:type", String)
|
|
283
|
-
], Payment.prototype, "statusReason", void 0);
|
|
284
|
-
__decorate([
|
|
285
|
-
Expose({ name: 'acquirer_response_code' }),
|
|
286
|
-
__metadata("design:type", String)
|
|
287
|
-
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
288
|
-
__decorate([
|
|
289
|
-
Expose({ name: 'acquirer_name' }),
|
|
290
|
-
__metadata("design:type", String)
|
|
291
|
-
], Payment.prototype, "acquirerName", void 0);
|
|
292
|
-
__decorate([
|
|
293
|
-
Expose({ name: 'acquirer_id' }),
|
|
294
|
-
__metadata("design:type", String)
|
|
295
|
-
], Payment.prototype, "acquirerId", void 0);
|
|
296
|
-
__decorate([
|
|
297
|
-
Expose({ name: 'authorization_code' }),
|
|
298
|
-
__metadata("design:type", String)
|
|
299
|
-
], Payment.prototype, "authorizationCode", void 0);
|
|
300
|
-
__decorate([
|
|
301
|
-
Expose({ name: 'soft_descriptor' }),
|
|
302
|
-
__metadata("design:type", String)
|
|
303
|
-
], Payment.prototype, "softDescriptor", void 0);
|
|
304
|
-
__decorate([
|
|
305
|
-
Expose({ name: 'date_created' }),
|
|
306
|
-
__metadata("design:type", String)
|
|
307
|
-
], Payment.prototype, "dateCreated", void 0);
|
|
308
|
-
__decorate([
|
|
309
|
-
Expose({ name: 'date_updated' }),
|
|
310
|
-
__metadata("design:type", String)
|
|
311
|
-
], Payment.prototype, "dateUpdated", void 0);
|
|
312
|
-
__decorate([
|
|
313
|
-
Expose({ name: 'authorized_amount' }),
|
|
314
|
-
__metadata("design:type", Number)
|
|
315
|
-
], Payment.prototype, "authorizedAmount", void 0);
|
|
316
|
-
__decorate([
|
|
317
|
-
Expose({ name: 'paid_amount' }),
|
|
318
|
-
__metadata("design:type", Number)
|
|
319
|
-
], Payment.prototype, "paidAmount", void 0);
|
|
320
|
-
__decorate([
|
|
321
|
-
Expose({ name: 'refunded_amount' }),
|
|
322
|
-
__metadata("design:type", Number)
|
|
323
|
-
], Payment.prototype, "refundedAmount", void 0);
|
|
324
|
-
__decorate([
|
|
325
|
-
Expose({ name: 'card_holder_name' }),
|
|
326
|
-
__metadata("design:type", String)
|
|
327
|
-
], Payment.prototype, "cardHolderName", void 0);
|
|
328
|
-
__decorate([
|
|
329
|
-
Expose({ name: 'card_last_digits' }),
|
|
330
|
-
__metadata("design:type", String)
|
|
331
|
-
], Payment.prototype, "cardLastDigits", void 0);
|
|
332
|
-
__decorate([
|
|
333
|
-
Expose({ name: 'card_first_digits' }),
|
|
334
|
-
__metadata("design:type", String)
|
|
335
|
-
], Payment.prototype, "cardFirstDigits", void 0);
|
|
336
|
-
__decorate([
|
|
337
|
-
Expose({ name: 'card_brand' }),
|
|
338
|
-
__metadata("design:type", String)
|
|
339
|
-
], Payment.prototype, "cardBrand", void 0);
|
|
340
|
-
__decorate([
|
|
341
|
-
Expose({ name: 'card_pin_mode' }),
|
|
342
|
-
__metadata("design:type", String)
|
|
343
|
-
], Payment.prototype, "cardPinMode", void 0);
|
|
344
|
-
__decorate([
|
|
345
|
-
Expose({ name: 'card_magstripe_fallback' }),
|
|
346
|
-
__metadata("design:type", Boolean)
|
|
347
|
-
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
348
|
-
__decorate([
|
|
349
|
-
Expose({ name: 'cvm_pin' }),
|
|
350
|
-
__metadata("design:type", Boolean)
|
|
351
|
-
], Payment.prototype, "cvmPin", void 0);
|
|
352
|
-
__decorate([
|
|
353
|
-
Expose({ name: 'postback_url' }),
|
|
354
|
-
__metadata("design:type", String)
|
|
355
|
-
], Payment.prototype, "postbackUrl", void 0);
|
|
356
|
-
__decorate([
|
|
357
|
-
Expose({ name: 'payment_method' }),
|
|
358
|
-
__metadata("design:type", String)
|
|
359
|
-
], Payment.prototype, "paymentMethod", void 0);
|
|
360
|
-
__decorate([
|
|
361
|
-
Expose({ name: 'capture_method' }),
|
|
362
|
-
__metadata("design:type", String)
|
|
363
|
-
], Payment.prototype, "captureMethod", void 0);
|
|
364
|
-
__decorate([
|
|
365
|
-
Expose({ name: 'antifraud_score' }),
|
|
366
|
-
__metadata("design:type", String)
|
|
367
|
-
], Payment.prototype, "antifraudScore", void 0);
|
|
368
|
-
__decorate([
|
|
369
|
-
Expose({ name: 'boleto_url' }),
|
|
370
|
-
__metadata("design:type", String)
|
|
371
|
-
], Payment.prototype, "boletoUrl", void 0);
|
|
372
|
-
__decorate([
|
|
373
|
-
Expose({ name: 'boleto_barcode' }),
|
|
374
|
-
__metadata("design:type", String)
|
|
375
|
-
], Payment.prototype, "boletoBarcode", void 0);
|
|
376
|
-
__decorate([
|
|
377
|
-
Expose({ name: 'boleto_expiration_date' }),
|
|
378
|
-
__metadata("design:type", String)
|
|
379
|
-
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
380
|
-
__decorate([
|
|
381
|
-
Expose({ name: 'subscription_id' }),
|
|
382
|
-
__metadata("design:type", String)
|
|
383
|
-
], Payment.prototype, "subscriptionId", void 0);
|
|
384
|
-
__decorate([
|
|
385
|
-
Expose({ name: 'split_rules' }),
|
|
386
|
-
__metadata("design:type", String)
|
|
387
|
-
], Payment.prototype, "splitRules", void 0);
|
|
388
|
-
__decorate([
|
|
389
|
-
Expose({ name: 'antifraud_metadata' }),
|
|
390
|
-
__metadata("design:type", Object)
|
|
391
|
-
], Payment.prototype, "antifraudMetadata", void 0);
|
|
392
|
-
__decorate([
|
|
393
|
-
Expose({ name: 'reference_key' }),
|
|
394
|
-
__metadata("design:type", String)
|
|
395
|
-
], Payment.prototype, "referenceKey", void 0);
|
|
396
|
-
__decorate([
|
|
397
|
-
Expose({ name: 'local_transaction_id' }),
|
|
398
|
-
__metadata("design:type", String)
|
|
399
|
-
], Payment.prototype, "localTransactionId", void 0);
|
|
400
|
-
__decorate([
|
|
401
|
-
Expose({ name: 'local_time' }),
|
|
402
|
-
__metadata("design:type", String)
|
|
403
|
-
], Payment.prototype, "localTime", void 0);
|
|
404
|
-
__decorate([
|
|
405
|
-
Expose({ name: 'fraud_covered' }),
|
|
406
|
-
__metadata("design:type", Boolean)
|
|
407
|
-
], Payment.prototype, "fraudCovered", void 0);
|
|
408
|
-
__decorate([
|
|
409
|
-
Expose({ name: 'fraud_reimbursed' }),
|
|
410
|
-
__metadata("design:type", String)
|
|
411
|
-
], Payment.prototype, "fraudReimbursed", void 0);
|
|
412
|
-
__decorate([
|
|
413
|
-
Expose({ name: 'order_id' }),
|
|
414
|
-
__metadata("design:type", String)
|
|
415
|
-
], Payment.prototype, "orderId", void 0);
|
|
416
|
-
__decorate([
|
|
417
|
-
Expose({ name: 'risk_level' }),
|
|
418
|
-
__metadata("design:type", String)
|
|
419
|
-
], Payment.prototype, "riskLevel", void 0);
|
|
420
|
-
__decorate([
|
|
421
|
-
Expose({ name: 'receipt_url' }),
|
|
422
|
-
__metadata("design:type", String)
|
|
423
|
-
], Payment.prototype, "receiptUrl", void 0);
|
|
424
|
-
__decorate([
|
|
425
|
-
Expose({ name: 'private_label' }),
|
|
426
|
-
__metadata("design:type", String)
|
|
427
|
-
], Payment.prototype, "privateLabel", void 0);
|
|
428
|
-
__decorate([
|
|
429
|
-
Expose({ name: 'pix_qr_code' }),
|
|
430
|
-
__metadata("design:type", String)
|
|
431
|
-
], Payment.prototype, "pixQrCode", void 0);
|
|
432
|
-
__decorate([
|
|
433
|
-
Expose({ name: 'pix_expiration_date' }),
|
|
434
|
-
__metadata("design:type", String)
|
|
262
|
+
class Edition extends BaseModel {
|
|
263
|
+
identifierFields() {
|
|
264
|
+
return ['id'];
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
class Payment extends BaseModel {
|
|
269
|
+
identifierFields() {
|
|
270
|
+
return ['id'];
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
__decorate([
|
|
274
|
+
Expose({ name: 'refuse_reason' }),
|
|
275
|
+
__metadata("design:type", String)
|
|
276
|
+
], Payment.prototype, "refuseReason", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
Expose({ name: 'status_reason' }),
|
|
279
|
+
__metadata("design:type", String)
|
|
280
|
+
], Payment.prototype, "statusReason", void 0);
|
|
281
|
+
__decorate([
|
|
282
|
+
Expose({ name: 'acquirer_response_code' }),
|
|
283
|
+
__metadata("design:type", String)
|
|
284
|
+
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
285
|
+
__decorate([
|
|
286
|
+
Expose({ name: 'acquirer_name' }),
|
|
287
|
+
__metadata("design:type", String)
|
|
288
|
+
], Payment.prototype, "acquirerName", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
Expose({ name: 'acquirer_id' }),
|
|
291
|
+
__metadata("design:type", String)
|
|
292
|
+
], Payment.prototype, "acquirerId", void 0);
|
|
293
|
+
__decorate([
|
|
294
|
+
Expose({ name: 'authorization_code' }),
|
|
295
|
+
__metadata("design:type", String)
|
|
296
|
+
], Payment.prototype, "authorizationCode", void 0);
|
|
297
|
+
__decorate([
|
|
298
|
+
Expose({ name: 'soft_descriptor' }),
|
|
299
|
+
__metadata("design:type", String)
|
|
300
|
+
], Payment.prototype, "softDescriptor", void 0);
|
|
301
|
+
__decorate([
|
|
302
|
+
Expose({ name: 'date_created' }),
|
|
303
|
+
__metadata("design:type", String)
|
|
304
|
+
], Payment.prototype, "dateCreated", void 0);
|
|
305
|
+
__decorate([
|
|
306
|
+
Expose({ name: 'date_updated' }),
|
|
307
|
+
__metadata("design:type", String)
|
|
308
|
+
], Payment.prototype, "dateUpdated", void 0);
|
|
309
|
+
__decorate([
|
|
310
|
+
Expose({ name: 'authorized_amount' }),
|
|
311
|
+
__metadata("design:type", Number)
|
|
312
|
+
], Payment.prototype, "authorizedAmount", void 0);
|
|
313
|
+
__decorate([
|
|
314
|
+
Expose({ name: 'paid_amount' }),
|
|
315
|
+
__metadata("design:type", Number)
|
|
316
|
+
], Payment.prototype, "paidAmount", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
Expose({ name: 'refunded_amount' }),
|
|
319
|
+
__metadata("design:type", Number)
|
|
320
|
+
], Payment.prototype, "refundedAmount", void 0);
|
|
321
|
+
__decorate([
|
|
322
|
+
Expose({ name: 'card_holder_name' }),
|
|
323
|
+
__metadata("design:type", String)
|
|
324
|
+
], Payment.prototype, "cardHolderName", void 0);
|
|
325
|
+
__decorate([
|
|
326
|
+
Expose({ name: 'card_last_digits' }),
|
|
327
|
+
__metadata("design:type", String)
|
|
328
|
+
], Payment.prototype, "cardLastDigits", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
Expose({ name: 'card_first_digits' }),
|
|
331
|
+
__metadata("design:type", String)
|
|
332
|
+
], Payment.prototype, "cardFirstDigits", void 0);
|
|
333
|
+
__decorate([
|
|
334
|
+
Expose({ name: 'card_brand' }),
|
|
335
|
+
__metadata("design:type", String)
|
|
336
|
+
], Payment.prototype, "cardBrand", void 0);
|
|
337
|
+
__decorate([
|
|
338
|
+
Expose({ name: 'card_pin_mode' }),
|
|
339
|
+
__metadata("design:type", String)
|
|
340
|
+
], Payment.prototype, "cardPinMode", void 0);
|
|
341
|
+
__decorate([
|
|
342
|
+
Expose({ name: 'card_magstripe_fallback' }),
|
|
343
|
+
__metadata("design:type", Boolean)
|
|
344
|
+
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
345
|
+
__decorate([
|
|
346
|
+
Expose({ name: 'cvm_pin' }),
|
|
347
|
+
__metadata("design:type", Boolean)
|
|
348
|
+
], Payment.prototype, "cvmPin", void 0);
|
|
349
|
+
__decorate([
|
|
350
|
+
Expose({ name: 'postback_url' }),
|
|
351
|
+
__metadata("design:type", String)
|
|
352
|
+
], Payment.prototype, "postbackUrl", void 0);
|
|
353
|
+
__decorate([
|
|
354
|
+
Expose({ name: 'payment_method' }),
|
|
355
|
+
__metadata("design:type", String)
|
|
356
|
+
], Payment.prototype, "paymentMethod", void 0);
|
|
357
|
+
__decorate([
|
|
358
|
+
Expose({ name: 'capture_method' }),
|
|
359
|
+
__metadata("design:type", String)
|
|
360
|
+
], Payment.prototype, "captureMethod", void 0);
|
|
361
|
+
__decorate([
|
|
362
|
+
Expose({ name: 'antifraud_score' }),
|
|
363
|
+
__metadata("design:type", String)
|
|
364
|
+
], Payment.prototype, "antifraudScore", void 0);
|
|
365
|
+
__decorate([
|
|
366
|
+
Expose({ name: 'boleto_url' }),
|
|
367
|
+
__metadata("design:type", String)
|
|
368
|
+
], Payment.prototype, "boletoUrl", void 0);
|
|
369
|
+
__decorate([
|
|
370
|
+
Expose({ name: 'boleto_barcode' }),
|
|
371
|
+
__metadata("design:type", String)
|
|
372
|
+
], Payment.prototype, "boletoBarcode", void 0);
|
|
373
|
+
__decorate([
|
|
374
|
+
Expose({ name: 'boleto_expiration_date' }),
|
|
375
|
+
__metadata("design:type", String)
|
|
376
|
+
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
377
|
+
__decorate([
|
|
378
|
+
Expose({ name: 'subscription_id' }),
|
|
379
|
+
__metadata("design:type", String)
|
|
380
|
+
], Payment.prototype, "subscriptionId", void 0);
|
|
381
|
+
__decorate([
|
|
382
|
+
Expose({ name: 'split_rules' }),
|
|
383
|
+
__metadata("design:type", String)
|
|
384
|
+
], Payment.prototype, "splitRules", void 0);
|
|
385
|
+
__decorate([
|
|
386
|
+
Expose({ name: 'antifraud_metadata' }),
|
|
387
|
+
__metadata("design:type", Object)
|
|
388
|
+
], Payment.prototype, "antifraudMetadata", void 0);
|
|
389
|
+
__decorate([
|
|
390
|
+
Expose({ name: 'reference_key' }),
|
|
391
|
+
__metadata("design:type", String)
|
|
392
|
+
], Payment.prototype, "referenceKey", void 0);
|
|
393
|
+
__decorate([
|
|
394
|
+
Expose({ name: 'local_transaction_id' }),
|
|
395
|
+
__metadata("design:type", String)
|
|
396
|
+
], Payment.prototype, "localTransactionId", void 0);
|
|
397
|
+
__decorate([
|
|
398
|
+
Expose({ name: 'local_time' }),
|
|
399
|
+
__metadata("design:type", String)
|
|
400
|
+
], Payment.prototype, "localTime", void 0);
|
|
401
|
+
__decorate([
|
|
402
|
+
Expose({ name: 'fraud_covered' }),
|
|
403
|
+
__metadata("design:type", Boolean)
|
|
404
|
+
], Payment.prototype, "fraudCovered", void 0);
|
|
405
|
+
__decorate([
|
|
406
|
+
Expose({ name: 'fraud_reimbursed' }),
|
|
407
|
+
__metadata("design:type", String)
|
|
408
|
+
], Payment.prototype, "fraudReimbursed", void 0);
|
|
409
|
+
__decorate([
|
|
410
|
+
Expose({ name: 'order_id' }),
|
|
411
|
+
__metadata("design:type", String)
|
|
412
|
+
], Payment.prototype, "orderId", void 0);
|
|
413
|
+
__decorate([
|
|
414
|
+
Expose({ name: 'risk_level' }),
|
|
415
|
+
__metadata("design:type", String)
|
|
416
|
+
], Payment.prototype, "riskLevel", void 0);
|
|
417
|
+
__decorate([
|
|
418
|
+
Expose({ name: 'receipt_url' }),
|
|
419
|
+
__metadata("design:type", String)
|
|
420
|
+
], Payment.prototype, "receiptUrl", void 0);
|
|
421
|
+
__decorate([
|
|
422
|
+
Expose({ name: 'private_label' }),
|
|
423
|
+
__metadata("design:type", String)
|
|
424
|
+
], Payment.prototype, "privateLabel", void 0);
|
|
425
|
+
__decorate([
|
|
426
|
+
Expose({ name: 'pix_qr_code' }),
|
|
427
|
+
__metadata("design:type", String)
|
|
428
|
+
], Payment.prototype, "pixQrCode", void 0);
|
|
429
|
+
__decorate([
|
|
430
|
+
Expose({ name: 'pix_expiration_date' }),
|
|
431
|
+
__metadata("design:type", String)
|
|
435
432
|
], Payment.prototype, "pixExpirationDate", void 0);
|
|
436
433
|
|
|
437
|
-
class SubscriptionPayment extends BaseModel {
|
|
438
|
-
identifierFields() {
|
|
439
|
-
return ['id'];
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
__decorate([
|
|
443
|
-
Type(() => Payment),
|
|
444
|
-
__metadata("design:type", Payment)
|
|
434
|
+
class SubscriptionPayment extends BaseModel {
|
|
435
|
+
identifierFields() {
|
|
436
|
+
return ['id'];
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
__decorate([
|
|
440
|
+
Type(() => Payment),
|
|
441
|
+
__metadata("design:type", Payment)
|
|
445
442
|
], SubscriptionPayment.prototype, "payment", void 0);
|
|
446
443
|
|
|
447
|
-
class Address extends BaseModel {
|
|
444
|
+
class Address extends BaseModel {
|
|
448
445
|
}
|
|
449
446
|
|
|
450
|
-
var CheckoutTypes;
|
|
451
|
-
(function (CheckoutTypes) {
|
|
452
|
-
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
453
|
-
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
447
|
+
var CheckoutTypes;
|
|
448
|
+
(function (CheckoutTypes) {
|
|
449
|
+
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
450
|
+
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
454
451
|
})(CheckoutTypes || (CheckoutTypes = {}));
|
|
455
452
|
|
|
456
|
-
class Base {
|
|
457
|
-
constructor(...args) {
|
|
458
|
-
Object.assign(this, ...args);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
var
|
|
463
|
-
(function (
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
})(CouponSubtypes || (CouponSubtypes = {}));
|
|
475
|
-
|
|
476
|
-
var Exclusivities;
|
|
477
|
-
(function (Exclusivities) {
|
|
478
|
-
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
479
|
-
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
480
|
-
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
453
|
+
class Base {
|
|
454
|
+
constructor(...args) {
|
|
455
|
+
Object.assign(this, ...args);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
var DiscountType;
|
|
460
|
+
(function (DiscountType) {
|
|
461
|
+
DiscountType[DiscountType["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
462
|
+
DiscountType[DiscountType["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
463
|
+
DiscountType[DiscountType["FREE_SHIPPING"] = 3] = "FREE_SHIPPING";
|
|
464
|
+
})(DiscountType || (DiscountType = {}));
|
|
465
|
+
|
|
466
|
+
var Exclusivities;
|
|
467
|
+
(function (Exclusivities) {
|
|
468
|
+
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
469
|
+
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
470
|
+
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
481
471
|
})(Exclusivities || (Exclusivities = {}));
|
|
482
472
|
|
|
483
|
-
class Coupon extends BaseModel {
|
|
484
|
-
get isInfluencer() {
|
|
485
|
-
return !isNil(this.influencerEmail);
|
|
486
|
-
}
|
|
487
|
-
identifierFields() {
|
|
488
|
-
return ['id'];
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
__decorate([
|
|
492
|
-
Expose({ name: 'checkout_type' }),
|
|
493
|
-
__metadata("design:type", Number)
|
|
494
|
-
], Coupon.prototype, "checkoutType", void 0);
|
|
495
|
-
__decorate([
|
|
496
|
-
Expose({ name: 'exclusivity_type' }),
|
|
497
|
-
__metadata("design:type", Number)
|
|
473
|
+
class Coupon extends BaseModel {
|
|
474
|
+
get isInfluencer() {
|
|
475
|
+
return !isNil(this.influencerEmail);
|
|
476
|
+
}
|
|
477
|
+
identifierFields() {
|
|
478
|
+
return ['id'];
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
__decorate([
|
|
482
|
+
Expose({ name: 'checkout_type' }),
|
|
483
|
+
__metadata("design:type", Number)
|
|
484
|
+
], Coupon.prototype, "checkoutType", void 0);
|
|
485
|
+
__decorate([
|
|
486
|
+
Expose({ name: 'exclusivity_type' }),
|
|
487
|
+
__metadata("design:type", Number)
|
|
498
488
|
], Coupon.prototype, "exclusivityType", void 0);
|
|
499
489
|
|
|
500
|
-
class SubscriptionPlan extends BaseModel {
|
|
501
|
-
identifierFields() {
|
|
502
|
-
return ['id'];
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
class BeautyProfile extends BaseModel {
|
|
507
|
-
toPlain() {
|
|
508
|
-
const plain = super.toPlain();
|
|
509
|
-
delete plain.id;
|
|
510
|
-
return plain;
|
|
511
|
-
}
|
|
512
|
-
identifierFields() {
|
|
513
|
-
return ['id'];
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
class User extends BaseModel {
|
|
518
|
-
static toInstance(data) {
|
|
519
|
-
const instance = super.toInstance(data);
|
|
520
|
-
if (!isNil(data.firstName))
|
|
521
|
-
instance.displayName = `${data.firstName}${!isNil(data.lastName) ? ` ${data.lastName}` : ''}`;
|
|
522
|
-
return instance;
|
|
523
|
-
}
|
|
524
|
-
identifierFields() {
|
|
525
|
-
return ['id'];
|
|
526
|
-
}
|
|
527
|
-
toPlain() {
|
|
528
|
-
const plain = super.toPlain();
|
|
529
|
-
delete plain.beautyProfile;
|
|
530
|
-
return plain;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
__decorate([
|
|
534
|
-
Type(() => BeautyProfile),
|
|
535
|
-
__metadata("design:type", BeautyProfile)
|
|
490
|
+
class SubscriptionPlan extends BaseModel {
|
|
491
|
+
identifierFields() {
|
|
492
|
+
return ['id'];
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
class BeautyProfile extends BaseModel {
|
|
497
|
+
toPlain() {
|
|
498
|
+
const plain = super.toPlain();
|
|
499
|
+
delete plain.id;
|
|
500
|
+
return plain;
|
|
501
|
+
}
|
|
502
|
+
identifierFields() {
|
|
503
|
+
return ['id'];
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
class User extends BaseModel {
|
|
508
|
+
static toInstance(data) {
|
|
509
|
+
const instance = super.toInstance(data);
|
|
510
|
+
if (!isNil(data.firstName))
|
|
511
|
+
instance.displayName = `${data.firstName}${!isNil(data.lastName) ? ` ${data.lastName}` : ''}`;
|
|
512
|
+
return instance;
|
|
513
|
+
}
|
|
514
|
+
identifierFields() {
|
|
515
|
+
return ['id'];
|
|
516
|
+
}
|
|
517
|
+
toPlain() {
|
|
518
|
+
const plain = super.toPlain();
|
|
519
|
+
delete plain.beautyProfile;
|
|
520
|
+
return plain;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
__decorate([
|
|
524
|
+
Type(() => BeautyProfile),
|
|
525
|
+
__metadata("design:type", BeautyProfile)
|
|
536
526
|
], User.prototype, "beautyProfile", void 0);
|
|
537
527
|
|
|
538
|
-
class Subscription extends BaseModel {
|
|
539
|
-
identifierFields() {
|
|
540
|
-
return ['id'];
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
__decorate([
|
|
544
|
-
Type(() => User),
|
|
545
|
-
__metadata("design:type", User)
|
|
546
|
-
], Subscription.prototype, "user", void 0);
|
|
547
|
-
__decorate([
|
|
548
|
-
Type(() => SubscriptionPlan),
|
|
549
|
-
__metadata("design:type", SubscriptionPlan)
|
|
550
|
-
], Subscription.prototype, "subscriptionPlan", void 0);
|
|
551
|
-
__decorate([
|
|
552
|
-
Type(() => Address),
|
|
553
|
-
__metadata("design:type", Address)
|
|
554
|
-
], Subscription.prototype, "shippingAddress", void 0);
|
|
555
|
-
__decorate([
|
|
556
|
-
Type(() => Address),
|
|
557
|
-
__metadata("design:type", Address)
|
|
558
|
-
], Subscription.prototype, "billingAddress", void 0);
|
|
559
|
-
__decorate([
|
|
560
|
-
Type(() => Coupon),
|
|
561
|
-
__metadata("design:type", Coupon)
|
|
562
|
-
], Subscription.prototype, "coupon", void 0);
|
|
563
|
-
__decorate([
|
|
564
|
-
Type(() => Edition),
|
|
565
|
-
__metadata("design:type", Array)
|
|
566
|
-
], Subscription.prototype, "editions", void 0);
|
|
567
|
-
__decorate([
|
|
568
|
-
Type(() => SubscriptionPayment),
|
|
569
|
-
__metadata("design:type", Array)
|
|
528
|
+
class Subscription extends BaseModel {
|
|
529
|
+
identifierFields() {
|
|
530
|
+
return ['id'];
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
__decorate([
|
|
534
|
+
Type(() => User),
|
|
535
|
+
__metadata("design:type", User)
|
|
536
|
+
], Subscription.prototype, "user", void 0);
|
|
537
|
+
__decorate([
|
|
538
|
+
Type(() => SubscriptionPlan),
|
|
539
|
+
__metadata("design:type", SubscriptionPlan)
|
|
540
|
+
], Subscription.prototype, "subscriptionPlan", void 0);
|
|
541
|
+
__decorate([
|
|
542
|
+
Type(() => Address),
|
|
543
|
+
__metadata("design:type", Address)
|
|
544
|
+
], Subscription.prototype, "shippingAddress", void 0);
|
|
545
|
+
__decorate([
|
|
546
|
+
Type(() => Address),
|
|
547
|
+
__metadata("design:type", Address)
|
|
548
|
+
], Subscription.prototype, "billingAddress", void 0);
|
|
549
|
+
__decorate([
|
|
550
|
+
Type(() => Coupon),
|
|
551
|
+
__metadata("design:type", Coupon)
|
|
552
|
+
], Subscription.prototype, "coupon", void 0);
|
|
553
|
+
__decorate([
|
|
554
|
+
Type(() => Edition),
|
|
555
|
+
__metadata("design:type", Array)
|
|
556
|
+
], Subscription.prototype, "editions", void 0);
|
|
557
|
+
__decorate([
|
|
558
|
+
Type(() => SubscriptionPayment),
|
|
559
|
+
__metadata("design:type", Array)
|
|
570
560
|
], Subscription.prototype, "payment", void 0);
|
|
571
561
|
|
|
572
|
-
class UserAddress extends Address {
|
|
573
|
-
identifierFields() {
|
|
574
|
-
return ['id'];
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
class UserPaymentMethod extends BaseModel {
|
|
579
|
-
identifierFields() {
|
|
580
|
-
return ['id'];
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
class Lead extends BaseModel {
|
|
585
|
-
identifierFields() {
|
|
586
|
-
return ['id'];
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
class UnauthorizedError extends Error {
|
|
591
|
-
constructor(message) {
|
|
592
|
-
super(message);
|
|
593
|
-
this.message = message;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
var SignInMethods;
|
|
598
|
-
(function (SignInMethods) {
|
|
599
|
-
SignInMethods["EMAIL_PASSWORD"] = "email_password";
|
|
600
|
-
SignInMethods["GOOGLE"] = "google";
|
|
601
|
-
})(SignInMethods || (SignInMethods = {}));
|
|
602
|
-
class Authentication {
|
|
603
|
-
constructor(authService, userRepository) {
|
|
604
|
-
this.authService = authService;
|
|
605
|
-
this.userRepository = userRepository;
|
|
606
|
-
}
|
|
607
|
-
signIn({ email, password }, signInMethod) {
|
|
608
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
609
|
-
const method = this.getServiceByMethod(signInMethod);
|
|
610
|
-
const userAuth = yield this.authService[method]({ email, password });
|
|
611
|
-
const user = this.userRepository.get(userAuth);
|
|
612
|
-
if (!isNil(user))
|
|
613
|
-
return user;
|
|
614
|
-
if (/^.+@b4a.com.br$/.test(userAuth.email))
|
|
615
|
-
return this.createsUserByCredential(userAuth);
|
|
616
|
-
throw new UnauthorizedError('Invalid credentials');
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
getServiceByMethod(signInMethod) {
|
|
620
|
-
return signInMethod === SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
|
|
621
|
-
}
|
|
622
|
-
createsUserByCredential(user) {
|
|
623
|
-
var _a;
|
|
624
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
625
|
-
const [firstName, lastName] = (_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/);
|
|
626
|
-
const person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName,
|
|
627
|
-
lastName, acceptsNewsletter: false, area: Area.Transactional, officePosition: OfficePosition.Intern, type: UserType.Collaborator }));
|
|
628
|
-
return this.userRepository.create(person);
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
class UserAlreadyRegisteredError extends Error {
|
|
634
|
-
constructor(message) {
|
|
635
|
-
super(message);
|
|
636
|
-
this.message = message;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
class WeakPasswordError extends Error {
|
|
641
|
-
constructor(message = 'Weak password') {
|
|
642
|
-
super(message);
|
|
643
|
-
this.message = message;
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
class Register {
|
|
648
|
-
constructor(registerService, userRepository) {
|
|
649
|
-
this.registerService = registerService;
|
|
650
|
-
this.userRepository = userRepository;
|
|
651
|
-
}
|
|
652
|
-
register(params) {
|
|
653
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
654
|
-
const email = params.email.toLocaleLowerCase();
|
|
655
|
-
const displayName = `${params.firstName} ${params.lastName}`;
|
|
656
|
-
if (yield this.userRepository.checkIfExistsByField('cpf', params.cpf))
|
|
657
|
-
throw new UserAlreadyRegisteredError(`
|
|
658
|
-
if (yield this.userRepository.checkIfExistsByField('email', params.email))
|
|
659
|
-
throw new UserAlreadyRegisteredError(`
|
|
660
|
-
const auth = yield this.registerService.register({
|
|
661
|
-
birthday: params.birthday,
|
|
662
|
-
email,
|
|
663
|
-
firstName: params.firstName,
|
|
664
|
-
lastName: params.lastName,
|
|
665
|
-
cpf: params.cpf,
|
|
666
|
-
displayName,
|
|
667
|
-
phone: params.phone,
|
|
668
|
-
password: params.password,
|
|
669
|
-
});
|
|
670
|
-
delete params.password;
|
|
671
|
-
const user = yield this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email,
|
|
672
|
-
displayName, type: UserType.B2C, dateCreated: new Date(), dateModified: new Date() }));
|
|
673
|
-
return user;
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
class SignOut {
|
|
679
|
-
constructor(authService) {
|
|
680
|
-
this.authService = authService;
|
|
681
|
-
}
|
|
682
|
-
signOut() {
|
|
683
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
684
|
-
yield this.authService.signOut();
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
sendEmail(email) {
|
|
694
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
695
|
-
yield this.authService.sendPasswordResetEmail(email);
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
var Shops;
|
|
701
|
-
(function (Shops) {
|
|
702
|
-
Shops["MENSMARKET"] = "mensmarket";
|
|
703
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
704
|
-
Shops["GLAMPOINTS"] = "Glampoints";
|
|
562
|
+
class UserAddress extends Address {
|
|
563
|
+
identifierFields() {
|
|
564
|
+
return ['id'];
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
class UserPaymentMethod extends BaseModel {
|
|
569
|
+
identifierFields() {
|
|
570
|
+
return ['id'];
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
class Lead extends BaseModel {
|
|
575
|
+
identifierFields() {
|
|
576
|
+
return ['id'];
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
class UnauthorizedError extends Error {
|
|
581
|
+
constructor(message) {
|
|
582
|
+
super(message);
|
|
583
|
+
this.message = message;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
var SignInMethods;
|
|
588
|
+
(function (SignInMethods) {
|
|
589
|
+
SignInMethods["EMAIL_PASSWORD"] = "email_password";
|
|
590
|
+
SignInMethods["GOOGLE"] = "google";
|
|
591
|
+
})(SignInMethods || (SignInMethods = {}));
|
|
592
|
+
class Authentication {
|
|
593
|
+
constructor(authService, userRepository) {
|
|
594
|
+
this.authService = authService;
|
|
595
|
+
this.userRepository = userRepository;
|
|
596
|
+
}
|
|
597
|
+
signIn({ email, password }, signInMethod) {
|
|
598
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
599
|
+
const method = this.getServiceByMethod(signInMethod);
|
|
600
|
+
const userAuth = yield this.authService[method]({ email, password });
|
|
601
|
+
const user = this.userRepository.get(userAuth);
|
|
602
|
+
if (!isNil(user))
|
|
603
|
+
return user;
|
|
604
|
+
if (/^.+@b4a.com.br$/.test(userAuth.email))
|
|
605
|
+
return this.createsUserByCredential(userAuth);
|
|
606
|
+
throw new UnauthorizedError('Invalid credentials');
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
getServiceByMethod(signInMethod) {
|
|
610
|
+
return signInMethod === SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
|
|
611
|
+
}
|
|
612
|
+
createsUserByCredential(user) {
|
|
613
|
+
var _a;
|
|
614
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
615
|
+
const [firstName, lastName] = (_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/);
|
|
616
|
+
const person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName,
|
|
617
|
+
lastName, acceptsNewsletter: false, area: Area.Transactional, officePosition: OfficePosition.Intern, type: UserType.Collaborator }));
|
|
618
|
+
return this.userRepository.create(person);
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
class UserAlreadyRegisteredError extends Error {
|
|
624
|
+
constructor(message) {
|
|
625
|
+
super(message);
|
|
626
|
+
this.message = message;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
class WeakPasswordError extends Error {
|
|
631
|
+
constructor(message = 'Weak password') {
|
|
632
|
+
super(message);
|
|
633
|
+
this.message = message;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
class Register {
|
|
638
|
+
constructor(registerService, userRepository) {
|
|
639
|
+
this.registerService = registerService;
|
|
640
|
+
this.userRepository = userRepository;
|
|
641
|
+
}
|
|
642
|
+
register(params) {
|
|
643
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
644
|
+
const email = params.email.toLocaleLowerCase();
|
|
645
|
+
const displayName = `${params.firstName} ${params.lastName}`;
|
|
646
|
+
if (yield this.userRepository.checkIfExistsByField('cpf', params.cpf))
|
|
647
|
+
throw new UserAlreadyRegisteredError(`User with CPF ${params.cpf} already registered`);
|
|
648
|
+
if (yield this.userRepository.checkIfExistsByField('email', params.email))
|
|
649
|
+
throw new UserAlreadyRegisteredError(`User with E-mail ${params.email} already registered`);
|
|
650
|
+
const auth = yield this.registerService.register({
|
|
651
|
+
birthday: params.birthday,
|
|
652
|
+
email,
|
|
653
|
+
firstName: params.firstName,
|
|
654
|
+
lastName: params.lastName,
|
|
655
|
+
cpf: params.cpf,
|
|
656
|
+
displayName,
|
|
657
|
+
phone: params.phone,
|
|
658
|
+
password: params.password,
|
|
659
|
+
});
|
|
660
|
+
delete params.password;
|
|
661
|
+
const user = yield this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email,
|
|
662
|
+
displayName, type: UserType.B2C, dateCreated: new Date(), dateModified: new Date() }));
|
|
663
|
+
return user;
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
class SignOut {
|
|
669
|
+
constructor(authService) {
|
|
670
|
+
this.authService = authService;
|
|
671
|
+
}
|
|
672
|
+
signOut() {
|
|
673
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
674
|
+
yield this.authService.signOut();
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
var Shops;
|
|
680
|
+
(function (Shops) {
|
|
681
|
+
Shops["MENSMARKET"] = "mensmarket";
|
|
682
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
705
683
|
})(Shops || (Shops = {}));
|
|
706
684
|
|
|
707
|
-
class Category extends BaseModel {
|
|
708
|
-
identifierFields() {
|
|
709
|
-
return ['id'];
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
class Product extends BaseModel {
|
|
714
|
-
identifierFields() {
|
|
715
|
-
return ['id'];
|
|
716
|
-
}
|
|
717
|
-
getInfoByShop(shop) {
|
|
718
|
-
var _a, _b, _c, _d, _e, _f;
|
|
719
|
-
return Object.assign(Object.assign(Object.assign({}, (((_b = (_a = this.description) === null || _a === void 0 ? void 0 : _a[shop]) === null || _b === void 0 ? void 0 : _b.description) ? { description: (_d = (_c = this.description) === null || _c === void 0 ? void 0 : _c[shop]) === null || _d === void 0 ? void 0 : _d.description } : {})), (((_e = this.price) === null || _e === void 0 ? void 0 : _e[shop]) || {})), (((_f = this.stock) === null || _f === void 0 ? void 0 : _f[shop]) || {}));
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
class Variant extends BaseModel {
|
|
724
|
-
identifierFields() {
|
|
725
|
-
return ['id'];
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
685
|
+
class Category extends BaseModel {
|
|
686
|
+
identifierFields() {
|
|
687
|
+
return ['id'];
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
class Product extends BaseModel {
|
|
692
|
+
identifierFields() {
|
|
693
|
+
return ['id'];
|
|
694
|
+
}
|
|
695
|
+
getInfoByShop(shop) {
|
|
696
|
+
var _a, _b, _c, _d, _e, _f;
|
|
697
|
+
return Object.assign(Object.assign(Object.assign({}, (((_b = (_a = this.description) === null || _a === void 0 ? void 0 : _a[shop]) === null || _b === void 0 ? void 0 : _b.description) ? { description: (_d = (_c = this.description) === null || _c === void 0 ? void 0 : _c[shop]) === null || _d === void 0 ? void 0 : _d.description } : {})), (((_e = this.price) === null || _e === void 0 ? void 0 : _e[shop]) || {})), (((_f = this.stock) === null || _f === void 0 ? void 0 : _f[shop]) || {}));
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
class Variant extends BaseModel {
|
|
702
|
+
identifierFields() {
|
|
703
|
+
return ['id'];
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
class ClubCoupon extends Coupon {
|
|
708
|
+
constructor() {
|
|
709
|
+
super(...arguments);
|
|
710
|
+
this.checkoutType = CheckoutTypes.SUBSCRIPTION;
|
|
711
|
+
}
|
|
712
|
+
static isClubCoupon(coupon) {
|
|
713
|
+
return coupon instanceof ClubCoupon;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
__decorate([
|
|
717
|
+
Expose({ name: 'checkout_type' }),
|
|
718
|
+
__metadata("design:type", Object)
|
|
719
|
+
], ClubCoupon.prototype, "checkoutType", void 0);
|
|
720
|
+
__decorate([
|
|
721
|
+
Type(() => Category),
|
|
722
|
+
__metadata("design:type", Array)
|
|
723
|
+
], ClubCoupon.prototype, "categories", void 0);
|
|
724
|
+
|
|
725
|
+
class StoreCoupon extends Coupon {
|
|
726
|
+
constructor() {
|
|
727
|
+
super(...arguments);
|
|
728
|
+
this.checkoutType = CheckoutTypes.ECOMMERCE;
|
|
729
|
+
}
|
|
730
|
+
static isStoreCoupon(coupon) {
|
|
731
|
+
return coupon instanceof StoreCoupon;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
__decorate([
|
|
735
|
+
Expose({ name: 'checkout_type' }),
|
|
736
|
+
__metadata("design:type", Object)
|
|
737
|
+
], StoreCoupon.prototype, "checkoutType", void 0);
|
|
738
|
+
__decorate([
|
|
739
|
+
Type(() => Category),
|
|
740
|
+
__metadata("design:type", Array)
|
|
741
|
+
], StoreCoupon.prototype, "categories", void 0);
|
|
742
|
+
|
|
743
|
+
var OrderStatus;
|
|
744
|
+
(function (OrderStatus) {
|
|
745
|
+
OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
|
|
746
|
+
OrderStatus["EM_PREPARO"] = "Preparando pedido";
|
|
747
|
+
OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
|
|
748
|
+
OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
|
|
749
|
+
OrderStatus["ENVIADO"] = "Pedido Enviado";
|
|
750
|
+
OrderStatus["ENTREGUE"] = "Pedido entregue";
|
|
751
|
+
OrderStatus["CANCELADO"] = "Cancelado";
|
|
752
|
+
OrderStatus["CREDIT_CARD"] = "credit_card";
|
|
763
753
|
})(OrderStatus || (OrderStatus = {}));
|
|
764
754
|
|
|
765
|
-
class LineItem extends Product {
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
class ShippingMethod extends BaseModel {
|
|
769
|
-
identifierFields() {
|
|
770
|
-
return ['id'];
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
class Checkout extends BaseModel {
|
|
775
|
-
identifierFields() {
|
|
776
|
-
return ['id'];
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
__decorate([
|
|
780
|
-
Type(() => LineItem),
|
|
781
|
-
__metadata("design:type", Array)
|
|
782
|
-
], Checkout.prototype, "lineItems", void 0);
|
|
783
|
-
__decorate([
|
|
784
|
-
Type(() => User),
|
|
785
|
-
__metadata("design:type", User)
|
|
786
|
-
], Checkout.prototype, "user", void 0);
|
|
787
|
-
__decorate([
|
|
788
|
-
Type(() => Address),
|
|
789
|
-
__metadata("design:type", Address)
|
|
790
|
-
], Checkout.prototype, "shippingAddress", void 0);
|
|
791
|
-
__decorate([
|
|
792
|
-
Type(() => Address),
|
|
793
|
-
__metadata("design:type", Address)
|
|
794
|
-
], Checkout.prototype, "billingAddress", void 0);
|
|
795
|
-
__decorate([
|
|
796
|
-
Type(() => ShippingMethod),
|
|
797
|
-
__metadata("design:type", ShippingMethod)
|
|
798
|
-
], Checkout.prototype, "shipping", void 0);
|
|
799
|
-
__decorate([
|
|
800
|
-
Type(() => Coupon),
|
|
801
|
-
__metadata("design:type", Coupon)
|
|
755
|
+
class LineItem extends Product {
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
class ShippingMethod extends BaseModel {
|
|
759
|
+
identifierFields() {
|
|
760
|
+
return ['id'];
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
class Checkout extends BaseModel {
|
|
765
|
+
identifierFields() {
|
|
766
|
+
return ['id'];
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
__decorate([
|
|
770
|
+
Type(() => LineItem),
|
|
771
|
+
__metadata("design:type", Array)
|
|
772
|
+
], Checkout.prototype, "lineItems", void 0);
|
|
773
|
+
__decorate([
|
|
774
|
+
Type(() => User),
|
|
775
|
+
__metadata("design:type", User)
|
|
776
|
+
], Checkout.prototype, "user", void 0);
|
|
777
|
+
__decorate([
|
|
778
|
+
Type(() => Address),
|
|
779
|
+
__metadata("design:type", Address)
|
|
780
|
+
], Checkout.prototype, "shippingAddress", void 0);
|
|
781
|
+
__decorate([
|
|
782
|
+
Type(() => Address),
|
|
783
|
+
__metadata("design:type", Address)
|
|
784
|
+
], Checkout.prototype, "billingAddress", void 0);
|
|
785
|
+
__decorate([
|
|
786
|
+
Type(() => ShippingMethod),
|
|
787
|
+
__metadata("design:type", ShippingMethod)
|
|
788
|
+
], Checkout.prototype, "shipping", void 0);
|
|
789
|
+
__decorate([
|
|
790
|
+
Type(() => Coupon),
|
|
791
|
+
__metadata("design:type", Coupon)
|
|
802
792
|
], Checkout.prototype, "coupon", void 0);
|
|
803
793
|
|
|
804
|
-
class Order extends Checkout {
|
|
805
|
-
}
|
|
806
|
-
__decorate([
|
|
807
|
-
Type(() => Payment),
|
|
808
|
-
__metadata("design:type", Payment)
|
|
794
|
+
class Order extends Checkout {
|
|
795
|
+
}
|
|
796
|
+
__decorate([
|
|
797
|
+
Type(() => Payment),
|
|
798
|
+
__metadata("design:type", Payment)
|
|
809
799
|
], Order.prototype, "payment", void 0);
|
|
810
800
|
|
|
811
|
-
class CheckoutSubscription extends BaseModel {
|
|
812
|
-
identifierFields() {
|
|
813
|
-
return ['id'];
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
__decorate([
|
|
817
|
-
Type(() => Address),
|
|
818
|
-
__metadata("design:type", Address)
|
|
819
|
-
], CheckoutSubscription.prototype, "shippingAddress", void 0);
|
|
820
|
-
__decorate([
|
|
821
|
-
Type(() => Address),
|
|
822
|
-
__metadata("design:type", Address)
|
|
823
|
-
], CheckoutSubscription.prototype, "billingAddress", void 0);
|
|
824
|
-
__decorate([
|
|
825
|
-
Type(() => SubscriptionPlan),
|
|
826
|
-
__metadata("design:type", SubscriptionPlan)
|
|
827
|
-
], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
|
|
828
|
-
__decorate([
|
|
829
|
-
Type(() => Coupon),
|
|
830
|
-
__metadata("design:type", Coupon)
|
|
801
|
+
class CheckoutSubscription extends BaseModel {
|
|
802
|
+
identifierFields() {
|
|
803
|
+
return ['id'];
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
__decorate([
|
|
807
|
+
Type(() => Address),
|
|
808
|
+
__metadata("design:type", Address)
|
|
809
|
+
], CheckoutSubscription.prototype, "shippingAddress", void 0);
|
|
810
|
+
__decorate([
|
|
811
|
+
Type(() => Address),
|
|
812
|
+
__metadata("design:type", Address)
|
|
813
|
+
], CheckoutSubscription.prototype, "billingAddress", void 0);
|
|
814
|
+
__decorate([
|
|
815
|
+
Type(() => SubscriptionPlan),
|
|
816
|
+
__metadata("design:type", SubscriptionPlan)
|
|
817
|
+
], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
|
|
818
|
+
__decorate([
|
|
819
|
+
Type(() => Coupon),
|
|
820
|
+
__metadata("design:type", Coupon)
|
|
831
821
|
], CheckoutSubscription.prototype, "coupon", void 0);
|
|
832
822
|
|
|
833
|
-
class Buy2Win extends BaseModel {
|
|
834
|
-
identifierFields() {
|
|
835
|
-
return ['id'];
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
__decorate([
|
|
839
|
-
Type(() => Category),
|
|
840
|
-
__metadata("design:type", Array)
|
|
823
|
+
class Buy2Win extends BaseModel {
|
|
824
|
+
identifierFields() {
|
|
825
|
+
return ['id'];
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
__decorate([
|
|
829
|
+
Type(() => Category),
|
|
830
|
+
__metadata("design:type", Array)
|
|
841
831
|
], Buy2Win.prototype, "categories", void 0);
|
|
842
832
|
|
|
843
|
-
var FilterType;
|
|
844
|
-
(function (FilterType) {
|
|
845
|
-
FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
|
|
846
|
-
FilterType["BEARD_PROBLEMS"] = "beardProblems";
|
|
847
|
-
FilterType["BEARD_SIZE"] = "beardSize";
|
|
848
|
-
FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
|
|
849
|
-
FilterType["BODY_PROBLEMS"] = "bodyProblems";
|
|
850
|
-
FilterType["BODY_SHAPE"] = "bodyShape";
|
|
851
|
-
FilterType["BODY_TATTOOS"] = "bodyTattoos";
|
|
852
|
-
FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
|
|
853
|
-
FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
|
|
854
|
-
FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
|
|
855
|
-
FilterType["FAMILY_INCOME"] = "familyIncome";
|
|
856
|
-
FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
|
|
857
|
-
FilterType["HAIR_COLOR"] = "hairColor";
|
|
858
|
-
FilterType["HAIR_PROBLEMS"] = "hairProblems";
|
|
859
|
-
FilterType["HAIR_STRANDS"] = "hairStrands";
|
|
860
|
-
FilterType["HAIR_TYPE"] = "hairType";
|
|
861
|
-
FilterType["PRODUCT_SPENT"] = "productSpent";
|
|
833
|
+
var FilterType;
|
|
834
|
+
(function (FilterType) {
|
|
835
|
+
FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
|
|
836
|
+
FilterType["BEARD_PROBLEMS"] = "beardProblems";
|
|
837
|
+
FilterType["BEARD_SIZE"] = "beardSize";
|
|
838
|
+
FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
|
|
839
|
+
FilterType["BODY_PROBLEMS"] = "bodyProblems";
|
|
840
|
+
FilterType["BODY_SHAPE"] = "bodyShape";
|
|
841
|
+
FilterType["BODY_TATTOOS"] = "bodyTattoos";
|
|
842
|
+
FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
|
|
843
|
+
FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
|
|
844
|
+
FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
|
|
845
|
+
FilterType["FAMILY_INCOME"] = "familyIncome";
|
|
846
|
+
FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
|
|
847
|
+
FilterType["HAIR_COLOR"] = "hairColor";
|
|
848
|
+
FilterType["HAIR_PROBLEMS"] = "hairProblems";
|
|
849
|
+
FilterType["HAIR_STRANDS"] = "hairStrands";
|
|
850
|
+
FilterType["HAIR_TYPE"] = "hairType";
|
|
851
|
+
FilterType["PRODUCT_SPENT"] = "productSpent";
|
|
862
852
|
})(FilterType || (FilterType = {}));
|
|
863
853
|
|
|
864
|
-
var QuestionsFilters;
|
|
865
|
-
(function (QuestionsFilters) {
|
|
866
|
-
QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
|
|
867
|
-
QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
|
|
868
|
-
QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
|
|
869
|
-
QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
|
|
870
|
-
QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
|
|
871
|
-
QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
|
|
872
|
-
QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
|
|
873
|
-
QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
|
|
874
|
-
QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
|
|
875
|
-
QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
|
|
876
|
-
QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
|
|
877
|
-
QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
|
|
878
|
-
QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
|
|
879
|
-
QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
|
|
880
|
-
QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
|
|
881
|
-
QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
|
|
882
|
-
QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
|
|
854
|
+
var QuestionsFilters;
|
|
855
|
+
(function (QuestionsFilters) {
|
|
856
|
+
QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
|
|
857
|
+
QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
|
|
858
|
+
QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
|
|
859
|
+
QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
|
|
860
|
+
QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
|
|
861
|
+
QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
|
|
862
|
+
QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
|
|
863
|
+
QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
|
|
864
|
+
QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
|
|
865
|
+
QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
|
|
866
|
+
QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
|
|
867
|
+
QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
|
|
868
|
+
QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
|
|
869
|
+
QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
|
|
870
|
+
QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
|
|
871
|
+
QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
|
|
872
|
+
QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
|
|
883
873
|
})(QuestionsFilters || (QuestionsFilters = {}));
|
|
884
874
|
|
|
885
|
-
class BeautyQuestionsHelper {
|
|
886
|
-
static getAnswers(filter) {
|
|
887
|
-
switch (filter) {
|
|
888
|
-
case FilterType.ACCESSORY_IMPORTANCE:
|
|
889
|
-
return AccessoryImportances;
|
|
890
|
-
case FilterType.BEARD_PROBLEMS:
|
|
891
|
-
return BeardProblems;
|
|
892
|
-
case FilterType.BEARD_SIZE:
|
|
893
|
-
return BeardSizes;
|
|
894
|
-
case FilterType.BEAUTY_PRODUCT_IMPORTANCE:
|
|
895
|
-
return BeautyProductImportances;
|
|
896
|
-
case FilterType.BODY_PROBLEMS:
|
|
897
|
-
return BodyProblems;
|
|
898
|
-
case FilterType.BODY_SHAPE:
|
|
899
|
-
return BodyShapes;
|
|
900
|
-
case FilterType.BODY_TATTOOS:
|
|
901
|
-
return BodyTattoos;
|
|
902
|
-
case FilterType.FACE_SKIN_OILINESS:
|
|
903
|
-
return FaceSkinOilinesses;
|
|
904
|
-
case FilterType.FACE_SKIN_PROBLEMS:
|
|
905
|
-
return FaceSkinProblems;
|
|
906
|
-
case FilterType.FACE_SKIN_TONE:
|
|
907
|
-
return FaceSkinTones;
|
|
908
|
-
case FilterType.FAMILY_INCOME:
|
|
909
|
-
return FamilyIncomes;
|
|
910
|
-
case FilterType.FRAGRANCE_IMPORTANCE:
|
|
911
|
-
return FragranceImportances;
|
|
912
|
-
case FilterType.HAIR_COLOR:
|
|
913
|
-
return HairColors;
|
|
914
|
-
case FilterType.HAIR_PROBLEMS:
|
|
915
|
-
return HairProblems;
|
|
916
|
-
case FilterType.HAIR_STRANDS:
|
|
917
|
-
return HairStrands;
|
|
918
|
-
case FilterType.HAIR_TYPE:
|
|
919
|
-
return HairTypes;
|
|
920
|
-
case FilterType.PRODUCT_SPENT:
|
|
921
|
-
return ProductSpents;
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
static getQuestions(filter) {
|
|
925
|
-
return QuestionsFilters[filter];
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
class Home extends BaseModel {
|
|
930
|
-
identifierFields() {
|
|
931
|
-
return ['id'];
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
class ShopMenu extends BaseModel {
|
|
936
|
-
identifierFields() {
|
|
937
|
-
return ['id'];
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
class
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
class ProductsIndex {
|
|
997
|
-
constructor(adapter) {
|
|
998
|
-
this.adapter = adapter;
|
|
999
|
-
}
|
|
1000
|
-
findById(ids, options) {
|
|
1001
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1002
|
-
const publishedField = options.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1003
|
-
const fields = [
|
|
1004
|
-
'brand',
|
|
1005
|
-
'id',
|
|
1006
|
-
'images',
|
|
1007
|
-
'miniatures',
|
|
1008
|
-
'name',
|
|
1009
|
-
'price',
|
|
1010
|
-
'sku',
|
|
1011
|
-
'stock',
|
|
1012
|
-
'slug',
|
|
1013
|
-
'reviews',
|
|
1014
|
-
'pricePaid',
|
|
1015
|
-
'isGift',
|
|
1016
|
-
'stock',
|
|
1017
|
-
'weight',
|
|
1018
|
-
'tags',
|
|
1019
|
-
'hasVariants',
|
|
1020
|
-
];
|
|
1021
|
-
const { hits } = yield this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
|
|
1022
|
-
bool: {
|
|
1023
|
-
filter: [
|
|
1024
|
-
{
|
|
1025
|
-
terms: {
|
|
1026
|
-
_id: ids,
|
|
1027
|
-
},
|
|
1028
|
-
},
|
|
1029
|
-
{
|
|
1030
|
-
term: {
|
|
1031
|
-
[publishedField]: true,
|
|
1032
|
-
},
|
|
1033
|
-
},
|
|
1034
|
-
...(options.hasStock
|
|
1035
|
-
? [
|
|
1036
|
-
{
|
|
1037
|
-
range: {
|
|
1038
|
-
'stock.quantity': {
|
|
1039
|
-
gt: 0,
|
|
1040
|
-
},
|
|
1041
|
-
},
|
|
1042
|
-
},
|
|
1043
|
-
]
|
|
1044
|
-
: []),
|
|
1045
|
-
],
|
|
1046
|
-
},
|
|
1047
|
-
} }, (options.size ? { size: options.size } : {})));
|
|
1048
|
-
return hits.map((hit) => Product.toInstance(hit._source));
|
|
1049
|
-
});
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
const withFirestore = (MixinBase) => {
|
|
1054
|
-
return class extends MixinBase {
|
|
1055
|
-
constructor(...args) {
|
|
1056
|
-
super(args);
|
|
1057
|
-
}
|
|
1058
|
-
collection(path) {
|
|
1059
|
-
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
1060
|
-
}
|
|
1061
|
-
buildModelInstance() {
|
|
1062
|
-
return {
|
|
1063
|
-
toFirestore: (data) => ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data),
|
|
1064
|
-
fromFirestore: (snap) => {
|
|
1065
|
-
const data = snap.data();
|
|
1066
|
-
Object.keys(data).forEach((key) => {
|
|
1067
|
-
if (data[key] instanceof firebase.firestore.Timestamp) {
|
|
1068
|
-
data[key] = data[key].toDate();
|
|
1069
|
-
}
|
|
1070
|
-
});
|
|
1071
|
-
return this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
|
|
1072
|
-
},
|
|
1073
|
-
};
|
|
1074
|
-
}
|
|
1075
|
-
};
|
|
875
|
+
class BeautyQuestionsHelper {
|
|
876
|
+
static getAnswers(filter) {
|
|
877
|
+
switch (filter) {
|
|
878
|
+
case FilterType.ACCESSORY_IMPORTANCE:
|
|
879
|
+
return AccessoryImportances;
|
|
880
|
+
case FilterType.BEARD_PROBLEMS:
|
|
881
|
+
return BeardProblems;
|
|
882
|
+
case FilterType.BEARD_SIZE:
|
|
883
|
+
return BeardSizes;
|
|
884
|
+
case FilterType.BEAUTY_PRODUCT_IMPORTANCE:
|
|
885
|
+
return BeautyProductImportances;
|
|
886
|
+
case FilterType.BODY_PROBLEMS:
|
|
887
|
+
return BodyProblems;
|
|
888
|
+
case FilterType.BODY_SHAPE:
|
|
889
|
+
return BodyShapes;
|
|
890
|
+
case FilterType.BODY_TATTOOS:
|
|
891
|
+
return BodyTattoos;
|
|
892
|
+
case FilterType.FACE_SKIN_OILINESS:
|
|
893
|
+
return FaceSkinOilinesses;
|
|
894
|
+
case FilterType.FACE_SKIN_PROBLEMS:
|
|
895
|
+
return FaceSkinProblems;
|
|
896
|
+
case FilterType.FACE_SKIN_TONE:
|
|
897
|
+
return FaceSkinTones;
|
|
898
|
+
case FilterType.FAMILY_INCOME:
|
|
899
|
+
return FamilyIncomes;
|
|
900
|
+
case FilterType.FRAGRANCE_IMPORTANCE:
|
|
901
|
+
return FragranceImportances;
|
|
902
|
+
case FilterType.HAIR_COLOR:
|
|
903
|
+
return HairColors;
|
|
904
|
+
case FilterType.HAIR_PROBLEMS:
|
|
905
|
+
return HairProblems;
|
|
906
|
+
case FilterType.HAIR_STRANDS:
|
|
907
|
+
return HairStrands;
|
|
908
|
+
case FilterType.HAIR_TYPE:
|
|
909
|
+
return HairTypes;
|
|
910
|
+
case FilterType.PRODUCT_SPENT:
|
|
911
|
+
return ProductSpents;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
static getQuestions(filter) {
|
|
915
|
+
return QuestionsFilters[filter];
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
class Home extends BaseModel {
|
|
920
|
+
identifierFields() {
|
|
921
|
+
return ['id'];
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
class ShopMenu extends BaseModel {
|
|
926
|
+
identifierFields() {
|
|
927
|
+
return ['id'];
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
class InvalidArgumentError extends Error {
|
|
932
|
+
constructor(message) {
|
|
933
|
+
super(message);
|
|
934
|
+
this.message = message;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
class RequiredArgumentError extends Error {
|
|
939
|
+
constructor(args) {
|
|
940
|
+
super(`Required arguments: ${args.join(', ')}`);
|
|
941
|
+
this.args = args;
|
|
942
|
+
this.arguments = args;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
class NotFoundError extends Error {
|
|
947
|
+
constructor(message) {
|
|
948
|
+
super(message);
|
|
949
|
+
this.message = message;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
class DuplicatedResultsError extends Error {
|
|
954
|
+
constructor(message) {
|
|
955
|
+
super(message);
|
|
956
|
+
this.message = message;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
const withFirestore = (MixinBase) => {
|
|
961
|
+
return class extends MixinBase {
|
|
962
|
+
constructor(...args) {
|
|
963
|
+
super(args);
|
|
964
|
+
}
|
|
965
|
+
collection(path) {
|
|
966
|
+
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
967
|
+
}
|
|
968
|
+
buildModelInstance() {
|
|
969
|
+
return {
|
|
970
|
+
toFirestore: (data) => ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data),
|
|
971
|
+
fromFirestore: (snap) => {
|
|
972
|
+
const data = snap.data();
|
|
973
|
+
Object.keys(data).forEach((key) => {
|
|
974
|
+
if (data[key] instanceof firebase.firestore.Timestamp) {
|
|
975
|
+
data[key] = data[key].toDate();
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
return this.model.toInstance(Object.assign({ id: snap.id }, data));
|
|
979
|
+
},
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
};
|
|
1076
983
|
};
|
|
1077
984
|
|
|
1078
|
-
const withHelpers = (MixinBase) => {
|
|
1079
|
-
return class extends MixinBase {
|
|
1080
|
-
toArray(snapShot) {
|
|
1081
|
-
if (Array.isArray(snapShot)) {
|
|
1082
|
-
return snapShot.map((doc) => doc.data());
|
|
1083
|
-
}
|
|
1084
|
-
else {
|
|
1085
|
-
return snapShot.docs.map((doc) => doc.data());
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
isSubCollection(repository) {
|
|
1089
|
-
return !isNil(Object.keys(this).find((key) => key === 'parentRepository'));
|
|
1090
|
-
}
|
|
1091
|
-
};
|
|
985
|
+
const withHelpers = (MixinBase) => {
|
|
986
|
+
return class extends MixinBase {
|
|
987
|
+
toArray(snapShot) {
|
|
988
|
+
if (Array.isArray(snapShot)) {
|
|
989
|
+
return snapShot.map((doc) => doc.data());
|
|
990
|
+
}
|
|
991
|
+
else {
|
|
992
|
+
return snapShot.docs.map((doc) => doc.data());
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
isSubCollection(repository) {
|
|
996
|
+
return !isNil(Object.keys(this).find((key) => key === 'parentRepository'));
|
|
997
|
+
}
|
|
998
|
+
};
|
|
1092
999
|
};
|
|
1093
1000
|
|
|
1094
|
-
const withGetFirestore = (MixinBase) => {
|
|
1095
|
-
return class GetFirestore extends MixinBase {
|
|
1096
|
-
get(identifiers) {
|
|
1097
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1098
|
-
const doc = yield this.collection(this.buildCollectionPathForGet(identifiers))
|
|
1099
|
-
.doc(Object.values(identifiers).shift().toString())
|
|
1100
|
-
.get();
|
|
1101
|
-
const data = doc.data();
|
|
1102
|
-
if (isNil(data))
|
|
1103
|
-
throw new NotFoundError(`Document ${JSON.stringify(identifiers)} not found`);
|
|
1104
|
-
return data;
|
|
1105
|
-
});
|
|
1106
|
-
}
|
|
1107
|
-
buildCollectionPathForGet(identifiers) {
|
|
1108
|
-
return this.isSubCollection(this)
|
|
1109
|
-
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1110
|
-
: this.collectionName;
|
|
1111
|
-
}
|
|
1112
|
-
};
|
|
1001
|
+
const withGetFirestore = (MixinBase) => {
|
|
1002
|
+
return class GetFirestore extends MixinBase {
|
|
1003
|
+
get(identifiers) {
|
|
1004
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1005
|
+
const doc = yield this.collection(this.buildCollectionPathForGet(identifiers))
|
|
1006
|
+
.doc(Object.values(identifiers).shift().toString())
|
|
1007
|
+
.get();
|
|
1008
|
+
const data = doc.data();
|
|
1009
|
+
if (isNil(data))
|
|
1010
|
+
throw new NotFoundError(`Document ${JSON.stringify(identifiers)} not found`);
|
|
1011
|
+
return data;
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
buildCollectionPathForGet(identifiers) {
|
|
1015
|
+
return this.isSubCollection(this)
|
|
1016
|
+
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1017
|
+
: this.collectionName;
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1113
1020
|
};
|
|
1114
1021
|
|
|
1115
|
-
const withFindFirestore = (MixinBase) => {
|
|
1116
|
-
const checkIfIsFilterOption = (filter) => !isNil(filter === null || filter === void 0 ? void 0 : filter.operator);
|
|
1117
|
-
const getValueFromFilter = (filter) => {
|
|
1118
|
-
return checkIfIsFilterOption(filter) ? filter.value : filter;
|
|
1119
|
-
};
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
return
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
return query;
|
|
1187
|
-
});
|
|
1188
|
-
}
|
|
1189
|
-
calculateCount(data, limits) {
|
|
1190
|
-
if (data.length <= 0)
|
|
1191
|
-
return 0;
|
|
1192
|
-
if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
|
|
1193
|
-
return data.length;
|
|
1194
|
-
return Infinity;
|
|
1195
|
-
}
|
|
1196
|
-
};
|
|
1022
|
+
const withFindFirestore = (MixinBase) => {
|
|
1023
|
+
const checkIfIsFilterOption = (filter) => !isNil(filter === null || filter === void 0 ? void 0 : filter.operator);
|
|
1024
|
+
const getValueFromFilter = (filter) => {
|
|
1025
|
+
return checkIfIsFilterOption(filter) ? filter.value : filter;
|
|
1026
|
+
};
|
|
1027
|
+
return class FindFirestore extends MixinBase {
|
|
1028
|
+
constructor() {
|
|
1029
|
+
super(...arguments);
|
|
1030
|
+
this.makeFirestoreWhere = (queryReference, filter) => Object.keys(filter).reduce((query, fieldName) => this.buildWhereSentence(query, fieldName, filter[fieldName]), queryReference);
|
|
1031
|
+
this.buildWhereSentence = (queryReference, fieldName, options) => {
|
|
1032
|
+
if (this.isSubCollection(this) && fieldName === this.parentIdField)
|
|
1033
|
+
return queryReference;
|
|
1034
|
+
if ((options === null || options === void 0 ? void 0 : options.operator) === Where.LIKE) {
|
|
1035
|
+
if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1036
|
+
return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
|
|
1037
|
+
queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
|
|
1038
|
+
queryReference = queryReference.where(fieldName.toString(), '<=', `${options.value}~`);
|
|
1039
|
+
return queryReference;
|
|
1040
|
+
}
|
|
1041
|
+
if ((options === null || options === void 0 ? void 0 : options.operator) === Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1042
|
+
return queryReference.where(fieldName.toString(), 'array-contains', options.value);
|
|
1043
|
+
if (isObject(options) && isNil(options === null || options === void 0 ? void 0 : options.operator) && isNil(options === null || options === void 0 ? void 0 : options.value))
|
|
1044
|
+
return Object.keys(options).reduce((queryReferenceWithWhere, key) => this.buildWhereSentence(queryReferenceWithWhere, `${fieldName}.${key}`, options[key]), queryReference);
|
|
1045
|
+
return queryReference.where(fieldName.toString(), (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
find(filters, limits, orderBy) {
|
|
1049
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1050
|
+
let query = this.collection(this.buildCollectionPathForFind(filters));
|
|
1051
|
+
filters === null || filters === void 0 ? void 0 : filters.forEach((filterer) => (query = this.makeFirestoreWhere(query, filterer)));
|
|
1052
|
+
orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach((orderer) => Object.keys(orderer).forEach((fieldName) => (query = query.orderBy(fieldName, orderer[fieldName]))));
|
|
1053
|
+
query = yield this.defineLimits(query, filters, limits);
|
|
1054
|
+
const docs = yield query.get();
|
|
1055
|
+
const data = docs.docs.map((doc) => doc.data());
|
|
1056
|
+
return {
|
|
1057
|
+
data,
|
|
1058
|
+
count: this.calculateCount(data, limits),
|
|
1059
|
+
};
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
buildCollectionPathForFind(filters) {
|
|
1063
|
+
var _a;
|
|
1064
|
+
if (!this.isSubCollection(this))
|
|
1065
|
+
return this.collectionName;
|
|
1066
|
+
const parentIdField = this.parentIdField;
|
|
1067
|
+
const parentId = getValueFromFilter((_a = filters.find((groupFilter) => Boolean(getValueFromFilter(groupFilter[parentIdField])))) === null || _a === void 0 ? void 0 : _a[parentIdField]);
|
|
1068
|
+
return `${this.parentRepository.collectionName}/${parentId}/${this.collectionName}`;
|
|
1069
|
+
}
|
|
1070
|
+
defineLimits(query, filters, limits) {
|
|
1071
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1072
|
+
if (limits === null || limits === void 0 ? void 0 : limits.offset) {
|
|
1073
|
+
if (limits.offset instanceof this.model)
|
|
1074
|
+
query = query.startAfter(yield this.collection(this.buildCollectionPathForFind(filters))
|
|
1075
|
+
.doc(limits.offset[limits.offset.identifierFields().shift()])
|
|
1076
|
+
.get());
|
|
1077
|
+
else if (isNumber(limits.offset) || isString(limits.offset))
|
|
1078
|
+
query = query.startAt(limits.offset);
|
|
1079
|
+
}
|
|
1080
|
+
if (limits === null || limits === void 0 ? void 0 : limits.limit)
|
|
1081
|
+
query = query.limit(limits.limit);
|
|
1082
|
+
return query;
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
calculateCount(data, limits) {
|
|
1086
|
+
if (data.length <= 0)
|
|
1087
|
+
return 0;
|
|
1088
|
+
if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
|
|
1089
|
+
return data.length;
|
|
1090
|
+
return Infinity;
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1197
1093
|
};
|
|
1198
1094
|
|
|
1199
|
-
const withCreateFirestore = (MixinBase) => {
|
|
1200
|
-
return class CreateFirestore extends MixinBase {
|
|
1201
|
-
create(data) {
|
|
1202
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1203
|
-
const docRef = yield this.save(this.model.toInstance(data));
|
|
1204
|
-
const doc = yield docRef.get();
|
|
1205
|
-
return doc.data();
|
|
1206
|
-
});
|
|
1207
|
-
}
|
|
1208
|
-
save(data) {
|
|
1209
|
-
var _a;
|
|
1210
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1211
|
-
const id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1212
|
-
const collectionPath = this.buildCollectionPathForAdd(data);
|
|
1213
|
-
if (isEmpty(id))
|
|
1214
|
-
return this.collection(collectionPath).add(data);
|
|
1215
|
-
const docRef = this.collection(collectionPath).doc(id);
|
|
1216
|
-
yield docRef.set(data);
|
|
1217
|
-
return docRef;
|
|
1218
|
-
});
|
|
1219
|
-
}
|
|
1220
|
-
buildCollectionPathForAdd(identifiers) {
|
|
1221
|
-
return this.isSubCollection(this)
|
|
1222
|
-
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1223
|
-
: this.collectionName;
|
|
1224
|
-
}
|
|
1225
|
-
};
|
|
1095
|
+
const withCreateFirestore = (MixinBase) => {
|
|
1096
|
+
return class CreateFirestore extends MixinBase {
|
|
1097
|
+
create(data) {
|
|
1098
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1099
|
+
const docRef = yield this.save(this.model.toInstance(data));
|
|
1100
|
+
const doc = yield docRef.get();
|
|
1101
|
+
return doc.data();
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
save(data) {
|
|
1105
|
+
var _a;
|
|
1106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1107
|
+
const id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1108
|
+
const collectionPath = this.buildCollectionPathForAdd(data);
|
|
1109
|
+
if (isEmpty(id))
|
|
1110
|
+
return this.collection(collectionPath).add(data);
|
|
1111
|
+
const docRef = this.collection(collectionPath).doc(id);
|
|
1112
|
+
yield docRef.set(data);
|
|
1113
|
+
return docRef;
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
buildCollectionPathForAdd(identifiers) {
|
|
1117
|
+
return this.isSubCollection(this)
|
|
1118
|
+
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1119
|
+
: this.collectionName;
|
|
1120
|
+
}
|
|
1121
|
+
};
|
|
1226
1122
|
};
|
|
1227
1123
|
|
|
1228
|
-
const withUpdateFirestore = (MixinBase) => {
|
|
1229
|
-
const getValueFromParams = (params, field) => { var _a; return (isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
|
|
1230
|
-
const getValueByAction = (options) => {
|
|
1231
|
-
const fieldValues = firebase.firestore.FieldValue;
|
|
1232
|
-
if (isNil(options.action))
|
|
1233
|
-
return options;
|
|
1234
|
-
if (options.action === UpdateOptionActions.REMOVE_FIELD)
|
|
1235
|
-
return fieldValues.delete();
|
|
1236
|
-
if (Array.isArray(options.value)) {
|
|
1237
|
-
if (options.action === UpdateOptionActions.MERGE)
|
|
1238
|
-
return fieldValues.arrayUnion(...options.value);
|
|
1239
|
-
if (options.action === UpdateOptionActions.REMOVE)
|
|
1240
|
-
return fieldValues.arrayRemove(...options.value);
|
|
1241
|
-
}
|
|
1242
|
-
return options.value;
|
|
1243
|
-
};
|
|
1244
|
-
return class UpdateFirestore extends MixinBase {
|
|
1245
|
-
update(data) {
|
|
1246
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1247
|
-
const model = new this.model();
|
|
1248
|
-
const keyField = model.identifierFields().shift();
|
|
1249
|
-
const docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1250
|
-
yield docRef.set(this.paramsToPlain(data), { merge: true });
|
|
1251
|
-
const doc = yield docRef.get();
|
|
1252
|
-
return doc.data();
|
|
1253
|
-
});
|
|
1254
|
-
}
|
|
1255
|
-
buildCollectionPathForUpdate(identifiers) {
|
|
1256
|
-
return this.isSubCollection(this)
|
|
1257
|
-
? `${this.parentRepository.collectionName}/${getValueFromParams(identifiers, this.parentIdField)}/${this.collectionName}`
|
|
1258
|
-
: this.collectionName;
|
|
1259
|
-
}
|
|
1260
|
-
paramsToPlain(params) {
|
|
1261
|
-
const model = this.model;
|
|
1262
|
-
if (params instanceof model)
|
|
1263
|
-
return params;
|
|
1264
|
-
return Object.keys(params).reduce((data, currentKey) => (Object.assign(Object.assign({}, data), { [currentKey]: getValueByAction(params[currentKey]) })), {});
|
|
1265
|
-
}
|
|
1266
|
-
};
|
|
1124
|
+
const withUpdateFirestore = (MixinBase) => {
|
|
1125
|
+
const getValueFromParams = (params, field) => { var _a; return (isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
|
|
1126
|
+
const getValueByAction = (options) => {
|
|
1127
|
+
const fieldValues = firebase.firestore.FieldValue;
|
|
1128
|
+
if (isNil(options.action))
|
|
1129
|
+
return options;
|
|
1130
|
+
if (options.action === UpdateOptionActions.REMOVE_FIELD)
|
|
1131
|
+
return fieldValues.delete();
|
|
1132
|
+
if (Array.isArray(options.value)) {
|
|
1133
|
+
if (options.action === UpdateOptionActions.MERGE)
|
|
1134
|
+
return fieldValues.arrayUnion(...options.value);
|
|
1135
|
+
if (options.action === UpdateOptionActions.REMOVE)
|
|
1136
|
+
return fieldValues.arrayRemove(...options.value);
|
|
1137
|
+
}
|
|
1138
|
+
return options.value;
|
|
1139
|
+
};
|
|
1140
|
+
return class UpdateFirestore extends MixinBase {
|
|
1141
|
+
update(data) {
|
|
1142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1143
|
+
const model = new this.model();
|
|
1144
|
+
const keyField = model.identifierFields().shift();
|
|
1145
|
+
const docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1146
|
+
yield docRef.set(this.paramsToPlain(data), { merge: true });
|
|
1147
|
+
const doc = yield docRef.get();
|
|
1148
|
+
return doc.data();
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
buildCollectionPathForUpdate(identifiers) {
|
|
1152
|
+
return this.isSubCollection(this)
|
|
1153
|
+
? `${this.parentRepository.collectionName}/${getValueFromParams(identifiers, this.parentIdField)}/${this.collectionName}`
|
|
1154
|
+
: this.collectionName;
|
|
1155
|
+
}
|
|
1156
|
+
paramsToPlain(params) {
|
|
1157
|
+
const model = this.model;
|
|
1158
|
+
if (params instanceof model)
|
|
1159
|
+
return params;
|
|
1160
|
+
return Object.keys(params).reduce((data, currentKey) => (Object.assign(Object.assign({}, data), { [currentKey]: getValueByAction(params[currentKey]) })), {});
|
|
1161
|
+
}
|
|
1162
|
+
};
|
|
1267
1163
|
};
|
|
1268
1164
|
|
|
1269
|
-
const withDeleteFirestore = (MixinBase) => {
|
|
1270
|
-
return class DeleteFirestore extends MixinBase {
|
|
1271
|
-
delete(identifiers) {
|
|
1272
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1273
|
-
yield this.collection(this.buildCollectionPathForRemove(identifiers))
|
|
1274
|
-
.doc(Object.values(identifiers).shift().toString())
|
|
1275
|
-
.delete();
|
|
1276
|
-
});
|
|
1277
|
-
}
|
|
1278
|
-
buildCollectionPathForRemove(identifiers) {
|
|
1279
|
-
return this.isSubCollection(this)
|
|
1280
|
-
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1281
|
-
: this.collectionName;
|
|
1282
|
-
}
|
|
1283
|
-
};
|
|
1165
|
+
const withDeleteFirestore = (MixinBase) => {
|
|
1166
|
+
return class DeleteFirestore extends MixinBase {
|
|
1167
|
+
delete(identifiers) {
|
|
1168
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1169
|
+
yield this.collection(this.buildCollectionPathForRemove(identifiers))
|
|
1170
|
+
.doc(Object.values(identifiers).shift().toString())
|
|
1171
|
+
.delete();
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
buildCollectionPathForRemove(identifiers) {
|
|
1175
|
+
return this.isSubCollection(this)
|
|
1176
|
+
? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
|
|
1177
|
+
: this.collectionName;
|
|
1178
|
+
}
|
|
1179
|
+
};
|
|
1284
1180
|
};
|
|
1285
1181
|
|
|
1286
|
-
const withSubCollection = (MixinBase, ParentModel) => {
|
|
1287
|
-
return class SubCollectionMix extends MixinBase {
|
|
1288
|
-
constructor(...args) {
|
|
1289
|
-
super(args);
|
|
1290
|
-
}
|
|
1291
|
-
collection(path) {
|
|
1292
|
-
return super.collection(path);
|
|
1293
|
-
}
|
|
1294
|
-
};
|
|
1182
|
+
const withSubCollection = (MixinBase, ParentModel) => {
|
|
1183
|
+
return class SubCollectionMix extends MixinBase {
|
|
1184
|
+
constructor(...args) {
|
|
1185
|
+
super(args);
|
|
1186
|
+
}
|
|
1187
|
+
collection(path) {
|
|
1188
|
+
return super.collection(path);
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1295
1191
|
};
|
|
1296
1192
|
|
|
1297
|
-
const withCrudFirestore = (MixinBase) => {
|
|
1298
|
-
return class CrudFirestore extends withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase))))) {
|
|
1299
|
-
};
|
|
1193
|
+
const withCrudFirestore = (MixinBase) => {
|
|
1194
|
+
return class CrudFirestore extends withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase))))) {
|
|
1195
|
+
};
|
|
1300
1196
|
};
|
|
1301
1197
|
|
|
1302
|
-
class SubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1303
|
-
constructor(firestore) {
|
|
1304
|
-
super();
|
|
1305
|
-
this.firestore = firestore;
|
|
1306
|
-
this.collectionName = 'subscription';
|
|
1307
|
-
this.model = Subscription;
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
class UserSearch extends BaseModel {
|
|
1312
|
-
identifierFields() {
|
|
1313
|
-
return ['id'];
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
class UserSearchFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1318
|
-
constructor(firestore) {
|
|
1319
|
-
super();
|
|
1320
|
-
this.firestore = firestore;
|
|
1321
|
-
this.collectionName = 'userSearch';
|
|
1322
|
-
this.model = UserSearch;
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
class UserFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1327
|
-
constructor(firestore, userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore)) {
|
|
1328
|
-
super();
|
|
1329
|
-
this.firestore = firestore;
|
|
1330
|
-
this.userSearchFirestoreRepository = userSearchFirestoreRepository;
|
|
1331
|
-
this.collectionName = 'users';
|
|
1332
|
-
this.model = User;
|
|
1333
|
-
}
|
|
1334
|
-
get(identifiers) {
|
|
1335
|
-
const _super = Object.create(null, {
|
|
1336
|
-
get: { get: () => super.get }
|
|
1337
|
-
});
|
|
1338
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1339
|
-
const user = yield _super.get.call(this, { id: identifiers.id });
|
|
1340
|
-
user.beautyProfile = yield this.getBeautyProfile(user.id);
|
|
1341
|
-
user.isSubscriber = yield this.checkIfIsSubscriber(user.id);
|
|
1342
|
-
return user;
|
|
1343
|
-
});
|
|
1344
|
-
}
|
|
1345
|
-
checkIfExistsByField(field, value) {
|
|
1346
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1347
|
-
const result = yield this.userSearchFirestoreRepository.find([{ [field]: { operator: Where.EQUALS, value } }]);
|
|
1348
|
-
return result.count > 0;
|
|
1349
|
-
});
|
|
1350
|
-
}
|
|
1351
|
-
buildModelInstance() {
|
|
1352
|
-
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1353
|
-
return {
|
|
1354
|
-
toFirestore: (data) => {
|
|
1355
|
-
const plain = toFirestore(data);
|
|
1356
|
-
delete plain.isSubscriber;
|
|
1357
|
-
return plain;
|
|
1358
|
-
},
|
|
1359
|
-
fromFirestore,
|
|
1360
|
-
};
|
|
1361
|
-
}
|
|
1362
|
-
getBeautyProfile(userId) {
|
|
1363
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1364
|
-
const beautyProfile = yield this.collection()
|
|
1365
|
-
.doc(userId)
|
|
1366
|
-
.collection('CX')
|
|
1367
|
-
.withConverter(this.buildBeautyProfileModelInstance())
|
|
1368
|
-
.doc('beautyProfile')
|
|
1369
|
-
.get();
|
|
1370
|
-
return beautyProfile.data();
|
|
1371
|
-
});
|
|
1372
|
-
}
|
|
1373
|
-
checkIfIsSubscriber(userId) {
|
|
1374
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1375
|
-
const docs = yield this.firestore
|
|
1376
|
-
.collection('subscription')
|
|
1377
|
-
.where('user.id', '==', userId)
|
|
1378
|
-
.where('status', '==', 'active')
|
|
1379
|
-
.get();
|
|
1380
|
-
return !!docs && !!docs.size;
|
|
1381
|
-
});
|
|
1382
|
-
}
|
|
1383
|
-
buildBeautyProfileModelInstance() {
|
|
1384
|
-
return {
|
|
1385
|
-
toFirestore: (data) => data.toPlain(),
|
|
1386
|
-
fromFirestore: (snap) => BeautyProfile.toInstance(snap.data()),
|
|
1387
|
-
};
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
class SubscriptionEditionFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
|
|
1392
|
-
constructor(firestore, parentRepository) {
|
|
1393
|
-
super();
|
|
1394
|
-
this.firestore = firestore;
|
|
1395
|
-
this.parentRepository = parentRepository;
|
|
1396
|
-
this.collectionName = 'editions';
|
|
1397
|
-
this.parentIdField = 'subscriptionId';
|
|
1398
|
-
this.model = Edition;
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1403
|
-
constructor(firestore, parentRepository) {
|
|
1404
|
-
super();
|
|
1405
|
-
this.firestore = firestore;
|
|
1406
|
-
this.parentRepository = parentRepository;
|
|
1407
|
-
this.collectionName = 'CX';
|
|
1408
|
-
this.parentIdField = 'userId';
|
|
1409
|
-
this.model = BeautyProfile;
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
class UserAddressFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1414
|
-
constructor(firestore, parentRepository) {
|
|
1415
|
-
super();
|
|
1416
|
-
this.firestore = firestore;
|
|
1417
|
-
this.parentRepository = parentRepository;
|
|
1418
|
-
this.collectionName = 'address';
|
|
1419
|
-
this.parentIdField = 'userId';
|
|
1420
|
-
this.model = UserAddress;
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
class UserPaymentMethodFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1425
|
-
constructor(firestore, parentRepository) {
|
|
1426
|
-
super();
|
|
1427
|
-
this.firestore = firestore;
|
|
1428
|
-
this.parentRepository = parentRepository;
|
|
1429
|
-
this.collectionName = 'payment_method';
|
|
1430
|
-
this.parentIdField = 'userId';
|
|
1431
|
-
this.model = UserPaymentMethod;
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
class SubscriptionPaymentFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
|
|
1436
|
-
constructor(firestore, parentRepository) {
|
|
1437
|
-
super();
|
|
1438
|
-
this.firestore = firestore;
|
|
1439
|
-
this.parentRepository = parentRepository;
|
|
1440
|
-
this.collectionName = 'payments';
|
|
1441
|
-
this.parentIdField = 'subscriptionId';
|
|
1442
|
-
this.model = SubscriptionPayment;
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
class LeadFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1447
|
-
constructor(firestore) {
|
|
1448
|
-
super();
|
|
1449
|
-
this.firestore = firestore;
|
|
1450
|
-
this.collectionName = 'leads';
|
|
1451
|
-
this.model = Lead;
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1456
|
-
constructor(firestore) {
|
|
1457
|
-
super();
|
|
1458
|
-
this.firestore = firestore;
|
|
1459
|
-
this.collectionName = 'categories';
|
|
1460
|
-
this.model = Category;
|
|
1461
|
-
}
|
|
1462
|
-
getCategoryBySlug(slug, shop) {
|
|
1463
|
-
return this.collection(this.collectionName)
|
|
1464
|
-
.where('slug', '==', slug)
|
|
1465
|
-
.where('shop', '==', shop)
|
|
1466
|
-
.where('published', '==', true)
|
|
1467
|
-
.get()
|
|
1468
|
-
.then((snap) => {
|
|
1469
|
-
if (snap.size > 1)
|
|
1470
|
-
throw new DuplicatedResultsError('Query returned duplicated values');
|
|
1471
|
-
if (snap.empty)
|
|
1472
|
-
throw new NotFoundError(`Document with slug ${slug} not found`);
|
|
1473
|
-
return snap.docs[0].data();
|
|
1474
|
-
})
|
|
1475
|
-
.catch((error) => error);
|
|
1476
|
-
}
|
|
1477
|
-
getCategoriesForHome(categoryIds, limit = 4) {
|
|
1478
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1479
|
-
const categorySnap = yield this.collection(this.collectionName)
|
|
1480
|
-
.where('id', 'in', categoryIds
|
|
1481
|
-
.where('published', '==', true)
|
|
1482
|
-
.get();
|
|
1483
|
-
if (categorySnap.empty)
|
|
1484
|
-
throw new NotFoundError('Categories not found');
|
|
1485
|
-
const categories = categorySnap.docs.map((doc) => doc.data());
|
|
1486
|
-
const homeSections =
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
}
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
const
|
|
1588
|
-
if (
|
|
1589
|
-
|
|
1590
|
-
return
|
|
1591
|
-
},
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
this.
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
this.
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
}
|
|
1697
|
-
};
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
this
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
}
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
}
|
|
1747
|
-
});
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
}
|
|
1754
|
-
signInAnonymously() {
|
|
1755
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1756
|
-
const auth = yield this.firebaseAuth.signInAnonymously();
|
|
1757
|
-
const user = auth.user;
|
|
1758
|
-
user.id = auth.user.uid;
|
|
1759
|
-
return user;
|
|
1760
|
-
});
|
|
1761
|
-
}
|
|
1762
|
-
sendPasswordResetEmail(email) {
|
|
1763
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1764
|
-
return this.firebaseAuth.sendPasswordResetEmail(email);
|
|
1765
|
-
});
|
|
1766
|
-
}
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
class RegisterFirebaseAuthService {
|
|
1770
|
-
constructor(firebaseAuth) {
|
|
1771
|
-
this.firebaseAuth = firebaseAuth;
|
|
1772
|
-
}
|
|
1773
|
-
register(params) {
|
|
1774
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1775
|
-
try {
|
|
1776
|
-
const auth = yield this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password);
|
|
1777
|
-
const user = auth.user;
|
|
1778
|
-
user.sendEmailVerification();
|
|
1779
|
-
user.id = auth.user.uid;
|
|
1780
|
-
return user;
|
|
1781
|
-
}
|
|
1782
|
-
catch (error) {
|
|
1783
|
-
if (error.code === 'auth/email-already-in-use')
|
|
1784
|
-
throw new UserAlreadyRegisteredError('Email already registered');
|
|
1785
|
-
if (error.code === 'auth/weak-password')
|
|
1786
|
-
throw new WeakPasswordError();
|
|
1787
|
-
throw error;
|
|
1788
|
-
}
|
|
1789
|
-
});
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
|
|
1793
|
-
/**
|
|
1794
|
-
* Generated bundle index. Do not edit.
|
|
1198
|
+
class SubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1199
|
+
constructor(firestore) {
|
|
1200
|
+
super();
|
|
1201
|
+
this.firestore = firestore;
|
|
1202
|
+
this.collectionName = 'subscription';
|
|
1203
|
+
this.model = Subscription;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
class UserSearch extends BaseModel {
|
|
1208
|
+
identifierFields() {
|
|
1209
|
+
return ['id'];
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
class UserSearchFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1214
|
+
constructor(firestore) {
|
|
1215
|
+
super();
|
|
1216
|
+
this.firestore = firestore;
|
|
1217
|
+
this.collectionName = 'userSearch';
|
|
1218
|
+
this.model = UserSearch;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
class UserFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1223
|
+
constructor(firestore, userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore)) {
|
|
1224
|
+
super();
|
|
1225
|
+
this.firestore = firestore;
|
|
1226
|
+
this.userSearchFirestoreRepository = userSearchFirestoreRepository;
|
|
1227
|
+
this.collectionName = 'users';
|
|
1228
|
+
this.model = User;
|
|
1229
|
+
}
|
|
1230
|
+
get(identifiers) {
|
|
1231
|
+
const _super = Object.create(null, {
|
|
1232
|
+
get: { get: () => super.get }
|
|
1233
|
+
});
|
|
1234
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1235
|
+
const user = yield _super.get.call(this, { id: identifiers.id });
|
|
1236
|
+
user.beautyProfile = yield this.getBeautyProfile(user.id);
|
|
1237
|
+
user.isSubscriber = yield this.checkIfIsSubscriber(user.id);
|
|
1238
|
+
return user;
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
checkIfExistsByField(field, value) {
|
|
1242
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1243
|
+
const result = yield this.userSearchFirestoreRepository.find([{ [field]: { operator: Where.EQUALS, value } }]);
|
|
1244
|
+
return result.count > 0;
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
buildModelInstance() {
|
|
1248
|
+
const { fromFirestore, toFirestore } = super.buildModelInstance();
|
|
1249
|
+
return {
|
|
1250
|
+
toFirestore: (data) => {
|
|
1251
|
+
const plain = toFirestore(data);
|
|
1252
|
+
delete plain.isSubscriber;
|
|
1253
|
+
return plain;
|
|
1254
|
+
},
|
|
1255
|
+
fromFirestore,
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
getBeautyProfile(userId) {
|
|
1259
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1260
|
+
const beautyProfile = yield this.collection()
|
|
1261
|
+
.doc(userId)
|
|
1262
|
+
.collection('CX')
|
|
1263
|
+
.withConverter(this.buildBeautyProfileModelInstance())
|
|
1264
|
+
.doc('beautyProfile')
|
|
1265
|
+
.get();
|
|
1266
|
+
return beautyProfile.data();
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
checkIfIsSubscriber(userId) {
|
|
1270
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1271
|
+
const docs = yield this.firestore
|
|
1272
|
+
.collection('subscription')
|
|
1273
|
+
.where('user.id', '==', userId)
|
|
1274
|
+
.where('status', '==', 'active')
|
|
1275
|
+
.get();
|
|
1276
|
+
return !!docs && !!docs.size;
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1279
|
+
buildBeautyProfileModelInstance() {
|
|
1280
|
+
return {
|
|
1281
|
+
toFirestore: (data) => data.toPlain(),
|
|
1282
|
+
fromFirestore: (snap) => BeautyProfile.toInstance(snap.data()),
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
class SubscriptionEditionFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
|
|
1288
|
+
constructor(firestore, parentRepository) {
|
|
1289
|
+
super();
|
|
1290
|
+
this.firestore = firestore;
|
|
1291
|
+
this.parentRepository = parentRepository;
|
|
1292
|
+
this.collectionName = 'editions';
|
|
1293
|
+
this.parentIdField = 'subscriptionId';
|
|
1294
|
+
this.model = Edition;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1299
|
+
constructor(firestore, parentRepository) {
|
|
1300
|
+
super();
|
|
1301
|
+
this.firestore = firestore;
|
|
1302
|
+
this.parentRepository = parentRepository;
|
|
1303
|
+
this.collectionName = 'CX';
|
|
1304
|
+
this.parentIdField = 'userId';
|
|
1305
|
+
this.model = BeautyProfile;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
class UserAddressFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1310
|
+
constructor(firestore, parentRepository) {
|
|
1311
|
+
super();
|
|
1312
|
+
this.firestore = firestore;
|
|
1313
|
+
this.parentRepository = parentRepository;
|
|
1314
|
+
this.collectionName = 'address';
|
|
1315
|
+
this.parentIdField = 'userId';
|
|
1316
|
+
this.model = UserAddress;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
class UserPaymentMethodFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
|
|
1321
|
+
constructor(firestore, parentRepository) {
|
|
1322
|
+
super();
|
|
1323
|
+
this.firestore = firestore;
|
|
1324
|
+
this.parentRepository = parentRepository;
|
|
1325
|
+
this.collectionName = 'payment_method';
|
|
1326
|
+
this.parentIdField = 'userId';
|
|
1327
|
+
this.model = UserPaymentMethod;
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
class SubscriptionPaymentFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
|
|
1332
|
+
constructor(firestore, parentRepository) {
|
|
1333
|
+
super();
|
|
1334
|
+
this.firestore = firestore;
|
|
1335
|
+
this.parentRepository = parentRepository;
|
|
1336
|
+
this.collectionName = 'payments';
|
|
1337
|
+
this.parentIdField = 'subscriptionId';
|
|
1338
|
+
this.model = SubscriptionPayment;
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
class LeadFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1343
|
+
constructor(firestore) {
|
|
1344
|
+
super();
|
|
1345
|
+
this.firestore = firestore;
|
|
1346
|
+
this.collectionName = 'leads';
|
|
1347
|
+
this.model = Lead;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1352
|
+
constructor(firestore) {
|
|
1353
|
+
super();
|
|
1354
|
+
this.firestore = firestore;
|
|
1355
|
+
this.collectionName = 'categories';
|
|
1356
|
+
this.model = Category;
|
|
1357
|
+
}
|
|
1358
|
+
getCategoryBySlug(slug, shop) {
|
|
1359
|
+
return this.collection(this.collectionName)
|
|
1360
|
+
.where('slug', '==', slug)
|
|
1361
|
+
.where('shop', '==', shop)
|
|
1362
|
+
.where('published', '==', true)
|
|
1363
|
+
.get()
|
|
1364
|
+
.then((snap) => {
|
|
1365
|
+
if (snap.size > 1)
|
|
1366
|
+
throw new DuplicatedResultsError('Query returned duplicated values');
|
|
1367
|
+
if (snap.empty)
|
|
1368
|
+
throw new NotFoundError(`Document with slug ${slug} not found`);
|
|
1369
|
+
return snap.docs[0].data();
|
|
1370
|
+
})
|
|
1371
|
+
.catch((error) => error);
|
|
1372
|
+
}
|
|
1373
|
+
getCategoriesForHome(categoryIds, limit = 4) {
|
|
1374
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1375
|
+
const categorySnap = yield this.collection(this.collectionName)
|
|
1376
|
+
.where('id', 'in', categoryIds)
|
|
1377
|
+
.where('published', '==', true)
|
|
1378
|
+
.get();
|
|
1379
|
+
if (categorySnap.empty)
|
|
1380
|
+
throw new NotFoundError('Categories not found');
|
|
1381
|
+
const categories = categorySnap.docs.map((doc) => doc.data());
|
|
1382
|
+
const homeSections = [];
|
|
1383
|
+
for (const category of categories) {
|
|
1384
|
+
const publishedField = category.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1385
|
+
const productSnap = yield this.collection('products')
|
|
1386
|
+
.where('categories', 'array-contains', category.id)
|
|
1387
|
+
.where(publishedField, '==', true)
|
|
1388
|
+
.where('stock.quantity', '>', 1)
|
|
1389
|
+
.limit(limit)
|
|
1390
|
+
.get();
|
|
1391
|
+
const products = productSnap.docs.map((doc) => doc.data());
|
|
1392
|
+
homeSections.push({ category, products });
|
|
1393
|
+
}
|
|
1394
|
+
return homeSections;
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1397
|
+
mountCategory(category) {
|
|
1398
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1399
|
+
if (!category.products)
|
|
1400
|
+
throw new RequiredArgumentError(['Category products is empty']);
|
|
1401
|
+
const chunks = category.products.reduce((resultArray, item, index) => {
|
|
1402
|
+
const chunkIndex = Math.floor(index / 10);
|
|
1403
|
+
if (!resultArray[chunkIndex])
|
|
1404
|
+
resultArray[chunkIndex] = [];
|
|
1405
|
+
resultArray[chunkIndex].push(item);
|
|
1406
|
+
return resultArray;
|
|
1407
|
+
}, []);
|
|
1408
|
+
const products = [];
|
|
1409
|
+
const publishedField = category.shop === Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1410
|
+
yield Promise.all(chunks.map((productIds) => __awaiter(this, void 0, void 0, function* () {
|
|
1411
|
+
const productSnap = yield this.collection('products')
|
|
1412
|
+
.where(publishedField, '==', true)
|
|
1413
|
+
.where('id', 'in', productIds)
|
|
1414
|
+
.get();
|
|
1415
|
+
if (productSnap.empty)
|
|
1416
|
+
return;
|
|
1417
|
+
products.push(...productSnap.docs.map((doc) => doc.data()));
|
|
1418
|
+
})));
|
|
1419
|
+
return products;
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1425
|
+
constructor(firestore) {
|
|
1426
|
+
super();
|
|
1427
|
+
this.firestore = firestore;
|
|
1428
|
+
this.collectionName = 'products';
|
|
1429
|
+
this.model = Product;
|
|
1430
|
+
}
|
|
1431
|
+
getBySlug(slug, shop) {
|
|
1432
|
+
var _a;
|
|
1433
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1434
|
+
const result = yield this.find([
|
|
1435
|
+
{ slug: { operator: Where.EQUALS, value: slug } },
|
|
1436
|
+
{ shopAvailability: { operator: Where.IN, value: [shop] } },
|
|
1437
|
+
]);
|
|
1438
|
+
return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product) {
|
|
1444
|
+
constructor(firestore, parentRepository) {
|
|
1445
|
+
super();
|
|
1446
|
+
this.firestore = firestore;
|
|
1447
|
+
this.parentRepository = parentRepository;
|
|
1448
|
+
this.collectionName = 'variants';
|
|
1449
|
+
this.parentIdField = 'productId';
|
|
1450
|
+
this.model = Variant;
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
class SubscriptionProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1455
|
+
constructor(firestore) {
|
|
1456
|
+
super();
|
|
1457
|
+
this.firestore = firestore;
|
|
1458
|
+
this.collectionName = 'subscriptionProducts';
|
|
1459
|
+
this.model = Product;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
class CheckoutFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1464
|
+
constructor(firestore) {
|
|
1465
|
+
super();
|
|
1466
|
+
this.firestore = firestore;
|
|
1467
|
+
this.collectionName = 'checkouts';
|
|
1468
|
+
this.model = Checkout;
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
class CouponFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1473
|
+
constructor(firestore) {
|
|
1474
|
+
super();
|
|
1475
|
+
this.firestore = firestore;
|
|
1476
|
+
this.collectionName = 'coupons';
|
|
1477
|
+
this.model = Coupon;
|
|
1478
|
+
}
|
|
1479
|
+
buildModelInstance() {
|
|
1480
|
+
return {
|
|
1481
|
+
toFirestore: (data) => {
|
|
1482
|
+
var _a;
|
|
1483
|
+
const plain = (data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data;
|
|
1484
|
+
if (!!plain.categories)
|
|
1485
|
+
plain.categories = (_a = plain === null || plain === void 0 ? void 0 : plain.categories) === null || _a === void 0 ? void 0 : _a.map((category) => category.id);
|
|
1486
|
+
return plain;
|
|
1487
|
+
},
|
|
1488
|
+
fromFirestore: (snap) => {
|
|
1489
|
+
var _a;
|
|
1490
|
+
const data = snap.data();
|
|
1491
|
+
Object.keys(data).forEach((key) => {
|
|
1492
|
+
if (data[key] instanceof firebase.firestore.Timestamp) {
|
|
1493
|
+
data[key] = data[key].toDate();
|
|
1494
|
+
}
|
|
1495
|
+
});
|
|
1496
|
+
data.categories = (_a = data === null || data === void 0 ? void 0 : data.categories) === null || _a === void 0 ? void 0 : _a.map((category) => ({ id: category }));
|
|
1497
|
+
if (data.checkout_type === CheckoutTypes.SUBSCRIPTION)
|
|
1498
|
+
return ClubCoupon.toInstance(Object.assign({ id: snap.id }, data));
|
|
1499
|
+
if (data.checkout_type === CheckoutTypes.ECOMMERCE)
|
|
1500
|
+
return StoreCoupon.toInstance(Object.assign({ id: snap.id }, data));
|
|
1501
|
+
return this.model.toInstance(Object.assign({ id: snap.id }, data));
|
|
1502
|
+
},
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
class OrderFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1508
|
+
constructor(firestore) {
|
|
1509
|
+
super();
|
|
1510
|
+
this.firestore = firestore;
|
|
1511
|
+
this.collectionName = 'orders';
|
|
1512
|
+
this.model = Order;
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1517
|
+
constructor(firestore) {
|
|
1518
|
+
super();
|
|
1519
|
+
this.firestore = firestore;
|
|
1520
|
+
this.collectionName = 'payments';
|
|
1521
|
+
this.model = Payment;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
class CheckoutSubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1526
|
+
constructor(firestore) {
|
|
1527
|
+
super();
|
|
1528
|
+
this.firestore = firestore;
|
|
1529
|
+
this.collectionName = 'checkoutsSubscription';
|
|
1530
|
+
this.model = CheckoutSubscription;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
class SubscriptionPlanFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1535
|
+
constructor(firestore) {
|
|
1536
|
+
super();
|
|
1537
|
+
this.firestore = firestore;
|
|
1538
|
+
this.collectionName = 'subscriptionPlans';
|
|
1539
|
+
this.model = SubscriptionPlan;
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
class Buy2WinFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1544
|
+
constructor(firestore) {
|
|
1545
|
+
super();
|
|
1546
|
+
this.firestore = firestore;
|
|
1547
|
+
this.collectionName = 'buy2win';
|
|
1548
|
+
this.model = Buy2Win;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
1553
|
+
constructor(firestore) {
|
|
1554
|
+
super(firestore);
|
|
1555
|
+
this.firestore = firestore;
|
|
1556
|
+
this.collectionName = 'legacyOrders';
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1561
|
+
constructor(firestore) {
|
|
1562
|
+
super();
|
|
1563
|
+
this.firestore = firestore;
|
|
1564
|
+
this.collectionName = 'dms';
|
|
1565
|
+
this.model = Home;
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
class ShopMenuFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
1570
|
+
constructor(firestore) {
|
|
1571
|
+
super();
|
|
1572
|
+
this.firestore = firestore;
|
|
1573
|
+
this.collectionName = 'shopMenus';
|
|
1574
|
+
this.model = ShopMenu;
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
class AuthenticationFirebaseAuthService {
|
|
1579
|
+
constructor(firebaseAuth) {
|
|
1580
|
+
this.firebaseAuth = firebaseAuth;
|
|
1581
|
+
}
|
|
1582
|
+
signInWithEmailAndPassword(data) {
|
|
1583
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1584
|
+
const credentials = yield this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password);
|
|
1585
|
+
const user = credentials.user;
|
|
1586
|
+
return {
|
|
1587
|
+
id: user.uid,
|
|
1588
|
+
displayName: user.displayName,
|
|
1589
|
+
email: user.email,
|
|
1590
|
+
phone: user.phoneNumber,
|
|
1591
|
+
isAnonymous: false,
|
|
1592
|
+
};
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
signInWithGoogle() {
|
|
1596
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1597
|
+
const credentials = yield this.firebaseAuth.signInWithPopup(new firebase$1.auth.GoogleAuthProvider());
|
|
1598
|
+
const user = credentials.user;
|
|
1599
|
+
return {
|
|
1600
|
+
id: user.uid,
|
|
1601
|
+
displayName: user.displayName,
|
|
1602
|
+
email: user.email,
|
|
1603
|
+
phone: user.phoneNumber,
|
|
1604
|
+
isAnonymous: false,
|
|
1605
|
+
};
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
signOut() {
|
|
1609
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1610
|
+
this.firebaseAuth.signOut();
|
|
1611
|
+
});
|
|
1612
|
+
}
|
|
1613
|
+
signInAnonymously() {
|
|
1614
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1615
|
+
const auth = yield this.firebaseAuth.signInAnonymously();
|
|
1616
|
+
const user = auth.user;
|
|
1617
|
+
user.id = auth.user.uid;
|
|
1618
|
+
return user;
|
|
1619
|
+
});
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
class RegisterFirebaseAuthService {
|
|
1624
|
+
constructor(firebaseAuth) {
|
|
1625
|
+
this.firebaseAuth = firebaseAuth;
|
|
1626
|
+
}
|
|
1627
|
+
register(params) {
|
|
1628
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1629
|
+
try {
|
|
1630
|
+
const auth = yield this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password);
|
|
1631
|
+
const user = auth.user;
|
|
1632
|
+
user.sendEmailVerification();
|
|
1633
|
+
user.id = auth.user.uid;
|
|
1634
|
+
return user;
|
|
1635
|
+
}
|
|
1636
|
+
catch (error) {
|
|
1637
|
+
if (error.code === 'auth/email-already-in-use')
|
|
1638
|
+
throw new UserAlreadyRegisteredError('Email already registered');
|
|
1639
|
+
if (error.code === 'auth/weak-password')
|
|
1640
|
+
throw new WeakPasswordError();
|
|
1641
|
+
throw error;
|
|
1642
|
+
}
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* Generated bundle index. Do not edit.
|
|
1795
1649
|
*/
|
|
1796
1650
|
|
|
1797
|
-
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService,
|
|
1651
|
+
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Category, CategoryFirestoreRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClubCoupon, Coupon, CouponFirestoreRepository, DiscountType, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, FilterType, FragranceImportances, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Product, ProductFirestoreRepository, ProductSpents, ProductVariantFirestoreRepository, QuestionsFilters, Register, RegisterFirebaseAuthService, RequiredArgumentError, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, Shops, SignInMethods, SignOut, Status, StoreCoupon, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, UnauthorizedError, UpdateOptionActions, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserSearchFirestoreRepository, UserType, Variant, WeakPasswordError, Where, withCreateFirestore, withCrudFirestore, withDeleteFirestore, withFindFirestore, withFirestore, withGetFirestore, withHelpers, withSubCollection, withUpdateFirestore };
|
|
1798
1652
|
//# sourceMappingURL=infrab4a-connect.js.map
|