@infrab4a/connect 0.4.9 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/README.md +24 -24
  2. package/bundles/infrab4a-connect.umd.js +1787 -1625
  3. package/bundles/infrab4a-connect.umd.js.map +1 -1
  4. package/esm2015/infrab4a-connect.js +4 -4
  5. package/esm2015/lib/domain/catalog/index.js +3 -3
  6. package/esm2015/lib/domain/catalog/models/category.js +7 -7
  7. package/esm2015/lib/domain/catalog/models/enums/index.js +2 -2
  8. package/esm2015/lib/domain/catalog/models/enums/shops.enum.js +6 -6
  9. package/esm2015/lib/domain/catalog/models/index.js +6 -6
  10. package/esm2015/lib/domain/catalog/models/product.js +11 -7
  11. package/esm2015/lib/domain/catalog/models/types/category-condition.type.js +2 -2
  12. package/esm2015/lib/domain/catalog/models/types/category-filter.type.js +2 -2
  13. package/esm2015/lib/domain/catalog/models/types/index.js +8 -8
  14. package/esm2015/lib/domain/catalog/models/types/product-review.type.js +2 -2
  15. package/esm2015/lib/domain/catalog/models/types/shops-description.type.js +2 -2
  16. package/esm2015/lib/domain/catalog/models/types/shops-price.type.js +2 -2
  17. package/esm2015/lib/domain/catalog/models/types/stock.type.js +2 -2
  18. package/esm2015/lib/domain/catalog/models/types/variant-grade.type.js +2 -2
  19. package/esm2015/lib/domain/catalog/models/variant.js +7 -7
  20. package/esm2015/lib/domain/catalog/repositories/category.repository.js +2 -2
  21. package/esm2015/lib/domain/catalog/repositories/index.js +4 -4
  22. package/esm2015/lib/domain/catalog/repositories/product.repository.js +2 -2
  23. package/esm2015/lib/domain/catalog/repositories/variant.repository.js +2 -2
  24. package/esm2015/lib/domain/general/index.js +3 -3
  25. package/esm2015/lib/domain/general/model/base-model-with-identifier-fields.js +2 -2
  26. package/esm2015/lib/domain/general/model/base.model.js +13 -13
  27. package/esm2015/lib/domain/general/model/identifier-fields.js +2 -2
  28. package/esm2015/lib/domain/general/model/index.js +5 -5
  29. package/esm2015/lib/domain/general/model/types/base-model-builder.type.js +2 -2
  30. package/esm2015/lib/domain/general/model/types/index.js +4 -4
  31. package/esm2015/lib/domain/general/model/types/non-function-properties.type.js +2 -2
  32. package/esm2015/lib/domain/general/model/types/non-function-property-name.type.js +2 -2
  33. package/esm2015/lib/domain/general/repository/create.repository.js +2 -2
  34. package/esm2015/lib/domain/general/repository/crud.repository.js +2 -2
  35. package/esm2015/lib/domain/general/repository/delete.repository.js +2 -2
  36. package/esm2015/lib/domain/general/repository/enums/index.js +3 -3
  37. package/esm2015/lib/domain/general/repository/enums/update-option-actions.enum.js +9 -9
  38. package/esm2015/lib/domain/general/repository/enums/where.enum.js +11 -11
  39. package/esm2015/lib/domain/general/repository/find.repository.js +2 -2
  40. package/esm2015/lib/domain/general/repository/get.repository.js +2 -2
  41. package/esm2015/lib/domain/general/repository/index.js +10 -10
  42. package/esm2015/lib/domain/general/repository/read.repository.js +2 -2
  43. package/esm2015/lib/domain/general/repository/types/index.js +6 -6
  44. package/esm2015/lib/domain/general/repository/types/repository-find-filters.type.js +2 -2
  45. package/esm2015/lib/domain/general/repository/types/repository-find-result.type.js +2 -2
  46. package/esm2015/lib/domain/general/repository/types/repository-limit-options.type.js +2 -2
  47. package/esm2015/lib/domain/general/repository/types/repository-order-by-list.type.js +2 -2
  48. package/esm2015/lib/domain/general/repository/types/repository-update-params.type.js +2 -2
  49. package/esm2015/lib/domain/general/repository/update.repository.js +2 -2
  50. package/esm2015/lib/domain/index.js +7 -7
  51. package/esm2015/lib/domain/location/index.js +2 -2
  52. package/esm2015/lib/domain/location/models/address.js +4 -4
  53. package/esm2015/lib/domain/location/models/index.js +3 -3
  54. package/esm2015/lib/domain/location/models/types/index.js +4 -4
  55. package/esm2015/lib/domain/location/models/types/location-bound.type.js +2 -2
  56. package/esm2015/lib/domain/location/models/types/location-geometry.type.js +2 -2
  57. package/esm2015/lib/domain/location/models/types/location-lat-lng.type.js +2 -2
  58. package/esm2015/lib/domain/shop-settings/index.js +3 -3
  59. package/esm2015/lib/domain/shop-settings/models/home.js +7 -7
  60. package/esm2015/lib/domain/shop-settings/models/index.js +4 -4
  61. package/esm2015/lib/domain/shop-settings/models/shop-menu.js +7 -7
  62. package/esm2015/lib/domain/shop-settings/models/types/banner.type.js +2 -2
  63. package/esm2015/lib/domain/shop-settings/models/types/benefit.type.js +2 -2
  64. package/esm2015/lib/domain/shop-settings/models/types/index.js +5 -5
  65. package/esm2015/lib/domain/shop-settings/models/types/menu-nav.type.js +2 -2
  66. package/esm2015/lib/domain/shop-settings/models/types/sub-menu.type.js +2 -2
  67. package/esm2015/lib/domain/shop-settings/repositories/home.repository.js +2 -2
  68. package/esm2015/lib/domain/shop-settings/repositories/index.js +3 -3
  69. package/esm2015/lib/domain/shop-settings/repositories/shop-menu.repository.js +2 -2
  70. package/esm2015/lib/domain/shopping/index.js +3 -3
  71. package/esm2015/lib/domain/shopping/models/buy-2-win.js +14 -7
  72. package/esm2015/lib/domain/shopping/models/checkout.js +38 -7
  73. package/esm2015/lib/domain/shopping/models/coupons/coupon.js +19 -15
  74. package/esm2015/lib/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +6 -6
  75. package/esm2015/lib/domain/shopping/models/coupons/enums/coupon-types.enum.js +8 -8
  76. package/esm2015/lib/domain/shopping/models/coupons/enums/exclusivities.enum.js +7 -7
  77. package/esm2015/lib/domain/shopping/models/coupons/enums/index.js +4 -4
  78. package/esm2015/lib/domain/shopping/models/coupons/financial-coupon.js +28 -28
  79. package/esm2015/lib/domain/shopping/models/coupons/index.js +4 -4
  80. package/esm2015/lib/domain/shopping/models/enums/checkout-types.enum.js +6 -6
  81. package/esm2015/lib/domain/shopping/models/enums/index.js +3 -3
  82. package/esm2015/lib/domain/shopping/models/enums/order-status.enum.js +12 -12
  83. package/esm2015/lib/domain/shopping/models/index.js +12 -12
  84. package/esm2015/lib/domain/shopping/models/line-item.js +4 -4
  85. package/esm2015/lib/domain/shopping/models/order.js +11 -4
  86. package/esm2015/lib/domain/shopping/models/payment.js +169 -129
  87. package/esm2015/lib/domain/shopping/models/shipping-method.js +7 -7
  88. package/esm2015/lib/domain/shopping/models/subscription/checkout.js +28 -7
  89. package/esm2015/lib/domain/shopping/models/subscription/index.js +3 -3
  90. package/esm2015/lib/domain/shopping/models/subscription/plan.js +7 -7
  91. package/esm2015/lib/domain/shopping/models/types/index.js +8 -8
  92. package/esm2015/lib/domain/shopping/models/types/payment-address.type.js +2 -2
  93. package/esm2015/lib/domain/shopping/models/types/payment-billing.type.js +2 -2
  94. package/esm2015/lib/domain/shopping/models/types/payment-card.type.js +2 -2
  95. package/esm2015/lib/domain/shopping/models/types/payment-customer.type.js +2 -2
  96. package/esm2015/lib/domain/shopping/models/types/payment-document.type.js +2 -2
  97. package/esm2015/lib/domain/shopping/models/types/payment-item.type.js +2 -2
  98. package/esm2015/lib/domain/shopping/models/types/payment-shipping.type.js +2 -2
  99. package/esm2015/lib/domain/shopping/repositories/buy-2-win.repository.js +2 -2
  100. package/esm2015/lib/domain/shopping/repositories/checkout.repository.js +2 -2
  101. package/esm2015/lib/domain/shopping/repositories/coupon.repository.js +2 -2
  102. package/esm2015/lib/domain/shopping/repositories/index.js +7 -7
  103. package/esm2015/lib/domain/shopping/repositories/order.repository.js +2 -2
  104. package/esm2015/lib/domain/shopping/repositories/payment.repository.js +2 -2
  105. package/esm2015/lib/domain/shopping/repositories/subscription/checkout.repository.js +2 -2
  106. package/esm2015/lib/domain/shopping/repositories/subscription/index.js +3 -3
  107. package/esm2015/lib/domain/shopping/repositories/subscription/plan.repository.js +2 -2
  108. package/esm2015/lib/domain/users/errors/index.js +2 -2
  109. package/esm2015/lib/domain/users/errors/unauthorized.error.js +7 -7
  110. package/esm2015/lib/domain/users/index.js +6 -6
  111. package/esm2015/lib/domain/users/models/beauty-profile.js +12 -12
  112. package/esm2015/lib/domain/users/models/enums/area.enum.js +13 -13
  113. package/esm2015/lib/domain/users/models/enums/beard-sizes.enum.js +9 -9
  114. package/esm2015/lib/domain/users/models/enums/hair-types.enum.js +9 -9
  115. package/esm2015/lib/domain/users/models/enums/index.js +7 -7
  116. package/esm2015/lib/domain/users/models/enums/office-position.enum.js +8 -8
  117. package/esm2015/lib/domain/users/models/enums/user-type.enum.js +10 -10
  118. package/esm2015/lib/domain/users/models/index.js +6 -6
  119. package/esm2015/lib/domain/users/models/subscription/edition.js +7 -7
  120. package/esm2015/lib/domain/users/models/subscription/enums/billing-status.enum.js +5 -5
  121. package/esm2015/lib/domain/users/models/subscription/enums/edition-status.enum.js +5 -5
  122. package/esm2015/lib/domain/users/models/subscription/enums/index.js +5 -5
  123. package/esm2015/lib/domain/users/models/subscription/enums/payment-type.enum.js +7 -7
  124. package/esm2015/lib/domain/users/models/subscription/enums/status.enum.js +5 -5
  125. package/esm2015/lib/domain/users/models/subscription/index.js +5 -5
  126. package/esm2015/lib/domain/users/models/subscription/payment.js +14 -7
  127. package/esm2015/lib/domain/users/models/subscription/subscription.js +43 -7
  128. package/esm2015/lib/domain/users/models/user-address.js +7 -7
  129. package/esm2015/lib/domain/users/models/user.js +24 -17
  130. package/esm2015/lib/domain/users/repositories/beauty-profile.repository.js +2 -2
  131. package/esm2015/lib/domain/users/repositories/edition.repository.js +2 -2
  132. package/esm2015/lib/domain/users/repositories/index.js +7 -7
  133. package/esm2015/lib/domain/users/repositories/subscription-payment.repository.js +2 -2
  134. package/esm2015/lib/domain/users/repositories/subscription.repository.js +2 -2
  135. package/esm2015/lib/domain/users/repositories/user-address.repository.js +2 -2
  136. package/esm2015/lib/domain/users/repositories/user.repository.js +2 -2
  137. package/esm2015/lib/domain/users/services/authentication.service.js +2 -2
  138. package/esm2015/lib/domain/users/services/index.js +2 -2
  139. package/esm2015/lib/domain/users/use-cases/authentication.js +40 -40
  140. package/esm2015/lib/domain/users/use-cases/index.js +3 -3
  141. package/esm2015/lib/domain/users/use-cases/signout.js +12 -12
  142. package/esm2015/lib/errors/duplicated-results.error.js +7 -7
  143. package/esm2015/lib/errors/index.js +5 -5
  144. package/esm2015/lib/errors/invalid-argument.error.js +7 -7
  145. package/esm2015/lib/errors/not-found.error.js +7 -7
  146. package/esm2015/lib/errors/required-argument.error.js +8 -8
  147. package/esm2015/lib/index.js +5 -5
  148. package/esm2015/lib/infra/firebase/auth/authentication-firebase-auth.service.js +27 -27
  149. package/esm2015/lib/infra/firebase/auth/index.js +2 -2
  150. package/esm2015/lib/infra/firebase/firestore/index.js +4 -4
  151. package/esm2015/lib/infra/firebase/firestore/mixins/index.js +10 -10
  152. package/esm2015/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +30 -30
  153. package/esm2015/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +10 -10
  154. package/esm2015/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +18 -18
  155. package/esm2015/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +64 -64
  156. package/esm2015/lib/infra/firebase/firestore/mixins/with-firestore.mixin.js +26 -26
  157. package/esm2015/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +24 -24
  158. package/esm2015/lib/infra/firebase/firestore/mixins/with-helpers.mixin.js +17 -17
  159. package/esm2015/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +11 -11
  160. package/esm2015/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +45 -45
  161. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +74 -74
  162. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/index.js +4 -4
  163. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +23 -23
  164. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -14
  165. package/esm2015/lib/infra/firebase/firestore/repositories/index.js +5 -5
  166. package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +12 -12
  167. package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/index.js +3 -3
  168. package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +12 -12
  169. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +12 -12
  170. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -12
  171. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +12 -12
  172. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +12 -12
  173. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/index.js +8 -8
  174. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -12
  175. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -12
  176. package/esm2015/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +12 -12
  177. package/esm2015/lib/infra/firebase/firestore/repositories/users/index.js +7 -7
  178. package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +14 -14
  179. package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +12 -12
  180. package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +14 -14
  181. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -14
  182. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +14 -14
  183. package/esm2015/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.js +62 -40
  184. package/esm2015/lib/infra/firebase/firestore/types/firestore-sub.repository.type.js +2 -2
  185. package/esm2015/lib/infra/firebase/firestore/types/firestore.helpers.type.js +2 -2
  186. package/esm2015/lib/infra/firebase/firestore/types/firestore.repository.type.js +2 -2
  187. package/esm2015/lib/infra/firebase/firestore/types/index.js +4 -4
  188. package/esm2015/lib/infra/firebase/index.js +3 -3
  189. package/esm2015/lib/infra/index.js +2 -2
  190. package/esm2015/lib/utils/index.js +5 -5
  191. package/esm2015/lib/utils/mixins/base.mixin.js +6 -6
  192. package/esm2015/lib/utils/mixins/index.js +3 -3
  193. package/esm2015/lib/utils/mixins/mixin-ctor.type.js +2 -2
  194. package/esm2015/lib/utils/types/index.js +2 -2
  195. package/esm2015/lib/utils/types/prop.type.js +2 -2
  196. package/esm2015/public-api.js +3 -2
  197. package/fesm2015/infrab4a-connect.js +1061 -908
  198. package/fesm2015/infrab4a-connect.js.map +1 -1
  199. package/infrab4a-connect.d.ts +5 -5
  200. package/lib/domain/catalog/index.d.ts +2 -2
  201. package/lib/domain/catalog/models/category.d.ts +20 -20
  202. package/lib/domain/catalog/models/enums/index.d.ts +1 -1
  203. package/lib/domain/catalog/models/enums/shops.enum.d.ts +4 -4
  204. package/lib/domain/catalog/models/index.d.ts +5 -5
  205. package/lib/domain/catalog/models/product.d.ts +33 -32
  206. package/lib/domain/catalog/models/types/category-condition.type.d.ts +4 -4
  207. package/lib/domain/catalog/models/types/category-filter.type.d.ts +4 -4
  208. package/lib/domain/catalog/models/types/index.d.ts +7 -7
  209. package/lib/domain/catalog/models/types/product-review.type.d.ts +12 -12
  210. package/lib/domain/catalog/models/types/shops-description.type.d.ts +7 -7
  211. package/lib/domain/catalog/models/types/shops-price.type.d.ts +10 -10
  212. package/lib/domain/catalog/models/types/stock.type.d.ts +3 -3
  213. package/lib/domain/catalog/models/types/variant-grade.type.d.ts +4 -4
  214. package/lib/domain/catalog/models/variant.d.ts +12 -12
  215. package/lib/domain/catalog/repositories/category.repository.d.ts +12 -12
  216. package/lib/domain/catalog/repositories/index.d.ts +3 -3
  217. package/lib/domain/catalog/repositories/product.repository.d.ts +5 -5
  218. package/lib/domain/catalog/repositories/variant.repository.d.ts +4 -4
  219. package/lib/domain/general/index.d.ts +2 -2
  220. package/lib/domain/general/model/base-model-with-identifier-fields.d.ts +3 -3
  221. package/lib/domain/general/model/base.model.d.ts +6 -6
  222. package/lib/domain/general/model/identifier-fields.d.ts +4 -4
  223. package/lib/domain/general/model/index.d.ts +4 -4
  224. package/lib/domain/general/model/types/base-model-builder.type.d.ts +5 -5
  225. package/lib/domain/general/model/types/index.d.ts +3 -3
  226. package/lib/domain/general/model/types/non-function-properties.type.d.ts +2 -2
  227. package/lib/domain/general/model/types/non-function-property-name.type.d.ts +3 -3
  228. package/lib/domain/general/repository/create.repository.d.ts +5 -5
  229. package/lib/domain/general/repository/crud.repository.d.ts +7 -7
  230. package/lib/domain/general/repository/delete.repository.d.ts +5 -5
  231. package/lib/domain/general/repository/enums/index.d.ts +2 -2
  232. package/lib/domain/general/repository/enums/update-option-actions.enum.d.ts +7 -7
  233. package/lib/domain/general/repository/enums/where.enum.d.ts +9 -9
  234. package/lib/domain/general/repository/find.repository.d.ts +5 -5
  235. package/lib/domain/general/repository/get.repository.d.ts +5 -5
  236. package/lib/domain/general/repository/index.d.ts +9 -9
  237. package/lib/domain/general/repository/read.repository.d.ts +5 -5
  238. package/lib/domain/general/repository/types/index.d.ts +5 -5
  239. package/lib/domain/general/repository/types/repository-find-filters.type.d.ts +10 -10
  240. package/lib/domain/general/repository/types/repository-find-result.type.d.ts +4 -4
  241. package/lib/domain/general/repository/types/repository-limit-options.type.d.ts +4 -4
  242. package/lib/domain/general/repository/types/repository-order-by-list.type.d.ts +5 -5
  243. package/lib/domain/general/repository/types/repository-update-params.type.d.ts +11 -11
  244. package/lib/domain/general/repository/update.repository.d.ts +5 -5
  245. package/lib/domain/index.d.ts +6 -6
  246. package/lib/domain/location/index.d.ts +1 -1
  247. package/lib/domain/location/models/address.d.ts +21 -21
  248. package/lib/domain/location/models/index.d.ts +2 -2
  249. package/lib/domain/location/models/types/index.d.ts +3 -3
  250. package/lib/domain/location/models/types/location-bound.type.d.ts +6 -6
  251. package/lib/domain/location/models/types/location-geometry.type.d.ts +7 -7
  252. package/lib/domain/location/models/types/location-lat-lng.type.d.ts +4 -4
  253. package/lib/domain/shop-settings/index.d.ts +2 -2
  254. package/lib/domain/shop-settings/models/home.d.ts +17 -17
  255. package/lib/domain/shop-settings/models/index.d.ts +3 -3
  256. package/lib/domain/shop-settings/models/shop-menu.d.ts +7 -7
  257. package/lib/domain/shop-settings/models/types/banner.type.d.ts +6 -6
  258. package/lib/domain/shop-settings/models/types/benefit.type.d.ts +5 -5
  259. package/lib/domain/shop-settings/models/types/index.d.ts +4 -4
  260. package/lib/domain/shop-settings/models/types/menu-nav.type.d.ts +8 -8
  261. package/lib/domain/shop-settings/models/types/sub-menu.type.d.ts +8 -8
  262. package/lib/domain/shop-settings/repositories/home.repository.d.ts +4 -4
  263. package/lib/domain/shop-settings/repositories/index.d.ts +2 -2
  264. package/lib/domain/shop-settings/repositories/shop-menu.repository.d.ts +4 -4
  265. package/lib/domain/shopping/index.d.ts +2 -2
  266. package/lib/domain/shopping/models/buy-2-win.d.ts +18 -18
  267. package/lib/domain/shopping/models/checkout.d.ts +28 -28
  268. package/lib/domain/shopping/models/coupons/coupon.d.ts +25 -25
  269. package/lib/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +4 -4
  270. package/lib/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +6 -6
  271. package/lib/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +5 -5
  272. package/lib/domain/shopping/models/coupons/enums/index.d.ts +3 -3
  273. package/lib/domain/shopping/models/coupons/financial-coupon.d.ts +8 -8
  274. package/lib/domain/shopping/models/coupons/index.d.ts +3 -3
  275. package/lib/domain/shopping/models/enums/checkout-types.enum.d.ts +4 -4
  276. package/lib/domain/shopping/models/enums/index.d.ts +2 -2
  277. package/lib/domain/shopping/models/enums/order-status.enum.d.ts +10 -10
  278. package/lib/domain/shopping/models/index.d.ts +11 -11
  279. package/lib/domain/shopping/models/line-item.d.ts +8 -7
  280. package/lib/domain/shopping/models/order.d.ts +7 -7
  281. package/lib/domain/shopping/models/payment.d.ts +69 -69
  282. package/lib/domain/shopping/models/shipping-method.d.ts +18 -18
  283. package/lib/domain/shopping/models/subscription/checkout.d.ts +23 -23
  284. package/lib/domain/shopping/models/subscription/index.d.ts +2 -2
  285. package/lib/domain/shopping/models/subscription/plan.d.ts +12 -12
  286. package/lib/domain/shopping/models/types/index.d.ts +7 -7
  287. package/lib/domain/shopping/models/types/payment-address.type.d.ts +12 -12
  288. package/lib/domain/shopping/models/types/payment-billing.type.d.ts +7 -7
  289. package/lib/domain/shopping/models/types/payment-card.type.d.ts +14 -14
  290. package/lib/domain/shopping/models/types/payment-customer.type.d.ts +18 -18
  291. package/lib/domain/shopping/models/types/payment-document.type.d.ts +6 -6
  292. package/lib/domain/shopping/models/types/payment-item.type.d.ts +11 -11
  293. package/lib/domain/shopping/models/types/payment-shipping.type.d.ts +10 -10
  294. package/lib/domain/shopping/repositories/buy-2-win.repository.d.ts +4 -4
  295. package/lib/domain/shopping/repositories/checkout.repository.d.ts +4 -4
  296. package/lib/domain/shopping/repositories/coupon.repository.d.ts +4 -4
  297. package/lib/domain/shopping/repositories/index.d.ts +6 -6
  298. package/lib/domain/shopping/repositories/order.repository.d.ts +4 -4
  299. package/lib/domain/shopping/repositories/payment.repository.d.ts +4 -4
  300. package/lib/domain/shopping/repositories/subscription/checkout.repository.d.ts +4 -4
  301. package/lib/domain/shopping/repositories/subscription/index.d.ts +2 -2
  302. package/lib/domain/shopping/repositories/subscription/plan.repository.d.ts +4 -4
  303. package/lib/domain/users/errors/index.d.ts +1 -1
  304. package/lib/domain/users/errors/unauthorized.error.d.ts +4 -4
  305. package/lib/domain/users/index.d.ts +5 -5
  306. package/lib/domain/users/models/beauty-profile.d.ts +12 -12
  307. package/lib/domain/users/models/enums/area.enum.d.ts +11 -11
  308. package/lib/domain/users/models/enums/beard-sizes.enum.d.ts +7 -7
  309. package/lib/domain/users/models/enums/hair-types.enum.d.ts +7 -7
  310. package/lib/domain/users/models/enums/index.d.ts +6 -6
  311. package/lib/domain/users/models/enums/office-position.enum.d.ts +6 -6
  312. package/lib/domain/users/models/enums/user-type.enum.d.ts +8 -8
  313. package/lib/domain/users/models/index.d.ts +5 -5
  314. package/lib/domain/users/models/subscription/edition.d.ts +15 -15
  315. package/lib/domain/users/models/subscription/enums/billing-status.enum.d.ts +3 -3
  316. package/lib/domain/users/models/subscription/enums/edition-status.enum.d.ts +3 -3
  317. package/lib/domain/users/models/subscription/enums/index.d.ts +4 -4
  318. package/lib/domain/users/models/subscription/enums/payment-type.enum.d.ts +5 -5
  319. package/lib/domain/users/models/subscription/enums/status.enum.d.ts +3 -3
  320. package/lib/domain/users/models/subscription/index.d.ts +4 -4
  321. package/lib/domain/users/models/subscription/payment.d.ts +14 -14
  322. package/lib/domain/users/models/subscription/subscription.d.ts +30 -30
  323. package/lib/domain/users/models/user-address.d.ts +7 -7
  324. package/lib/domain/users/models/user.d.ts +24 -23
  325. package/lib/domain/users/repositories/beauty-profile.repository.d.ts +4 -4
  326. package/lib/domain/users/repositories/edition.repository.d.ts +4 -4
  327. package/lib/domain/users/repositories/index.d.ts +6 -6
  328. package/lib/domain/users/repositories/subscription-payment.repository.d.ts +4 -4
  329. package/lib/domain/users/repositories/subscription.repository.d.ts +4 -4
  330. package/lib/domain/users/repositories/user-address.repository.d.ts +4 -4
  331. package/lib/domain/users/repositories/user.repository.d.ts +4 -4
  332. package/lib/domain/users/services/authentication.service.d.ts +10 -10
  333. package/lib/domain/users/services/index.d.ts +1 -1
  334. package/lib/domain/users/use-cases/authentication.d.ts +21 -21
  335. package/lib/domain/users/use-cases/index.d.ts +2 -2
  336. package/lib/domain/users/use-cases/signout.d.ts +6 -6
  337. package/lib/errors/duplicated-results.error.d.ts +4 -4
  338. package/lib/errors/index.d.ts +4 -4
  339. package/lib/errors/invalid-argument.error.d.ts +4 -4
  340. package/lib/errors/not-found.error.d.ts +4 -4
  341. package/lib/errors/required-argument.error.d.ts +5 -5
  342. package/lib/index.d.ts +4 -4
  343. package/lib/infra/firebase/auth/authentication-firebase-auth.service.d.ts +9 -9
  344. package/lib/infra/firebase/auth/index.d.ts +1 -1
  345. package/lib/infra/firebase/firestore/index.d.ts +3 -3
  346. package/lib/infra/firebase/firestore/mixins/index.d.ts +9 -9
  347. package/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +17 -17
  348. package/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +29 -29
  349. package/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +15 -15
  350. package/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +20 -20
  351. package/lib/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +15 -15
  352. package/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +15 -15
  353. package/lib/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +10 -10
  354. package/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +14 -14
  355. package/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +16 -16
  356. package/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +55 -55
  357. package/lib/infra/firebase/firestore/repositories/catalog/index.d.ts +3 -3
  358. package/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +50 -50
  359. package/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +60 -60
  360. package/lib/infra/firebase/firestore/repositories/index.d.ts +4 -4
  361. package/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +49 -49
  362. package/lib/infra/firebase/firestore/repositories/shop-settings/index.d.ts +2 -2
  363. package/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +49 -49
  364. package/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +49 -49
  365. package/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +49 -49
  366. package/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +49 -49
  367. package/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +49 -49
  368. package/lib/infra/firebase/firestore/repositories/shopping/index.d.ts +7 -7
  369. package/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +49 -49
  370. package/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +49 -49
  371. package/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +49 -49
  372. package/lib/infra/firebase/firestore/repositories/users/index.d.ts +6 -6
  373. package/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +60 -60
  374. package/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +49 -49
  375. package/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +60 -60
  376. package/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +60 -60
  377. package/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +60 -60
  378. package/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +57 -52
  379. package/lib/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +6 -6
  380. package/lib/infra/firebase/firestore/types/firestore.helpers.type.d.ts +8 -8
  381. package/lib/infra/firebase/firestore/types/firestore.repository.type.d.ts +8 -8
  382. package/lib/infra/firebase/firestore/types/index.d.ts +3 -3
  383. package/lib/infra/firebase/index.d.ts +2 -2
  384. package/lib/infra/index.d.ts +1 -1
  385. package/lib/utils/index.d.ts +4 -4
  386. package/lib/utils/mixins/base.mixin.d.ts +3 -3
  387. package/lib/utils/mixins/index.d.ts +2 -2
  388. package/lib/utils/mixins/mixin-ctor.type.d.ts +1 -1
  389. package/lib/utils/types/index.d.ts +1 -1
  390. package/lib/utils/types/prop.type.d.ts +1 -1
  391. package/package.json +1 -1
  392. package/public-api.d.ts +2 -1
@@ -1,1051 +1,1204 @@
1
- import { plainToClass, classToPlain, Expose } from 'class-transformer';
2
- import { __awaiter, __decorate } from 'tslib';
1
+ import 'reflect-metadata';
2
+ import { plainToClass, classToPlain, Expose, Type } from 'class-transformer';
3
+ import { __decorate, __metadata, __awaiter } from 'tslib';
3
4
  import { isNil, isNumber, isString, isEmpty } from 'lodash';
4
5
  export { chunk, isEmpty, isNil, isNumber, isString } from 'lodash';
5
6
  import { Md5 } from 'ts-md5';
6
7
  import firebase from 'firebase';
7
8
  import firebase$1 from 'firebase/app';
8
9
 
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
- }
10
+ class BaseModel {
11
+ constructor(args) {
12
+ Object.assign(this, args);
13
+ }
14
+ static toInstance(data) {
15
+ return plainToClass(this, data);
16
+ }
17
+ toPlain() {
18
+ return classToPlain(this, { exposeUnsetFields: false });
19
+ }
19
20
  }
20
21
 
21
- var Where;
22
- (function (Where) {
23
- Where["EQUALS"] = "==";
24
- Where["GT"] = ">";
25
- Where["GTE"] = ">=";
26
- Where["IN"] = "in";
27
- Where["LT"] = "<";
28
- Where["LTE"] = "<=";
29
- Where["LIKE"] = "like";
22
+ var Where;
23
+ (function (Where) {
24
+ Where["EQUALS"] = "==";
25
+ Where["GT"] = ">";
26
+ Where["GTE"] = ">=";
27
+ Where["IN"] = "in";
28
+ Where["LT"] = "<";
29
+ Where["LTE"] = "<=";
30
+ Where["LIKE"] = "like";
30
31
  })(Where || (Where = {}));
31
32
 
32
- var UpdateOptionActions;
33
- (function (UpdateOptionActions) {
34
- UpdateOptionActions["UPDATE"] = "update";
35
- UpdateOptionActions["MERGE"] = "merge";
36
- UpdateOptionActions["REMOVE"] = "remove";
37
- UpdateOptionActions["REMOVE_FIELD"] = "removeField";
38
- 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";
39
40
  })(UpdateOptionActions || (UpdateOptionActions = {}));
40
41
 
41
- var UserType;
42
- (function (UserType) {
43
- UserType["B2C"] = "Cliente Transacional";
44
- UserType["GlamGirl"] = "Glamgirl";
45
- UserType["MensBoy"] = "Mensboy";
46
- UserType["B2B"] = "Company";
47
- UserType["Collaborator"] = "Funcion\u00E1rio";
48
- UserType["Influencer"] = "Influencer";
42
+ var UserType;
43
+ (function (UserType) {
44
+ UserType["B2C"] = "Cliente Transacional";
45
+ UserType["GlamGirl"] = "Glamgirl";
46
+ UserType["MensBoy"] = "Mensboy";
47
+ UserType["B2B"] = "Company";
48
+ UserType["Collaborator"] = "Funcion\u00E1rio";
49
+ UserType["Influencer"] = "Influencer";
49
50
  })(UserType || (UserType = {}));
50
51
 
51
- var BeardSizes;
52
- (function (BeardSizes) {
53
- BeardSizes["BIG"] = "Grande";
54
- BeardSizes["MEDIUM"] = "M\u00E9dia";
55
- BeardSizes["SHORT"] = "Curta";
56
- BeardSizes["MUSTACHE"] = "Bigode";
57
- BeardSizes["NOTHING"] = "Sem Barba";
52
+ var BeardSizes;
53
+ (function (BeardSizes) {
54
+ BeardSizes["BIG"] = "Grande";
55
+ BeardSizes["MEDIUM"] = "M\u00E9dia";
56
+ BeardSizes["SHORT"] = "Curta";
57
+ BeardSizes["MUSTACHE"] = "Bigode";
58
+ BeardSizes["NOTHING"] = "Sem Barba";
58
59
  })(BeardSizes || (BeardSizes = {}));
59
60
 
60
- var HairTypes;
61
- (function (HairTypes) {
62
- HairTypes["Smooth"] = "Liso";
63
- HairTypes["WAVY"] = "Ondulado";
64
- HairTypes["CURLY"] = "Cacheado";
65
- HairTypes["FRIZZY"] = "Crespo";
66
- HairTypes["BALD"] = "Sou careca";
61
+ var HairTypes;
62
+ (function (HairTypes) {
63
+ HairTypes["Smooth"] = "Liso";
64
+ HairTypes["WAVY"] = "Ondulado";
65
+ HairTypes["CURLY"] = "Cacheado";
66
+ HairTypes["FRIZZY"] = "Crespo";
67
+ HairTypes["BALD"] = "Sou careca";
67
68
  })(HairTypes || (HairTypes = {}));
68
69
 
69
- var Area;
70
- (function (Area) {
71
- Area["GP"] = "Geral";
72
- Area["CRM"] = "CRM";
73
- Area["MediaProd"] = "Media Production";
74
- Area["Tech"] = "Tecnologia";
75
- Area["Transactional"] = "Transacional";
76
- Area["Operations"] = "Opera\u00E7\u00F5es";
77
- Area["Sales"] = "Comercial";
78
- Area["Finantial"] = "Financeiro";
79
- Area["HR"] = "RH";
70
+ var Area;
71
+ (function (Area) {
72
+ Area["GP"] = "Geral";
73
+ Area["CRM"] = "CRM";
74
+ Area["MediaProd"] = "Media Production";
75
+ Area["Tech"] = "Tecnologia";
76
+ Area["Transactional"] = "Transacional";
77
+ Area["Operations"] = "Opera\u00E7\u00F5es";
78
+ Area["Sales"] = "Comercial";
79
+ Area["Finantial"] = "Financeiro";
80
+ Area["HR"] = "RH";
80
81
  })(Area || (Area = {}));
81
82
 
82
- var OfficePosition;
83
- (function (OfficePosition) {
84
- OfficePosition["Intern"] = "Estagi\u00E1rio";
85
- OfficePosition["Analyst"] = "Analista";
86
- OfficePosition["Manager"] = "Gerente";
87
- OfficePosition["Director"] = "Diretor";
83
+ var OfficePosition;
84
+ (function (OfficePosition) {
85
+ OfficePosition["Intern"] = "Estagi\u00E1rio";
86
+ OfficePosition["Analyst"] = "Analista";
87
+ OfficePosition["Manager"] = "Gerente";
88
+ OfficePosition["Director"] = "Diretor";
88
89
  })(OfficePosition || (OfficePosition = {}));
89
90
 
90
- var BillingStatus;
91
- (function (BillingStatus) {
92
- BillingStatus["PAYED"] = "PAGO";
91
+ var BillingStatus;
92
+ (function (BillingStatus) {
93
+ BillingStatus["PAYED"] = "PAGO";
93
94
  })(BillingStatus || (BillingStatus = {}));
94
95
 
95
- var EditionStatus;
96
- (function (EditionStatus) {
97
- EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
96
+ var EditionStatus;
97
+ (function (EditionStatus) {
98
+ EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
98
99
  })(EditionStatus || (EditionStatus = {}));
99
100
 
100
- var PaymentType;
101
- (function (PaymentType) {
102
- PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
103
- PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
104
- PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
101
+ var PaymentType;
102
+ (function (PaymentType) {
103
+ PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
104
+ PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
105
+ PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
105
106
  })(PaymentType || (PaymentType = {}));
106
107
 
107
- var Status;
108
- (function (Status) {
109
- Status["ACTIVE"] = "active";
108
+ var Status;
109
+ (function (Status) {
110
+ Status["ACTIVE"] = "active";
110
111
  })(Status || (Status = {}));
111
112
 
112
- class Edition extends BaseModel {
113
- identifierFields() {
114
- return ['id'];
115
- }
113
+ class Edition extends BaseModel {
114
+ identifierFields() {
115
+ return ['id'];
116
+ }
116
117
  }
117
118
 
118
- class SubscriptionPayment extends BaseModel {
119
- identifierFields() {
120
- return ['id'];
121
- }
119
+ class Payment extends BaseModel {
120
+ identifierFields() {
121
+ return ['id'];
122
+ }
122
123
  }
124
+ __decorate([
125
+ Expose({ name: 'refuse_reason' }),
126
+ __metadata("design:type", String)
127
+ ], Payment.prototype, "refuseReason", void 0);
128
+ __decorate([
129
+ Expose({ name: 'status_reason' }),
130
+ __metadata("design:type", String)
131
+ ], Payment.prototype, "statusReason", void 0);
132
+ __decorate([
133
+ Expose({ name: 'acquirer_response_code' }),
134
+ __metadata("design:type", String)
135
+ ], Payment.prototype, "acquirerResponseCode", void 0);
136
+ __decorate([
137
+ Expose({ name: 'acquirer_name' }),
138
+ __metadata("design:type", String)
139
+ ], Payment.prototype, "acquirerName", void 0);
140
+ __decorate([
141
+ Expose({ name: 'acquirer_id' }),
142
+ __metadata("design:type", String)
143
+ ], Payment.prototype, "acquirerId", void 0);
144
+ __decorate([
145
+ Expose({ name: 'authorization_code' }),
146
+ __metadata("design:type", String)
147
+ ], Payment.prototype, "authorizationCode", void 0);
148
+ __decorate([
149
+ Expose({ name: 'soft_descriptor' }),
150
+ __metadata("design:type", String)
151
+ ], Payment.prototype, "softDescriptor", void 0);
152
+ __decorate([
153
+ Expose({ name: 'date_created' }),
154
+ __metadata("design:type", String)
155
+ ], Payment.prototype, "dateCreated", void 0);
156
+ __decorate([
157
+ Expose({ name: 'date_updated' }),
158
+ __metadata("design:type", String)
159
+ ], Payment.prototype, "dateUpdated", void 0);
160
+ __decorate([
161
+ Expose({ name: 'authorized_amount' }),
162
+ __metadata("design:type", Number)
163
+ ], Payment.prototype, "authorizedAmount", void 0);
164
+ __decorate([
165
+ Expose({ name: 'paid_amount' }),
166
+ __metadata("design:type", Number)
167
+ ], Payment.prototype, "paidAmount", void 0);
168
+ __decorate([
169
+ Expose({ name: 'refunded_amount' }),
170
+ __metadata("design:type", Number)
171
+ ], Payment.prototype, "refundedAmount", void 0);
172
+ __decorate([
173
+ Expose({ name: 'card_holder_name' }),
174
+ __metadata("design:type", String)
175
+ ], Payment.prototype, "cardHolderName", void 0);
176
+ __decorate([
177
+ Expose({ name: 'card_last_digits' }),
178
+ __metadata("design:type", String)
179
+ ], Payment.prototype, "cardLastDigits", void 0);
180
+ __decorate([
181
+ Expose({ name: 'card_first_digits' }),
182
+ __metadata("design:type", String)
183
+ ], Payment.prototype, "cardFirstDigits", void 0);
184
+ __decorate([
185
+ Expose({ name: 'card_brand' }),
186
+ __metadata("design:type", String)
187
+ ], Payment.prototype, "cardBrand", void 0);
188
+ __decorate([
189
+ Expose({ name: 'card_pin_mode' }),
190
+ __metadata("design:type", String)
191
+ ], Payment.prototype, "cardPinMode", void 0);
192
+ __decorate([
193
+ Expose({ name: 'card_magstripe_fallback' }),
194
+ __metadata("design:type", Boolean)
195
+ ], Payment.prototype, "cardMagstripeFallback", void 0);
196
+ __decorate([
197
+ Expose({ name: 'cvm_pin' }),
198
+ __metadata("design:type", Boolean)
199
+ ], Payment.prototype, "cvmPin", void 0);
200
+ __decorate([
201
+ Expose({ name: 'postback_url' }),
202
+ __metadata("design:type", String)
203
+ ], Payment.prototype, "postbackUrl", void 0);
204
+ __decorate([
205
+ Expose({ name: 'payment_method' }),
206
+ __metadata("design:type", String)
207
+ ], Payment.prototype, "paymentMethod", void 0);
208
+ __decorate([
209
+ Expose({ name: 'capture_method' }),
210
+ __metadata("design:type", String)
211
+ ], Payment.prototype, "captureMethod", void 0);
212
+ __decorate([
213
+ Expose({ name: 'antifraud_score' }),
214
+ __metadata("design:type", String)
215
+ ], Payment.prototype, "antifraudScore", void 0);
216
+ __decorate([
217
+ Expose({ name: 'boleto_url' }),
218
+ __metadata("design:type", String)
219
+ ], Payment.prototype, "boletoUrl", void 0);
220
+ __decorate([
221
+ Expose({ name: 'boleto_barcode' }),
222
+ __metadata("design:type", String)
223
+ ], Payment.prototype, "boletoBarcode", void 0);
224
+ __decorate([
225
+ Expose({ name: 'boleto_expiration_date' }),
226
+ __metadata("design:type", String)
227
+ ], Payment.prototype, "boletoExpirationDate", void 0);
228
+ __decorate([
229
+ Expose({ name: 'subscription_id' }),
230
+ __metadata("design:type", String)
231
+ ], Payment.prototype, "subscriptionId", void 0);
232
+ __decorate([
233
+ Expose({ name: 'split_rules' }),
234
+ __metadata("design:type", String)
235
+ ], Payment.prototype, "splitRules", void 0);
236
+ __decorate([
237
+ Expose({ name: 'antifraud_metadata' }),
238
+ __metadata("design:type", Object)
239
+ ], Payment.prototype, "antifraudMetadata", void 0);
240
+ __decorate([
241
+ Expose({ name: 'reference_key' }),
242
+ __metadata("design:type", String)
243
+ ], Payment.prototype, "referenceKey", void 0);
244
+ __decorate([
245
+ Expose({ name: 'local_transaction_id' }),
246
+ __metadata("design:type", String)
247
+ ], Payment.prototype, "localTransactionId", void 0);
248
+ __decorate([
249
+ Expose({ name: 'local_time' }),
250
+ __metadata("design:type", String)
251
+ ], Payment.prototype, "localTime", void 0);
252
+ __decorate([
253
+ Expose({ name: 'fraud_covered' }),
254
+ __metadata("design:type", Boolean)
255
+ ], Payment.prototype, "fraudCovered", void 0);
256
+ __decorate([
257
+ Expose({ name: 'fraud_reimbursed' }),
258
+ __metadata("design:type", String)
259
+ ], Payment.prototype, "fraudReimbursed", void 0);
260
+ __decorate([
261
+ Expose({ name: 'order_id' }),
262
+ __metadata("design:type", String)
263
+ ], Payment.prototype, "orderId", void 0);
264
+ __decorate([
265
+ Expose({ name: 'risk_level' }),
266
+ __metadata("design:type", String)
267
+ ], Payment.prototype, "riskLevel", void 0);
268
+ __decorate([
269
+ Expose({ name: 'receipt_url' }),
270
+ __metadata("design:type", String)
271
+ ], Payment.prototype, "receiptUrl", void 0);
272
+ __decorate([
273
+ Expose({ name: 'private_label' }),
274
+ __metadata("design:type", String)
275
+ ], Payment.prototype, "privateLabel", void 0);
276
+ __decorate([
277
+ Expose({ name: 'pix_qr_code' }),
278
+ __metadata("design:type", String)
279
+ ], Payment.prototype, "pixQrCode", void 0);
280
+ __decorate([
281
+ Expose({ name: 'pix_expiration_date' }),
282
+ __metadata("design:type", String)
283
+ ], Payment.prototype, "pixExpirationDate", void 0);
123
284
 
124
- class Subscription extends BaseModel {
125
- identifierFields() {
126
- return ['id'];
127
- }
285
+ class SubscriptionPayment extends BaseModel {
286
+ identifierFields() {
287
+ return ['id'];
288
+ }
128
289
  }
290
+ __decorate([
291
+ Type(() => Payment),
292
+ __metadata("design:type", Payment)
293
+ ], SubscriptionPayment.prototype, "payment", void 0);
129
294
 
130
- class User extends BaseModel {
131
- static toInstance(data) {
132
- const instance = super.toInstance(data);
133
- instance.displayName = `${data.firstName} ${data.lastName}`;
134
- return instance;
135
- }
136
- identifierFields() {
137
- return ['id'];
138
- }
139
- toPlain() {
140
- const plain = super.toPlain();
141
- delete plain.beautyProfile;
142
- return plain;
143
- }
295
+ class Address extends BaseModel {
144
296
  }
145
297
 
146
- class BeautyProfile extends BaseModel {
147
- toPlain() {
148
- const plain = super.toPlain();
149
- delete plain.id;
150
- return plain;
151
- }
152
- identifierFields() {
153
- return ['id'];
154
- }
155
- }
298
+ var CheckoutTypes;
299
+ (function (CheckoutTypes) {
300
+ CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
301
+ CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
302
+ })(CheckoutTypes || (CheckoutTypes = {}));
156
303
 
157
- class Address extends BaseModel {
158
- }
304
+ var CouponTypes;
305
+ (function (CouponTypes) {
306
+ CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
307
+ CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
308
+ CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
309
+ CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
310
+ })(CouponTypes || (CouponTypes = {}));
159
311
 
160
- class UserAddress extends Address {
161
- identifierFields() {
162
- return ['id'];
163
- }
164
- }
312
+ var CouponSubtypes;
313
+ (function (CouponSubtypes) {
314
+ CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
315
+ CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
316
+ })(CouponSubtypes || (CouponSubtypes = {}));
165
317
 
166
- class Base {
167
- constructor(...args) {
168
- Object.assign(this, ...args);
169
- }
170
- }
318
+ var Exclusivities;
319
+ (function (Exclusivities) {
320
+ Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
321
+ Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
322
+ Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
323
+ })(Exclusivities || (Exclusivities = {}));
171
324
 
172
- class UnauthorizedError extends Error {
173
- constructor(message) {
174
- super(message);
175
- this.message = message;
176
- }
325
+ class Coupon extends BaseModel {
326
+ identifierFields() {
327
+ return ['id'];
328
+ }
177
329
  }
330
+ __decorate([
331
+ Expose({ name: 'checkout_type' }),
332
+ __metadata("design:type", Number)
333
+ ], Coupon.prototype, "checkoutType", void 0);
334
+ __decorate([
335
+ Expose({ name: 'exclusivity_type' }),
336
+ __metadata("design:type", Number)
337
+ ], Coupon.prototype, "exclusivityType", void 0);
178
338
 
179
- var SignInMethods;
180
- (function (SignInMethods) {
181
- SignInMethods["EMAIL_PASSWORD"] = "email_password";
182
- SignInMethods["GOOGLE"] = "google";
183
- })(SignInMethods || (SignInMethods = {}));
184
- class Authentication {
185
- constructor(authService, userRepository) {
186
- this.authService = authService;
187
- this.userRepository = userRepository;
188
- }
189
- signIn({ email, password }, signInMethod) {
190
- return __awaiter(this, void 0, void 0, function* () {
191
- const method = this.getServiceByMethod(signInMethod);
192
- const userAuth = yield this.authService[method]({ email, password });
193
- const user = this.userRepository.get(userAuth);
194
- if (!isNil(user))
195
- return user;
196
- if (/^.+@b4a.com.br$/.test(userAuth.email))
197
- return this.createsUserByCredential(userAuth);
198
- throw new UnauthorizedError('Invalid credentials');
199
- });
200
- }
201
- getServiceByMethod(signInMethod) {
202
- return signInMethod === SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
203
- }
204
- createsUserByCredential(user) {
205
- var _a;
206
- return __awaiter(this, void 0, void 0, function* () {
207
- const [firstName, lastName] = (_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/);
208
- const person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName,
209
- lastName, acceptsNewsletter: false, area: Area.Transactional, officePosition: OfficePosition.Intern, type: UserType.Collaborator }));
210
- return this.userRepository.create(person);
211
- });
212
- }
339
+ class SubscriptionPlan extends BaseModel {
340
+ identifierFields() {
341
+ return ['id'];
342
+ }
213
343
  }
214
344
 
215
- class SignOut {
216
- constructor(authService) {
217
- this.authService = authService;
218
- }
219
- signOut() {
220
- return __awaiter(this, void 0, void 0, function* () {
221
- yield this.authService.signOut();
222
- });
223
- }
345
+ class BeautyProfile extends BaseModel {
346
+ toPlain() {
347
+ const plain = super.toPlain();
348
+ delete plain.id;
349
+ return plain;
350
+ }
351
+ identifierFields() {
352
+ return ['id'];
353
+ }
224
354
  }
225
355
 
226
- var Shops;
227
- (function (Shops) {
228
- Shops["MENSMARKET"] = "Men's Market";
229
- Shops["GLAMSHOP"] = "Glamshop";
230
- })(Shops || (Shops = {}));
231
-
232
- class Category extends BaseModel {
233
- identifierFields() {
234
- return ['id'];
235
- }
356
+ class User extends BaseModel {
357
+ static toInstance(data) {
358
+ const instance = super.toInstance(data);
359
+ instance.displayName = `${data.firstName} ${data.lastName}`;
360
+ return instance;
361
+ }
362
+ identifierFields() {
363
+ return ['id'];
364
+ }
365
+ toPlain() {
366
+ const plain = super.toPlain();
367
+ delete plain.beautyProfile;
368
+ return plain;
369
+ }
236
370
  }
237
-
238
- class Product extends BaseModel {
239
- identifierFields() {
240
- return ['id'];
241
- }
371
+ __decorate([
372
+ Type(() => BeautyProfile),
373
+ __metadata("design:type", BeautyProfile)
374
+ ], User.prototype, "beautyProfile", void 0);
375
+
376
+ class Subscription extends BaseModel {
377
+ identifierFields() {
378
+ return ['id'];
379
+ }
242
380
  }
243
-
244
- class Variant extends BaseModel {
245
- identifierFields() {
246
- return ['id'];
247
- }
381
+ __decorate([
382
+ Type(() => User),
383
+ __metadata("design:type", User)
384
+ ], Subscription.prototype, "user", void 0);
385
+ __decorate([
386
+ Type(() => SubscriptionPlan),
387
+ __metadata("design:type", SubscriptionPlan)
388
+ ], Subscription.prototype, "subscriptionPlan", void 0);
389
+ __decorate([
390
+ Type(() => Address),
391
+ __metadata("design:type", Address)
392
+ ], Subscription.prototype, "shippingAddress", void 0);
393
+ __decorate([
394
+ Type(() => Address),
395
+ __metadata("design:type", Address)
396
+ ], Subscription.prototype, "billingAddress", void 0);
397
+ __decorate([
398
+ Type(() => Coupon),
399
+ __metadata("design:type", Coupon)
400
+ ], Subscription.prototype, "coupon", void 0);
401
+ __decorate([
402
+ Type(() => Edition),
403
+ __metadata("design:type", Array)
404
+ ], Subscription.prototype, "editions", void 0);
405
+ __decorate([
406
+ Type(() => SubscriptionPayment),
407
+ __metadata("design:type", Array)
408
+ ], Subscription.prototype, "payment", void 0);
409
+
410
+ class UserAddress extends Address {
411
+ identifierFields() {
412
+ return ['id'];
413
+ }
248
414
  }
249
415
 
250
- var CouponTypes;
251
- (function (CouponTypes) {
252
- CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
253
- CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
254
- CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
255
- CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
256
- })(CouponTypes || (CouponTypes = {}));
416
+ class Base {
417
+ constructor(...args) {
418
+ Object.assign(this, ...args);
419
+ }
420
+ }
257
421
 
258
- var CouponSubtypes;
259
- (function (CouponSubtypes) {
260
- CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
261
- CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
262
- })(CouponSubtypes || (CouponSubtypes = {}));
422
+ class UnauthorizedError extends Error {
423
+ constructor(message) {
424
+ super(message);
425
+ this.message = message;
426
+ }
427
+ }
263
428
 
264
- var Exclusivities;
265
- (function (Exclusivities) {
266
- Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
267
- Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
268
- Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
269
- })(Exclusivities || (Exclusivities = {}));
429
+ var SignInMethods;
430
+ (function (SignInMethods) {
431
+ SignInMethods["EMAIL_PASSWORD"] = "email_password";
432
+ SignInMethods["GOOGLE"] = "google";
433
+ })(SignInMethods || (SignInMethods = {}));
434
+ class Authentication {
435
+ constructor(authService, userRepository) {
436
+ this.authService = authService;
437
+ this.userRepository = userRepository;
438
+ }
439
+ signIn({ email, password }, signInMethod) {
440
+ return __awaiter(this, void 0, void 0, function* () {
441
+ const method = this.getServiceByMethod(signInMethod);
442
+ const userAuth = yield this.authService[method]({ email, password });
443
+ const user = this.userRepository.get(userAuth);
444
+ if (!isNil(user))
445
+ return user;
446
+ if (/^.+@b4a.com.br$/.test(userAuth.email))
447
+ return this.createsUserByCredential(userAuth);
448
+ throw new UnauthorizedError('Invalid credentials');
449
+ });
450
+ }
451
+ getServiceByMethod(signInMethod) {
452
+ return signInMethod === SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
453
+ }
454
+ createsUserByCredential(user) {
455
+ var _a;
456
+ return __awaiter(this, void 0, void 0, function* () {
457
+ const [firstName, lastName] = (_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/);
458
+ const person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName,
459
+ lastName, acceptsNewsletter: false, area: Area.Transactional, officePosition: OfficePosition.Intern, type: UserType.Collaborator }));
460
+ return this.userRepository.create(person);
461
+ });
462
+ }
463
+ }
270
464
 
271
- class Coupon extends BaseModel {
272
- identifierFields() {
273
- return ['id'];
274
- }
275
- }
276
- __decorate([
277
- Expose({ name: 'checkout_type' })
278
- ], Coupon.prototype, "checkoutType", void 0);
279
- __decorate([
280
- Expose({ name: 'exclusivity_type' })
281
- ], Coupon.prototype, "exclusivityType", void 0);
465
+ class SignOut {
466
+ constructor(authService) {
467
+ this.authService = authService;
468
+ }
469
+ signOut() {
470
+ return __awaiter(this, void 0, void 0, function* () {
471
+ yield this.authService.signOut();
472
+ });
473
+ }
474
+ }
282
475
 
283
- var CheckoutTypes;
284
- (function (CheckoutTypes) {
285
- CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
286
- CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
287
- })(CheckoutTypes || (CheckoutTypes = {}));
476
+ var Shops;
477
+ (function (Shops) {
478
+ Shops["MENSMARKET"] = "Men's Market";
479
+ Shops["GLAMSHOP"] = "Glamshop";
480
+ })(Shops || (Shops = {}));
288
481
 
289
- const COUPON_EXPIRATION = 60 * 60 * 24 * 30;
290
- class FinancialCoupon extends Coupon {
291
- constructor() {
292
- super(...arguments);
293
- this.type = CouponTypes.FINANCIAL;
294
- }
295
- static isFinancialCoupon(coupon) {
296
- return coupon.type === CouponTypes.FINANCIAL && !!coupon.subtype;
297
- }
298
- static createCoupon(userId) {
299
- return this.toInstance({
300
- name: Md5.hashStr(`${userId}_${Date.now}`).toString(),
301
- nickname: `${Date.now()}`,
302
- type: CouponTypes.FINANCIAL,
303
- subtype: CouponSubtypes.PERCENTAGE,
304
- checkoutType: CheckoutTypes.ECOMMERCE,
305
- discount: 30,
306
- user: userId,
307
- createdAt: new Date(Date.now()),
308
- expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
309
- });
310
- }
482
+ class Category extends BaseModel {
483
+ identifierFields() {
484
+ return ['id'];
485
+ }
311
486
  }
312
487
 
313
- var OrderStatus;
314
- (function (OrderStatus) {
315
- OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
316
- OrderStatus["EM_PREPARO"] = "Preparando pedido";
317
- OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
318
- OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
319
- OrderStatus["ENVIADO"] = "Pedido Enviado";
320
- OrderStatus["ENTREGUE"] = "Pedido entregue";
321
- OrderStatus["CANCELADO"] = "Cancelado";
322
- OrderStatus["CREDIT_CARD"] = "credit_card";
323
- })(OrderStatus || (OrderStatus = {}));
324
-
325
- class Checkout extends BaseModel {
326
- identifierFields() {
327
- return ['id'];
328
- }
488
+ class Product extends BaseModel {
489
+ identifierFields() {
490
+ return ['id'];
491
+ }
492
+ getInfoByShop(shop) {
493
+ var _a, _b, _c, _d, _e, _f;
494
+ 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]) || {}));
495
+ }
329
496
  }
330
497
 
331
- class LineItem extends Product {
498
+ class Variant extends BaseModel {
499
+ identifierFields() {
500
+ return ['id'];
501
+ }
332
502
  }
333
503
 
334
- class Order extends Checkout {
504
+ const COUPON_EXPIRATION = 60 * 60 * 24 * 30;
505
+ class FinancialCoupon extends Coupon {
506
+ constructor() {
507
+ super(...arguments);
508
+ this.type = CouponTypes.FINANCIAL;
509
+ }
510
+ static isFinancialCoupon(coupon) {
511
+ return coupon.type === CouponTypes.FINANCIAL && !!coupon.subtype;
512
+ }
513
+ static createCoupon(userId) {
514
+ return this.toInstance({
515
+ name: Md5.hashStr(`${userId}_${Date.now}`).toString(),
516
+ nickname: `${Date.now()}`,
517
+ type: CouponTypes.FINANCIAL,
518
+ subtype: CouponSubtypes.PERCENTAGE,
519
+ checkoutType: CheckoutTypes.ECOMMERCE,
520
+ discount: 30,
521
+ user: userId,
522
+ createdAt: new Date(Date.now()),
523
+ expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
524
+ });
525
+ }
335
526
  }
336
527
 
337
- class Payment extends BaseModel {
338
- identifierFields() {
339
- return ['id'];
340
- }
341
- }
342
- __decorate([
343
- Expose({ name: 'refuse_reason' })
344
- ], Payment.prototype, "refuseReason", void 0);
345
- __decorate([
346
- Expose({ name: 'status_reason' })
347
- ], Payment.prototype, "statusReason", void 0);
348
- __decorate([
349
- Expose({ name: 'acquirer_response_code' })
350
- ], Payment.prototype, "acquirerResponseCode", void 0);
351
- __decorate([
352
- Expose({ name: 'acquirer_name' })
353
- ], Payment.prototype, "acquirerName", void 0);
354
- __decorate([
355
- Expose({ name: 'acquirer_id' })
356
- ], Payment.prototype, "acquirerId", void 0);
357
- __decorate([
358
- Expose({ name: 'authorization_code' })
359
- ], Payment.prototype, "authorizationCode", void 0);
360
- __decorate([
361
- Expose({ name: 'soft_descriptor' })
362
- ], Payment.prototype, "softDescriptor", void 0);
363
- __decorate([
364
- Expose({ name: 'date_created' })
365
- ], Payment.prototype, "dateCreated", void 0);
366
- __decorate([
367
- Expose({ name: 'date_updated' })
368
- ], Payment.prototype, "dateUpdated", void 0);
369
- __decorate([
370
- Expose({ name: 'authorized_amount' })
371
- ], Payment.prototype, "authorizedAmount", void 0);
372
- __decorate([
373
- Expose({ name: 'paid_amount' })
374
- ], Payment.prototype, "paidAmount", void 0);
375
- __decorate([
376
- Expose({ name: 'refunded_amount' })
377
- ], Payment.prototype, "refundedAmount", void 0);
378
- __decorate([
379
- Expose({ name: 'card_holder_name' })
380
- ], Payment.prototype, "cardHolderName", void 0);
381
- __decorate([
382
- Expose({ name: 'card_last_digits' })
383
- ], Payment.prototype, "cardLastDigits", void 0);
384
- __decorate([
385
- Expose({ name: 'card_first_digits' })
386
- ], Payment.prototype, "cardFirstDigits", void 0);
387
- __decorate([
388
- Expose({ name: 'card_brand' })
389
- ], Payment.prototype, "cardBrand", void 0);
390
- __decorate([
391
- Expose({ name: 'card_pin_mode' })
392
- ], Payment.prototype, "cardPinMode", void 0);
393
- __decorate([
394
- Expose({ name: 'card_magstripe_fallback' })
395
- ], Payment.prototype, "cardMagstripeFallback", void 0);
396
- __decorate([
397
- Expose({ name: 'cvm_pin' })
398
- ], Payment.prototype, "cvmPin", void 0);
399
- __decorate([
400
- Expose({ name: 'postback_url' })
401
- ], Payment.prototype, "postbackUrl", void 0);
402
- __decorate([
403
- Expose({ name: 'payment_method' })
404
- ], Payment.prototype, "paymentMethod", void 0);
405
- __decorate([
406
- Expose({ name: 'capture_method' })
407
- ], Payment.prototype, "captureMethod", void 0);
408
- __decorate([
409
- Expose({ name: 'antifraud_score' })
410
- ], Payment.prototype, "antifraudScore", void 0);
411
- __decorate([
412
- Expose({ name: 'boleto_url' })
413
- ], Payment.prototype, "boletoUrl", void 0);
414
- __decorate([
415
- Expose({ name: 'boleto_barcode' })
416
- ], Payment.prototype, "boletoBarcode", void 0);
417
- __decorate([
418
- Expose({ name: 'boleto_expiration_date' })
419
- ], Payment.prototype, "boletoExpirationDate", void 0);
420
- __decorate([
421
- Expose({ name: 'subscription_id' })
422
- ], Payment.prototype, "subscriptionId", void 0);
423
- __decorate([
424
- Expose({ name: 'split_rules' })
425
- ], Payment.prototype, "splitRules", void 0);
426
- __decorate([
427
- Expose({ name: 'antifraud_metadata' })
428
- ], Payment.prototype, "antifraudMetadata", void 0);
429
- __decorate([
430
- Expose({ name: 'reference_key' })
431
- ], Payment.prototype, "referenceKey", void 0);
432
- __decorate([
433
- Expose({ name: 'local_transaction_id' })
434
- ], Payment.prototype, "localTransactionId", void 0);
435
- __decorate([
436
- Expose({ name: 'local_time' })
437
- ], Payment.prototype, "localTime", void 0);
438
- __decorate([
439
- Expose({ name: 'fraud_covered' })
440
- ], Payment.prototype, "fraudCovered", void 0);
441
- __decorate([
442
- Expose({ name: 'fraud_reimbursed' })
443
- ], Payment.prototype, "fraudReimbursed", void 0);
444
- __decorate([
445
- Expose({ name: 'order_id' })
446
- ], Payment.prototype, "orderId", void 0);
447
- __decorate([
448
- Expose({ name: 'risk_level' })
449
- ], Payment.prototype, "riskLevel", void 0);
450
- __decorate([
451
- Expose({ name: 'receipt_url' })
452
- ], Payment.prototype, "receiptUrl", void 0);
453
- __decorate([
454
- Expose({ name: 'private_label' })
455
- ], Payment.prototype, "privateLabel", void 0);
456
- __decorate([
457
- Expose({ name: 'pix_qr_code' })
458
- ], Payment.prototype, "pixQrCode", void 0);
459
- __decorate([
460
- Expose({ name: 'pix_expiration_date' })
461
- ], Payment.prototype, "pixExpirationDate", void 0);
528
+ var OrderStatus;
529
+ (function (OrderStatus) {
530
+ OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
531
+ OrderStatus["EM_PREPARO"] = "Preparando pedido";
532
+ OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
533
+ OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
534
+ OrderStatus["ENVIADO"] = "Pedido Enviado";
535
+ OrderStatus["ENTREGUE"] = "Pedido entregue";
536
+ OrderStatus["CANCELADO"] = "Cancelado";
537
+ OrderStatus["CREDIT_CARD"] = "credit_card";
538
+ })(OrderStatus || (OrderStatus = {}));
462
539
 
463
- class ShippingMethod extends BaseModel {
464
- identifierFields() {
465
- return ['id'];
466
- }
540
+ class LineItem extends Product {
467
541
  }
468
542
 
469
- class CheckoutSubscription extends BaseModel {
470
- identifierFields() {
471
- return ['id'];
472
- }
543
+ class ShippingMethod extends BaseModel {
544
+ identifierFields() {
545
+ return ['id'];
546
+ }
473
547
  }
474
548
 
475
- class SubscriptionPlan extends BaseModel {
476
- identifierFields() {
477
- return ['id'];
478
- }
549
+ class Checkout extends BaseModel {
550
+ identifierFields() {
551
+ return ['id'];
552
+ }
479
553
  }
480
-
481
- class Buy2Win extends BaseModel {
482
- identifierFields() {
483
- return ['id'];
484
- }
554
+ __decorate([
555
+ Type(() => LineItem),
556
+ __metadata("design:type", Array)
557
+ ], Checkout.prototype, "lineItems", void 0);
558
+ __decorate([
559
+ Type(() => User),
560
+ __metadata("design:type", User)
561
+ ], Checkout.prototype, "user", void 0);
562
+ __decorate([
563
+ Type(() => Address),
564
+ __metadata("design:type", Address)
565
+ ], Checkout.prototype, "shippingAddress", void 0);
566
+ __decorate([
567
+ Type(() => Address),
568
+ __metadata("design:type", Address)
569
+ ], Checkout.prototype, "billingAddress", void 0);
570
+ __decorate([
571
+ Type(() => ShippingMethod),
572
+ __metadata("design:type", ShippingMethod)
573
+ ], Checkout.prototype, "shipping", void 0);
574
+ __decorate([
575
+ Type(() => Coupon),
576
+ __metadata("design:type", Coupon)
577
+ ], Checkout.prototype, "coupon", void 0);
578
+
579
+ class Order extends Checkout {
485
580
  }
486
-
487
- class Home extends BaseModel {
488
- identifierFields() {
489
- return ['id'];
490
- }
581
+ __decorate([
582
+ Type(() => Payment),
583
+ __metadata("design:type", Payment)
584
+ ], Order.prototype, "payment", void 0);
585
+
586
+ class CheckoutSubscription extends BaseModel {
587
+ identifierFields() {
588
+ return ['id'];
589
+ }
590
+ }
591
+ __decorate([
592
+ Type(() => Address),
593
+ __metadata("design:type", Address)
594
+ ], CheckoutSubscription.prototype, "shippingAddress", void 0);
595
+ __decorate([
596
+ Type(() => Address),
597
+ __metadata("design:type", Address)
598
+ ], CheckoutSubscription.prototype, "billingAddress", void 0);
599
+ __decorate([
600
+ Type(() => SubscriptionPlan),
601
+ __metadata("design:type", SubscriptionPlan)
602
+ ], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
603
+ __decorate([
604
+ Type(() => Coupon),
605
+ __metadata("design:type", Coupon)
606
+ ], CheckoutSubscription.prototype, "coupon", void 0);
607
+
608
+ class Buy2Win extends BaseModel {
609
+ identifierFields() {
610
+ return ['id'];
611
+ }
612
+ }
613
+ __decorate([
614
+ Type(() => Category),
615
+ __metadata("design:type", Array)
616
+ ], Buy2Win.prototype, "categories", void 0);
617
+
618
+ class Home extends BaseModel {
619
+ identifierFields() {
620
+ return ['id'];
621
+ }
491
622
  }
492
623
 
493
- class ShopMenu extends BaseModel {
494
- identifierFields() {
495
- return ['id'];
496
- }
624
+ class ShopMenu extends BaseModel {
625
+ identifierFields() {
626
+ return ['id'];
627
+ }
497
628
  }
498
629
 
499
- class InvalidArgumentError extends Error {
500
- constructor(message) {
501
- super(message);
502
- this.message = message;
503
- }
630
+ class InvalidArgumentError extends Error {
631
+ constructor(message) {
632
+ super(message);
633
+ this.message = message;
634
+ }
504
635
  }
505
636
 
506
- class RequiredArgumentError extends Error {
507
- constructor(args) {
508
- super(`Required arguments: ${args.join(', ')}`);
509
- this.args = args;
510
- this.arguments = args;
511
- }
637
+ class RequiredArgumentError extends Error {
638
+ constructor(args) {
639
+ super(`Required arguments: ${args.join(', ')}`);
640
+ this.args = args;
641
+ this.arguments = args;
642
+ }
512
643
  }
513
644
 
514
- class NotFoundError extends Error {
515
- constructor(message) {
516
- super(message);
517
- this.message = message;
518
- }
645
+ class NotFoundError extends Error {
646
+ constructor(message) {
647
+ super(message);
648
+ this.message = message;
649
+ }
519
650
  }
520
651
 
521
- class DuplicatedResultsError extends Error {
522
- constructor(message) {
523
- super(message);
524
- this.message = message;
525
- }
652
+ class DuplicatedResultsError extends Error {
653
+ constructor(message) {
654
+ super(message);
655
+ this.message = message;
656
+ }
526
657
  }
527
658
 
528
- const withFirestore = (MixinBase) => {
529
- return class extends MixinBase {
530
- constructor(...args) {
531
- super(args);
532
- }
533
- collection(path) {
534
- return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
535
- }
536
- buildModelInstance() {
537
- return {
538
- toFirestore: (data) => data.toPlain(),
539
- fromFirestore: (snap) => {
540
- const data = snap.data();
541
- Object.keys(data).forEach((key) => {
542
- if (data[key] instanceof firebase.firestore.Timestamp) {
543
- data[key] = data[key].toDate();
544
- }
545
- });
546
- return this.model.toInstance(Object.assign({ id: snap.id }, data));
547
- },
548
- };
549
- }
550
- };
659
+ const withFirestore = (MixinBase) => {
660
+ return class extends MixinBase {
661
+ constructor(...args) {
662
+ super(args);
663
+ }
664
+ collection(path) {
665
+ return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
666
+ }
667
+ buildModelInstance() {
668
+ return {
669
+ toFirestore: (data) => data.toPlain(),
670
+ fromFirestore: (snap) => {
671
+ const data = snap.data();
672
+ Object.keys(data).forEach((key) => {
673
+ if (data[key] instanceof firebase.firestore.Timestamp) {
674
+ data[key] = data[key].toDate();
675
+ }
676
+ });
677
+ return this.model.toInstance(Object.assign({ id: snap.id }, data));
678
+ },
679
+ };
680
+ }
681
+ };
551
682
  };
552
683
 
553
- const withHelpers = (MixinBase) => {
554
- return class extends MixinBase {
555
- toArray(snapShot) {
556
- if (Array.isArray(snapShot)) {
557
- return snapShot.map((doc) => doc.data());
558
- }
559
- else {
560
- return snapShot.docs.map((doc) => doc.data());
561
- }
562
- }
563
- isSubCollection(repository) {
564
- return !isNil(Object.keys(this).find((key) => key === 'parentRepository'));
565
- }
566
- };
684
+ const withHelpers = (MixinBase) => {
685
+ return class extends MixinBase {
686
+ toArray(snapShot) {
687
+ if (Array.isArray(snapShot)) {
688
+ return snapShot.map((doc) => doc.data());
689
+ }
690
+ else {
691
+ return snapShot.docs.map((doc) => doc.data());
692
+ }
693
+ }
694
+ isSubCollection(repository) {
695
+ return !isNil(Object.keys(this).find((key) => key === 'parentRepository'));
696
+ }
697
+ };
567
698
  };
568
699
 
569
- const withGetFirestore = (MixinBase) => {
570
- return class GetFirestore extends MixinBase {
571
- get(identifiers) {
572
- return __awaiter(this, void 0, void 0, function* () {
573
- const doc = yield this.collection(this.buildCollectionPathForGet(identifiers))
574
- .doc(Object.values(identifiers).shift().toString())
575
- .get();
576
- const data = doc.data();
577
- if (isNil(data))
578
- throw new NotFoundError(`Document ${JSON.stringify(identifiers)} not found`);
579
- return data;
580
- });
581
- }
582
- buildCollectionPathForGet(identifiers) {
583
- return this.isSubCollection(this)
584
- ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
585
- : this.collectionName;
586
- }
587
- };
700
+ const withGetFirestore = (MixinBase) => {
701
+ return class GetFirestore extends MixinBase {
702
+ get(identifiers) {
703
+ return __awaiter(this, void 0, void 0, function* () {
704
+ const doc = yield this.collection(this.buildCollectionPathForGet(identifiers))
705
+ .doc(Object.values(identifiers).shift().toString())
706
+ .get();
707
+ const data = doc.data();
708
+ if (isNil(data))
709
+ throw new NotFoundError(`Document ${JSON.stringify(identifiers)} not found`);
710
+ return data;
711
+ });
712
+ }
713
+ buildCollectionPathForGet(identifiers) {
714
+ return this.isSubCollection(this)
715
+ ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
716
+ : this.collectionName;
717
+ }
718
+ };
588
719
  };
589
720
 
590
- const withFindFirestore = (MixinBase) => {
591
- return class FindFirestore extends MixinBase {
592
- constructor() {
593
- super(...arguments);
594
- this.makeFirestoreWhere = (queryReference, filter) => Object.keys(filter).reduce((query, fieldName) => this.buildWhereSentence(query, fieldName, filter[fieldName]), queryReference);
595
- this.buildWhereSentence = (queryReference, fieldName, options) => {
596
- if (this.isSubCollection(this) && fieldName === this.parentIdField)
597
- return queryReference;
598
- if ((options === null || options === void 0 ? void 0 : options.operator) === Where.LIKE) {
599
- queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
600
- queryReference = queryReference.where(fieldName.toString(), '<=', `${options.value}~`);
601
- return queryReference;
602
- }
603
- if ((options === null || options === void 0 ? void 0 : options.operator) === Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
604
- return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
605
- return queryReference.where(fieldName.toString(), options.operator, options.value);
606
- };
607
- }
608
- find(filters, limits, orderBy) {
609
- return __awaiter(this, void 0, void 0, function* () {
610
- let query = this.collection(this.buildCollectionPathForFind(filters));
611
- filters === null || filters === void 0 ? void 0 : filters.forEach((filterer) => (query = this.makeFirestoreWhere(query, filterer)));
612
- orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach((orderer) => Object.keys(orderer).forEach((fieldName) => (query = query.orderBy(fieldName, orderer[fieldName]))));
613
- query = this.defineLimits(query, filters, limits);
614
- const docs = yield query.get();
615
- const data = docs.docs.map((doc) => doc.data());
616
- return {
617
- data,
618
- count: this.calculateCount(data, limits),
619
- };
620
- });
621
- }
622
- buildCollectionPathForFind(filters) {
623
- var _a;
624
- if (!this.isSubCollection(this))
625
- return this.collectionName;
626
- const parentIdField = this.parentIdField;
627
- const parentId = (_a = filters.find((groupFilter) => { var _a; return Boolean((_a = groupFilter[parentIdField]) === null || _a === void 0 ? void 0 : _a.value); })) === null || _a === void 0 ? void 0 : _a[parentIdField].value;
628
- return `${this.parentRepository.collectionName}/${parentId}/${this.collectionName}`;
629
- }
630
- defineLimits(query, filters, limits) {
631
- if (limits === null || limits === void 0 ? void 0 : limits.offset) {
632
- if (limits.offset instanceof this.model)
633
- query = query.startAfter(this.collection(this.buildCollectionPathForFind(filters)).doc(limits.offset[limits.offset.identifierFields().shift()]));
634
- if (isNumber(limits.offset) || isString(limits.offset))
635
- query = query.startAt(limits.offset);
636
- }
637
- if (limits === null || limits === void 0 ? void 0 : limits.limit)
638
- query = query.limit(limits.limit);
639
- return query;
640
- }
641
- calculateCount(data, limits) {
642
- if (data.length <= 0)
643
- return 0;
644
- if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
645
- return data.length;
646
- return Infinity;
647
- }
648
- };
721
+ const withFindFirestore = (MixinBase) => {
722
+ return class FindFirestore extends MixinBase {
723
+ constructor() {
724
+ super(...arguments);
725
+ this.makeFirestoreWhere = (queryReference, filter) => Object.keys(filter).reduce((query, fieldName) => this.buildWhereSentence(query, fieldName, filter[fieldName]), queryReference);
726
+ this.buildWhereSentence = (queryReference, fieldName, options) => {
727
+ if (this.isSubCollection(this) && fieldName === this.parentIdField)
728
+ return queryReference;
729
+ if ((options === null || options === void 0 ? void 0 : options.operator) === Where.LIKE) {
730
+ queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
731
+ queryReference = queryReference.where(fieldName.toString(), '<=', `${options.value}~`);
732
+ return queryReference;
733
+ }
734
+ if ((options === null || options === void 0 ? void 0 : options.operator) === Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
735
+ return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
736
+ return queryReference.where(fieldName.toString(), options.operator, options.value);
737
+ };
738
+ }
739
+ find(filters, limits, orderBy) {
740
+ return __awaiter(this, void 0, void 0, function* () {
741
+ let query = this.collection(this.buildCollectionPathForFind(filters));
742
+ filters === null || filters === void 0 ? void 0 : filters.forEach((filterer) => (query = this.makeFirestoreWhere(query, filterer)));
743
+ orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach((orderer) => Object.keys(orderer).forEach((fieldName) => (query = query.orderBy(fieldName, orderer[fieldName]))));
744
+ query = this.defineLimits(query, filters, limits);
745
+ const docs = yield query.get();
746
+ const data = docs.docs.map((doc) => doc.data());
747
+ return {
748
+ data,
749
+ count: this.calculateCount(data, limits),
750
+ };
751
+ });
752
+ }
753
+ buildCollectionPathForFind(filters) {
754
+ var _a;
755
+ if (!this.isSubCollection(this))
756
+ return this.collectionName;
757
+ const parentIdField = this.parentIdField;
758
+ const parentId = (_a = filters.find((groupFilter) => { var _a; return Boolean((_a = groupFilter[parentIdField]) === null || _a === void 0 ? void 0 : _a.value); })) === null || _a === void 0 ? void 0 : _a[parentIdField].value;
759
+ return `${this.parentRepository.collectionName}/${parentId}/${this.collectionName}`;
760
+ }
761
+ defineLimits(query, filters, limits) {
762
+ if (limits === null || limits === void 0 ? void 0 : limits.offset) {
763
+ if (limits.offset instanceof this.model)
764
+ query = query.startAfter(this.collection(this.buildCollectionPathForFind(filters)).doc(limits.offset[limits.offset.identifierFields().shift()]));
765
+ if (isNumber(limits.offset) || isString(limits.offset))
766
+ query = query.startAt(limits.offset);
767
+ }
768
+ if (limits === null || limits === void 0 ? void 0 : limits.limit)
769
+ query = query.limit(limits.limit);
770
+ return query;
771
+ }
772
+ calculateCount(data, limits) {
773
+ if (data.length <= 0)
774
+ return 0;
775
+ if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
776
+ return data.length;
777
+ return Infinity;
778
+ }
779
+ };
649
780
  };
650
781
 
651
- const withCreateFirestore = (MixinBase) => {
652
- return class CreateFirestore extends MixinBase {
653
- create(data) {
654
- return __awaiter(this, void 0, void 0, function* () {
655
- const docRef = yield this.save(this.model.toInstance(data));
656
- const doc = yield docRef.get();
657
- return doc.data();
658
- });
659
- }
660
- save(data) {
661
- var _a;
662
- return __awaiter(this, void 0, void 0, function* () {
663
- const id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
664
- if (isEmpty(id))
665
- return this.collection(this.buildCollectionPathForAdd(data)).add(data);
666
- const docRef = this.collection().doc(id);
667
- yield docRef.set(data);
668
- return docRef;
669
- });
670
- }
671
- buildCollectionPathForAdd(identifiers) {
672
- return this.isSubCollection(this)
673
- ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
674
- : this.collectionName;
675
- }
676
- };
782
+ const withCreateFirestore = (MixinBase) => {
783
+ return class CreateFirestore extends MixinBase {
784
+ create(data) {
785
+ return __awaiter(this, void 0, void 0, function* () {
786
+ const docRef = yield this.save(this.model.toInstance(data));
787
+ const doc = yield docRef.get();
788
+ return doc.data();
789
+ });
790
+ }
791
+ save(data) {
792
+ var _a;
793
+ return __awaiter(this, void 0, void 0, function* () {
794
+ const id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
795
+ if (isEmpty(id))
796
+ return this.collection(this.buildCollectionPathForAdd(data)).add(data);
797
+ const docRef = this.collection().doc(id);
798
+ yield docRef.set(data);
799
+ return docRef;
800
+ });
801
+ }
802
+ buildCollectionPathForAdd(identifiers) {
803
+ return this.isSubCollection(this)
804
+ ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
805
+ : this.collectionName;
806
+ }
807
+ };
677
808
  };
678
809
 
679
- const withUpdateFirestore = (MixinBase) => {
680
- 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; };
681
- const getValueByAction = (options) => {
682
- const fieldValues = firebase.firestore.FieldValue;
683
- if (isNil(options.action))
684
- return options;
685
- if (options.action === UpdateOptionActions.REMOVE_FIELD)
686
- return fieldValues.delete();
687
- if (Array.isArray(options.value)) {
688
- if (options.action === UpdateOptionActions.MERGE)
689
- return fieldValues.arrayUnion(...options.value);
690
- if (options.action === UpdateOptionActions.REMOVE)
691
- return fieldValues.arrayRemove(...options.value);
692
- }
693
- return options.value;
694
- };
695
- return class UpdateFirestore extends MixinBase {
696
- update(data) {
697
- return __awaiter(this, void 0, void 0, function* () {
698
- const model = new this.model();
699
- const keyField = model.identifierFields().shift();
700
- const docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
701
- yield docRef.update(this.paramsToPlain(data));
702
- const doc = yield docRef.get();
703
- return doc.data();
704
- });
705
- }
706
- buildCollectionPathForUpdate(identifiers) {
707
- return this.isSubCollection(this)
708
- ? `${this.parentRepository.collectionName}/${getValueFromParams(identifiers, this.parentIdField)}/${this.collectionName}`
709
- : this.collectionName;
710
- }
711
- paramsToPlain(params) {
712
- const model = this.model;
713
- if (params instanceof model)
714
- return params.toPlain();
715
- return Object.keys(params).reduce((data, currentKey) => (Object.assign(Object.assign({}, data), { [currentKey]: getValueByAction(params[currentKey]) })), {});
716
- }
717
- };
810
+ const withUpdateFirestore = (MixinBase) => {
811
+ 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; };
812
+ const getValueByAction = (options) => {
813
+ const fieldValues = firebase.firestore.FieldValue;
814
+ if (isNil(options.action))
815
+ return options;
816
+ if (options.action === UpdateOptionActions.REMOVE_FIELD)
817
+ return fieldValues.delete();
818
+ if (Array.isArray(options.value)) {
819
+ if (options.action === UpdateOptionActions.MERGE)
820
+ return fieldValues.arrayUnion(...options.value);
821
+ if (options.action === UpdateOptionActions.REMOVE)
822
+ return fieldValues.arrayRemove(...options.value);
823
+ }
824
+ return options.value;
825
+ };
826
+ return class UpdateFirestore extends MixinBase {
827
+ update(data) {
828
+ return __awaiter(this, void 0, void 0, function* () {
829
+ const model = new this.model();
830
+ const keyField = model.identifierFields().shift();
831
+ const docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
832
+ yield docRef.update(this.paramsToPlain(data));
833
+ const doc = yield docRef.get();
834
+ return doc.data();
835
+ });
836
+ }
837
+ buildCollectionPathForUpdate(identifiers) {
838
+ return this.isSubCollection(this)
839
+ ? `${this.parentRepository.collectionName}/${getValueFromParams(identifiers, this.parentIdField)}/${this.collectionName}`
840
+ : this.collectionName;
841
+ }
842
+ paramsToPlain(params) {
843
+ const model = this.model;
844
+ if (params instanceof model)
845
+ return params.toPlain();
846
+ return Object.keys(params).reduce((data, currentKey) => (Object.assign(Object.assign({}, data), { [currentKey]: getValueByAction(params[currentKey]) })), {});
847
+ }
848
+ };
718
849
  };
719
850
 
720
- const withDeleteFirestore = (MixinBase) => {
721
- return class DeleteFirestore extends MixinBase {
722
- delete(identifiers) {
723
- return __awaiter(this, void 0, void 0, function* () {
724
- yield this.collection(this.buildCollectionPathForRemove(identifiers))
725
- .doc(Object.values(identifiers).shift().toString())
726
- .delete();
727
- });
728
- }
729
- buildCollectionPathForRemove(identifiers) {
730
- return this.isSubCollection(this)
731
- ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
732
- : this.collectionName;
733
- }
734
- };
851
+ const withDeleteFirestore = (MixinBase) => {
852
+ return class DeleteFirestore extends MixinBase {
853
+ delete(identifiers) {
854
+ return __awaiter(this, void 0, void 0, function* () {
855
+ yield this.collection(this.buildCollectionPathForRemove(identifiers))
856
+ .doc(Object.values(identifiers).shift().toString())
857
+ .delete();
858
+ });
859
+ }
860
+ buildCollectionPathForRemove(identifiers) {
861
+ return this.isSubCollection(this)
862
+ ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`
863
+ : this.collectionName;
864
+ }
865
+ };
735
866
  };
736
867
 
737
- const withSubCollection = (MixinBase, ParentModel) => {
738
- return class SubCollectionMix extends MixinBase {
739
- constructor(...args) {
740
- super(args);
741
- }
742
- collection(path) {
743
- return super.collection(path);
744
- }
745
- };
868
+ const withSubCollection = (MixinBase, ParentModel) => {
869
+ return class SubCollectionMix extends MixinBase {
870
+ constructor(...args) {
871
+ super(args);
872
+ }
873
+ collection(path) {
874
+ return super.collection(path);
875
+ }
876
+ };
746
877
  };
747
878
 
748
- const withCrudFirestore = (MixinBase) => {
749
- return class CrudFirestore extends withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase))))) {
750
- };
879
+ const withCrudFirestore = (MixinBase) => {
880
+ return class CrudFirestore extends withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase))))) {
881
+ };
751
882
  };
752
883
 
753
- class SubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
754
- constructor(firestore) {
755
- super();
756
- this.firestore = firestore;
757
- this.collectionName = 'subscription';
758
- this.model = Subscription;
759
- }
884
+ class SubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
885
+ constructor(firestore) {
886
+ super();
887
+ this.firestore = firestore;
888
+ this.collectionName = 'subscription';
889
+ this.model = Subscription;
890
+ }
760
891
  }
761
892
 
762
- class UserFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
763
- constructor(firestore) {
764
- super();
765
- this.firestore = firestore;
766
- this.collectionName = 'users';
767
- this.model = User;
768
- }
769
- get(identifiers) {
770
- const _super = Object.create(null, {
771
- get: { get: () => super.get }
772
- });
773
- return __awaiter(this, void 0, void 0, function* () {
774
- const user = yield _super.get.call(this, { id: identifiers.id });
775
- user.beautyProfile = yield this.getBeautyProfile(user.id);
776
- return user;
777
- });
778
- }
779
- getBeautyProfile(userId) {
780
- return __awaiter(this, void 0, void 0, function* () {
781
- const beautyProfile = yield this.collection()
782
- .doc(userId)
783
- .collection('CX')
784
- .withConverter(this.buildBeautyProfileModelInstance())
785
- .doc('beautyProfile')
786
- .get();
787
- return beautyProfile.data();
788
- });
789
- }
790
- buildBeautyProfileModelInstance() {
791
- return {
792
- toFirestore: (data) => data.toPlain(),
793
- fromFirestore: (snap) => BeautyProfile.toInstance(snap.data()),
794
- };
795
- }
893
+ class UserFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
894
+ constructor(firestore) {
895
+ super();
896
+ this.firestore = firestore;
897
+ this.collectionName = 'users';
898
+ this.model = User;
899
+ }
900
+ get(identifiers) {
901
+ const _super = Object.create(null, {
902
+ get: { get: () => super.get }
903
+ });
904
+ return __awaiter(this, void 0, void 0, function* () {
905
+ const user = yield _super.get.call(this, { id: identifiers.id });
906
+ user.beautyProfile = yield this.getBeautyProfile(user.id);
907
+ user.isSubscriber = yield this.checkIfIsSubscriber(user.id);
908
+ return user;
909
+ });
910
+ }
911
+ buildModelInstance() {
912
+ const { fromFirestore, toFirestore } = super.buildModelInstance();
913
+ return {
914
+ toFirestore: (data) => {
915
+ const plain = toFirestore(data);
916
+ delete plain.isSubscriber;
917
+ return plain;
918
+ },
919
+ fromFirestore,
920
+ };
921
+ }
922
+ getBeautyProfile(userId) {
923
+ return __awaiter(this, void 0, void 0, function* () {
924
+ const beautyProfile = yield this.collection()
925
+ .doc(userId)
926
+ .collection('CX')
927
+ .withConverter(this.buildBeautyProfileModelInstance())
928
+ .doc('beautyProfile')
929
+ .get();
930
+ return beautyProfile.data();
931
+ });
932
+ }
933
+ checkIfIsSubscriber(userId) {
934
+ return __awaiter(this, void 0, void 0, function* () {
935
+ const docs = yield this.firestore
936
+ .collection('subscription')
937
+ .where('user.id', '==', userId)
938
+ .where('status', '==', 'active')
939
+ .get();
940
+ return !!docs && !!docs.size;
941
+ });
942
+ }
943
+ buildBeautyProfileModelInstance() {
944
+ return {
945
+ toFirestore: (data) => data.toPlain(),
946
+ fromFirestore: (snap) => BeautyProfile.toInstance(snap.data()),
947
+ };
948
+ }
796
949
  }
797
950
 
798
- class SubscriptionEditionFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
799
- constructor(firestore, parentRepository) {
800
- super();
801
- this.firestore = firestore;
802
- this.parentRepository = parentRepository;
803
- this.collectionName = 'editions';
804
- this.parentIdField = 'subscriptionId';
805
- this.model = Edition;
806
- }
951
+ class SubscriptionEditionFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
952
+ constructor(firestore, parentRepository) {
953
+ super();
954
+ this.firestore = firestore;
955
+ this.parentRepository = parentRepository;
956
+ this.collectionName = 'editions';
957
+ this.parentIdField = 'subscriptionId';
958
+ this.model = Edition;
959
+ }
807
960
  }
808
961
 
809
- class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
810
- constructor(firestore, parentRepository) {
811
- super();
812
- this.firestore = firestore;
813
- this.parentRepository = parentRepository;
814
- this.collectionName = 'CX';
815
- this.parentIdField = 'userId';
816
- this.model = BeautyProfile;
817
- }
962
+ class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
963
+ constructor(firestore, parentRepository) {
964
+ super();
965
+ this.firestore = firestore;
966
+ this.parentRepository = parentRepository;
967
+ this.collectionName = 'CX';
968
+ this.parentIdField = 'userId';
969
+ this.model = BeautyProfile;
970
+ }
818
971
  }
819
972
 
820
- class UserAddressFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
821
- constructor(firestore, parentRepository) {
822
- super();
823
- this.firestore = firestore;
824
- this.parentRepository = parentRepository;
825
- this.collectionName = 'address';
826
- this.parentIdField = 'userId';
827
- this.model = UserAddress;
828
- }
973
+ class UserAddressFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
974
+ constructor(firestore, parentRepository) {
975
+ super();
976
+ this.firestore = firestore;
977
+ this.parentRepository = parentRepository;
978
+ this.collectionName = 'address';
979
+ this.parentIdField = 'userId';
980
+ this.model = UserAddress;
981
+ }
829
982
  }
830
983
 
831
- class SubscriptionPaymentFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
832
- constructor(firestore, parentRepository) {
833
- super();
834
- this.firestore = firestore;
835
- this.parentRepository = parentRepository;
836
- this.collectionName = 'Payments';
837
- this.parentIdField = 'subscriptionId';
838
- this.model = SubscriptionPayment;
839
- }
984
+ class SubscriptionPaymentFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
985
+ constructor(firestore, parentRepository) {
986
+ super();
987
+ this.firestore = firestore;
988
+ this.parentRepository = parentRepository;
989
+ this.collectionName = 'Payments';
990
+ this.parentIdField = 'subscriptionId';
991
+ this.model = SubscriptionPayment;
992
+ }
840
993
  }
841
994
 
842
- class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
843
- constructor(firestore) {
844
- super();
845
- this.firestore = firestore;
846
- this.collectionName = 'categories';
847
- this.model = Category;
848
- }
849
- getCategoryBySlug(slug, shop) {
850
- return this.collection(this.collectionName)
851
- .where("slug", "==", slug)
852
- .where("shop", "==", shop)
853
- .where("published", "==", true)
854
- .get().then(snap => {
855
- if (snap.size > 1)
856
- throw new DuplicatedResultsError("Query returned duplicated values");
857
- if (snap.empty)
858
- throw new NotFoundError(`Document with slug ${slug} not found`);
859
- return snap.docs[0].data();
860
- }).catch(error => error);
861
- }
862
- getCategoriesForHome(categoryIds) {
863
- return __awaiter(this, void 0, void 0, function* () {
864
- const categorySnap = yield this.collection(this.collectionName)
865
- .where("id", "in", categoryIds)
866
- .where("published", "==", true)
867
- .get();
868
- if (categorySnap.empty)
869
- throw new NotFoundError("Categories not found");
870
- const categories = categorySnap.docs.map(doc => doc.data());
871
- const homeSections = [];
872
- for (const category of categories) {
873
- const productSnap = yield this.collection("products")
874
- .where("categories", "array-contains", category.id)
875
- // .where("published", "==", true)
876
- .where("stock.quantity", ">", 1)
877
- .limit(4)
878
- .get();
879
- const products = productSnap.docs.map(doc => doc.data());
880
- homeSections.push({ title: category.name, products });
881
- }
882
- return homeSections;
883
- });
884
- }
885
- mountCategory(category) {
886
- return __awaiter(this, void 0, void 0, function* () {
887
- if (!category.products)
888
- throw new RequiredArgumentError(["Category products is empty"]);
889
- const chunks = category.products.reduce((resultArray, item, index) => {
890
- const chunkIndex = Math.floor(index / 10);
891
- if (!resultArray[chunkIndex])
892
- resultArray[chunkIndex] = [];
893
- resultArray[chunkIndex].push(item);
894
- return resultArray;
895
- }, []);
896
- const products = [];
897
- for (const productIds of chunks) {
898
- const productSnap = yield this.collection("products")
899
- .where("id", "in", productIds)
900
- // .where("published", "==", true)
901
- .get();
902
- if (productSnap.empty)
903
- continue;
904
- products.push(...productSnap.docs.map(doc => doc.data()));
905
- }
906
- return products;
907
- });
908
- }
995
+ class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
996
+ constructor(firestore) {
997
+ super();
998
+ this.firestore = firestore;
999
+ this.collectionName = 'categories';
1000
+ this.model = Category;
1001
+ }
1002
+ getCategoryBySlug(slug, shop) {
1003
+ return this.collection(this.collectionName)
1004
+ .where("slug", "==", slug)
1005
+ .where("shop", "==", shop)
1006
+ .where("published", "==", true)
1007
+ .get().then(snap => {
1008
+ if (snap.size > 1)
1009
+ throw new DuplicatedResultsError("Query returned duplicated values");
1010
+ if (snap.empty)
1011
+ throw new NotFoundError(`Document with slug ${slug} not found`);
1012
+ return snap.docs[0].data();
1013
+ }).catch(error => error);
1014
+ }
1015
+ getCategoriesForHome(categoryIds) {
1016
+ return __awaiter(this, void 0, void 0, function* () {
1017
+ const categorySnap = yield this.collection(this.collectionName)
1018
+ .where("id", "in", categoryIds)
1019
+ .where("published", "==", true)
1020
+ .get();
1021
+ if (categorySnap.empty)
1022
+ throw new NotFoundError("Categories not found");
1023
+ const categories = categorySnap.docs.map(doc => doc.data());
1024
+ const homeSections = [];
1025
+ for (const category of categories) {
1026
+ const productSnap = yield this.collection("products")
1027
+ .where("categories", "array-contains", category.id)
1028
+ // .where("published", "==", true)
1029
+ .where("stock.quantity", ">", 1)
1030
+ .limit(4)
1031
+ .get();
1032
+ const products = productSnap.docs.map(doc => doc.data());
1033
+ homeSections.push({ title: category.name, products });
1034
+ }
1035
+ return homeSections;
1036
+ });
1037
+ }
1038
+ mountCategory(category) {
1039
+ return __awaiter(this, void 0, void 0, function* () {
1040
+ if (!category.products)
1041
+ throw new RequiredArgumentError(["Category products is empty"]);
1042
+ const chunks = category.products.reduce((resultArray, item, index) => {
1043
+ const chunkIndex = Math.floor(index / 10);
1044
+ if (!resultArray[chunkIndex])
1045
+ resultArray[chunkIndex] = [];
1046
+ resultArray[chunkIndex].push(item);
1047
+ return resultArray;
1048
+ }, []);
1049
+ const products = [];
1050
+ for (const productIds of chunks) {
1051
+ const productSnap = yield this.collection("products")
1052
+ .where("id", "in", productIds)
1053
+ // .where("published", "==", true)
1054
+ .get();
1055
+ if (productSnap.empty)
1056
+ continue;
1057
+ products.push(...productSnap.docs.map(doc => doc.data()));
1058
+ }
1059
+ return products;
1060
+ });
1061
+ }
909
1062
  }
910
1063
 
911
- class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
912
- constructor(firestore) {
913
- super();
914
- this.firestore = firestore;
915
- this.collectionName = 'products';
916
- this.model = Product;
917
- }
918
- getBySlug(slug, shop) {
919
- var _a;
920
- return __awaiter(this, void 0, void 0, function* () {
921
- const result = yield this.find([
922
- { slug: { operator: Where.EQUALS, value: slug } },
923
- { shopAvailability: { operator: Where.IN, value: [shop] } },
924
- ]);
925
- return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
926
- });
927
- }
1064
+ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1065
+ constructor(firestore) {
1066
+ super();
1067
+ this.firestore = firestore;
1068
+ this.collectionName = 'products';
1069
+ this.model = Product;
1070
+ }
1071
+ getBySlug(slug, shop) {
1072
+ var _a;
1073
+ return __awaiter(this, void 0, void 0, function* () {
1074
+ const result = yield this.find([
1075
+ { slug: { operator: Where.EQUALS, value: slug } },
1076
+ { shopAvailability: { operator: Where.IN, value: [shop] } },
1077
+ ]);
1078
+ return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
1079
+ });
1080
+ }
928
1081
  }
929
1082
 
930
- class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product) {
931
- constructor(firestore, parentRepository) {
932
- super();
933
- this.firestore = firestore;
934
- this.parentRepository = parentRepository;
935
- this.collectionName = 'variants';
936
- this.parentIdField = 'productId';
937
- this.model = Variant;
938
- }
1083
+ class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product) {
1084
+ constructor(firestore, parentRepository) {
1085
+ super();
1086
+ this.firestore = firestore;
1087
+ this.parentRepository = parentRepository;
1088
+ this.collectionName = 'variants';
1089
+ this.parentIdField = 'productId';
1090
+ this.model = Variant;
1091
+ }
939
1092
  }
940
1093
 
941
- class CheckoutFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
942
- constructor(firestore) {
943
- super();
944
- this.firestore = firestore;
945
- this.collectionName = 'checkouts';
946
- this.model = Checkout;
947
- }
1094
+ class CheckoutFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1095
+ constructor(firestore) {
1096
+ super();
1097
+ this.firestore = firestore;
1098
+ this.collectionName = 'checkouts';
1099
+ this.model = Checkout;
1100
+ }
948
1101
  }
949
1102
 
950
- class CouponFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
951
- constructor(firestore) {
952
- super();
953
- this.firestore = firestore;
954
- this.collectionName = 'coupons';
955
- this.model = Coupon;
956
- }
1103
+ class CouponFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1104
+ constructor(firestore) {
1105
+ super();
1106
+ this.firestore = firestore;
1107
+ this.collectionName = 'coupons';
1108
+ this.model = Coupon;
1109
+ }
957
1110
  }
958
1111
 
959
- class OrderFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
960
- constructor(firestore) {
961
- super();
962
- this.firestore = firestore;
963
- this.collectionName = 'orders';
964
- this.model = Order;
965
- }
1112
+ class OrderFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1113
+ constructor(firestore) {
1114
+ super();
1115
+ this.firestore = firestore;
1116
+ this.collectionName = 'orders';
1117
+ this.model = Order;
1118
+ }
966
1119
  }
967
1120
 
968
- class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
969
- constructor(firestore) {
970
- super();
971
- this.firestore = firestore;
972
- this.collectionName = 'payments';
973
- this.model = Payment;
974
- }
1121
+ class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1122
+ constructor(firestore) {
1123
+ super();
1124
+ this.firestore = firestore;
1125
+ this.collectionName = 'payments';
1126
+ this.model = Payment;
1127
+ }
975
1128
  }
976
1129
 
977
- class CheckoutSubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
978
- constructor(firestore) {
979
- super();
980
- this.firestore = firestore;
981
- this.collectionName = 'checkoutsSubscription';
982
- this.model = CheckoutSubscription;
983
- }
1130
+ class CheckoutSubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1131
+ constructor(firestore) {
1132
+ super();
1133
+ this.firestore = firestore;
1134
+ this.collectionName = 'checkoutsSubscription';
1135
+ this.model = CheckoutSubscription;
1136
+ }
984
1137
  }
985
1138
 
986
- class SubscriptionPlanFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
987
- constructor(firestore) {
988
- super();
989
- this.firestore = firestore;
990
- this.collectionName = 'subscriptionPlans';
991
- this.model = SubscriptionPlan;
992
- }
1139
+ class SubscriptionPlanFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1140
+ constructor(firestore) {
1141
+ super();
1142
+ this.firestore = firestore;
1143
+ this.collectionName = 'subscriptionPlans';
1144
+ this.model = SubscriptionPlan;
1145
+ }
993
1146
  }
994
1147
 
995
- class Buy2WinFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
996
- constructor(firestore) {
997
- super();
998
- this.firestore = firestore;
999
- this.collectionName = 'buy2win';
1000
- this.model = Buy2Win;
1001
- }
1148
+ class Buy2WinFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1149
+ constructor(firestore) {
1150
+ super();
1151
+ this.firestore = firestore;
1152
+ this.collectionName = 'buy2win';
1153
+ this.model = Buy2Win;
1154
+ }
1002
1155
  }
1003
1156
 
1004
- class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1005
- constructor(firestore) {
1006
- super();
1007
- this.firestore = firestore;
1008
- this.collectionName = 'dms';
1009
- this.model = Home;
1010
- }
1157
+ class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1158
+ constructor(firestore) {
1159
+ super();
1160
+ this.firestore = firestore;
1161
+ this.collectionName = 'dms';
1162
+ this.model = Home;
1163
+ }
1011
1164
  }
1012
1165
 
1013
- class ShopMenuFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1014
- constructor(firestore) {
1015
- super();
1016
- this.firestore = firestore;
1017
- this.collectionName = 'shopMenus';
1018
- this.model = ShopMenu;
1019
- }
1166
+ class ShopMenuFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1167
+ constructor(firestore) {
1168
+ super();
1169
+ this.firestore = firestore;
1170
+ this.collectionName = 'shopMenus';
1171
+ this.model = ShopMenu;
1172
+ }
1020
1173
  }
1021
1174
 
1022
- class AuthenticationFirebaseAuthService {
1023
- constructor(firebaseAuth) {
1024
- this.firebaseAuth = firebaseAuth;
1025
- }
1026
- signInWithEmailAndPassword(data) {
1027
- return __awaiter(this, void 0, void 0, function* () {
1028
- const credentials = yield this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password);
1029
- const user = credentials.user;
1030
- return { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber };
1031
- });
1032
- }
1033
- signInWithGoogle() {
1034
- return __awaiter(this, void 0, void 0, function* () {
1035
- const credentials = yield this.firebaseAuth.signInWithPopup(new firebase$1.auth.GoogleAuthProvider());
1036
- const user = credentials.user;
1037
- return { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber };
1038
- });
1039
- }
1040
- signOut() {
1041
- return __awaiter(this, void 0, void 0, function* () {
1042
- this.firebaseAuth.signOut();
1043
- });
1044
- }
1175
+ class AuthenticationFirebaseAuthService {
1176
+ constructor(firebaseAuth) {
1177
+ this.firebaseAuth = firebaseAuth;
1178
+ }
1179
+ signInWithEmailAndPassword(data) {
1180
+ return __awaiter(this, void 0, void 0, function* () {
1181
+ const credentials = yield this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password);
1182
+ const user = credentials.user;
1183
+ return { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber };
1184
+ });
1185
+ }
1186
+ signInWithGoogle() {
1187
+ return __awaiter(this, void 0, void 0, function* () {
1188
+ const credentials = yield this.firebaseAuth.signInWithPopup(new firebase$1.auth.GoogleAuthProvider());
1189
+ const user = credentials.user;
1190
+ return { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber };
1191
+ });
1192
+ }
1193
+ signOut() {
1194
+ return __awaiter(this, void 0, void 0, function* () {
1195
+ this.firebaseAuth.signOut();
1196
+ });
1197
+ }
1045
1198
  }
1046
1199
 
1047
- /**
1048
- * Generated bundle index. Do not edit.
1200
+ /**
1201
+ * Generated bundle index. Do not edit.
1049
1202
  */
1050
1203
 
1051
1204
  export { Address, Area, Authentication, AuthenticationFirebaseAuthService, Base, BaseModel, BeardSizes, BeautyProfile, BillingStatus, Buy2Win, Buy2WinFirestoreRepository, Category, CategoryFirestoreRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FinancialCoupon, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, LineItem, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Product, ProductFirestoreRepository, ProductVariantFirestoreRepository, RequiredArgumentError, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, UnauthorizedError, UpdateOptionActions, User, UserAddress, UserAddressFirestoreRepository, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserType, Variant, Where, withCreateFirestore, withCrudFirestore, withDeleteFirestore, withFindFirestore, withFirestore, withGetFirestore, withHelpers, withSubCollection, withUpdateFirestore };