@infrab4a/connect 0.17.0-beta.10 → 0.17.0-beta.3

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 (490) hide show
  1. package/README.md +24 -24
  2. package/bundles/infrab4a-connect.umd.js +2390 -2393
  3. package/bundles/infrab4a-connect.umd.js.map +1 -1
  4. package/domain/catalog/index.d.ts +2 -2
  5. package/domain/catalog/models/category.d.ts +22 -22
  6. package/domain/catalog/models/enums/index.d.ts +1 -1
  7. package/domain/catalog/models/enums/shops.enum.d.ts +6 -6
  8. package/domain/catalog/models/index.d.ts +5 -5
  9. package/domain/catalog/models/product.d.ts +35 -35
  10. package/domain/catalog/models/types/category-condition.type.d.ts +4 -4
  11. package/domain/catalog/models/types/category-filter.type.d.ts +4 -4
  12. package/domain/catalog/models/types/index.d.ts +7 -7
  13. package/domain/catalog/models/types/product-review.type.d.ts +15 -15
  14. package/domain/catalog/models/types/shops-description.type.d.ts +7 -7
  15. package/domain/catalog/models/types/shops-price.type.d.ts +10 -10
  16. package/domain/catalog/models/types/stock.type.d.ts +3 -3
  17. package/domain/catalog/models/types/variant-grade.type.d.ts +4 -4
  18. package/domain/catalog/models/variant.d.ts +14 -14
  19. package/domain/catalog/repositories/category.repository.d.ts +15 -15
  20. package/domain/catalog/repositories/index.d.ts +4 -4
  21. package/domain/catalog/repositories/product.repository.d.ts +5 -5
  22. package/domain/catalog/repositories/subscription-product.repository.d.ts +4 -4
  23. package/domain/catalog/repositories/variant.repository.d.ts +4 -4
  24. package/domain/general/index.d.ts +2 -2
  25. package/domain/general/model/base-model-with-identifier-fields.d.ts +3 -3
  26. package/domain/general/model/base.model.d.ts +6 -6
  27. package/domain/general/model/identifier-fields.d.ts +4 -4
  28. package/domain/general/model/index.d.ts +4 -4
  29. package/domain/general/model/types/base-model-builder.type.d.ts +5 -5
  30. package/domain/general/model/types/index.d.ts +3 -3
  31. package/domain/general/model/types/non-function-properties.type.d.ts +2 -2
  32. package/domain/general/model/types/non-function-property-name.type.d.ts +3 -3
  33. package/domain/general/repository/create.repository.d.ts +5 -5
  34. package/domain/general/repository/crud.repository.d.ts +7 -7
  35. package/domain/general/repository/delete.repository.d.ts +5 -5
  36. package/domain/general/repository/enums/index.d.ts +2 -2
  37. package/domain/general/repository/enums/update-option-actions.enum.d.ts +7 -7
  38. package/domain/general/repository/enums/where.enum.d.ts +10 -10
  39. package/domain/general/repository/find.repository.d.ts +5 -5
  40. package/domain/general/repository/get.repository.d.ts +5 -5
  41. package/domain/general/repository/index.d.ts +9 -9
  42. package/domain/general/repository/read.repository.d.ts +5 -5
  43. package/domain/general/repository/types/index.d.ts +5 -5
  44. package/domain/general/repository/types/repository-find-filters.type.d.ts +14 -14
  45. package/domain/general/repository/types/repository-find-result.type.d.ts +4 -4
  46. package/domain/general/repository/types/repository-limit-options.type.d.ts +4 -4
  47. package/domain/general/repository/types/repository-order-by-list.type.d.ts +5 -5
  48. package/domain/general/repository/types/repository-update-params.type.d.ts +11 -11
  49. package/domain/general/repository/update.repository.d.ts +5 -5
  50. package/domain/index.d.ts +6 -6
  51. package/domain/location/index.d.ts +1 -1
  52. package/domain/location/models/address.d.ts +21 -21
  53. package/domain/location/models/index.d.ts +2 -2
  54. package/domain/location/models/types/index.d.ts +3 -3
  55. package/domain/location/models/types/location-bound.type.d.ts +6 -6
  56. package/domain/location/models/types/location-geometry.type.d.ts +7 -7
  57. package/domain/location/models/types/location-lat-lng.type.d.ts +4 -4
  58. package/domain/shop-settings/enums/filter-type.enum.d.ts +19 -19
  59. package/domain/shop-settings/enums/index.d.ts +2 -2
  60. package/domain/shop-settings/enums/questions-filters.enum.d.ts +19 -19
  61. package/domain/shop-settings/helpers/beauty-questions.helper.d.ts +9 -9
  62. package/domain/shop-settings/helpers/index.d.ts +1 -1
  63. package/domain/shop-settings/index.d.ts +4 -4
  64. package/domain/shop-settings/models/home.d.ts +17 -17
  65. package/domain/shop-settings/models/index.d.ts +3 -3
  66. package/domain/shop-settings/models/shop-menu.d.ts +7 -7
  67. package/domain/shop-settings/models/types/banner.type.d.ts +6 -6
  68. package/domain/shop-settings/models/types/benefit.type.d.ts +5 -5
  69. package/domain/shop-settings/models/types/home-data.type.d.ts +15 -15
  70. package/domain/shop-settings/models/types/index.d.ts +5 -5
  71. package/domain/shop-settings/models/types/menu-nav.type.d.ts +8 -8
  72. package/domain/shop-settings/models/types/sub-menu.type.d.ts +8 -8
  73. package/domain/shop-settings/repositories/home.repository.d.ts +4 -4
  74. package/domain/shop-settings/repositories/index.d.ts +2 -2
  75. package/domain/shop-settings/repositories/shop-menu.repository.d.ts +4 -4
  76. package/domain/shopping/index.d.ts +2 -2
  77. package/domain/shopping/models/buy-2-win.d.ts +18 -18
  78. package/domain/shopping/models/checkout.d.ts +29 -29
  79. package/domain/shopping/models/coupons/coupon.d.ts +29 -34
  80. package/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +4 -4
  81. package/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +4 -4
  82. package/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +5 -8
  83. package/domain/shopping/models/coupons/enums/index.d.ts +3 -3
  84. package/domain/shopping/models/coupons/index.d.ts +2 -2
  85. package/domain/shopping/models/enums/checkout-types.enum.d.ts +5 -5
  86. package/domain/shopping/models/enums/index.d.ts +2 -2
  87. package/domain/shopping/models/enums/order-status.enum.d.ts +10 -10
  88. package/domain/shopping/models/index.d.ts +11 -11
  89. package/domain/shopping/models/line-item.d.ts +8 -8
  90. package/domain/shopping/models/order.d.ts +9 -9
  91. package/domain/shopping/models/payment.d.ts +69 -69
  92. package/domain/shopping/models/shipping-method.d.ts +18 -18
  93. package/domain/shopping/models/subscription/checkout.d.ts +23 -23
  94. package/domain/shopping/models/subscription/index.d.ts +2 -2
  95. package/domain/shopping/models/subscription/plan.d.ts +12 -12
  96. package/domain/shopping/models/types/index.d.ts +7 -7
  97. package/domain/shopping/models/types/payment-address.type.d.ts +12 -12
  98. package/domain/shopping/models/types/payment-billing.type.d.ts +7 -7
  99. package/domain/shopping/models/types/payment-card.type.d.ts +14 -14
  100. package/domain/shopping/models/types/payment-customer.type.d.ts +18 -18
  101. package/domain/shopping/models/types/payment-document.type.d.ts +6 -6
  102. package/domain/shopping/models/types/payment-item.type.d.ts +11 -11
  103. package/domain/shopping/models/types/payment-shipping.type.d.ts +10 -10
  104. package/domain/shopping/repositories/buy-2-win.repository.d.ts +4 -4
  105. package/domain/shopping/repositories/checkout.repository.d.ts +4 -4
  106. package/domain/shopping/repositories/coupon.repository.d.ts +4 -4
  107. package/domain/shopping/repositories/index.d.ts +7 -7
  108. package/domain/shopping/repositories/legacy-order.repository.d.ts +3 -3
  109. package/domain/shopping/repositories/order.repository.d.ts +4 -4
  110. package/domain/shopping/repositories/payment.repository.d.ts +4 -4
  111. package/domain/shopping/repositories/subscription/checkout.repository.d.ts +4 -4
  112. package/domain/shopping/repositories/subscription/index.d.ts +2 -2
  113. package/domain/shopping/repositories/subscription/plan.repository.d.ts +4 -4
  114. package/domain/users/errors/index.d.ts +3 -3
  115. package/domain/users/errors/unauthorized.error.d.ts +4 -4
  116. package/domain/users/errors/user-already-registered.error.d.ts +4 -4
  117. package/domain/users/errors/weak-password.error.d.ts +4 -4
  118. package/domain/users/index.d.ts +5 -5
  119. package/domain/users/models/beauty-profile.d.ts +12 -12
  120. package/domain/users/models/enums/accessory-importances.enum.d.ts +5 -5
  121. package/domain/users/models/enums/area.enum.d.ts +11 -11
  122. package/domain/users/models/enums/beard-problems.enum.d.ts +9 -9
  123. package/domain/users/models/enums/beard-sizes.enum.d.ts +7 -7
  124. package/domain/users/models/enums/beauty-product-importances.enum.d.ts +6 -6
  125. package/domain/users/models/enums/body-problems.enum.d.ts +11 -11
  126. package/domain/users/models/enums/body-shapes.enum.d.ts +7 -7
  127. package/domain/users/models/enums/body-tattoos.enum.d.ts +5 -5
  128. package/domain/users/models/enums/face-skin-oilinesses.enum.d.ts +7 -7
  129. package/domain/users/models/enums/face-skin-problems.enum.d.ts +10 -10
  130. package/domain/users/models/enums/face-skin-tones.enum.d.ts +8 -8
  131. package/domain/users/models/enums/family-incomes.enum.d.ts +8 -8
  132. package/domain/users/models/enums/fragrance-importances.enum.d.ts +5 -5
  133. package/domain/users/models/enums/hair-colors.enum.d.ts +10 -10
  134. package/domain/users/models/enums/hair-problems.enum.d.ts +10 -10
  135. package/domain/users/models/enums/hair-strands.enum.d.ts +8 -8
  136. package/domain/users/models/enums/hair-types.enum.d.ts +7 -7
  137. package/domain/users/models/enums/index.d.ts +20 -20
  138. package/domain/users/models/enums/office-position.enum.d.ts +6 -6
  139. package/domain/users/models/enums/product-spents.enum.d.ts +8 -8
  140. package/domain/users/models/enums/user-type.enum.d.ts +8 -8
  141. package/domain/users/models/index.d.ts +7 -7
  142. package/domain/users/models/lead.d.ts +9 -9
  143. package/domain/users/models/subscription/edition.d.ts +17 -17
  144. package/domain/users/models/subscription/enums/billing-status.enum.d.ts +3 -3
  145. package/domain/users/models/subscription/enums/edition-status.enum.d.ts +4 -4
  146. package/domain/users/models/subscription/enums/index.d.ts +4 -4
  147. package/domain/users/models/subscription/enums/payment-type.enum.d.ts +5 -5
  148. package/domain/users/models/subscription/enums/status.enum.d.ts +4 -4
  149. package/domain/users/models/subscription/index.d.ts +4 -4
  150. package/domain/users/models/subscription/payment.d.ts +14 -14
  151. package/domain/users/models/subscription/subscription.d.ts +30 -30
  152. package/domain/users/models/user-address.d.ts +7 -7
  153. package/domain/users/models/user-payment-method.d.ts +14 -14
  154. package/domain/users/models/user.d.ts +25 -25
  155. package/domain/users/repositories/beauty-profile.repository.d.ts +4 -4
  156. package/domain/users/repositories/edition.repository.d.ts +4 -4
  157. package/domain/users/repositories/index.d.ts +8 -8
  158. package/domain/users/repositories/lead.repository.d.ts +4 -4
  159. package/domain/users/repositories/subscription-payment.repository.d.ts +4 -4
  160. package/domain/users/repositories/subscription.repository.d.ts +4 -4
  161. package/domain/users/repositories/user-address.repository.d.ts +4 -4
  162. package/domain/users/repositories/user-payment-method.repository.d.ts +4 -4
  163. package/domain/users/repositories/user.repository.d.ts +6 -6
  164. package/domain/users/services/authentication.service.d.ts +12 -12
  165. package/domain/users/services/index.d.ts +3 -3
  166. package/domain/users/services/register.service.d.ts +7 -7
  167. package/domain/users/services/types/basic-user-data.type.d.ts +4 -4
  168. package/domain/users/services/types/index.d.ts +1 -1
  169. package/domain/users/use-cases/authentication.d.ts +21 -21
  170. package/domain/users/use-cases/index.d.ts +4 -4
  171. package/domain/users/use-cases/recovery-password.d.ts +6 -6
  172. package/domain/users/use-cases/register.d.ts +13 -13
  173. package/domain/users/use-cases/signout.d.ts +6 -6
  174. package/errors/duplicated-results.error.d.ts +4 -4
  175. package/errors/index.d.ts +4 -4
  176. package/errors/invalid-argument.error.d.ts +4 -4
  177. package/errors/not-found.error.d.ts +4 -4
  178. package/errors/required-argument.error.d.ts +5 -5
  179. package/esm2015/domain/catalog/index.js +3 -3
  180. package/esm2015/domain/catalog/models/category.js +7 -7
  181. package/esm2015/domain/catalog/models/enums/index.js +2 -2
  182. package/esm2015/domain/catalog/models/enums/shops.enum.js +8 -8
  183. package/esm2015/domain/catalog/models/index.js +6 -6
  184. package/esm2015/domain/catalog/models/product.js +11 -11
  185. package/esm2015/domain/catalog/models/types/category-condition.type.js +2 -2
  186. package/esm2015/domain/catalog/models/types/category-filter.type.js +2 -2
  187. package/esm2015/domain/catalog/models/types/index.js +8 -8
  188. package/esm2015/domain/catalog/models/types/product-review.type.js +2 -2
  189. package/esm2015/domain/catalog/models/types/shops-description.type.js +2 -2
  190. package/esm2015/domain/catalog/models/types/shops-price.type.js +2 -2
  191. package/esm2015/domain/catalog/models/types/stock.type.js +2 -2
  192. package/esm2015/domain/catalog/models/types/variant-grade.type.js +2 -2
  193. package/esm2015/domain/catalog/models/variant.js +7 -7
  194. package/esm2015/domain/catalog/repositories/category.repository.js +2 -2
  195. package/esm2015/domain/catalog/repositories/index.js +5 -5
  196. package/esm2015/domain/catalog/repositories/product.repository.js +2 -2
  197. package/esm2015/domain/catalog/repositories/subscription-product.repository.js +2 -2
  198. package/esm2015/domain/catalog/repositories/variant.repository.js +2 -2
  199. package/esm2015/domain/general/index.js +3 -3
  200. package/esm2015/domain/general/model/base-model-with-identifier-fields.js +2 -2
  201. package/esm2015/domain/general/model/base.model.js +13 -13
  202. package/esm2015/domain/general/model/identifier-fields.js +2 -2
  203. package/esm2015/domain/general/model/index.js +5 -5
  204. package/esm2015/domain/general/model/types/base-model-builder.type.js +2 -2
  205. package/esm2015/domain/general/model/types/index.js +4 -4
  206. package/esm2015/domain/general/model/types/non-function-properties.type.js +2 -2
  207. package/esm2015/domain/general/model/types/non-function-property-name.type.js +2 -2
  208. package/esm2015/domain/general/repository/create.repository.js +2 -2
  209. package/esm2015/domain/general/repository/crud.repository.js +2 -2
  210. package/esm2015/domain/general/repository/delete.repository.js +2 -2
  211. package/esm2015/domain/general/repository/enums/index.js +3 -3
  212. package/esm2015/domain/general/repository/enums/update-option-actions.enum.js +9 -9
  213. package/esm2015/domain/general/repository/enums/where.enum.js +12 -12
  214. package/esm2015/domain/general/repository/find.repository.js +2 -2
  215. package/esm2015/domain/general/repository/get.repository.js +2 -2
  216. package/esm2015/domain/general/repository/index.js +10 -10
  217. package/esm2015/domain/general/repository/read.repository.js +2 -2
  218. package/esm2015/domain/general/repository/types/index.js +6 -6
  219. package/esm2015/domain/general/repository/types/repository-find-filters.type.js +2 -2
  220. package/esm2015/domain/general/repository/types/repository-find-result.type.js +2 -2
  221. package/esm2015/domain/general/repository/types/repository-limit-options.type.js +2 -2
  222. package/esm2015/domain/general/repository/types/repository-order-by-list.type.js +2 -2
  223. package/esm2015/domain/general/repository/types/repository-update-params.type.js +2 -2
  224. package/esm2015/domain/general/repository/update.repository.js +2 -2
  225. package/esm2015/domain/index.js +7 -7
  226. package/esm2015/domain/location/index.js +2 -2
  227. package/esm2015/domain/location/models/address.js +4 -4
  228. package/esm2015/domain/location/models/index.js +3 -3
  229. package/esm2015/domain/location/models/types/index.js +4 -4
  230. package/esm2015/domain/location/models/types/location-bound.type.js +2 -2
  231. package/esm2015/domain/location/models/types/location-geometry.type.js +2 -2
  232. package/esm2015/domain/location/models/types/location-lat-lng.type.js +2 -2
  233. package/esm2015/domain/shop-settings/enums/filter-type.enum.js +21 -21
  234. package/esm2015/domain/shop-settings/enums/index.js +3 -3
  235. package/esm2015/domain/shop-settings/enums/questions-filters.enum.js +21 -21
  236. package/esm2015/domain/shop-settings/helpers/beauty-questions.helper.js +46 -46
  237. package/esm2015/domain/shop-settings/helpers/index.js +2 -2
  238. package/esm2015/domain/shop-settings/index.js +5 -5
  239. package/esm2015/domain/shop-settings/models/home.js +7 -7
  240. package/esm2015/domain/shop-settings/models/index.js +4 -4
  241. package/esm2015/domain/shop-settings/models/shop-menu.js +7 -7
  242. package/esm2015/domain/shop-settings/models/types/banner.type.js +2 -2
  243. package/esm2015/domain/shop-settings/models/types/benefit.type.js +2 -2
  244. package/esm2015/domain/shop-settings/models/types/home-data.type.js +2 -2
  245. package/esm2015/domain/shop-settings/models/types/index.js +6 -6
  246. package/esm2015/domain/shop-settings/models/types/menu-nav.type.js +2 -2
  247. package/esm2015/domain/shop-settings/models/types/sub-menu.type.js +2 -2
  248. package/esm2015/domain/shop-settings/repositories/home.repository.js +2 -2
  249. package/esm2015/domain/shop-settings/repositories/index.js +3 -3
  250. package/esm2015/domain/shop-settings/repositories/shop-menu.repository.js +2 -2
  251. package/esm2015/domain/shopping/index.js +3 -3
  252. package/esm2015/domain/shopping/models/buy-2-win.js +14 -14
  253. package/esm2015/domain/shopping/models/checkout.js +38 -38
  254. package/esm2015/domain/shopping/models/coupons/coupon.js +38 -38
  255. package/esm2015/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +6 -6
  256. package/esm2015/domain/shopping/models/coupons/enums/coupon-types.enum.js +10 -10
  257. package/esm2015/domain/shopping/models/coupons/enums/exclusivities.enum.js +7 -10
  258. package/esm2015/domain/shopping/models/coupons/enums/index.js +4 -4
  259. package/esm2015/domain/shopping/models/coupons/index.js +3 -3
  260. package/esm2015/domain/shopping/models/enums/checkout-types.enum.js +7 -7
  261. package/esm2015/domain/shopping/models/enums/index.js +3 -3
  262. package/esm2015/domain/shopping/models/enums/order-status.enum.js +12 -12
  263. package/esm2015/domain/shopping/models/index.js +12 -12
  264. package/esm2015/domain/shopping/models/line-item.js +4 -4
  265. package/esm2015/domain/shopping/models/order.js +11 -11
  266. package/esm2015/domain/shopping/models/payment.js +169 -169
  267. package/esm2015/domain/shopping/models/shipping-method.js +7 -7
  268. package/esm2015/domain/shopping/models/subscription/checkout.js +28 -28
  269. package/esm2015/domain/shopping/models/subscription/index.js +3 -3
  270. package/esm2015/domain/shopping/models/subscription/plan.js +7 -7
  271. package/esm2015/domain/shopping/models/types/index.js +8 -8
  272. package/esm2015/domain/shopping/models/types/payment-address.type.js +2 -2
  273. package/esm2015/domain/shopping/models/types/payment-billing.type.js +2 -2
  274. package/esm2015/domain/shopping/models/types/payment-card.type.js +2 -2
  275. package/esm2015/domain/shopping/models/types/payment-customer.type.js +2 -2
  276. package/esm2015/domain/shopping/models/types/payment-document.type.js +2 -2
  277. package/esm2015/domain/shopping/models/types/payment-item.type.js +2 -2
  278. package/esm2015/domain/shopping/models/types/payment-shipping.type.js +2 -2
  279. package/esm2015/domain/shopping/repositories/buy-2-win.repository.js +2 -2
  280. package/esm2015/domain/shopping/repositories/checkout.repository.js +2 -2
  281. package/esm2015/domain/shopping/repositories/coupon.repository.js +2 -2
  282. package/esm2015/domain/shopping/repositories/index.js +8 -8
  283. package/esm2015/domain/shopping/repositories/legacy-order.repository.js +2 -2
  284. package/esm2015/domain/shopping/repositories/order.repository.js +2 -2
  285. package/esm2015/domain/shopping/repositories/payment.repository.js +2 -2
  286. package/esm2015/domain/shopping/repositories/subscription/checkout.repository.js +2 -2
  287. package/esm2015/domain/shopping/repositories/subscription/index.js +3 -3
  288. package/esm2015/domain/shopping/repositories/subscription/plan.repository.js +2 -2
  289. package/esm2015/domain/users/errors/index.js +4 -4
  290. package/esm2015/domain/users/errors/unauthorized.error.js +7 -7
  291. package/esm2015/domain/users/errors/user-already-registered.error.js +7 -7
  292. package/esm2015/domain/users/errors/weak-password.error.js +7 -7
  293. package/esm2015/domain/users/index.js +6 -6
  294. package/esm2015/domain/users/models/beauty-profile.js +12 -12
  295. package/esm2015/domain/users/models/enums/accessory-importances.enum.js +7 -7
  296. package/esm2015/domain/users/models/enums/area.enum.js +13 -13
  297. package/esm2015/domain/users/models/enums/beard-problems.enum.js +11 -11
  298. package/esm2015/domain/users/models/enums/beard-sizes.enum.js +9 -9
  299. package/esm2015/domain/users/models/enums/beauty-product-importances.enum.js +8 -8
  300. package/esm2015/domain/users/models/enums/body-problems.enum.js +13 -13
  301. package/esm2015/domain/users/models/enums/body-shapes.enum.js +9 -9
  302. package/esm2015/domain/users/models/enums/body-tattoos.enum.js +7 -7
  303. package/esm2015/domain/users/models/enums/face-skin-oilinesses.enum.js +9 -9
  304. package/esm2015/domain/users/models/enums/face-skin-problems.enum.js +12 -12
  305. package/esm2015/domain/users/models/enums/face-skin-tones.enum.js +10 -10
  306. package/esm2015/domain/users/models/enums/family-incomes.enum.js +10 -10
  307. package/esm2015/domain/users/models/enums/fragrance-importances.enum.js +7 -7
  308. package/esm2015/domain/users/models/enums/hair-colors.enum.js +12 -12
  309. package/esm2015/domain/users/models/enums/hair-problems.enum.js +12 -12
  310. package/esm2015/domain/users/models/enums/hair-strands.enum.js +10 -10
  311. package/esm2015/domain/users/models/enums/hair-types.enum.js +9 -9
  312. package/esm2015/domain/users/models/enums/index.js +21 -21
  313. package/esm2015/domain/users/models/enums/office-position.enum.js +8 -8
  314. package/esm2015/domain/users/models/enums/product-spents.enum.js +10 -10
  315. package/esm2015/domain/users/models/enums/user-type.enum.js +10 -10
  316. package/esm2015/domain/users/models/index.js +8 -8
  317. package/esm2015/domain/users/models/lead.js +7 -7
  318. package/esm2015/domain/users/models/subscription/edition.js +7 -7
  319. package/esm2015/domain/users/models/subscription/enums/billing-status.enum.js +5 -5
  320. package/esm2015/domain/users/models/subscription/enums/edition-status.enum.js +6 -6
  321. package/esm2015/domain/users/models/subscription/enums/index.js +5 -5
  322. package/esm2015/domain/users/models/subscription/enums/payment-type.enum.js +7 -7
  323. package/esm2015/domain/users/models/subscription/enums/status.enum.js +6 -6
  324. package/esm2015/domain/users/models/subscription/index.js +5 -5
  325. package/esm2015/domain/users/models/subscription/payment.js +14 -14
  326. package/esm2015/domain/users/models/subscription/subscription.js +43 -43
  327. package/esm2015/domain/users/models/user-address.js +7 -7
  328. package/esm2015/domain/users/models/user-payment-method.js +7 -7
  329. package/esm2015/domain/users/models/user.js +26 -26
  330. package/esm2015/domain/users/repositories/beauty-profile.repository.js +2 -2
  331. package/esm2015/domain/users/repositories/edition.repository.js +2 -2
  332. package/esm2015/domain/users/repositories/index.js +9 -9
  333. package/esm2015/domain/users/repositories/lead.repository.js +2 -2
  334. package/esm2015/domain/users/repositories/subscription-payment.repository.js +2 -2
  335. package/esm2015/domain/users/repositories/subscription.repository.js +2 -2
  336. package/esm2015/domain/users/repositories/user-address.repository.js +2 -2
  337. package/esm2015/domain/users/repositories/user-payment-method.repository.js +2 -2
  338. package/esm2015/domain/users/repositories/user.repository.js +2 -2
  339. package/esm2015/domain/users/services/authentication.service.js +2 -2
  340. package/esm2015/domain/users/services/index.js +4 -4
  341. package/esm2015/domain/users/services/register.service.js +2 -2
  342. package/esm2015/domain/users/services/types/basic-user-data.type.js +2 -2
  343. package/esm2015/domain/users/services/types/index.js +2 -2
  344. package/esm2015/domain/users/use-cases/authentication.js +40 -40
  345. package/esm2015/domain/users/use-cases/index.js +5 -5
  346. package/esm2015/domain/users/use-cases/recovery-password.js +12 -12
  347. package/esm2015/domain/users/use-cases/register.js +34 -34
  348. package/esm2015/domain/users/use-cases/signout.js +12 -12
  349. package/esm2015/errors/duplicated-results.error.js +7 -7
  350. package/esm2015/errors/index.js +5 -5
  351. package/esm2015/errors/invalid-argument.error.js +7 -7
  352. package/esm2015/errors/not-found.error.js +7 -7
  353. package/esm2015/errors/required-argument.error.js +8 -8
  354. package/esm2015/index.js +6 -6
  355. package/esm2015/infra/elasticsearch/adapters/axios.adapter.js +22 -22
  356. package/esm2015/infra/elasticsearch/adapters/elastic-search.adapter.js +2 -2
  357. package/esm2015/infra/elasticsearch/adapters/index.js +3 -3
  358. package/esm2015/infra/elasticsearch/index.js +4 -4
  359. package/esm2015/infra/elasticsearch/indexes/index.js +2 -2
  360. package/esm2015/infra/elasticsearch/indexes/products-index.js +59 -59
  361. package/esm2015/infra/elasticsearch/types/elastic-search-result.js +2 -2
  362. package/esm2015/infra/elasticsearch/types/index.js +2 -2
  363. package/esm2015/infra/firebase/auth/authentication-firebase-auth.service.js +52 -52
  364. package/esm2015/infra/firebase/auth/index.js +3 -3
  365. package/esm2015/infra/firebase/auth/register-firebase-auth.service.js +26 -26
  366. package/esm2015/infra/firebase/auth/types/firebase-user-with-id.type.js +2 -2
  367. package/esm2015/infra/firebase/firestore/index.js +4 -4
  368. package/esm2015/infra/firebase/firestore/mixins/index.js +10 -10
  369. package/esm2015/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +31 -31
  370. package/esm2015/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +10 -10
  371. package/esm2015/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +18 -18
  372. package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +87 -87
  373. package/esm2015/infra/firebase/firestore/mixins/with-firestore.mixin.js +26 -26
  374. package/esm2015/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +24 -24
  375. package/esm2015/infra/firebase/firestore/mixins/with-helpers.mixin.js +17 -17
  376. package/esm2015/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +11 -11
  377. package/esm2015/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +45 -45
  378. package/esm2015/infra/firebase/firestore/models/user-search.js +7 -7
  379. package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +70 -70
  380. package/esm2015/infra/firebase/firestore/repositories/catalog/index.js +5 -5
  381. package/esm2015/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +23 -23
  382. package/esm2015/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -14
  383. package/esm2015/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +12 -12
  384. package/esm2015/infra/firebase/firestore/repositories/index.js +5 -5
  385. package/esm2015/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +56 -56
  386. package/esm2015/infra/firebase/firestore/repositories/shop-settings/index.js +3 -3
  387. package/esm2015/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +12 -12
  388. package/esm2015/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +12 -12
  389. package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -12
  390. package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +12 -12
  391. package/esm2015/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +29 -29
  392. package/esm2015/infra/firebase/firestore/repositories/shopping/index.js +9 -9
  393. package/esm2015/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +9 -9
  394. package/esm2015/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -12
  395. package/esm2015/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -12
  396. package/esm2015/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +12 -12
  397. package/esm2015/infra/firebase/firestore/repositories/users/index.js +10 -10
  398. package/esm2015/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +12 -12
  399. package/esm2015/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +14 -14
  400. package/esm2015/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +12 -12
  401. package/esm2015/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +14 -14
  402. package/esm2015/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -14
  403. package/esm2015/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +14 -14
  404. package/esm2015/infra/firebase/firestore/repositories/users/user-firestore.repository.js +70 -70
  405. package/esm2015/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +14 -14
  406. package/esm2015/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +12 -12
  407. package/esm2015/infra/firebase/firestore/types/firestore-sub.repository.type.js +2 -2
  408. package/esm2015/infra/firebase/firestore/types/firestore.helpers.type.js +2 -2
  409. package/esm2015/infra/firebase/firestore/types/firestore.repository.type.js +2 -2
  410. package/esm2015/infra/firebase/firestore/types/index.js +4 -4
  411. package/esm2015/infra/firebase/index.js +3 -3
  412. package/esm2015/infra/index.js +3 -3
  413. package/esm2015/infrab4a-connect.js +4 -4
  414. package/esm2015/utils/index.js +6 -6
  415. package/esm2015/utils/mixins/base.mixin.js +6 -6
  416. package/esm2015/utils/mixins/index.js +3 -3
  417. package/esm2015/utils/mixins/mixin-ctor.type.js +2 -2
  418. package/esm2015/utils/types/index.js +2 -2
  419. package/esm2015/utils/types/prop.type.js +2 -2
  420. package/fesm2015/infrab4a-connect.js +1653 -1656
  421. package/fesm2015/infrab4a-connect.js.map +1 -1
  422. package/index.d.ts +5 -5
  423. package/infra/elasticsearch/adapters/axios.adapter.d.ts +11 -11
  424. package/infra/elasticsearch/adapters/elastic-search.adapter.d.ts +4 -4
  425. package/infra/elasticsearch/adapters/index.d.ts +2 -2
  426. package/infra/elasticsearch/index.d.ts +3 -3
  427. package/infra/elasticsearch/indexes/index.d.ts +1 -1
  428. package/infra/elasticsearch/indexes/products-index.d.ts +11 -11
  429. package/infra/elasticsearch/types/elastic-search-result.d.ts +7 -7
  430. package/infra/elasticsearch/types/index.d.ts +1 -1
  431. package/infra/firebase/auth/authentication-firebase-auth.service.d.ts +12 -12
  432. package/infra/firebase/auth/index.d.ts +2 -2
  433. package/infra/firebase/auth/register-firebase-auth.service.d.ts +8 -8
  434. package/infra/firebase/auth/types/firebase-user-with-id.type.d.ts +3 -3
  435. package/infra/firebase/firestore/index.d.ts +3 -3
  436. package/infra/firebase/firestore/mixins/index.d.ts +9 -9
  437. package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +17 -17
  438. package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +29 -29
  439. package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +15 -15
  440. package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +20 -20
  441. package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +15 -15
  442. package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +15 -15
  443. package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +10 -10
  444. package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +14 -14
  445. package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +16 -16
  446. package/infra/firebase/firestore/models/user-search.d.ts +9 -9
  447. package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +58 -58
  448. package/infra/firebase/firestore/repositories/catalog/index.d.ts +4 -4
  449. package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +50 -50
  450. package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +60 -60
  451. package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +49 -49
  452. package/infra/firebase/firestore/repositories/index.d.ts +4 -4
  453. package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +57 -57
  454. package/infra/firebase/firestore/repositories/shop-settings/index.d.ts +2 -2
  455. package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +49 -49
  456. package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +49 -49
  457. package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +49 -49
  458. package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +49 -49
  459. package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +53 -53
  460. package/infra/firebase/firestore/repositories/shopping/index.d.ts +8 -8
  461. package/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +7 -7
  462. package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +49 -49
  463. package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +49 -49
  464. package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +49 -49
  465. package/infra/firebase/firestore/repositories/users/index.d.ts +9 -9
  466. package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +49 -49
  467. package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +60 -60
  468. package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +49 -49
  469. package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +60 -60
  470. package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +60 -60
  471. package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +60 -60
  472. package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +60 -60
  473. package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +60 -60
  474. package/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +50 -50
  475. package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +6 -6
  476. package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +8 -8
  477. package/infra/firebase/firestore/types/firestore.repository.type.d.ts +8 -8
  478. package/infra/firebase/firestore/types/index.d.ts +3 -3
  479. package/infra/firebase/index.d.ts +2 -2
  480. package/infra/index.d.ts +2 -2
  481. package/infrab4a-connect.d.ts +5 -5
  482. package/package.json +1 -1
  483. package/utils/index.d.ts +6 -6
  484. package/utils/mixins/base.mixin.d.ts +3 -3
  485. package/utils/mixins/index.d.ts +2 -2
  486. package/utils/mixins/mixin-ctor.type.d.ts +1 -1
  487. package/utils/types/index.d.ts +1 -1
  488. package/utils/types/prop.type.d.ts +1 -1
  489. package/domain/shopping/models/coupons/enums/coupon-club-mens.enum.d.ts +0 -5
  490. package/esm2015/domain/shopping/models/coupons/enums/coupon-club-mens.enum.js +0 -7
@@ -10,2617 +10,2614 @@
10
10
  var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
11
11
  var firebase__default$1 = /*#__PURE__*/_interopDefaultLegacy(firebase$1);
12
12
 
13
- var BaseModel = /** @class */ (function () {
14
- function BaseModel(args) {
15
- Object.assign(this, args);
16
- }
17
- BaseModel.toInstance = function (data) {
18
- return classTransformer.plainToClass(this, data);
19
- };
20
- BaseModel.prototype.toPlain = function () {
21
- return classTransformer.classToPlain(this, { exposeUnsetFields: false });
22
- };
23
- return BaseModel;
13
+ var BaseModel = /** @class */ (function () {
14
+ function BaseModel(args) {
15
+ Object.assign(this, args);
16
+ }
17
+ BaseModel.toInstance = function (data) {
18
+ return classTransformer.plainToClass(this, data);
19
+ };
20
+ BaseModel.prototype.toPlain = function () {
21
+ return classTransformer.classToPlain(this, { exposeUnsetFields: false });
22
+ };
23
+ return BaseModel;
24
24
  }());
25
25
 
26
- exports.Where = void 0;
27
- (function (Where) {
28
- Where["EQUALS"] = "==";
29
- Where["NOTEQUALS"] = "!=";
30
- Where["GT"] = ">";
31
- Where["GTE"] = ">=";
32
- Where["IN"] = "in";
33
- Where["LT"] = "<";
34
- Where["LTE"] = "<=";
35
- Where["LIKE"] = "like";
26
+ exports.Where = void 0;
27
+ (function (Where) {
28
+ Where["EQUALS"] = "==";
29
+ Where["NOTEQUALS"] = "!=";
30
+ Where["GT"] = ">";
31
+ Where["GTE"] = ">=";
32
+ Where["IN"] = "in";
33
+ Where["LT"] = "<";
34
+ Where["LTE"] = "<=";
35
+ Where["LIKE"] = "like";
36
36
  })(exports.Where || (exports.Where = {}));
37
37
 
38
- exports.UpdateOptionActions = void 0;
39
- (function (UpdateOptionActions) {
40
- UpdateOptionActions["UPDATE"] = "update";
41
- UpdateOptionActions["MERGE"] = "merge";
42
- UpdateOptionActions["REMOVE"] = "remove";
43
- UpdateOptionActions["REMOVE_FIELD"] = "removeField";
44
- UpdateOptionActions["NULL"] = "null";
38
+ exports.UpdateOptionActions = void 0;
39
+ (function (UpdateOptionActions) {
40
+ UpdateOptionActions["UPDATE"] = "update";
41
+ UpdateOptionActions["MERGE"] = "merge";
42
+ UpdateOptionActions["REMOVE"] = "remove";
43
+ UpdateOptionActions["REMOVE_FIELD"] = "removeField";
44
+ UpdateOptionActions["NULL"] = "null";
45
45
  })(exports.UpdateOptionActions || (exports.UpdateOptionActions = {}));
46
46
 
47
- exports.AccessoryImportances = void 0;
48
- (function (AccessoryImportances) {
49
- AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
50
- AccessoryImportances["LIKE_RARELY_USE"] = "Gosto, mas uso poucos";
51
- AccessoryImportances["LIKE_ALWAYS_FOLLOW_FASHION"] = "Gosto muito de acess\u00F3rios e sempre procuro acompanhar a moda";
47
+ exports.AccessoryImportances = void 0;
48
+ (function (AccessoryImportances) {
49
+ AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
50
+ AccessoryImportances["LIKE_RARELY_USE"] = "Gosto, mas uso poucos";
51
+ AccessoryImportances["LIKE_ALWAYS_FOLLOW_FASHION"] = "Gosto muito de acess\u00F3rios e sempre procuro acompanhar a moda";
52
52
  })(exports.AccessoryImportances || (exports.AccessoryImportances = {}));
53
53
 
54
- exports.Area = void 0;
55
- (function (Area) {
56
- Area["GP"] = "Geral";
57
- Area["CRM"] = "CRM";
58
- Area["MediaProd"] = "Media Production";
59
- Area["Tech"] = "Tecnologia";
60
- Area["Transactional"] = "Transacional";
61
- Area["Operations"] = "Opera\u00E7\u00F5es";
62
- Area["Sales"] = "Comercial";
63
- Area["Finantial"] = "Financeiro";
64
- Area["HR"] = "RH";
54
+ exports.Area = void 0;
55
+ (function (Area) {
56
+ Area["GP"] = "Geral";
57
+ Area["CRM"] = "CRM";
58
+ Area["MediaProd"] = "Media Production";
59
+ Area["Tech"] = "Tecnologia";
60
+ Area["Transactional"] = "Transacional";
61
+ Area["Operations"] = "Opera\u00E7\u00F5es";
62
+ Area["Sales"] = "Comercial";
63
+ Area["Finantial"] = "Financeiro";
64
+ Area["HR"] = "RH";
65
65
  })(exports.Area || (exports.Area = {}));
66
66
 
67
- exports.BeardProblems = void 0;
68
- (function (BeardProblems) {
69
- BeardProblems["NO_PROBLEMS"] = "Sem problemas";
70
- BeardProblems["DRY"] = "Barba Seca";
71
- BeardProblems["OILY"] = "Barba Oleaosa";
72
- BeardProblems["DANCRUFF"] = "Barba com Caspa";
73
- BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
74
- BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
75
- BeardProblems["SPARSE_BEARD"] = "Barba Rala";
67
+ exports.BeardProblems = void 0;
68
+ (function (BeardProblems) {
69
+ BeardProblems["NO_PROBLEMS"] = "Sem problemas";
70
+ BeardProblems["DRY"] = "Barba Seca";
71
+ BeardProblems["OILY"] = "Barba Oleaosa";
72
+ BeardProblems["DANCRUFF"] = "Barba com Caspa";
73
+ BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
74
+ BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
75
+ BeardProblems["SPARSE_BEARD"] = "Barba Rala";
76
76
  })(exports.BeardProblems || (exports.BeardProblems = {}));
77
77
 
78
- exports.BeardSizes = void 0;
79
- (function (BeardSizes) {
80
- BeardSizes["BIG"] = "Grande";
81
- BeardSizes["MEDIUM"] = "M\u00E9dia";
82
- BeardSizes["SHORT"] = "Curta";
83
- BeardSizes["MUSTACHE"] = "Bigode";
84
- BeardSizes["NOTHING"] = "Sem Barba";
78
+ exports.BeardSizes = void 0;
79
+ (function (BeardSizes) {
80
+ BeardSizes["BIG"] = "Grande";
81
+ BeardSizes["MEDIUM"] = "M\u00E9dia";
82
+ BeardSizes["SHORT"] = "Curta";
83
+ BeardSizes["MUSTACHE"] = "Bigode";
84
+ BeardSizes["NOTHING"] = "Sem Barba";
85
85
  })(exports.BeardSizes || (exports.BeardSizes = {}));
86
86
 
87
- exports.BeautyProductImportances = void 0;
88
- (function (BeautyProductImportances) {
89
- BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
90
- BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
91
- BeautyProductImportances["GOOD_CARE_MYSELF"] = "Me considero um homem que se cuida bem. Conhe\u00E7o sobre produtos especializados e me preocupo em ter uma rotina de cuidados";
92
- BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
87
+ exports.BeautyProductImportances = void 0;
88
+ (function (BeautyProductImportances) {
89
+ BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
90
+ BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
91
+ BeautyProductImportances["GOOD_CARE_MYSELF"] = "Me considero um homem que se cuida bem. Conhe\u00E7o sobre produtos especializados e me preocupo em ter uma rotina de cuidados";
92
+ BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
93
93
  })(exports.BeautyProductImportances || (exports.BeautyProductImportances = {}));
94
94
 
95
- exports.BodyProblems = void 0;
96
- (function (BodyProblems) {
97
- BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
98
- BodyProblems["FLACCIDITY"] = "Flacidez";
99
- BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
100
- BodyProblems["STRETCH_MARKS"] = "Estrias";
101
- BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
102
- BodyProblems["DRY_SKIN"] = "Pele Seca";
103
- BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
104
- BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
105
- BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
95
+ exports.BodyProblems = void 0;
96
+ (function (BodyProblems) {
97
+ BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
98
+ BodyProblems["FLACCIDITY"] = "Flacidez";
99
+ BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
100
+ BodyProblems["STRETCH_MARKS"] = "Estrias";
101
+ BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
102
+ BodyProblems["DRY_SKIN"] = "Pele Seca";
103
+ BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
104
+ BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
105
+ BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
106
106
  })(exports.BodyProblems || (exports.BodyProblems = {}));
107
107
 
108
- exports.BodyShapes = void 0;
109
- (function (BodyShapes) {
110
- BodyShapes["LEAN"] = "Magro";
111
- BodyShapes["REGULAR"] = "Regular";
112
- BodyShapes["OVERWEIGHT"] = "Acima do Peso";
113
- BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
114
- BodyShapes["MUSCULAR"] = "Musculoso";
108
+ exports.BodyShapes = void 0;
109
+ (function (BodyShapes) {
110
+ BodyShapes["LEAN"] = "Magro";
111
+ BodyShapes["REGULAR"] = "Regular";
112
+ BodyShapes["OVERWEIGHT"] = "Acima do Peso";
113
+ BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
114
+ BodyShapes["MUSCULAR"] = "Musculoso";
115
115
  })(exports.BodyShapes || (exports.BodyShapes = {}));
116
116
 
117
- exports.BodyTattoos = void 0;
118
- (function (BodyTattoos) {
119
- BodyTattoos["NONE"] = "Nenhuma";
120
- BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
121
- BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
117
+ exports.BodyTattoos = void 0;
118
+ (function (BodyTattoos) {
119
+ BodyTattoos["NONE"] = "Nenhuma";
120
+ BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
121
+ BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
122
122
  })(exports.BodyTattoos || (exports.BodyTattoos = {}));
123
123
 
124
- exports.FaceSkinOilinesses = void 0;
125
- (function (FaceSkinOilinesses) {
126
- FaceSkinOilinesses["DRY"] = "Seca";
127
- FaceSkinOilinesses["OILY"] = "Oleaosa";
128
- FaceSkinOilinesses["MIXED"] = "Mista";
129
- FaceSkinOilinesses["NORMAL"] = "Normal";
130
- FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
124
+ exports.FaceSkinOilinesses = void 0;
125
+ (function (FaceSkinOilinesses) {
126
+ FaceSkinOilinesses["DRY"] = "Seca";
127
+ FaceSkinOilinesses["OILY"] = "Oleaosa";
128
+ FaceSkinOilinesses["MIXED"] = "Mista";
129
+ FaceSkinOilinesses["NORMAL"] = "Normal";
130
+ FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
131
131
  })(exports.FaceSkinOilinesses || (exports.FaceSkinOilinesses = {}));
132
132
 
133
- exports.FaceSkinProblems = void 0;
134
- (function (FaceSkinProblems) {
135
- FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
136
- FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
137
- FaceSkinProblems["WRINKLES"] = "Rugas";
138
- FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
139
- FaceSkinProblems["STAINS"] = "Manchas";
140
- FaceSkinProblems["FRECKLES"] = "Sardas";
141
- FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
142
- FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
133
+ exports.FaceSkinProblems = void 0;
134
+ (function (FaceSkinProblems) {
135
+ FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
136
+ FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
137
+ FaceSkinProblems["WRINKLES"] = "Rugas";
138
+ FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
139
+ FaceSkinProblems["STAINS"] = "Manchas";
140
+ FaceSkinProblems["FRECKLES"] = "Sardas";
141
+ FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
142
+ FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
143
143
  })(exports.FaceSkinProblems || (exports.FaceSkinProblems = {}));
144
144
 
145
- exports.FaceSkinTones = void 0;
146
- (function (FaceSkinTones) {
147
- FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
148
- FaceSkinTones["CLEAR"] = "Clara";
149
- FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
150
- FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
151
- FaceSkinTones["DARK"] = "Escura";
152
- FaceSkinTones["VERY_DARK"] = "Muito Escura";
145
+ exports.FaceSkinTones = void 0;
146
+ (function (FaceSkinTones) {
147
+ FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
148
+ FaceSkinTones["CLEAR"] = "Clara";
149
+ FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
150
+ FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
151
+ FaceSkinTones["DARK"] = "Escura";
152
+ FaceSkinTones["VERY_DARK"] = "Muito Escura";
153
153
  })(exports.FaceSkinTones || (exports.FaceSkinTones = {}));
154
154
 
155
- exports.FamilyIncomes = void 0;
156
- (function (FamilyIncomes) {
157
- FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
158
- FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
159
- FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
160
- FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
161
- FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
162
- FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
155
+ exports.FamilyIncomes = void 0;
156
+ (function (FamilyIncomes) {
157
+ FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
158
+ FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
159
+ FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
160
+ FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
161
+ FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
162
+ FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
163
163
  })(exports.FamilyIncomes || (exports.FamilyIncomes = {}));
164
164
 
165
- exports.FragranceImportances = void 0;
166
- (function (FragranceImportances) {
167
- FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
168
- FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
169
- FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
165
+ exports.FragranceImportances = void 0;
166
+ (function (FragranceImportances) {
167
+ FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
168
+ FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
169
+ FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
170
170
  })(exports.FragranceImportances || (exports.FragranceImportances = {}));
171
171
 
172
- exports.HairColors = void 0;
173
- (function (HairColors) {
174
- HairColors["BLACK"] = "Preto";
175
- HairColors["DARK_BROWN"] = "Castanho Escuro";
176
- HairColors["LIGHT_BROWN"] = "Castanho Claro";
177
- HairColors["DARK_BLONDE"] = "Loiro Escuro";
178
- HairColors["LIGHT_BLONDE"] = "Loiro Claro";
179
- HairColors["WHITE_GRAY"] = "Branco/Grisalho";
180
- HairColors["REDHEAD"] = "Ruivo";
181
- HairColors["OTHER"] = "RuiOutroo";
172
+ exports.HairColors = void 0;
173
+ (function (HairColors) {
174
+ HairColors["BLACK"] = "Preto";
175
+ HairColors["DARK_BROWN"] = "Castanho Escuro";
176
+ HairColors["LIGHT_BROWN"] = "Castanho Claro";
177
+ HairColors["DARK_BLONDE"] = "Loiro Escuro";
178
+ HairColors["LIGHT_BLONDE"] = "Loiro Claro";
179
+ HairColors["WHITE_GRAY"] = "Branco/Grisalho";
180
+ HairColors["REDHEAD"] = "Ruivo";
181
+ HairColors["OTHER"] = "RuiOutroo";
182
182
  })(exports.HairColors || (exports.HairColors = {}));
183
183
 
184
- exports.HairProblems = void 0;
185
- (function (HairProblems) {
186
- HairProblems["NO_PROBLEMS"] = "Sem problemas";
187
- HairProblems["DANCRUFF"] = "Caspa";
188
- HairProblems["LOSS"] = "Queda";
189
- HairProblems["OILY"] = "Oleosidade";
190
- HairProblems["DRYNESS"] = "Ressecamento";
191
- HairProblems["CHEMICAL"] = "Quimica";
192
- HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
193
- HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
184
+ exports.HairProblems = void 0;
185
+ (function (HairProblems) {
186
+ HairProblems["NO_PROBLEMS"] = "Sem problemas";
187
+ HairProblems["DANCRUFF"] = "Caspa";
188
+ HairProblems["LOSS"] = "Queda";
189
+ HairProblems["OILY"] = "Oleosidade";
190
+ HairProblems["DRYNESS"] = "Ressecamento";
191
+ HairProblems["CHEMICAL"] = "Quimica";
192
+ HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
193
+ HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
194
194
  })(exports.HairProblems || (exports.HairProblems = {}));
195
195
 
196
- exports.HairStrands = void 0;
197
- (function (HairStrands) {
198
- HairStrands["NORMAL"] = "Fio Normal";
199
- HairStrands["DRY"] = "Fio Seco";
200
- HairStrands["OILY"] = "Fio Oleoso";
201
- HairStrands["MIXED"] = "Fio Misto";
202
- HairStrands["FINE"] = "Fio Fino";
203
- HairStrands["THICK"] = "Fio Grosso";
196
+ exports.HairStrands = void 0;
197
+ (function (HairStrands) {
198
+ HairStrands["NORMAL"] = "Fio Normal";
199
+ HairStrands["DRY"] = "Fio Seco";
200
+ HairStrands["OILY"] = "Fio Oleoso";
201
+ HairStrands["MIXED"] = "Fio Misto";
202
+ HairStrands["FINE"] = "Fio Fino";
203
+ HairStrands["THICK"] = "Fio Grosso";
204
204
  })(exports.HairStrands || (exports.HairStrands = {}));
205
205
 
206
- exports.HairTypes = void 0;
207
- (function (HairTypes) {
208
- HairTypes["Smooth"] = "Liso";
209
- HairTypes["WAVY"] = "Ondulado";
210
- HairTypes["CURLY"] = "Cacheado";
211
- HairTypes["FRIZZY"] = "Crespo";
212
- HairTypes["BALD"] = "Sou careca";
206
+ exports.HairTypes = void 0;
207
+ (function (HairTypes) {
208
+ HairTypes["Smooth"] = "Liso";
209
+ HairTypes["WAVY"] = "Ondulado";
210
+ HairTypes["CURLY"] = "Cacheado";
211
+ HairTypes["FRIZZY"] = "Crespo";
212
+ HairTypes["BALD"] = "Sou careca";
213
213
  })(exports.HairTypes || (exports.HairTypes = {}));
214
214
 
215
- exports.OfficePosition = void 0;
216
- (function (OfficePosition) {
217
- OfficePosition["Intern"] = "Estagi\u00E1rio";
218
- OfficePosition["Analyst"] = "Analista";
219
- OfficePosition["Manager"] = "Gerente";
220
- OfficePosition["Director"] = "Diretor";
215
+ exports.OfficePosition = void 0;
216
+ (function (OfficePosition) {
217
+ OfficePosition["Intern"] = "Estagi\u00E1rio";
218
+ OfficePosition["Analyst"] = "Analista";
219
+ OfficePosition["Manager"] = "Gerente";
220
+ OfficePosition["Director"] = "Diretor";
221
221
  })(exports.OfficePosition || (exports.OfficePosition = {}));
222
222
 
223
- exports.ProductSpents = void 0;
224
- (function (ProductSpents) {
225
- ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
226
- ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
227
- ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
228
- ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
229
- ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
230
- ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
223
+ exports.ProductSpents = void 0;
224
+ (function (ProductSpents) {
225
+ ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
226
+ ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
227
+ ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
228
+ ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
229
+ ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
230
+ ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
231
231
  })(exports.ProductSpents || (exports.ProductSpents = {}));
232
232
 
233
- exports.UserType = void 0;
234
- (function (UserType) {
235
- UserType["B2C"] = "Cliente Transacional";
236
- UserType["GlamGirl"] = "Glamgirl";
237
- UserType["MensBoy"] = "Mensboy";
238
- UserType["B2B"] = "Company";
239
- UserType["Collaborator"] = "Funcion\u00E1rio";
240
- UserType["Influencer"] = "Influencer";
233
+ exports.UserType = void 0;
234
+ (function (UserType) {
235
+ UserType["B2C"] = "Cliente Transacional";
236
+ UserType["GlamGirl"] = "Glamgirl";
237
+ UserType["MensBoy"] = "Mensboy";
238
+ UserType["B2B"] = "Company";
239
+ UserType["Collaborator"] = "Funcion\u00E1rio";
240
+ UserType["Influencer"] = "Influencer";
241
241
  })(exports.UserType || (exports.UserType = {}));
242
242
 
243
- exports.BillingStatus = void 0;
244
- (function (BillingStatus) {
245
- BillingStatus["PAYED"] = "PAGO";
243
+ exports.BillingStatus = void 0;
244
+ (function (BillingStatus) {
245
+ BillingStatus["PAYED"] = "PAGO";
246
246
  })(exports.BillingStatus || (exports.BillingStatus = {}));
247
247
 
248
- exports.EditionStatus = void 0;
249
- (function (EditionStatus) {
250
- EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
251
- EditionStatus["SHIPPED"] = "Enviado";
248
+ exports.EditionStatus = void 0;
249
+ (function (EditionStatus) {
250
+ EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
251
+ EditionStatus["SHIPPED"] = "Enviado";
252
252
  })(exports.EditionStatus || (exports.EditionStatus = {}));
253
253
 
254
- exports.PaymentType = void 0;
255
- (function (PaymentType) {
256
- PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
257
- PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
258
- PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
254
+ exports.PaymentType = void 0;
255
+ (function (PaymentType) {
256
+ PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
257
+ PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
258
+ PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
259
259
  })(exports.PaymentType || (exports.PaymentType = {}));
260
260
 
261
- exports.Status = void 0;
262
- (function (Status) {
263
- Status["ACTIVE"] = "active";
264
- Status["CANCELLED"] = "Cancelado";
261
+ exports.Status = void 0;
262
+ (function (Status) {
263
+ Status["ACTIVE"] = "active";
264
+ Status["CANCELLED"] = "Cancelado";
265
265
  })(exports.Status || (exports.Status = {}));
266
266
 
267
- /*! *****************************************************************************
268
- Copyright (c) Microsoft Corporation.
269
-
270
- Permission to use, copy, modify, and/or distribute this software for any
271
- purpose with or without fee is hereby granted.
272
-
273
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
274
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
275
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
276
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
277
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
278
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
279
- PERFORMANCE OF THIS SOFTWARE.
280
- ***************************************************************************** */
281
- /* global Reflect, Promise */
282
- var extendStatics = function (d, b) {
283
- extendStatics = Object.setPrototypeOf ||
284
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
285
- function (d, b) { for (var p in b)
286
- if (Object.prototype.hasOwnProperty.call(b, p))
287
- d[p] = b[p]; };
288
- return extendStatics(d, b);
289
- };
290
- function __extends(d, b) {
291
- if (typeof b !== "function" && b !== null)
292
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
293
- extendStatics(d, b);
294
- function __() { this.constructor = d; }
295
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
296
- }
297
- var __assign = function () {
298
- __assign = Object.assign || function __assign(t) {
299
- for (var s, i = 1, n = arguments.length; i < n; i++) {
300
- s = arguments[i];
301
- for (var p in s)
302
- if (Object.prototype.hasOwnProperty.call(s, p))
303
- t[p] = s[p];
304
- }
305
- return t;
306
- };
307
- return __assign.apply(this, arguments);
308
- };
309
- function __rest(s, e) {
310
- var t = {};
311
- for (var p in s)
312
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
313
- t[p] = s[p];
314
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
315
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
316
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
317
- t[p[i]] = s[p[i]];
318
- }
319
- return t;
320
- }
321
- function __decorate(decorators, target, key, desc) {
322
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
323
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
324
- r = Reflect.decorate(decorators, target, key, desc);
325
- else
326
- for (var i = decorators.length - 1; i >= 0; i--)
327
- if (d = decorators[i])
328
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
329
- return c > 3 && r && Object.defineProperty(target, key, r), r;
330
- }
331
- function __param(paramIndex, decorator) {
332
- return function (target, key) { decorator(target, key, paramIndex); };
333
- }
334
- function __metadata(metadataKey, metadataValue) {
335
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
336
- return Reflect.metadata(metadataKey, metadataValue);
337
- }
338
- function __awaiter(thisArg, _arguments, P, generator) {
339
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
340
- return new (P || (P = Promise))(function (resolve, reject) {
341
- function fulfilled(value) { try {
342
- step(generator.next(value));
343
- }
344
- catch (e) {
345
- reject(e);
346
- } }
347
- function rejected(value) { try {
348
- step(generator["throw"](value));
349
- }
350
- catch (e) {
351
- reject(e);
352
- } }
353
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
354
- step((generator = generator.apply(thisArg, _arguments || [])).next());
355
- });
356
- }
357
- function __generator(thisArg, body) {
358
- var _ = { label: 0, sent: function () { if (t[0] & 1)
359
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
360
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
361
- function verb(n) { return function (v) { return step([n, v]); }; }
362
- function step(op) {
363
- if (f)
364
- throw new TypeError("Generator is already executing.");
365
- while (_)
366
- try {
367
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
368
- return t;
369
- if (y = 0, t)
370
- op = [op[0] & 2, t.value];
371
- switch (op[0]) {
372
- case 0:
373
- case 1:
374
- t = op;
375
- break;
376
- case 4:
377
- _.label++;
378
- return { value: op[1], done: false };
379
- case 5:
380
- _.label++;
381
- y = op[1];
382
- op = [0];
383
- continue;
384
- case 7:
385
- op = _.ops.pop();
386
- _.trys.pop();
387
- continue;
388
- default:
389
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
390
- _ = 0;
391
- continue;
392
- }
393
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
394
- _.label = op[1];
395
- break;
396
- }
397
- if (op[0] === 6 && _.label < t[1]) {
398
- _.label = t[1];
399
- t = op;
400
- break;
401
- }
402
- if (t && _.label < t[2]) {
403
- _.label = t[2];
404
- _.ops.push(op);
405
- break;
406
- }
407
- if (t[2])
408
- _.ops.pop();
409
- _.trys.pop();
410
- continue;
411
- }
412
- op = body.call(thisArg, _);
413
- }
414
- catch (e) {
415
- op = [6, e];
416
- y = 0;
417
- }
418
- finally {
419
- f = t = 0;
420
- }
421
- if (op[0] & 5)
422
- throw op[1];
423
- return { value: op[0] ? op[1] : void 0, done: true };
424
- }
425
- }
426
- var __createBinding = Object.create ? (function (o, m, k, k2) {
427
- if (k2 === undefined)
428
- k2 = k;
429
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
430
- }) : (function (o, m, k, k2) {
431
- if (k2 === undefined)
432
- k2 = k;
433
- o[k2] = m[k];
434
- });
435
- function __exportStar(m, o) {
436
- for (var p in m)
437
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
438
- __createBinding(o, m, p);
439
- }
440
- function __values(o) {
441
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
442
- if (m)
443
- return m.call(o);
444
- if (o && typeof o.length === "number")
445
- return {
446
- next: function () {
447
- if (o && i >= o.length)
448
- o = void 0;
449
- return { value: o && o[i++], done: !o };
450
- }
451
- };
452
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
453
- }
454
- function __read(o, n) {
455
- var m = typeof Symbol === "function" && o[Symbol.iterator];
456
- if (!m)
457
- return o;
458
- var i = m.call(o), r, ar = [], e;
459
- try {
460
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
461
- ar.push(r.value);
462
- }
463
- catch (error) {
464
- e = { error: error };
465
- }
466
- finally {
467
- try {
468
- if (r && !r.done && (m = i["return"]))
469
- m.call(i);
470
- }
471
- finally {
472
- if (e)
473
- throw e.error;
474
- }
475
- }
476
- return ar;
477
- }
478
- /** @deprecated */
479
- function __spread() {
480
- for (var ar = [], i = 0; i < arguments.length; i++)
481
- ar = ar.concat(__read(arguments[i]));
482
- return ar;
483
- }
484
- /** @deprecated */
485
- function __spreadArrays() {
486
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
487
- s += arguments[i].length;
488
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
489
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
490
- r[k] = a[j];
491
- return r;
492
- }
493
- function __spreadArray(to, from, pack) {
494
- if (pack || arguments.length === 2)
495
- for (var i = 0, l = from.length, ar; i < l; i++) {
496
- if (ar || !(i in from)) {
497
- if (!ar)
498
- ar = Array.prototype.slice.call(from, 0, i);
499
- ar[i] = from[i];
500
- }
501
- }
502
- return to.concat(ar || Array.prototype.slice.call(from));
503
- }
504
- function __await(v) {
505
- return this instanceof __await ? (this.v = v, this) : new __await(v);
506
- }
507
- function __asyncGenerator(thisArg, _arguments, generator) {
508
- if (!Symbol.asyncIterator)
509
- throw new TypeError("Symbol.asyncIterator is not defined.");
510
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
511
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
512
- function verb(n) { if (g[n])
513
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
514
- function resume(n, v) { try {
515
- step(g[n](v));
516
- }
517
- catch (e) {
518
- settle(q[0][3], e);
519
- } }
520
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
521
- function fulfill(value) { resume("next", value); }
522
- function reject(value) { resume("throw", value); }
523
- function settle(f, v) { if (f(v), q.shift(), q.length)
524
- resume(q[0][0], q[0][1]); }
525
- }
526
- function __asyncDelegator(o) {
527
- var i, p;
528
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
529
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
530
- }
531
- function __asyncValues(o) {
532
- if (!Symbol.asyncIterator)
533
- throw new TypeError("Symbol.asyncIterator is not defined.");
534
- var m = o[Symbol.asyncIterator], i;
535
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
536
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
537
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
538
- }
539
- function __makeTemplateObject(cooked, raw) {
540
- if (Object.defineProperty) {
541
- Object.defineProperty(cooked, "raw", { value: raw });
542
- }
543
- else {
544
- cooked.raw = raw;
545
- }
546
- return cooked;
547
- }
548
- ;
549
- var __setModuleDefault = Object.create ? (function (o, v) {
550
- Object.defineProperty(o, "default", { enumerable: true, value: v });
551
- }) : function (o, v) {
552
- o["default"] = v;
553
- };
554
- function __importStar(mod) {
555
- if (mod && mod.__esModule)
556
- return mod;
557
- var result = {};
558
- if (mod != null)
559
- for (var k in mod)
560
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
561
- __createBinding(result, mod, k);
562
- __setModuleDefault(result, mod);
563
- return result;
564
- }
565
- function __importDefault(mod) {
566
- return (mod && mod.__esModule) ? mod : { default: mod };
567
- }
568
- function __classPrivateFieldGet(receiver, state, kind, f) {
569
- if (kind === "a" && !f)
570
- throw new TypeError("Private accessor was defined without a getter");
571
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
572
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
573
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
574
- }
575
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
576
- if (kind === "m")
577
- throw new TypeError("Private method is not writable");
578
- if (kind === "a" && !f)
579
- throw new TypeError("Private accessor was defined without a setter");
580
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
581
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
582
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
267
+ /*! *****************************************************************************
268
+ Copyright (c) Microsoft Corporation.
269
+
270
+ Permission to use, copy, modify, and/or distribute this software for any
271
+ purpose with or without fee is hereby granted.
272
+
273
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
274
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
275
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
276
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
277
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
278
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
279
+ PERFORMANCE OF THIS SOFTWARE.
280
+ ***************************************************************************** */
281
+ /* global Reflect, Promise */
282
+ var extendStatics = function (d, b) {
283
+ extendStatics = Object.setPrototypeOf ||
284
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
285
+ function (d, b) { for (var p in b)
286
+ if (Object.prototype.hasOwnProperty.call(b, p))
287
+ d[p] = b[p]; };
288
+ return extendStatics(d, b);
289
+ };
290
+ function __extends(d, b) {
291
+ if (typeof b !== "function" && b !== null)
292
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
293
+ extendStatics(d, b);
294
+ function __() { this.constructor = d; }
295
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
296
+ }
297
+ var __assign = function () {
298
+ __assign = Object.assign || function __assign(t) {
299
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
300
+ s = arguments[i];
301
+ for (var p in s)
302
+ if (Object.prototype.hasOwnProperty.call(s, p))
303
+ t[p] = s[p];
304
+ }
305
+ return t;
306
+ };
307
+ return __assign.apply(this, arguments);
308
+ };
309
+ function __rest(s, e) {
310
+ var t = {};
311
+ for (var p in s)
312
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
313
+ t[p] = s[p];
314
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
315
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
316
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
317
+ t[p[i]] = s[p[i]];
318
+ }
319
+ return t;
320
+ }
321
+ function __decorate(decorators, target, key, desc) {
322
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
323
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
324
+ r = Reflect.decorate(decorators, target, key, desc);
325
+ else
326
+ for (var i = decorators.length - 1; i >= 0; i--)
327
+ if (d = decorators[i])
328
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
329
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
330
+ }
331
+ function __param(paramIndex, decorator) {
332
+ return function (target, key) { decorator(target, key, paramIndex); };
333
+ }
334
+ function __metadata(metadataKey, metadataValue) {
335
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
336
+ return Reflect.metadata(metadataKey, metadataValue);
337
+ }
338
+ function __awaiter(thisArg, _arguments, P, generator) {
339
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
340
+ return new (P || (P = Promise))(function (resolve, reject) {
341
+ function fulfilled(value) { try {
342
+ step(generator.next(value));
343
+ }
344
+ catch (e) {
345
+ reject(e);
346
+ } }
347
+ function rejected(value) { try {
348
+ step(generator["throw"](value));
349
+ }
350
+ catch (e) {
351
+ reject(e);
352
+ } }
353
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
354
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
355
+ });
356
+ }
357
+ function __generator(thisArg, body) {
358
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
359
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
360
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
361
+ function verb(n) { return function (v) { return step([n, v]); }; }
362
+ function step(op) {
363
+ if (f)
364
+ throw new TypeError("Generator is already executing.");
365
+ while (_)
366
+ try {
367
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
368
+ return t;
369
+ if (y = 0, t)
370
+ op = [op[0] & 2, t.value];
371
+ switch (op[0]) {
372
+ case 0:
373
+ case 1:
374
+ t = op;
375
+ break;
376
+ case 4:
377
+ _.label++;
378
+ return { value: op[1], done: false };
379
+ case 5:
380
+ _.label++;
381
+ y = op[1];
382
+ op = [0];
383
+ continue;
384
+ case 7:
385
+ op = _.ops.pop();
386
+ _.trys.pop();
387
+ continue;
388
+ default:
389
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
390
+ _ = 0;
391
+ continue;
392
+ }
393
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
394
+ _.label = op[1];
395
+ break;
396
+ }
397
+ if (op[0] === 6 && _.label < t[1]) {
398
+ _.label = t[1];
399
+ t = op;
400
+ break;
401
+ }
402
+ if (t && _.label < t[2]) {
403
+ _.label = t[2];
404
+ _.ops.push(op);
405
+ break;
406
+ }
407
+ if (t[2])
408
+ _.ops.pop();
409
+ _.trys.pop();
410
+ continue;
411
+ }
412
+ op = body.call(thisArg, _);
413
+ }
414
+ catch (e) {
415
+ op = [6, e];
416
+ y = 0;
417
+ }
418
+ finally {
419
+ f = t = 0;
420
+ }
421
+ if (op[0] & 5)
422
+ throw op[1];
423
+ return { value: op[0] ? op[1] : void 0, done: true };
424
+ }
425
+ }
426
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
427
+ if (k2 === undefined)
428
+ k2 = k;
429
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
430
+ }) : (function (o, m, k, k2) {
431
+ if (k2 === undefined)
432
+ k2 = k;
433
+ o[k2] = m[k];
434
+ });
435
+ function __exportStar(m, o) {
436
+ for (var p in m)
437
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
438
+ __createBinding(o, m, p);
439
+ }
440
+ function __values(o) {
441
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
442
+ if (m)
443
+ return m.call(o);
444
+ if (o && typeof o.length === "number")
445
+ return {
446
+ next: function () {
447
+ if (o && i >= o.length)
448
+ o = void 0;
449
+ return { value: o && o[i++], done: !o };
450
+ }
451
+ };
452
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
453
+ }
454
+ function __read(o, n) {
455
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
456
+ if (!m)
457
+ return o;
458
+ var i = m.call(o), r, ar = [], e;
459
+ try {
460
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
461
+ ar.push(r.value);
462
+ }
463
+ catch (error) {
464
+ e = { error: error };
465
+ }
466
+ finally {
467
+ try {
468
+ if (r && !r.done && (m = i["return"]))
469
+ m.call(i);
470
+ }
471
+ finally {
472
+ if (e)
473
+ throw e.error;
474
+ }
475
+ }
476
+ return ar;
477
+ }
478
+ /** @deprecated */
479
+ function __spread() {
480
+ for (var ar = [], i = 0; i < arguments.length; i++)
481
+ ar = ar.concat(__read(arguments[i]));
482
+ return ar;
483
+ }
484
+ /** @deprecated */
485
+ function __spreadArrays() {
486
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
487
+ s += arguments[i].length;
488
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
489
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
490
+ r[k] = a[j];
491
+ return r;
492
+ }
493
+ function __spreadArray(to, from, pack) {
494
+ if (pack || arguments.length === 2)
495
+ for (var i = 0, l = from.length, ar; i < l; i++) {
496
+ if (ar || !(i in from)) {
497
+ if (!ar)
498
+ ar = Array.prototype.slice.call(from, 0, i);
499
+ ar[i] = from[i];
500
+ }
501
+ }
502
+ return to.concat(ar || Array.prototype.slice.call(from));
503
+ }
504
+ function __await(v) {
505
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
506
+ }
507
+ function __asyncGenerator(thisArg, _arguments, generator) {
508
+ if (!Symbol.asyncIterator)
509
+ throw new TypeError("Symbol.asyncIterator is not defined.");
510
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
511
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
512
+ function verb(n) { if (g[n])
513
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
514
+ function resume(n, v) { try {
515
+ step(g[n](v));
516
+ }
517
+ catch (e) {
518
+ settle(q[0][3], e);
519
+ } }
520
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
521
+ function fulfill(value) { resume("next", value); }
522
+ function reject(value) { resume("throw", value); }
523
+ function settle(f, v) { if (f(v), q.shift(), q.length)
524
+ resume(q[0][0], q[0][1]); }
525
+ }
526
+ function __asyncDelegator(o) {
527
+ var i, p;
528
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
529
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
530
+ }
531
+ function __asyncValues(o) {
532
+ if (!Symbol.asyncIterator)
533
+ throw new TypeError("Symbol.asyncIterator is not defined.");
534
+ var m = o[Symbol.asyncIterator], i;
535
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
536
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
537
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
538
+ }
539
+ function __makeTemplateObject(cooked, raw) {
540
+ if (Object.defineProperty) {
541
+ Object.defineProperty(cooked, "raw", { value: raw });
542
+ }
543
+ else {
544
+ cooked.raw = raw;
545
+ }
546
+ return cooked;
547
+ }
548
+ ;
549
+ var __setModuleDefault = Object.create ? (function (o, v) {
550
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
551
+ }) : function (o, v) {
552
+ o["default"] = v;
553
+ };
554
+ function __importStar(mod) {
555
+ if (mod && mod.__esModule)
556
+ return mod;
557
+ var result = {};
558
+ if (mod != null)
559
+ for (var k in mod)
560
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
561
+ __createBinding(result, mod, k);
562
+ __setModuleDefault(result, mod);
563
+ return result;
564
+ }
565
+ function __importDefault(mod) {
566
+ return (mod && mod.__esModule) ? mod : { default: mod };
567
+ }
568
+ function __classPrivateFieldGet(receiver, state, kind, f) {
569
+ if (kind === "a" && !f)
570
+ throw new TypeError("Private accessor was defined without a getter");
571
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
572
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
573
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
574
+ }
575
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
576
+ if (kind === "m")
577
+ throw new TypeError("Private method is not writable");
578
+ if (kind === "a" && !f)
579
+ throw new TypeError("Private accessor was defined without a setter");
580
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
581
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
582
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
583
583
  }
584
584
 
585
- var Edition = /** @class */ (function (_super) {
586
- __extends(Edition, _super);
587
- function Edition() {
588
- return _super !== null && _super.apply(this, arguments) || this;
589
- }
590
- Edition.prototype.identifierFields = function () {
591
- return ['id'];
592
- };
593
- return Edition;
585
+ var Edition = /** @class */ (function (_super) {
586
+ __extends(Edition, _super);
587
+ function Edition() {
588
+ return _super !== null && _super.apply(this, arguments) || this;
589
+ }
590
+ Edition.prototype.identifierFields = function () {
591
+ return ['id'];
592
+ };
593
+ return Edition;
594
594
  }(BaseModel));
595
595
 
596
- var Payment = /** @class */ (function (_super) {
597
- __extends(Payment, _super);
598
- function Payment() {
599
- return _super !== null && _super.apply(this, arguments) || this;
600
- }
601
- Payment.prototype.identifierFields = function () {
602
- return ['id'];
603
- };
604
- return Payment;
605
- }(BaseModel));
606
- __decorate([
607
- classTransformer.Expose({ name: 'refuse_reason' }),
608
- __metadata("design:type", String)
609
- ], Payment.prototype, "refuseReason", void 0);
610
- __decorate([
611
- classTransformer.Expose({ name: 'status_reason' }),
612
- __metadata("design:type", String)
613
- ], Payment.prototype, "statusReason", void 0);
614
- __decorate([
615
- classTransformer.Expose({ name: 'acquirer_response_code' }),
616
- __metadata("design:type", String)
617
- ], Payment.prototype, "acquirerResponseCode", void 0);
618
- __decorate([
619
- classTransformer.Expose({ name: 'acquirer_name' }),
620
- __metadata("design:type", String)
621
- ], Payment.prototype, "acquirerName", void 0);
622
- __decorate([
623
- classTransformer.Expose({ name: 'acquirer_id' }),
624
- __metadata("design:type", String)
625
- ], Payment.prototype, "acquirerId", void 0);
626
- __decorate([
627
- classTransformer.Expose({ name: 'authorization_code' }),
628
- __metadata("design:type", String)
629
- ], Payment.prototype, "authorizationCode", void 0);
630
- __decorate([
631
- classTransformer.Expose({ name: 'soft_descriptor' }),
632
- __metadata("design:type", String)
633
- ], Payment.prototype, "softDescriptor", void 0);
634
- __decorate([
635
- classTransformer.Expose({ name: 'date_created' }),
636
- __metadata("design:type", String)
637
- ], Payment.prototype, "dateCreated", void 0);
638
- __decorate([
639
- classTransformer.Expose({ name: 'date_updated' }),
640
- __metadata("design:type", String)
641
- ], Payment.prototype, "dateUpdated", void 0);
642
- __decorate([
643
- classTransformer.Expose({ name: 'authorized_amount' }),
644
- __metadata("design:type", Number)
645
- ], Payment.prototype, "authorizedAmount", void 0);
646
- __decorate([
647
- classTransformer.Expose({ name: 'paid_amount' }),
648
- __metadata("design:type", Number)
649
- ], Payment.prototype, "paidAmount", void 0);
650
- __decorate([
651
- classTransformer.Expose({ name: 'refunded_amount' }),
652
- __metadata("design:type", Number)
653
- ], Payment.prototype, "refundedAmount", void 0);
654
- __decorate([
655
- classTransformer.Expose({ name: 'card_holder_name' }),
656
- __metadata("design:type", String)
657
- ], Payment.prototype, "cardHolderName", void 0);
658
- __decorate([
659
- classTransformer.Expose({ name: 'card_last_digits' }),
660
- __metadata("design:type", String)
661
- ], Payment.prototype, "cardLastDigits", void 0);
662
- __decorate([
663
- classTransformer.Expose({ name: 'card_first_digits' }),
664
- __metadata("design:type", String)
665
- ], Payment.prototype, "cardFirstDigits", void 0);
666
- __decorate([
667
- classTransformer.Expose({ name: 'card_brand' }),
668
- __metadata("design:type", String)
669
- ], Payment.prototype, "cardBrand", void 0);
670
- __decorate([
671
- classTransformer.Expose({ name: 'card_pin_mode' }),
672
- __metadata("design:type", String)
673
- ], Payment.prototype, "cardPinMode", void 0);
674
- __decorate([
675
- classTransformer.Expose({ name: 'card_magstripe_fallback' }),
676
- __metadata("design:type", Boolean)
677
- ], Payment.prototype, "cardMagstripeFallback", void 0);
678
- __decorate([
679
- classTransformer.Expose({ name: 'cvm_pin' }),
680
- __metadata("design:type", Boolean)
681
- ], Payment.prototype, "cvmPin", void 0);
682
- __decorate([
683
- classTransformer.Expose({ name: 'postback_url' }),
684
- __metadata("design:type", String)
685
- ], Payment.prototype, "postbackUrl", void 0);
686
- __decorate([
687
- classTransformer.Expose({ name: 'payment_method' }),
688
- __metadata("design:type", String)
689
- ], Payment.prototype, "paymentMethod", void 0);
690
- __decorate([
691
- classTransformer.Expose({ name: 'capture_method' }),
692
- __metadata("design:type", String)
693
- ], Payment.prototype, "captureMethod", void 0);
694
- __decorate([
695
- classTransformer.Expose({ name: 'antifraud_score' }),
696
- __metadata("design:type", String)
697
- ], Payment.prototype, "antifraudScore", void 0);
698
- __decorate([
699
- classTransformer.Expose({ name: 'boleto_url' }),
700
- __metadata("design:type", String)
701
- ], Payment.prototype, "boletoUrl", void 0);
702
- __decorate([
703
- classTransformer.Expose({ name: 'boleto_barcode' }),
704
- __metadata("design:type", String)
705
- ], Payment.prototype, "boletoBarcode", void 0);
706
- __decorate([
707
- classTransformer.Expose({ name: 'boleto_expiration_date' }),
708
- __metadata("design:type", String)
709
- ], Payment.prototype, "boletoExpirationDate", void 0);
710
- __decorate([
711
- classTransformer.Expose({ name: 'subscription_id' }),
712
- __metadata("design:type", String)
713
- ], Payment.prototype, "subscriptionId", void 0);
714
- __decorate([
715
- classTransformer.Expose({ name: 'split_rules' }),
716
- __metadata("design:type", String)
717
- ], Payment.prototype, "splitRules", void 0);
718
- __decorate([
719
- classTransformer.Expose({ name: 'antifraud_metadata' }),
720
- __metadata("design:type", Object)
721
- ], Payment.prototype, "antifraudMetadata", void 0);
722
- __decorate([
723
- classTransformer.Expose({ name: 'reference_key' }),
724
- __metadata("design:type", String)
725
- ], Payment.prototype, "referenceKey", void 0);
726
- __decorate([
727
- classTransformer.Expose({ name: 'local_transaction_id' }),
728
- __metadata("design:type", String)
729
- ], Payment.prototype, "localTransactionId", void 0);
730
- __decorate([
731
- classTransformer.Expose({ name: 'local_time' }),
732
- __metadata("design:type", String)
733
- ], Payment.prototype, "localTime", void 0);
734
- __decorate([
735
- classTransformer.Expose({ name: 'fraud_covered' }),
736
- __metadata("design:type", Boolean)
737
- ], Payment.prototype, "fraudCovered", void 0);
738
- __decorate([
739
- classTransformer.Expose({ name: 'fraud_reimbursed' }),
740
- __metadata("design:type", String)
741
- ], Payment.prototype, "fraudReimbursed", void 0);
742
- __decorate([
743
- classTransformer.Expose({ name: 'order_id' }),
744
- __metadata("design:type", String)
745
- ], Payment.prototype, "orderId", void 0);
746
- __decorate([
747
- classTransformer.Expose({ name: 'risk_level' }),
748
- __metadata("design:type", String)
749
- ], Payment.prototype, "riskLevel", void 0);
750
- __decorate([
751
- classTransformer.Expose({ name: 'receipt_url' }),
752
- __metadata("design:type", String)
753
- ], Payment.prototype, "receiptUrl", void 0);
754
- __decorate([
755
- classTransformer.Expose({ name: 'private_label' }),
756
- __metadata("design:type", String)
757
- ], Payment.prototype, "privateLabel", void 0);
758
- __decorate([
759
- classTransformer.Expose({ name: 'pix_qr_code' }),
760
- __metadata("design:type", String)
761
- ], Payment.prototype, "pixQrCode", void 0);
762
- __decorate([
763
- classTransformer.Expose({ name: 'pix_expiration_date' }),
764
- __metadata("design:type", String)
596
+ var Payment = /** @class */ (function (_super) {
597
+ __extends(Payment, _super);
598
+ function Payment() {
599
+ return _super !== null && _super.apply(this, arguments) || this;
600
+ }
601
+ Payment.prototype.identifierFields = function () {
602
+ return ['id'];
603
+ };
604
+ return Payment;
605
+ }(BaseModel));
606
+ __decorate([
607
+ classTransformer.Expose({ name: 'refuse_reason' }),
608
+ __metadata("design:type", String)
609
+ ], Payment.prototype, "refuseReason", void 0);
610
+ __decorate([
611
+ classTransformer.Expose({ name: 'status_reason' }),
612
+ __metadata("design:type", String)
613
+ ], Payment.prototype, "statusReason", void 0);
614
+ __decorate([
615
+ classTransformer.Expose({ name: 'acquirer_response_code' }),
616
+ __metadata("design:type", String)
617
+ ], Payment.prototype, "acquirerResponseCode", void 0);
618
+ __decorate([
619
+ classTransformer.Expose({ name: 'acquirer_name' }),
620
+ __metadata("design:type", String)
621
+ ], Payment.prototype, "acquirerName", void 0);
622
+ __decorate([
623
+ classTransformer.Expose({ name: 'acquirer_id' }),
624
+ __metadata("design:type", String)
625
+ ], Payment.prototype, "acquirerId", void 0);
626
+ __decorate([
627
+ classTransformer.Expose({ name: 'authorization_code' }),
628
+ __metadata("design:type", String)
629
+ ], Payment.prototype, "authorizationCode", void 0);
630
+ __decorate([
631
+ classTransformer.Expose({ name: 'soft_descriptor' }),
632
+ __metadata("design:type", String)
633
+ ], Payment.prototype, "softDescriptor", void 0);
634
+ __decorate([
635
+ classTransformer.Expose({ name: 'date_created' }),
636
+ __metadata("design:type", String)
637
+ ], Payment.prototype, "dateCreated", void 0);
638
+ __decorate([
639
+ classTransformer.Expose({ name: 'date_updated' }),
640
+ __metadata("design:type", String)
641
+ ], Payment.prototype, "dateUpdated", void 0);
642
+ __decorate([
643
+ classTransformer.Expose({ name: 'authorized_amount' }),
644
+ __metadata("design:type", Number)
645
+ ], Payment.prototype, "authorizedAmount", void 0);
646
+ __decorate([
647
+ classTransformer.Expose({ name: 'paid_amount' }),
648
+ __metadata("design:type", Number)
649
+ ], Payment.prototype, "paidAmount", void 0);
650
+ __decorate([
651
+ classTransformer.Expose({ name: 'refunded_amount' }),
652
+ __metadata("design:type", Number)
653
+ ], Payment.prototype, "refundedAmount", void 0);
654
+ __decorate([
655
+ classTransformer.Expose({ name: 'card_holder_name' }),
656
+ __metadata("design:type", String)
657
+ ], Payment.prototype, "cardHolderName", void 0);
658
+ __decorate([
659
+ classTransformer.Expose({ name: 'card_last_digits' }),
660
+ __metadata("design:type", String)
661
+ ], Payment.prototype, "cardLastDigits", void 0);
662
+ __decorate([
663
+ classTransformer.Expose({ name: 'card_first_digits' }),
664
+ __metadata("design:type", String)
665
+ ], Payment.prototype, "cardFirstDigits", void 0);
666
+ __decorate([
667
+ classTransformer.Expose({ name: 'card_brand' }),
668
+ __metadata("design:type", String)
669
+ ], Payment.prototype, "cardBrand", void 0);
670
+ __decorate([
671
+ classTransformer.Expose({ name: 'card_pin_mode' }),
672
+ __metadata("design:type", String)
673
+ ], Payment.prototype, "cardPinMode", void 0);
674
+ __decorate([
675
+ classTransformer.Expose({ name: 'card_magstripe_fallback' }),
676
+ __metadata("design:type", Boolean)
677
+ ], Payment.prototype, "cardMagstripeFallback", void 0);
678
+ __decorate([
679
+ classTransformer.Expose({ name: 'cvm_pin' }),
680
+ __metadata("design:type", Boolean)
681
+ ], Payment.prototype, "cvmPin", void 0);
682
+ __decorate([
683
+ classTransformer.Expose({ name: 'postback_url' }),
684
+ __metadata("design:type", String)
685
+ ], Payment.prototype, "postbackUrl", void 0);
686
+ __decorate([
687
+ classTransformer.Expose({ name: 'payment_method' }),
688
+ __metadata("design:type", String)
689
+ ], Payment.prototype, "paymentMethod", void 0);
690
+ __decorate([
691
+ classTransformer.Expose({ name: 'capture_method' }),
692
+ __metadata("design:type", String)
693
+ ], Payment.prototype, "captureMethod", void 0);
694
+ __decorate([
695
+ classTransformer.Expose({ name: 'antifraud_score' }),
696
+ __metadata("design:type", String)
697
+ ], Payment.prototype, "antifraudScore", void 0);
698
+ __decorate([
699
+ classTransformer.Expose({ name: 'boleto_url' }),
700
+ __metadata("design:type", String)
701
+ ], Payment.prototype, "boletoUrl", void 0);
702
+ __decorate([
703
+ classTransformer.Expose({ name: 'boleto_barcode' }),
704
+ __metadata("design:type", String)
705
+ ], Payment.prototype, "boletoBarcode", void 0);
706
+ __decorate([
707
+ classTransformer.Expose({ name: 'boleto_expiration_date' }),
708
+ __metadata("design:type", String)
709
+ ], Payment.prototype, "boletoExpirationDate", void 0);
710
+ __decorate([
711
+ classTransformer.Expose({ name: 'subscription_id' }),
712
+ __metadata("design:type", String)
713
+ ], Payment.prototype, "subscriptionId", void 0);
714
+ __decorate([
715
+ classTransformer.Expose({ name: 'split_rules' }),
716
+ __metadata("design:type", String)
717
+ ], Payment.prototype, "splitRules", void 0);
718
+ __decorate([
719
+ classTransformer.Expose({ name: 'antifraud_metadata' }),
720
+ __metadata("design:type", Object)
721
+ ], Payment.prototype, "antifraudMetadata", void 0);
722
+ __decorate([
723
+ classTransformer.Expose({ name: 'reference_key' }),
724
+ __metadata("design:type", String)
725
+ ], Payment.prototype, "referenceKey", void 0);
726
+ __decorate([
727
+ classTransformer.Expose({ name: 'local_transaction_id' }),
728
+ __metadata("design:type", String)
729
+ ], Payment.prototype, "localTransactionId", void 0);
730
+ __decorate([
731
+ classTransformer.Expose({ name: 'local_time' }),
732
+ __metadata("design:type", String)
733
+ ], Payment.prototype, "localTime", void 0);
734
+ __decorate([
735
+ classTransformer.Expose({ name: 'fraud_covered' }),
736
+ __metadata("design:type", Boolean)
737
+ ], Payment.prototype, "fraudCovered", void 0);
738
+ __decorate([
739
+ classTransformer.Expose({ name: 'fraud_reimbursed' }),
740
+ __metadata("design:type", String)
741
+ ], Payment.prototype, "fraudReimbursed", void 0);
742
+ __decorate([
743
+ classTransformer.Expose({ name: 'order_id' }),
744
+ __metadata("design:type", String)
745
+ ], Payment.prototype, "orderId", void 0);
746
+ __decorate([
747
+ classTransformer.Expose({ name: 'risk_level' }),
748
+ __metadata("design:type", String)
749
+ ], Payment.prototype, "riskLevel", void 0);
750
+ __decorate([
751
+ classTransformer.Expose({ name: 'receipt_url' }),
752
+ __metadata("design:type", String)
753
+ ], Payment.prototype, "receiptUrl", void 0);
754
+ __decorate([
755
+ classTransformer.Expose({ name: 'private_label' }),
756
+ __metadata("design:type", String)
757
+ ], Payment.prototype, "privateLabel", void 0);
758
+ __decorate([
759
+ classTransformer.Expose({ name: 'pix_qr_code' }),
760
+ __metadata("design:type", String)
761
+ ], Payment.prototype, "pixQrCode", void 0);
762
+ __decorate([
763
+ classTransformer.Expose({ name: 'pix_expiration_date' }),
764
+ __metadata("design:type", String)
765
765
  ], Payment.prototype, "pixExpirationDate", void 0);
766
766
 
767
- var SubscriptionPayment = /** @class */ (function (_super) {
768
- __extends(SubscriptionPayment, _super);
769
- function SubscriptionPayment() {
770
- return _super !== null && _super.apply(this, arguments) || this;
771
- }
772
- SubscriptionPayment.prototype.identifierFields = function () {
773
- return ['id'];
774
- };
775
- return SubscriptionPayment;
776
- }(BaseModel));
777
- __decorate([
778
- classTransformer.Type(function () { return Payment; }),
779
- __metadata("design:type", Payment)
767
+ var SubscriptionPayment = /** @class */ (function (_super) {
768
+ __extends(SubscriptionPayment, _super);
769
+ function SubscriptionPayment() {
770
+ return _super !== null && _super.apply(this, arguments) || this;
771
+ }
772
+ SubscriptionPayment.prototype.identifierFields = function () {
773
+ return ['id'];
774
+ };
775
+ return SubscriptionPayment;
776
+ }(BaseModel));
777
+ __decorate([
778
+ classTransformer.Type(function () { return Payment; }),
779
+ __metadata("design:type", Payment)
780
780
  ], SubscriptionPayment.prototype, "payment", void 0);
781
781
 
782
- var Address = /** @class */ (function (_super) {
783
- __extends(Address, _super);
784
- function Address() {
785
- return _super !== null && _super.apply(this, arguments) || this;
786
- }
787
- return Address;
782
+ var Address = /** @class */ (function (_super) {
783
+ __extends(Address, _super);
784
+ function Address() {
785
+ return _super !== null && _super.apply(this, arguments) || this;
786
+ }
787
+ return Address;
788
788
  }(BaseModel));
789
789
 
790
- exports.CheckoutTypes = void 0;
791
- (function (CheckoutTypes) {
792
- CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
793
- CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
794
- CheckoutTypes[CheckoutTypes["ALL"] = 3] = "ALL";
790
+ exports.CheckoutTypes = void 0;
791
+ (function (CheckoutTypes) {
792
+ CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
793
+ CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
794
+ CheckoutTypes[CheckoutTypes["ALL"] = 3] = "ALL";
795
795
  })(exports.CheckoutTypes || (exports.CheckoutTypes = {}));
796
796
 
797
- var Base = /** @class */ (function () {
798
- function Base() {
799
- var args = [];
800
- for (var _i = 0; _i < arguments.length; _i++) {
801
- args[_i] = arguments[_i];
802
- }
803
- Object.assign.apply(Object, __spreadArray([this], __read(args)));
804
- }
805
- return Base;
797
+ var Base = /** @class */ (function () {
798
+ function Base() {
799
+ var args = [];
800
+ for (var _i = 0; _i < arguments.length; _i++) {
801
+ args[_i] = arguments[_i];
802
+ }
803
+ Object.assign.apply(Object, __spreadArray([this], __read(args)));
804
+ }
805
+ return Base;
806
806
  }());
807
807
 
808
- exports.CouponTypes = void 0;
809
- (function (CouponTypes) {
810
- CouponTypes[CouponTypes["ABSOLUTE"] = 1] = "ABSOLUTE";
811
- CouponTypes[CouponTypes["PERCENTAGE"] = 2] = "PERCENTAGE";
812
- // FINANCIAL = 1,
813
- // PRODUCT,
814
- // GIFTCARD,
815
- // VOUCHER,
808
+ exports.CouponTypes = void 0;
809
+ (function (CouponTypes) {
810
+ CouponTypes[CouponTypes["ABSOLUTE"] = 1] = "ABSOLUTE";
811
+ CouponTypes[CouponTypes["PERCENTAGE"] = 2] = "PERCENTAGE";
812
+ // FINANCIAL = 1,
813
+ // PRODUCT,
814
+ // GIFTCARD,
815
+ // VOUCHER,
816
816
  })(exports.CouponTypes || (exports.CouponTypes = {}));
817
817
 
818
- exports.CouponSubtypes = void 0;
819
- (function (CouponSubtypes) {
820
- CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
821
- CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
818
+ exports.CouponSubtypes = void 0;
819
+ (function (CouponSubtypes) {
820
+ CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
821
+ CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
822
822
  })(exports.CouponSubtypes || (exports.CouponSubtypes = {}));
823
823
 
824
- exports.Exclusivities = void 0;
825
- (function (Exclusivities) {
826
- Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
827
- Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
828
- Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
829
- Exclusivities[Exclusivities["ACTIVE_SUBSCRIBER"] = 4] = "ACTIVE_SUBSCRIBER";
830
- Exclusivities[Exclusivities["INACTIVE_SUBSCRIBER"] = 5] = "INACTIVE_SUBSCRIBER";
831
- Exclusivities[Exclusivities["NON_SUBSCRIBER"] = 6] = "NON_SUBSCRIBER";
824
+ exports.Exclusivities = void 0;
825
+ (function (Exclusivities) {
826
+ Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
827
+ Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
828
+ Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
832
829
  })(exports.Exclusivities || (exports.Exclusivities = {}));
833
830
 
834
- var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
835
- var Coupon = /** @class */ (function (_super) {
836
- __extends(Coupon, _super);
837
- function Coupon() {
838
- return _super !== null && _super.apply(this, arguments) || this;
839
- }
840
- Object.defineProperty(Coupon.prototype, "isInfluencer", {
841
- get: function () {
842
- return !lodash.isNil(this.influencerEmail);
843
- },
844
- enumerable: false,
845
- configurable: true
846
- });
847
- Coupon.prototype.identifierFields = function () {
848
- return ['id'];
849
- };
850
- Coupon.createCoupon = function (userId) {
851
- return this.toInstance({
852
- nickname: "" + Date.now(),
853
- type: exports.CouponTypes.ABSOLUTE,
854
- checkoutType: exports.CheckoutTypes.ECOMMERCE,
855
- discount: 30,
856
- user: userId,
857
- useLimit: 1,
858
- useLimitPerUser: true,
859
- createdAt: new Date(Date.now()),
860
- beginAt: new Date(Date.now()),
861
- expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
862
- });
863
- };
864
- return Coupon;
865
- }(BaseModel));
866
- __decorate([
867
- classTransformer.Expose({ name: 'checkout_type' }),
868
- __metadata("design:type", Number)
869
- ], Coupon.prototype, "checkoutType", void 0);
870
- __decorate([
871
- classTransformer.Expose({ name: 'exclusivity_type' }),
872
- __metadata("design:type", Number)
831
+ var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
832
+ var Coupon = /** @class */ (function (_super) {
833
+ __extends(Coupon, _super);
834
+ function Coupon() {
835
+ return _super !== null && _super.apply(this, arguments) || this;
836
+ }
837
+ Object.defineProperty(Coupon.prototype, "isInfluencer", {
838
+ get: function () {
839
+ return !lodash.isNil(this.influencerEmail);
840
+ },
841
+ enumerable: false,
842
+ configurable: true
843
+ });
844
+ Coupon.prototype.identifierFields = function () {
845
+ return ['id'];
846
+ };
847
+ Coupon.createCoupon = function (userId) {
848
+ return this.toInstance({
849
+ nickname: "" + Date.now(),
850
+ type: exports.CouponTypes.ABSOLUTE,
851
+ checkoutType: exports.CheckoutTypes.ECOMMERCE,
852
+ discount: 30,
853
+ user: userId,
854
+ useLimit: 1,
855
+ useLimitPerUser: 1,
856
+ createdAt: new Date(Date.now()),
857
+ beginAt: new Date(Date.now()),
858
+ expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
859
+ });
860
+ };
861
+ return Coupon;
862
+ }(BaseModel));
863
+ __decorate([
864
+ classTransformer.Expose({ name: 'checkout_type' }),
865
+ __metadata("design:type", Number)
866
+ ], Coupon.prototype, "checkoutType", void 0);
867
+ __decorate([
868
+ classTransformer.Expose({ name: 'exclusivity_type' }),
869
+ __metadata("design:type", Number)
873
870
  ], Coupon.prototype, "exclusivityType", void 0);
874
871
 
875
- var SubscriptionPlan = /** @class */ (function (_super) {
876
- __extends(SubscriptionPlan, _super);
877
- function SubscriptionPlan() {
878
- return _super !== null && _super.apply(this, arguments) || this;
879
- }
880
- SubscriptionPlan.prototype.identifierFields = function () {
881
- return ['id'];
882
- };
883
- return SubscriptionPlan;
872
+ var SubscriptionPlan = /** @class */ (function (_super) {
873
+ __extends(SubscriptionPlan, _super);
874
+ function SubscriptionPlan() {
875
+ return _super !== null && _super.apply(this, arguments) || this;
876
+ }
877
+ SubscriptionPlan.prototype.identifierFields = function () {
878
+ return ['id'];
879
+ };
880
+ return SubscriptionPlan;
884
881
  }(BaseModel));
885
882
 
886
- var BeautyProfile = /** @class */ (function (_super) {
887
- __extends(BeautyProfile, _super);
888
- function BeautyProfile() {
889
- return _super !== null && _super.apply(this, arguments) || this;
890
- }
891
- BeautyProfile.prototype.toPlain = function () {
892
- var plain = _super.prototype.toPlain.call(this);
893
- delete plain.id;
894
- return plain;
895
- };
896
- BeautyProfile.prototype.identifierFields = function () {
897
- return ['id'];
898
- };
899
- return BeautyProfile;
883
+ var BeautyProfile = /** @class */ (function (_super) {
884
+ __extends(BeautyProfile, _super);
885
+ function BeautyProfile() {
886
+ return _super !== null && _super.apply(this, arguments) || this;
887
+ }
888
+ BeautyProfile.prototype.toPlain = function () {
889
+ var plain = _super.prototype.toPlain.call(this);
890
+ delete plain.id;
891
+ return plain;
892
+ };
893
+ BeautyProfile.prototype.identifierFields = function () {
894
+ return ['id'];
895
+ };
896
+ return BeautyProfile;
900
897
  }(BaseModel));
901
898
 
902
- var User = /** @class */ (function (_super) {
903
- __extends(User, _super);
904
- function User() {
905
- return _super !== null && _super.apply(this, arguments) || this;
906
- }
907
- User.toInstance = function (data) {
908
- var instance = _super.toInstance.call(this, data);
909
- if (!lodash.isNil(data.firstName))
910
- instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
911
- return instance;
912
- };
913
- User.prototype.identifierFields = function () {
914
- return ['id'];
915
- };
916
- User.prototype.toPlain = function () {
917
- var plain = _super.prototype.toPlain.call(this);
918
- delete plain.beautyProfile;
919
- return plain;
920
- };
921
- return User;
922
- }(BaseModel));
923
- __decorate([
924
- classTransformer.Type(function () { return BeautyProfile; }),
925
- __metadata("design:type", BeautyProfile)
899
+ var User = /** @class */ (function (_super) {
900
+ __extends(User, _super);
901
+ function User() {
902
+ return _super !== null && _super.apply(this, arguments) || this;
903
+ }
904
+ User.toInstance = function (data) {
905
+ var instance = _super.toInstance.call(this, data);
906
+ if (!lodash.isNil(data.firstName))
907
+ instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
908
+ return instance;
909
+ };
910
+ User.prototype.identifierFields = function () {
911
+ return ['id'];
912
+ };
913
+ User.prototype.toPlain = function () {
914
+ var plain = _super.prototype.toPlain.call(this);
915
+ delete plain.beautyProfile;
916
+ return plain;
917
+ };
918
+ return User;
919
+ }(BaseModel));
920
+ __decorate([
921
+ classTransformer.Type(function () { return BeautyProfile; }),
922
+ __metadata("design:type", BeautyProfile)
926
923
  ], User.prototype, "beautyProfile", void 0);
927
924
 
928
- var Subscription = /** @class */ (function (_super) {
929
- __extends(Subscription, _super);
930
- function Subscription() {
931
- return _super !== null && _super.apply(this, arguments) || this;
932
- }
933
- Subscription.prototype.identifierFields = function () {
934
- return ['id'];
935
- };
936
- return Subscription;
937
- }(BaseModel));
938
- __decorate([
939
- classTransformer.Type(function () { return User; }),
940
- __metadata("design:type", User)
941
- ], Subscription.prototype, "user", void 0);
942
- __decorate([
943
- classTransformer.Type(function () { return SubscriptionPlan; }),
944
- __metadata("design:type", SubscriptionPlan)
945
- ], Subscription.prototype, "subscriptionPlan", void 0);
946
- __decorate([
947
- classTransformer.Type(function () { return Address; }),
948
- __metadata("design:type", Address)
949
- ], Subscription.prototype, "shippingAddress", void 0);
950
- __decorate([
951
- classTransformer.Type(function () { return Address; }),
952
- __metadata("design:type", Address)
953
- ], Subscription.prototype, "billingAddress", void 0);
954
- __decorate([
955
- classTransformer.Type(function () { return Coupon; }),
956
- __metadata("design:type", Coupon)
957
- ], Subscription.prototype, "coupon", void 0);
958
- __decorate([
959
- classTransformer.Type(function () { return Edition; }),
960
- __metadata("design:type", Array)
961
- ], Subscription.prototype, "editions", void 0);
962
- __decorate([
963
- classTransformer.Type(function () { return SubscriptionPayment; }),
964
- __metadata("design:type", Array)
925
+ var Subscription = /** @class */ (function (_super) {
926
+ __extends(Subscription, _super);
927
+ function Subscription() {
928
+ return _super !== null && _super.apply(this, arguments) || this;
929
+ }
930
+ Subscription.prototype.identifierFields = function () {
931
+ return ['id'];
932
+ };
933
+ return Subscription;
934
+ }(BaseModel));
935
+ __decorate([
936
+ classTransformer.Type(function () { return User; }),
937
+ __metadata("design:type", User)
938
+ ], Subscription.prototype, "user", void 0);
939
+ __decorate([
940
+ classTransformer.Type(function () { return SubscriptionPlan; }),
941
+ __metadata("design:type", SubscriptionPlan)
942
+ ], Subscription.prototype, "subscriptionPlan", void 0);
943
+ __decorate([
944
+ classTransformer.Type(function () { return Address; }),
945
+ __metadata("design:type", Address)
946
+ ], Subscription.prototype, "shippingAddress", void 0);
947
+ __decorate([
948
+ classTransformer.Type(function () { return Address; }),
949
+ __metadata("design:type", Address)
950
+ ], Subscription.prototype, "billingAddress", void 0);
951
+ __decorate([
952
+ classTransformer.Type(function () { return Coupon; }),
953
+ __metadata("design:type", Coupon)
954
+ ], Subscription.prototype, "coupon", void 0);
955
+ __decorate([
956
+ classTransformer.Type(function () { return Edition; }),
957
+ __metadata("design:type", Array)
958
+ ], Subscription.prototype, "editions", void 0);
959
+ __decorate([
960
+ classTransformer.Type(function () { return SubscriptionPayment; }),
961
+ __metadata("design:type", Array)
965
962
  ], Subscription.prototype, "payment", void 0);
966
963
 
967
- var UserAddress = /** @class */ (function (_super) {
968
- __extends(UserAddress, _super);
969
- function UserAddress() {
970
- return _super !== null && _super.apply(this, arguments) || this;
971
- }
972
- UserAddress.prototype.identifierFields = function () {
973
- return ['id'];
974
- };
975
- return UserAddress;
964
+ var UserAddress = /** @class */ (function (_super) {
965
+ __extends(UserAddress, _super);
966
+ function UserAddress() {
967
+ return _super !== null && _super.apply(this, arguments) || this;
968
+ }
969
+ UserAddress.prototype.identifierFields = function () {
970
+ return ['id'];
971
+ };
972
+ return UserAddress;
976
973
  }(Address));
977
974
 
978
- var UserPaymentMethod = /** @class */ (function (_super) {
979
- __extends(UserPaymentMethod, _super);
980
- function UserPaymentMethod() {
981
- return _super !== null && _super.apply(this, arguments) || this;
982
- }
983
- UserPaymentMethod.prototype.identifierFields = function () {
984
- return ['id'];
985
- };
986
- return UserPaymentMethod;
975
+ var UserPaymentMethod = /** @class */ (function (_super) {
976
+ __extends(UserPaymentMethod, _super);
977
+ function UserPaymentMethod() {
978
+ return _super !== null && _super.apply(this, arguments) || this;
979
+ }
980
+ UserPaymentMethod.prototype.identifierFields = function () {
981
+ return ['id'];
982
+ };
983
+ return UserPaymentMethod;
987
984
  }(BaseModel));
988
985
 
989
- var Lead = /** @class */ (function (_super) {
990
- __extends(Lead, _super);
991
- function Lead() {
992
- return _super !== null && _super.apply(this, arguments) || this;
993
- }
994
- Lead.prototype.identifierFields = function () {
995
- return ['id'];
996
- };
997
- return Lead;
986
+ var Lead = /** @class */ (function (_super) {
987
+ __extends(Lead, _super);
988
+ function Lead() {
989
+ return _super !== null && _super.apply(this, arguments) || this;
990
+ }
991
+ Lead.prototype.identifierFields = function () {
992
+ return ['id'];
993
+ };
994
+ return Lead;
998
995
  }(BaseModel));
999
996
 
1000
- var UnauthorizedError = /** @class */ (function (_super) {
1001
- __extends(UnauthorizedError, _super);
1002
- function UnauthorizedError(message) {
1003
- var _this = _super.call(this, message) || this;
1004
- _this.message = message;
1005
- return _this;
1006
- }
1007
- return UnauthorizedError;
997
+ var UnauthorizedError = /** @class */ (function (_super) {
998
+ __extends(UnauthorizedError, _super);
999
+ function UnauthorizedError(message) {
1000
+ var _this = _super.call(this, message) || this;
1001
+ _this.message = message;
1002
+ return _this;
1003
+ }
1004
+ return UnauthorizedError;
1008
1005
  }(Error));
1009
1006
 
1010
- exports.SignInMethods = void 0;
1011
- (function (SignInMethods) {
1012
- SignInMethods["EMAIL_PASSWORD"] = "email_password";
1013
- SignInMethods["GOOGLE"] = "google";
1014
- })(exports.SignInMethods || (exports.SignInMethods = {}));
1015
- var Authentication = /** @class */ (function () {
1016
- function Authentication(authService, userRepository) {
1017
- this.authService = authService;
1018
- this.userRepository = userRepository;
1019
- }
1020
- Authentication.prototype.signIn = function (_b, signInMethod) {
1021
- var email = _b.email, password = _b.password;
1022
- return __awaiter(this, void 0, void 0, function () {
1023
- var method, userAuth, user;
1024
- return __generator(this, function (_b) {
1025
- switch (_b.label) {
1026
- case 0:
1027
- method = this.getServiceByMethod(signInMethod);
1028
- return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
1029
- case 1:
1030
- userAuth = _b.sent();
1031
- user = this.userRepository.get(userAuth);
1032
- if (!lodash.isNil(user))
1033
- return [2 /*return*/, user];
1034
- if (/^.+@b4a.com.br$/.test(userAuth.email))
1035
- return [2 /*return*/, this.createsUserByCredential(userAuth)];
1036
- throw new UnauthorizedError('Invalid credentials');
1037
- }
1038
- });
1039
- });
1040
- };
1041
- Authentication.prototype.getServiceByMethod = function (signInMethod) {
1042
- return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
1043
- };
1044
- Authentication.prototype.createsUserByCredential = function (user) {
1045
- var _a;
1046
- return __awaiter(this, void 0, void 0, function () {
1047
- var _b, firstName, lastName, person;
1048
- return __generator(this, function (_c) {
1049
- _b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
1050
- person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
1051
- lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
1052
- return [2 /*return*/, this.userRepository.create(person)];
1053
- });
1054
- });
1055
- };
1056
- return Authentication;
1007
+ exports.SignInMethods = void 0;
1008
+ (function (SignInMethods) {
1009
+ SignInMethods["EMAIL_PASSWORD"] = "email_password";
1010
+ SignInMethods["GOOGLE"] = "google";
1011
+ })(exports.SignInMethods || (exports.SignInMethods = {}));
1012
+ var Authentication = /** @class */ (function () {
1013
+ function Authentication(authService, userRepository) {
1014
+ this.authService = authService;
1015
+ this.userRepository = userRepository;
1016
+ }
1017
+ Authentication.prototype.signIn = function (_b, signInMethod) {
1018
+ var email = _b.email, password = _b.password;
1019
+ return __awaiter(this, void 0, void 0, function () {
1020
+ var method, userAuth, user;
1021
+ return __generator(this, function (_b) {
1022
+ switch (_b.label) {
1023
+ case 0:
1024
+ method = this.getServiceByMethod(signInMethod);
1025
+ return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
1026
+ case 1:
1027
+ userAuth = _b.sent();
1028
+ user = this.userRepository.get(userAuth);
1029
+ if (!lodash.isNil(user))
1030
+ return [2 /*return*/, user];
1031
+ if (/^.+@b4a.com.br$/.test(userAuth.email))
1032
+ return [2 /*return*/, this.createsUserByCredential(userAuth)];
1033
+ throw new UnauthorizedError('Invalid credentials');
1034
+ }
1035
+ });
1036
+ });
1037
+ };
1038
+ Authentication.prototype.getServiceByMethod = function (signInMethod) {
1039
+ return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
1040
+ };
1041
+ Authentication.prototype.createsUserByCredential = function (user) {
1042
+ var _a;
1043
+ return __awaiter(this, void 0, void 0, function () {
1044
+ var _b, firstName, lastName, person;
1045
+ return __generator(this, function (_c) {
1046
+ _b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
1047
+ person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
1048
+ lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
1049
+ return [2 /*return*/, this.userRepository.create(person)];
1050
+ });
1051
+ });
1052
+ };
1053
+ return Authentication;
1057
1054
  }());
1058
1055
 
1059
- var UserAlreadyRegisteredError = /** @class */ (function (_super) {
1060
- __extends(UserAlreadyRegisteredError, _super);
1061
- function UserAlreadyRegisteredError(message) {
1062
- var _this = _super.call(this, message) || this;
1063
- _this.message = message;
1064
- return _this;
1065
- }
1066
- return UserAlreadyRegisteredError;
1056
+ var UserAlreadyRegisteredError = /** @class */ (function (_super) {
1057
+ __extends(UserAlreadyRegisteredError, _super);
1058
+ function UserAlreadyRegisteredError(message) {
1059
+ var _this = _super.call(this, message) || this;
1060
+ _this.message = message;
1061
+ return _this;
1062
+ }
1063
+ return UserAlreadyRegisteredError;
1067
1064
  }(Error));
1068
1065
 
1069
- var WeakPasswordError = /** @class */ (function (_super) {
1070
- __extends(WeakPasswordError, _super);
1071
- function WeakPasswordError(message) {
1072
- if (message === void 0) { message = 'Weak password'; }
1073
- var _this = _super.call(this, message) || this;
1074
- _this.message = message;
1075
- return _this;
1076
- }
1077
- return WeakPasswordError;
1066
+ var WeakPasswordError = /** @class */ (function (_super) {
1067
+ __extends(WeakPasswordError, _super);
1068
+ function WeakPasswordError(message) {
1069
+ if (message === void 0) { message = 'Weak password'; }
1070
+ var _this = _super.call(this, message) || this;
1071
+ _this.message = message;
1072
+ return _this;
1073
+ }
1074
+ return WeakPasswordError;
1078
1075
  }(Error));
1079
1076
 
1080
- var Register = /** @class */ (function () {
1081
- function Register(registerService, userRepository) {
1082
- this.registerService = registerService;
1083
- this.userRepository = userRepository;
1084
- }
1085
- Register.prototype.register = function (params) {
1086
- return __awaiter(this, void 0, void 0, function () {
1087
- var email, displayName, auth, user;
1088
- return __generator(this, function (_a) {
1089
- switch (_a.label) {
1090
- case 0:
1091
- email = params.email.toLocaleLowerCase();
1092
- displayName = params.firstName + " " + params.lastName;
1093
- return [4 /*yield*/, this.userRepository.checkIfExistsByField('cpf', params.cpf)];
1094
- case 1:
1095
- if (_a.sent())
1096
- throw new UserAlreadyRegisteredError("Usu\u00E1rio com CPF " + params.cpf + " j\u00E1 registrado.");
1097
- return [4 /*yield*/, this.userRepository.checkIfExistsByField('email', params.email)];
1098
- case 2:
1099
- if (_a.sent())
1100
- throw new UserAlreadyRegisteredError("Usu\u00E1rio com e-mail " + params.email + " j\u00E1 registrado.");
1101
- return [4 /*yield*/, this.registerService.register({
1102
- birthday: params.birthday,
1103
- email: email,
1104
- firstName: params.firstName,
1105
- lastName: params.lastName,
1106
- cpf: params.cpf,
1107
- displayName: displayName,
1108
- phone: params.phone,
1109
- password: params.password,
1110
- })];
1111
- case 3:
1112
- auth = _a.sent();
1113
- delete params.password;
1114
- return [4 /*yield*/, this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email: email,
1115
- displayName: displayName, type: exports.UserType.B2C, dateCreated: new Date(), dateModified: new Date() }))];
1116
- case 4:
1117
- user = _a.sent();
1118
- return [2 /*return*/, user];
1119
- }
1120
- });
1121
- });
1122
- };
1123
- return Register;
1077
+ var Register = /** @class */ (function () {
1078
+ function Register(registerService, userRepository) {
1079
+ this.registerService = registerService;
1080
+ this.userRepository = userRepository;
1081
+ }
1082
+ Register.prototype.register = function (params) {
1083
+ return __awaiter(this, void 0, void 0, function () {
1084
+ var email, displayName, auth, user;
1085
+ return __generator(this, function (_a) {
1086
+ switch (_a.label) {
1087
+ case 0:
1088
+ email = params.email.toLocaleLowerCase();
1089
+ displayName = params.firstName + " " + params.lastName;
1090
+ return [4 /*yield*/, this.userRepository.checkIfExistsByField('cpf', params.cpf)];
1091
+ case 1:
1092
+ if (_a.sent())
1093
+ throw new UserAlreadyRegisteredError("Usu\u00E1rio com CPF " + params.cpf + " j\u00E1 registrado.");
1094
+ return [4 /*yield*/, this.userRepository.checkIfExistsByField('email', params.email)];
1095
+ case 2:
1096
+ if (_a.sent())
1097
+ throw new UserAlreadyRegisteredError("Usu\u00E1rio com e-mail " + params.email + " j\u00E1 registrado.");
1098
+ return [4 /*yield*/, this.registerService.register({
1099
+ birthday: params.birthday,
1100
+ email: email,
1101
+ firstName: params.firstName,
1102
+ lastName: params.lastName,
1103
+ cpf: params.cpf,
1104
+ displayName: displayName,
1105
+ phone: params.phone,
1106
+ password: params.password,
1107
+ })];
1108
+ case 3:
1109
+ auth = _a.sent();
1110
+ delete params.password;
1111
+ return [4 /*yield*/, this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email: email,
1112
+ displayName: displayName, type: exports.UserType.B2C, dateCreated: new Date(), dateModified: new Date() }))];
1113
+ case 4:
1114
+ user = _a.sent();
1115
+ return [2 /*return*/, user];
1116
+ }
1117
+ });
1118
+ });
1119
+ };
1120
+ return Register;
1124
1121
  }());
1125
1122
 
1126
- var SignOut = /** @class */ (function () {
1127
- function SignOut(authService) {
1128
- this.authService = authService;
1129
- }
1130
- SignOut.prototype.signOut = function () {
1131
- return __awaiter(this, void 0, void 0, function () {
1132
- return __generator(this, function (_a) {
1133
- switch (_a.label) {
1134
- case 0: return [4 /*yield*/, this.authService.signOut()];
1135
- case 1:
1136
- _a.sent();
1137
- return [2 /*return*/];
1138
- }
1139
- });
1140
- });
1141
- };
1142
- return SignOut;
1123
+ var SignOut = /** @class */ (function () {
1124
+ function SignOut(authService) {
1125
+ this.authService = authService;
1126
+ }
1127
+ SignOut.prototype.signOut = function () {
1128
+ return __awaiter(this, void 0, void 0, function () {
1129
+ return __generator(this, function (_a) {
1130
+ switch (_a.label) {
1131
+ case 0: return [4 /*yield*/, this.authService.signOut()];
1132
+ case 1:
1133
+ _a.sent();
1134
+ return [2 /*return*/];
1135
+ }
1136
+ });
1137
+ });
1138
+ };
1139
+ return SignOut;
1143
1140
  }());
1144
1141
 
1145
- var RecoveryPassword = /** @class */ (function () {
1146
- function RecoveryPassword(authService) {
1147
- this.authService = authService;
1148
- }
1149
- RecoveryPassword.prototype.sendEmail = function (email) {
1150
- return __awaiter(this, void 0, void 0, function () {
1151
- return __generator(this, function (_a) {
1152
- switch (_a.label) {
1153
- case 0: return [4 /*yield*/, this.authService.sendPasswordResetEmail(email)];
1154
- case 1:
1155
- _a.sent();
1156
- return [2 /*return*/];
1157
- }
1158
- });
1159
- });
1160
- };
1161
- return RecoveryPassword;
1142
+ var RecoveryPassword = /** @class */ (function () {
1143
+ function RecoveryPassword(authService) {
1144
+ this.authService = authService;
1145
+ }
1146
+ RecoveryPassword.prototype.sendEmail = function (email) {
1147
+ return __awaiter(this, void 0, void 0, function () {
1148
+ return __generator(this, function (_a) {
1149
+ switch (_a.label) {
1150
+ case 0: return [4 /*yield*/, this.authService.sendPasswordResetEmail(email)];
1151
+ case 1:
1152
+ _a.sent();
1153
+ return [2 /*return*/];
1154
+ }
1155
+ });
1156
+ });
1157
+ };
1158
+ return RecoveryPassword;
1162
1159
  }());
1163
1160
 
1164
- exports.Shops = void 0;
1165
- (function (Shops) {
1166
- Shops["MENSMARKET"] = "mensmarket";
1167
- Shops["GLAMSHOP"] = "Glamshop";
1168
- Shops["GLAMPOINTS"] = "Glampoints";
1169
- Shops["ALL"] = "ALL";
1161
+ exports.Shops = void 0;
1162
+ (function (Shops) {
1163
+ Shops["MENSMARKET"] = "mensmarket";
1164
+ Shops["GLAMSHOP"] = "Glamshop";
1165
+ Shops["GLAMPOINTS"] = "Glampoints";
1166
+ Shops["ALL"] = "ALL";
1170
1167
  })(exports.Shops || (exports.Shops = {}));
1171
1168
 
1172
- var Category = /** @class */ (function (_super) {
1173
- __extends(Category, _super);
1174
- function Category() {
1175
- return _super !== null && _super.apply(this, arguments) || this;
1176
- }
1177
- Category.prototype.identifierFields = function () {
1178
- return ['id'];
1179
- };
1180
- return Category;
1169
+ var Category = /** @class */ (function (_super) {
1170
+ __extends(Category, _super);
1171
+ function Category() {
1172
+ return _super !== null && _super.apply(this, arguments) || this;
1173
+ }
1174
+ Category.prototype.identifierFields = function () {
1175
+ return ['id'];
1176
+ };
1177
+ return Category;
1181
1178
  }(BaseModel));
1182
1179
 
1183
- var Product = /** @class */ (function (_super) {
1184
- __extends(Product, _super);
1185
- function Product() {
1186
- return _super !== null && _super.apply(this, arguments) || this;
1187
- }
1188
- Product.prototype.identifierFields = function () {
1189
- return ['id'];
1190
- };
1191
- Product.prototype.getInfoByShop = function (shop) {
1192
- var _a, _b, _c, _d, _e, _f;
1193
- 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]) || {}));
1194
- };
1195
- return Product;
1180
+ var Product = /** @class */ (function (_super) {
1181
+ __extends(Product, _super);
1182
+ function Product() {
1183
+ return _super !== null && _super.apply(this, arguments) || this;
1184
+ }
1185
+ Product.prototype.identifierFields = function () {
1186
+ return ['id'];
1187
+ };
1188
+ Product.prototype.getInfoByShop = function (shop) {
1189
+ var _a, _b, _c, _d, _e, _f;
1190
+ 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]) || {}));
1191
+ };
1192
+ return Product;
1196
1193
  }(BaseModel));
1197
1194
 
1198
- var Variant = /** @class */ (function (_super) {
1199
- __extends(Variant, _super);
1200
- function Variant() {
1201
- return _super !== null && _super.apply(this, arguments) || this;
1202
- }
1203
- Variant.prototype.identifierFields = function () {
1204
- return ['id'];
1205
- };
1206
- return Variant;
1195
+ var Variant = /** @class */ (function (_super) {
1196
+ __extends(Variant, _super);
1197
+ function Variant() {
1198
+ return _super !== null && _super.apply(this, arguments) || this;
1199
+ }
1200
+ Variant.prototype.identifierFields = function () {
1201
+ return ['id'];
1202
+ };
1203
+ return Variant;
1207
1204
  }(BaseModel));
1208
1205
 
1209
- exports.OrderStatus = void 0;
1210
- (function (OrderStatus) {
1211
- OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
1212
- OrderStatus["EM_PREPARO"] = "Preparando pedido";
1213
- OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
1214
- OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
1215
- OrderStatus["ENVIADO"] = "Pedido Enviado";
1216
- OrderStatus["ENTREGUE"] = "Pedido entregue";
1217
- OrderStatus["CANCELADO"] = "Cancelado";
1218
- OrderStatus["CREDIT_CARD"] = "credit_card";
1206
+ exports.OrderStatus = void 0;
1207
+ (function (OrderStatus) {
1208
+ OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
1209
+ OrderStatus["EM_PREPARO"] = "Preparando pedido";
1210
+ OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
1211
+ OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
1212
+ OrderStatus["ENVIADO"] = "Pedido Enviado";
1213
+ OrderStatus["ENTREGUE"] = "Pedido entregue";
1214
+ OrderStatus["CANCELADO"] = "Cancelado";
1215
+ OrderStatus["CREDIT_CARD"] = "credit_card";
1219
1216
  })(exports.OrderStatus || (exports.OrderStatus = {}));
1220
1217
 
1221
- var LineItem = /** @class */ (function (_super) {
1222
- __extends(LineItem, _super);
1223
- function LineItem() {
1224
- return _super !== null && _super.apply(this, arguments) || this;
1225
- }
1226
- return LineItem;
1218
+ var LineItem = /** @class */ (function (_super) {
1219
+ __extends(LineItem, _super);
1220
+ function LineItem() {
1221
+ return _super !== null && _super.apply(this, arguments) || this;
1222
+ }
1223
+ return LineItem;
1227
1224
  }(Product));
1228
1225
 
1229
- var ShippingMethod = /** @class */ (function (_super) {
1230
- __extends(ShippingMethod, _super);
1231
- function ShippingMethod() {
1232
- return _super !== null && _super.apply(this, arguments) || this;
1233
- }
1234
- ShippingMethod.prototype.identifierFields = function () {
1235
- return ['id'];
1236
- };
1237
- return ShippingMethod;
1226
+ var ShippingMethod = /** @class */ (function (_super) {
1227
+ __extends(ShippingMethod, _super);
1228
+ function ShippingMethod() {
1229
+ return _super !== null && _super.apply(this, arguments) || this;
1230
+ }
1231
+ ShippingMethod.prototype.identifierFields = function () {
1232
+ return ['id'];
1233
+ };
1234
+ return ShippingMethod;
1238
1235
  }(BaseModel));
1239
1236
 
1240
- var Checkout = /** @class */ (function (_super) {
1241
- __extends(Checkout, _super);
1242
- function Checkout() {
1243
- return _super !== null && _super.apply(this, arguments) || this;
1244
- }
1245
- Checkout.prototype.identifierFields = function () {
1246
- return ['id'];
1247
- };
1248
- return Checkout;
1249
- }(BaseModel));
1250
- __decorate([
1251
- classTransformer.Type(function () { return LineItem; }),
1252
- __metadata("design:type", Array)
1253
- ], Checkout.prototype, "lineItems", void 0);
1254
- __decorate([
1255
- classTransformer.Type(function () { return User; }),
1256
- __metadata("design:type", User)
1257
- ], Checkout.prototype, "user", void 0);
1258
- __decorate([
1259
- classTransformer.Type(function () { return Address; }),
1260
- __metadata("design:type", Address)
1261
- ], Checkout.prototype, "shippingAddress", void 0);
1262
- __decorate([
1263
- classTransformer.Type(function () { return Address; }),
1264
- __metadata("design:type", Address)
1265
- ], Checkout.prototype, "billingAddress", void 0);
1266
- __decorate([
1267
- classTransformer.Type(function () { return ShippingMethod; }),
1268
- __metadata("design:type", ShippingMethod)
1269
- ], Checkout.prototype, "shipping", void 0);
1270
- __decorate([
1271
- classTransformer.Type(function () { return Coupon; }),
1272
- __metadata("design:type", Coupon)
1237
+ var Checkout = /** @class */ (function (_super) {
1238
+ __extends(Checkout, _super);
1239
+ function Checkout() {
1240
+ return _super !== null && _super.apply(this, arguments) || this;
1241
+ }
1242
+ Checkout.prototype.identifierFields = function () {
1243
+ return ['id'];
1244
+ };
1245
+ return Checkout;
1246
+ }(BaseModel));
1247
+ __decorate([
1248
+ classTransformer.Type(function () { return LineItem; }),
1249
+ __metadata("design:type", Array)
1250
+ ], Checkout.prototype, "lineItems", void 0);
1251
+ __decorate([
1252
+ classTransformer.Type(function () { return User; }),
1253
+ __metadata("design:type", User)
1254
+ ], Checkout.prototype, "user", void 0);
1255
+ __decorate([
1256
+ classTransformer.Type(function () { return Address; }),
1257
+ __metadata("design:type", Address)
1258
+ ], Checkout.prototype, "shippingAddress", void 0);
1259
+ __decorate([
1260
+ classTransformer.Type(function () { return Address; }),
1261
+ __metadata("design:type", Address)
1262
+ ], Checkout.prototype, "billingAddress", void 0);
1263
+ __decorate([
1264
+ classTransformer.Type(function () { return ShippingMethod; }),
1265
+ __metadata("design:type", ShippingMethod)
1266
+ ], Checkout.prototype, "shipping", void 0);
1267
+ __decorate([
1268
+ classTransformer.Type(function () { return Coupon; }),
1269
+ __metadata("design:type", Coupon)
1273
1270
  ], Checkout.prototype, "coupon", void 0);
1274
1271
 
1275
- var Order = /** @class */ (function (_super) {
1276
- __extends(Order, _super);
1277
- function Order() {
1278
- return _super !== null && _super.apply(this, arguments) || this;
1279
- }
1280
- return Order;
1281
- }(Checkout));
1282
- __decorate([
1283
- classTransformer.Type(function () { return Payment; }),
1284
- __metadata("design:type", Payment)
1272
+ var Order = /** @class */ (function (_super) {
1273
+ __extends(Order, _super);
1274
+ function Order() {
1275
+ return _super !== null && _super.apply(this, arguments) || this;
1276
+ }
1277
+ return Order;
1278
+ }(Checkout));
1279
+ __decorate([
1280
+ classTransformer.Type(function () { return Payment; }),
1281
+ __metadata("design:type", Payment)
1285
1282
  ], Order.prototype, "payment", void 0);
1286
1283
 
1287
- var CheckoutSubscription = /** @class */ (function (_super) {
1288
- __extends(CheckoutSubscription, _super);
1289
- function CheckoutSubscription() {
1290
- return _super !== null && _super.apply(this, arguments) || this;
1291
- }
1292
- CheckoutSubscription.prototype.identifierFields = function () {
1293
- return ['id'];
1294
- };
1295
- return CheckoutSubscription;
1296
- }(BaseModel));
1297
- __decorate([
1298
- classTransformer.Type(function () { return Address; }),
1299
- __metadata("design:type", Address)
1300
- ], CheckoutSubscription.prototype, "shippingAddress", void 0);
1301
- __decorate([
1302
- classTransformer.Type(function () { return Address; }),
1303
- __metadata("design:type", Address)
1304
- ], CheckoutSubscription.prototype, "billingAddress", void 0);
1305
- __decorate([
1306
- classTransformer.Type(function () { return SubscriptionPlan; }),
1307
- __metadata("design:type", SubscriptionPlan)
1308
- ], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
1309
- __decorate([
1310
- classTransformer.Type(function () { return Coupon; }),
1311
- __metadata("design:type", Coupon)
1284
+ var CheckoutSubscription = /** @class */ (function (_super) {
1285
+ __extends(CheckoutSubscription, _super);
1286
+ function CheckoutSubscription() {
1287
+ return _super !== null && _super.apply(this, arguments) || this;
1288
+ }
1289
+ CheckoutSubscription.prototype.identifierFields = function () {
1290
+ return ['id'];
1291
+ };
1292
+ return CheckoutSubscription;
1293
+ }(BaseModel));
1294
+ __decorate([
1295
+ classTransformer.Type(function () { return Address; }),
1296
+ __metadata("design:type", Address)
1297
+ ], CheckoutSubscription.prototype, "shippingAddress", void 0);
1298
+ __decorate([
1299
+ classTransformer.Type(function () { return Address; }),
1300
+ __metadata("design:type", Address)
1301
+ ], CheckoutSubscription.prototype, "billingAddress", void 0);
1302
+ __decorate([
1303
+ classTransformer.Type(function () { return SubscriptionPlan; }),
1304
+ __metadata("design:type", SubscriptionPlan)
1305
+ ], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
1306
+ __decorate([
1307
+ classTransformer.Type(function () { return Coupon; }),
1308
+ __metadata("design:type", Coupon)
1312
1309
  ], CheckoutSubscription.prototype, "coupon", void 0);
1313
1310
 
1314
- var Buy2Win = /** @class */ (function (_super) {
1315
- __extends(Buy2Win, _super);
1316
- function Buy2Win() {
1317
- return _super !== null && _super.apply(this, arguments) || this;
1318
- }
1319
- Buy2Win.prototype.identifierFields = function () {
1320
- return ['id'];
1321
- };
1322
- return Buy2Win;
1323
- }(BaseModel));
1324
- __decorate([
1325
- classTransformer.Type(function () { return Category; }),
1326
- __metadata("design:type", Array)
1311
+ var Buy2Win = /** @class */ (function (_super) {
1312
+ __extends(Buy2Win, _super);
1313
+ function Buy2Win() {
1314
+ return _super !== null && _super.apply(this, arguments) || this;
1315
+ }
1316
+ Buy2Win.prototype.identifierFields = function () {
1317
+ return ['id'];
1318
+ };
1319
+ return Buy2Win;
1320
+ }(BaseModel));
1321
+ __decorate([
1322
+ classTransformer.Type(function () { return Category; }),
1323
+ __metadata("design:type", Array)
1327
1324
  ], Buy2Win.prototype, "categories", void 0);
1328
1325
 
1329
- exports.FilterType = void 0;
1330
- (function (FilterType) {
1331
- FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
1332
- FilterType["BEARD_PROBLEMS"] = "beardProblems";
1333
- FilterType["BEARD_SIZE"] = "beardSize";
1334
- FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
1335
- FilterType["BODY_PROBLEMS"] = "bodyProblems";
1336
- FilterType["BODY_SHAPE"] = "bodyShape";
1337
- FilterType["BODY_TATTOOS"] = "bodyTattoos";
1338
- FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
1339
- FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
1340
- FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
1341
- FilterType["FAMILY_INCOME"] = "familyIncome";
1342
- FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
1343
- FilterType["HAIR_COLOR"] = "hairColor";
1344
- FilterType["HAIR_PROBLEMS"] = "hairProblems";
1345
- FilterType["HAIR_STRANDS"] = "hairStrands";
1346
- FilterType["HAIR_TYPE"] = "hairType";
1347
- FilterType["PRODUCT_SPENT"] = "productSpent";
1326
+ exports.FilterType = void 0;
1327
+ (function (FilterType) {
1328
+ FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
1329
+ FilterType["BEARD_PROBLEMS"] = "beardProblems";
1330
+ FilterType["BEARD_SIZE"] = "beardSize";
1331
+ FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
1332
+ FilterType["BODY_PROBLEMS"] = "bodyProblems";
1333
+ FilterType["BODY_SHAPE"] = "bodyShape";
1334
+ FilterType["BODY_TATTOOS"] = "bodyTattoos";
1335
+ FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
1336
+ FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
1337
+ FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
1338
+ FilterType["FAMILY_INCOME"] = "familyIncome";
1339
+ FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
1340
+ FilterType["HAIR_COLOR"] = "hairColor";
1341
+ FilterType["HAIR_PROBLEMS"] = "hairProblems";
1342
+ FilterType["HAIR_STRANDS"] = "hairStrands";
1343
+ FilterType["HAIR_TYPE"] = "hairType";
1344
+ FilterType["PRODUCT_SPENT"] = "productSpent";
1348
1345
  })(exports.FilterType || (exports.FilterType = {}));
1349
1346
 
1350
- exports.QuestionsFilters = void 0;
1351
- (function (QuestionsFilters) {
1352
- QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
1353
- QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
1354
- QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
1355
- QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
1356
- QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
1357
- QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
1358
- QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
1359
- QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
1360
- QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
1361
- QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
1362
- QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
1363
- QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
1364
- QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
1365
- QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
1366
- QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
1367
- QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
1368
- QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
1347
+ exports.QuestionsFilters = void 0;
1348
+ (function (QuestionsFilters) {
1349
+ QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
1350
+ QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
1351
+ QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
1352
+ QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
1353
+ QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
1354
+ QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
1355
+ QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
1356
+ QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
1357
+ QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
1358
+ QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
1359
+ QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
1360
+ QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
1361
+ QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
1362
+ QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
1363
+ QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
1364
+ QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
1365
+ QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
1369
1366
  })(exports.QuestionsFilters || (exports.QuestionsFilters = {}));
1370
1367
 
1371
- var BeautyQuestionsHelper = /** @class */ (function () {
1372
- function BeautyQuestionsHelper() {
1373
- }
1374
- BeautyQuestionsHelper.getAnswers = function (filter) {
1375
- switch (filter) {
1376
- case exports.FilterType.ACCESSORY_IMPORTANCE:
1377
- return exports.AccessoryImportances;
1378
- case exports.FilterType.BEARD_PROBLEMS:
1379
- return exports.BeardProblems;
1380
- case exports.FilterType.BEARD_SIZE:
1381
- return exports.BeardSizes;
1382
- case exports.FilterType.BEAUTY_PRODUCT_IMPORTANCE:
1383
- return exports.BeautyProductImportances;
1384
- case exports.FilterType.BODY_PROBLEMS:
1385
- return exports.BodyProblems;
1386
- case exports.FilterType.BODY_SHAPE:
1387
- return exports.BodyShapes;
1388
- case exports.FilterType.BODY_TATTOOS:
1389
- return exports.BodyTattoos;
1390
- case exports.FilterType.FACE_SKIN_OILINESS:
1391
- return exports.FaceSkinOilinesses;
1392
- case exports.FilterType.FACE_SKIN_PROBLEMS:
1393
- return exports.FaceSkinProblems;
1394
- case exports.FilterType.FACE_SKIN_TONE:
1395
- return exports.FaceSkinTones;
1396
- case exports.FilterType.FAMILY_INCOME:
1397
- return exports.FamilyIncomes;
1398
- case exports.FilterType.FRAGRANCE_IMPORTANCE:
1399
- return exports.FragranceImportances;
1400
- case exports.FilterType.HAIR_COLOR:
1401
- return exports.HairColors;
1402
- case exports.FilterType.HAIR_PROBLEMS:
1403
- return exports.HairProblems;
1404
- case exports.FilterType.HAIR_STRANDS:
1405
- return exports.HairStrands;
1406
- case exports.FilterType.HAIR_TYPE:
1407
- return exports.HairTypes;
1408
- case exports.FilterType.PRODUCT_SPENT:
1409
- return exports.ProductSpents;
1410
- }
1411
- };
1412
- BeautyQuestionsHelper.getQuestions = function (filter) {
1413
- return exports.QuestionsFilters[filter];
1414
- };
1415
- return BeautyQuestionsHelper;
1368
+ var BeautyQuestionsHelper = /** @class */ (function () {
1369
+ function BeautyQuestionsHelper() {
1370
+ }
1371
+ BeautyQuestionsHelper.getAnswers = function (filter) {
1372
+ switch (filter) {
1373
+ case exports.FilterType.ACCESSORY_IMPORTANCE:
1374
+ return exports.AccessoryImportances;
1375
+ case exports.FilterType.BEARD_PROBLEMS:
1376
+ return exports.BeardProblems;
1377
+ case exports.FilterType.BEARD_SIZE:
1378
+ return exports.BeardSizes;
1379
+ case exports.FilterType.BEAUTY_PRODUCT_IMPORTANCE:
1380
+ return exports.BeautyProductImportances;
1381
+ case exports.FilterType.BODY_PROBLEMS:
1382
+ return exports.BodyProblems;
1383
+ case exports.FilterType.BODY_SHAPE:
1384
+ return exports.BodyShapes;
1385
+ case exports.FilterType.BODY_TATTOOS:
1386
+ return exports.BodyTattoos;
1387
+ case exports.FilterType.FACE_SKIN_OILINESS:
1388
+ return exports.FaceSkinOilinesses;
1389
+ case exports.FilterType.FACE_SKIN_PROBLEMS:
1390
+ return exports.FaceSkinProblems;
1391
+ case exports.FilterType.FACE_SKIN_TONE:
1392
+ return exports.FaceSkinTones;
1393
+ case exports.FilterType.FAMILY_INCOME:
1394
+ return exports.FamilyIncomes;
1395
+ case exports.FilterType.FRAGRANCE_IMPORTANCE:
1396
+ return exports.FragranceImportances;
1397
+ case exports.FilterType.HAIR_COLOR:
1398
+ return exports.HairColors;
1399
+ case exports.FilterType.HAIR_PROBLEMS:
1400
+ return exports.HairProblems;
1401
+ case exports.FilterType.HAIR_STRANDS:
1402
+ return exports.HairStrands;
1403
+ case exports.FilterType.HAIR_TYPE:
1404
+ return exports.HairTypes;
1405
+ case exports.FilterType.PRODUCT_SPENT:
1406
+ return exports.ProductSpents;
1407
+ }
1408
+ };
1409
+ BeautyQuestionsHelper.getQuestions = function (filter) {
1410
+ return exports.QuestionsFilters[filter];
1411
+ };
1412
+ return BeautyQuestionsHelper;
1416
1413
  }());
1417
1414
 
1418
- var Home = /** @class */ (function (_super) {
1419
- __extends(Home, _super);
1420
- function Home() {
1421
- return _super !== null && _super.apply(this, arguments) || this;
1422
- }
1423
- Home.prototype.identifierFields = function () {
1424
- return ['id'];
1425
- };
1426
- return Home;
1415
+ var Home = /** @class */ (function (_super) {
1416
+ __extends(Home, _super);
1417
+ function Home() {
1418
+ return _super !== null && _super.apply(this, arguments) || this;
1419
+ }
1420
+ Home.prototype.identifierFields = function () {
1421
+ return ['id'];
1422
+ };
1423
+ return Home;
1427
1424
  }(BaseModel));
1428
1425
 
1429
- var ShopMenu = /** @class */ (function (_super) {
1430
- __extends(ShopMenu, _super);
1431
- function ShopMenu() {
1432
- return _super !== null && _super.apply(this, arguments) || this;
1433
- }
1434
- ShopMenu.prototype.identifierFields = function () {
1435
- return ['id'];
1436
- };
1437
- return ShopMenu;
1426
+ var ShopMenu = /** @class */ (function (_super) {
1427
+ __extends(ShopMenu, _super);
1428
+ function ShopMenu() {
1429
+ return _super !== null && _super.apply(this, arguments) || this;
1430
+ }
1431
+ ShopMenu.prototype.identifierFields = function () {
1432
+ return ['id'];
1433
+ };
1434
+ return ShopMenu;
1438
1435
  }(BaseModel));
1439
1436
 
1440
- var InvalidArgumentError = /** @class */ (function (_super) {
1441
- __extends(InvalidArgumentError, _super);
1442
- function InvalidArgumentError(message) {
1443
- var _this = _super.call(this, message) || this;
1444
- _this.message = message;
1445
- return _this;
1446
- }
1447
- return InvalidArgumentError;
1437
+ var InvalidArgumentError = /** @class */ (function (_super) {
1438
+ __extends(InvalidArgumentError, _super);
1439
+ function InvalidArgumentError(message) {
1440
+ var _this = _super.call(this, message) || this;
1441
+ _this.message = message;
1442
+ return _this;
1443
+ }
1444
+ return InvalidArgumentError;
1448
1445
  }(Error));
1449
1446
 
1450
- var RequiredArgumentError = /** @class */ (function (_super) {
1451
- __extends(RequiredArgumentError, _super);
1452
- function RequiredArgumentError(args) {
1453
- var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
1454
- _this.args = args;
1455
- _this.arguments = args;
1456
- return _this;
1457
- }
1458
- return RequiredArgumentError;
1447
+ var RequiredArgumentError = /** @class */ (function (_super) {
1448
+ __extends(RequiredArgumentError, _super);
1449
+ function RequiredArgumentError(args) {
1450
+ var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
1451
+ _this.args = args;
1452
+ _this.arguments = args;
1453
+ return _this;
1454
+ }
1455
+ return RequiredArgumentError;
1459
1456
  }(Error));
1460
1457
 
1461
- var NotFoundError = /** @class */ (function (_super) {
1462
- __extends(NotFoundError, _super);
1463
- function NotFoundError(message) {
1464
- var _this = _super.call(this, message) || this;
1465
- _this.message = message;
1466
- return _this;
1467
- }
1468
- return NotFoundError;
1458
+ var NotFoundError = /** @class */ (function (_super) {
1459
+ __extends(NotFoundError, _super);
1460
+ function NotFoundError(message) {
1461
+ var _this = _super.call(this, message) || this;
1462
+ _this.message = message;
1463
+ return _this;
1464
+ }
1465
+ return NotFoundError;
1469
1466
  }(Error));
1470
1467
 
1471
- var DuplicatedResultsError = /** @class */ (function (_super) {
1472
- __extends(DuplicatedResultsError, _super);
1473
- function DuplicatedResultsError(message) {
1474
- var _this = _super.call(this, message) || this;
1475
- _this.message = message;
1476
- return _this;
1477
- }
1478
- return DuplicatedResultsError;
1468
+ var DuplicatedResultsError = /** @class */ (function (_super) {
1469
+ __extends(DuplicatedResultsError, _super);
1470
+ function DuplicatedResultsError(message) {
1471
+ var _this = _super.call(this, message) || this;
1472
+ _this.message = message;
1473
+ return _this;
1474
+ }
1475
+ return DuplicatedResultsError;
1479
1476
  }(Error));
1480
1477
 
1481
- var AxiosAdapter = /** @class */ (function () {
1482
- function AxiosAdapter(config) {
1483
- this.config = config;
1484
- }
1485
- AxiosAdapter.prototype.query = function (index, query) {
1486
- return __awaiter(this, void 0, void 0, function () {
1487
- var data;
1488
- return __generator(this, function (_a) {
1489
- switch (_a.label) {
1490
- case 0: return [4 /*yield*/, axios__default["default"]({
1491
- url: this.config.url + "/" + index,
1492
- method: 'POST',
1493
- headers: { Authorization: "Basic " + this.config.credential },
1494
- data: query,
1495
- })];
1496
- case 1:
1497
- data = (_a.sent()).data;
1498
- return [2 /*return*/, {
1499
- total: data.hits.total.value,
1500
- hits: data.hits.hits,
1501
- }];
1502
- }
1503
- });
1504
- });
1505
- };
1506
- return AxiosAdapter;
1478
+ var AxiosAdapter = /** @class */ (function () {
1479
+ function AxiosAdapter(config) {
1480
+ this.config = config;
1481
+ }
1482
+ AxiosAdapter.prototype.query = function (index, query) {
1483
+ return __awaiter(this, void 0, void 0, function () {
1484
+ var data;
1485
+ return __generator(this, function (_a) {
1486
+ switch (_a.label) {
1487
+ case 0: return [4 /*yield*/, axios__default["default"]({
1488
+ url: this.config.url + "/" + index,
1489
+ method: 'POST',
1490
+ headers: { Authorization: "Basic " + this.config.credential },
1491
+ data: query,
1492
+ })];
1493
+ case 1:
1494
+ data = (_a.sent()).data;
1495
+ return [2 /*return*/, {
1496
+ total: data.hits.total.value,
1497
+ hits: data.hits.hits,
1498
+ }];
1499
+ }
1500
+ });
1501
+ });
1502
+ };
1503
+ return AxiosAdapter;
1507
1504
  }());
1508
1505
 
1509
- var ProductsIndex = /** @class */ (function () {
1510
- function ProductsIndex(adapter) {
1511
- this.adapter = adapter;
1512
- }
1513
- ProductsIndex.prototype.findById = function (ids, options) {
1514
- return __awaiter(this, void 0, void 0, function () {
1515
- var publishedField, fields, hits;
1516
- var _a;
1517
- return __generator(this, function (_b) {
1518
- switch (_b.label) {
1519
- case 0:
1520
- publishedField = options.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
1521
- fields = [
1522
- 'brand',
1523
- 'id',
1524
- 'images',
1525
- 'miniatures',
1526
- 'name',
1527
- 'price',
1528
- 'sku',
1529
- 'stock',
1530
- 'slug',
1531
- 'reviews',
1532
- 'pricePaid',
1533
- 'isGift',
1534
- 'stock',
1535
- 'weight',
1536
- 'tags',
1537
- 'hasVariants',
1538
- ];
1539
- return [4 /*yield*/, this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
1540
- bool: {
1541
- filter: __spreadArray([
1542
- {
1543
- terms: {
1544
- _id: ids,
1545
- },
1546
- },
1547
- {
1548
- term: (_a = {},
1549
- _a[publishedField] = true,
1550
- _a),
1551
- }
1552
- ], __read((options.hasStock
1553
- ? [
1554
- {
1555
- range: {
1556
- 'stock.quantity': {
1557
- gt: 0,
1558
- },
1559
- },
1560
- },
1561
- ]
1562
- : []))),
1563
- },
1564
- } }, (options.size ? { size: options.size } : {})))];
1565
- case 1:
1566
- hits = (_b.sent()).hits;
1567
- return [2 /*return*/, hits.map(function (hit) { return Product.toInstance(hit._source); })];
1568
- }
1569
- });
1570
- });
1571
- };
1572
- return ProductsIndex;
1506
+ var ProductsIndex = /** @class */ (function () {
1507
+ function ProductsIndex(adapter) {
1508
+ this.adapter = adapter;
1509
+ }
1510
+ ProductsIndex.prototype.findById = function (ids, options) {
1511
+ return __awaiter(this, void 0, void 0, function () {
1512
+ var publishedField, fields, hits;
1513
+ var _a;
1514
+ return __generator(this, function (_b) {
1515
+ switch (_b.label) {
1516
+ case 0:
1517
+ publishedField = options.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
1518
+ fields = [
1519
+ 'brand',
1520
+ 'id',
1521
+ 'images',
1522
+ 'miniatures',
1523
+ 'name',
1524
+ 'price',
1525
+ 'sku',
1526
+ 'stock',
1527
+ 'slug',
1528
+ 'reviews',
1529
+ 'pricePaid',
1530
+ 'isGift',
1531
+ 'stock',
1532
+ 'weight',
1533
+ 'tags',
1534
+ 'hasVariants',
1535
+ ];
1536
+ return [4 /*yield*/, this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
1537
+ bool: {
1538
+ filter: __spreadArray([
1539
+ {
1540
+ terms: {
1541
+ _id: ids,
1542
+ },
1543
+ },
1544
+ {
1545
+ term: (_a = {},
1546
+ _a[publishedField] = true,
1547
+ _a),
1548
+ }
1549
+ ], __read((options.hasStock
1550
+ ? [
1551
+ {
1552
+ range: {
1553
+ 'stock.quantity': {
1554
+ gt: 0,
1555
+ },
1556
+ },
1557
+ },
1558
+ ]
1559
+ : []))),
1560
+ },
1561
+ } }, (options.size ? { size: options.size } : {})))];
1562
+ case 1:
1563
+ hits = (_b.sent()).hits;
1564
+ return [2 /*return*/, hits.map(function (hit) { return Product.toInstance(hit._source); })];
1565
+ }
1566
+ });
1567
+ });
1568
+ };
1569
+ return ProductsIndex;
1573
1570
  }());
1574
1571
 
1575
- var withFirestore = function (MixinBase) {
1576
- return /** @class */ (function (_super) {
1577
- __extends(class_1, _super);
1578
- function class_1() {
1579
- var args = [];
1580
- for (var _i = 0; _i < arguments.length; _i++) {
1581
- args[_i] = arguments[_i];
1582
- }
1583
- return _super.call(this, args) || this;
1584
- }
1585
- class_1.prototype.collection = function (path) {
1586
- return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
1587
- };
1588
- class_1.prototype.buildModelInstance = function () {
1589
- var _this = this;
1590
- return {
1591
- toFirestore: function (data) { return ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
1592
- fromFirestore: function (snap) {
1593
- var data = snap.data();
1594
- Object.keys(data).forEach(function (key) {
1595
- if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
1596
- data[key] = data[key].toDate();
1597
- }
1598
- });
1599
- return _this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
1600
- },
1601
- };
1602
- };
1603
- return class_1;
1604
- }(MixinBase));
1572
+ var withFirestore = function (MixinBase) {
1573
+ return /** @class */ (function (_super) {
1574
+ __extends(class_1, _super);
1575
+ function class_1() {
1576
+ var args = [];
1577
+ for (var _i = 0; _i < arguments.length; _i++) {
1578
+ args[_i] = arguments[_i];
1579
+ }
1580
+ return _super.call(this, args) || this;
1581
+ }
1582
+ class_1.prototype.collection = function (path) {
1583
+ return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
1584
+ };
1585
+ class_1.prototype.buildModelInstance = function () {
1586
+ var _this = this;
1587
+ return {
1588
+ toFirestore: function (data) { return ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
1589
+ fromFirestore: function (snap) {
1590
+ var data = snap.data();
1591
+ Object.keys(data).forEach(function (key) {
1592
+ if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
1593
+ data[key] = data[key].toDate();
1594
+ }
1595
+ });
1596
+ return _this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
1597
+ },
1598
+ };
1599
+ };
1600
+ return class_1;
1601
+ }(MixinBase));
1605
1602
  };
1606
1603
 
1607
- var withHelpers = function (MixinBase) {
1608
- return /** @class */ (function (_super) {
1609
- __extends(class_1, _super);
1610
- function class_1() {
1611
- return _super !== null && _super.apply(this, arguments) || this;
1612
- }
1613
- class_1.prototype.toArray = function (snapShot) {
1614
- if (Array.isArray(snapShot)) {
1615
- return snapShot.map(function (doc) { return doc.data(); });
1616
- }
1617
- else {
1618
- return snapShot.docs.map(function (doc) { return doc.data(); });
1619
- }
1620
- };
1621
- class_1.prototype.isSubCollection = function (repository) {
1622
- return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
1623
- };
1624
- return class_1;
1625
- }(MixinBase));
1604
+ var withHelpers = function (MixinBase) {
1605
+ return /** @class */ (function (_super) {
1606
+ __extends(class_1, _super);
1607
+ function class_1() {
1608
+ return _super !== null && _super.apply(this, arguments) || this;
1609
+ }
1610
+ class_1.prototype.toArray = function (snapShot) {
1611
+ if (Array.isArray(snapShot)) {
1612
+ return snapShot.map(function (doc) { return doc.data(); });
1613
+ }
1614
+ else {
1615
+ return snapShot.docs.map(function (doc) { return doc.data(); });
1616
+ }
1617
+ };
1618
+ class_1.prototype.isSubCollection = function (repository) {
1619
+ return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
1620
+ };
1621
+ return class_1;
1622
+ }(MixinBase));
1626
1623
  };
1627
1624
 
1628
- var withGetFirestore = function (MixinBase) {
1629
- return /** @class */ (function (_super) {
1630
- __extends(GetFirestore, _super);
1631
- function GetFirestore() {
1632
- return _super !== null && _super.apply(this, arguments) || this;
1633
- }
1634
- GetFirestore.prototype.get = function (identifiers) {
1635
- return __awaiter(this, void 0, void 0, function () {
1636
- var doc, data;
1637
- return __generator(this, function (_a) {
1638
- switch (_a.label) {
1639
- case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
1640
- .doc(Object.values(identifiers).shift().toString())
1641
- .get()];
1642
- case 1:
1643
- doc = _a.sent();
1644
- data = doc.data();
1645
- if (lodash.isNil(data))
1646
- throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
1647
- return [2 /*return*/, data];
1648
- }
1649
- });
1650
- });
1651
- };
1652
- GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
1653
- return this.isSubCollection(this)
1654
- ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1655
- : this.collectionName;
1656
- };
1657
- return GetFirestore;
1658
- }(MixinBase));
1625
+ var withGetFirestore = function (MixinBase) {
1626
+ return /** @class */ (function (_super) {
1627
+ __extends(GetFirestore, _super);
1628
+ function GetFirestore() {
1629
+ return _super !== null && _super.apply(this, arguments) || this;
1630
+ }
1631
+ GetFirestore.prototype.get = function (identifiers) {
1632
+ return __awaiter(this, void 0, void 0, function () {
1633
+ var doc, data;
1634
+ return __generator(this, function (_a) {
1635
+ switch (_a.label) {
1636
+ case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
1637
+ .doc(Object.values(identifiers).shift().toString())
1638
+ .get()];
1639
+ case 1:
1640
+ doc = _a.sent();
1641
+ data = doc.data();
1642
+ if (lodash.isNil(data))
1643
+ throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
1644
+ return [2 /*return*/, data];
1645
+ }
1646
+ });
1647
+ });
1648
+ };
1649
+ GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
1650
+ return this.isSubCollection(this)
1651
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1652
+ : this.collectionName;
1653
+ };
1654
+ return GetFirestore;
1655
+ }(MixinBase));
1659
1656
  };
1660
1657
 
1661
- var withFindFirestore = function (MixinBase) {
1662
- var checkIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
1663
- var getValueFromFilter = function (filter) {
1664
- return checkIfIsFilterOption(filter) ? filter.value : filter;
1665
- };
1666
- var getFinalValueFrom = function (value) { return lodash.isNumber(value) || lodash.isString(value) || lodash.isDate(value) || Array.isArray(value)
1667
- ? value
1668
- : Object.values(getFinalValueFrom); };
1669
- return /** @class */ (function (_super) {
1670
- __extends(FindFirestore, _super);
1671
- function FindFirestore() {
1672
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1673
- _this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
1674
- _this.buildWhereSentence = function (queryReference, fieldName, options) {
1675
- if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
1676
- return queryReference;
1677
- var value = (options === null || options === void 0 ? void 0 : options.value) || options;
1678
- var object = {};
1679
- lodash.set(object, fieldName, value);
1680
- var plainInstance = new _this.model(object).toPlain();
1681
- var firestoreFieldName = fieldName.toString().indexOf('.') > -1
1682
- ? fieldName.toString()
1683
- : Object.keys(plainInstance).find(function (key) { return plainInstance[key]; });
1684
- if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
1685
- if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1686
- return queryReference.where(firestoreFieldName, 'array-contains-any', options.value);
1687
- queryReference = queryReference.where(firestoreFieldName, '>=', options.value);
1688
- queryReference = queryReference.where(firestoreFieldName, '<=', options.value + "~");
1689
- return queryReference;
1690
- }
1691
- if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1692
- return queryReference.where(firestoreFieldName, 'array-contains', options.value);
1693
- if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value)) {
1694
- return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
1695
- }
1696
- return queryReference.where(firestoreFieldName, (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
1697
- };
1698
- return _this;
1699
- }
1700
- FindFirestore.prototype.find = function (filters, limits, orderBy) {
1701
- return __awaiter(this, void 0, void 0, function () {
1702
- var query, docs, data;
1703
- var _this = this;
1704
- return __generator(this, function (_b) {
1705
- switch (_b.label) {
1706
- case 0:
1707
- query = this.collection(this.buildCollectionPathForFind(filters));
1708
- filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
1709
- orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach(function (orderer) { return Object.keys(orderer).forEach(function (fieldName) { return (query = query.orderBy(fieldName, orderer[fieldName])); }); });
1710
- return [4 /*yield*/, this.defineLimits(query, filters, limits)];
1711
- case 1:
1712
- query = _b.sent();
1713
- return [4 /*yield*/, query.get()];
1714
- case 2:
1715
- docs = _b.sent();
1716
- data = docs.docs.map(function (doc) { return doc.data(); });
1717
- return [2 /*return*/, {
1718
- data: data,
1719
- count: this.calculateCount(data, limits),
1720
- }];
1721
- }
1722
- });
1723
- });
1724
- };
1725
- FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
1726
- var _a;
1727
- if (!this.isSubCollection(this))
1728
- return this.collectionName;
1729
- var parentIdField = this.parentIdField;
1730
- var parentId = getValueFromFilter((_a = filters.find(function (groupFilter) { return Boolean(getValueFromFilter(groupFilter[parentIdField])); })) === null || _a === void 0 ? void 0 : _a[parentIdField]);
1731
- return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
1732
- };
1733
- FindFirestore.prototype.defineLimits = function (query, filters, limits) {
1734
- return __awaiter(this, void 0, void 0, function () {
1735
- var _b, _c;
1736
- return __generator(this, function (_d) {
1737
- switch (_d.label) {
1738
- case 0:
1739
- if (!(limits === null || limits === void 0 ? void 0 : limits.offset)) return [3 /*break*/, 3];
1740
- if (!(limits.offset instanceof this.model)) return [3 /*break*/, 2];
1741
- _c = (_b = query).startAfter;
1742
- return [4 /*yield*/, this.collection(this.buildCollectionPathForFind(filters))
1743
- .doc(limits.offset[limits.offset.identifierFields().shift()])
1744
- .get()];
1745
- case 1:
1746
- query = _c.apply(_b, [_d.sent()]);
1747
- return [3 /*break*/, 3];
1748
- case 2:
1749
- if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
1750
- query = query.startAt(limits.offset);
1751
- _d.label = 3;
1752
- case 3:
1753
- if (limits === null || limits === void 0 ? void 0 : limits.limit)
1754
- query = query.limit(limits.limit);
1755
- return [2 /*return*/, query];
1756
- }
1757
- });
1758
- });
1759
- };
1760
- FindFirestore.prototype.calculateCount = function (data, limits) {
1761
- if (data.length <= 0)
1762
- return 0;
1763
- if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
1764
- return data.length;
1765
- return Infinity;
1766
- };
1767
- return FindFirestore;
1768
- }(MixinBase));
1658
+ var withFindFirestore = function (MixinBase) {
1659
+ var checkIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
1660
+ var getValueFromFilter = function (filter) {
1661
+ return checkIfIsFilterOption(filter) ? filter.value : filter;
1662
+ };
1663
+ var getFinalValueFrom = function (value) { return lodash.isNumber(value) || lodash.isString(value) || lodash.isDate(value) || Array.isArray(value)
1664
+ ? value
1665
+ : Object.values(getFinalValueFrom); };
1666
+ return /** @class */ (function (_super) {
1667
+ __extends(FindFirestore, _super);
1668
+ function FindFirestore() {
1669
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1670
+ _this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
1671
+ _this.buildWhereSentence = function (queryReference, fieldName, options) {
1672
+ if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
1673
+ return queryReference;
1674
+ var value = (options === null || options === void 0 ? void 0 : options.value) || options;
1675
+ var object = {};
1676
+ lodash.set(object, fieldName, value);
1677
+ var plainInstance = new _this.model(object).toPlain();
1678
+ var firestoreFieldName = fieldName.toString().indexOf('.') > -1
1679
+ ? fieldName.toString()
1680
+ : Object.keys(plainInstance).find(function (key) { return plainInstance[key]; });
1681
+ if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
1682
+ if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1683
+ return queryReference.where(firestoreFieldName, 'array-contains-any', options.value);
1684
+ queryReference = queryReference.where(firestoreFieldName, '>=', options.value);
1685
+ queryReference = queryReference.where(firestoreFieldName, '<=', options.value + "~");
1686
+ return queryReference;
1687
+ }
1688
+ if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1689
+ return queryReference.where(firestoreFieldName, 'array-contains', options.value);
1690
+ if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value)) {
1691
+ return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
1692
+ }
1693
+ return queryReference.where(firestoreFieldName, (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
1694
+ };
1695
+ return _this;
1696
+ }
1697
+ FindFirestore.prototype.find = function (filters, limits, orderBy) {
1698
+ return __awaiter(this, void 0, void 0, function () {
1699
+ var query, docs, data;
1700
+ var _this = this;
1701
+ return __generator(this, function (_b) {
1702
+ switch (_b.label) {
1703
+ case 0:
1704
+ query = this.collection(this.buildCollectionPathForFind(filters));
1705
+ filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
1706
+ orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach(function (orderer) { return Object.keys(orderer).forEach(function (fieldName) { return (query = query.orderBy(fieldName, orderer[fieldName])); }); });
1707
+ return [4 /*yield*/, this.defineLimits(query, filters, limits)];
1708
+ case 1:
1709
+ query = _b.sent();
1710
+ return [4 /*yield*/, query.get()];
1711
+ case 2:
1712
+ docs = _b.sent();
1713
+ data = docs.docs.map(function (doc) { return doc.data(); });
1714
+ return [2 /*return*/, {
1715
+ data: data,
1716
+ count: this.calculateCount(data, limits),
1717
+ }];
1718
+ }
1719
+ });
1720
+ });
1721
+ };
1722
+ FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
1723
+ var _a;
1724
+ if (!this.isSubCollection(this))
1725
+ return this.collectionName;
1726
+ var parentIdField = this.parentIdField;
1727
+ var parentId = getValueFromFilter((_a = filters.find(function (groupFilter) { return Boolean(getValueFromFilter(groupFilter[parentIdField])); })) === null || _a === void 0 ? void 0 : _a[parentIdField]);
1728
+ return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
1729
+ };
1730
+ FindFirestore.prototype.defineLimits = function (query, filters, limits) {
1731
+ return __awaiter(this, void 0, void 0, function () {
1732
+ var _b, _c;
1733
+ return __generator(this, function (_d) {
1734
+ switch (_d.label) {
1735
+ case 0:
1736
+ if (!(limits === null || limits === void 0 ? void 0 : limits.offset)) return [3 /*break*/, 3];
1737
+ if (!(limits.offset instanceof this.model)) return [3 /*break*/, 2];
1738
+ _c = (_b = query).startAfter;
1739
+ return [4 /*yield*/, this.collection(this.buildCollectionPathForFind(filters))
1740
+ .doc(limits.offset[limits.offset.identifierFields().shift()])
1741
+ .get()];
1742
+ case 1:
1743
+ query = _c.apply(_b, [_d.sent()]);
1744
+ return [3 /*break*/, 3];
1745
+ case 2:
1746
+ if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
1747
+ query = query.startAt(limits.offset);
1748
+ _d.label = 3;
1749
+ case 3:
1750
+ if (limits === null || limits === void 0 ? void 0 : limits.limit)
1751
+ query = query.limit(limits.limit);
1752
+ return [2 /*return*/, query];
1753
+ }
1754
+ });
1755
+ });
1756
+ };
1757
+ FindFirestore.prototype.calculateCount = function (data, limits) {
1758
+ if (data.length <= 0)
1759
+ return 0;
1760
+ if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
1761
+ return data.length;
1762
+ return Infinity;
1763
+ };
1764
+ return FindFirestore;
1765
+ }(MixinBase));
1769
1766
  };
1770
1767
 
1771
- var withCreateFirestore = function (MixinBase) {
1772
- return /** @class */ (function (_super) {
1773
- __extends(CreateFirestore, _super);
1774
- function CreateFirestore() {
1775
- return _super !== null && _super.apply(this, arguments) || this;
1776
- }
1777
- CreateFirestore.prototype.create = function (data) {
1778
- return __awaiter(this, void 0, void 0, function () {
1779
- var docRef, doc;
1780
- return __generator(this, function (_b) {
1781
- switch (_b.label) {
1782
- case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
1783
- case 1:
1784
- docRef = _b.sent();
1785
- return [4 /*yield*/, docRef.get()];
1786
- case 2:
1787
- doc = _b.sent();
1788
- return [2 /*return*/, doc.data()];
1789
- }
1790
- });
1791
- });
1792
- };
1793
- CreateFirestore.prototype.save = function (data) {
1794
- var _a;
1795
- return __awaiter(this, void 0, void 0, function () {
1796
- var id, collectionPath, docRef;
1797
- return __generator(this, function (_b) {
1798
- switch (_b.label) {
1799
- case 0:
1800
- id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
1801
- collectionPath = this.buildCollectionPathForAdd(data);
1802
- if (lodash.isEmpty(id))
1803
- return [2 /*return*/, this.collection(collectionPath).add(data)];
1804
- docRef = this.collection(collectionPath).doc(id);
1805
- return [4 /*yield*/, docRef.set(data)];
1806
- case 1:
1807
- _b.sent();
1808
- return [2 /*return*/, docRef];
1809
- }
1810
- });
1811
- });
1812
- };
1813
- CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
1814
- return this.isSubCollection(this)
1815
- ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1816
- : this.collectionName;
1817
- };
1818
- return CreateFirestore;
1819
- }(MixinBase));
1768
+ var withCreateFirestore = function (MixinBase) {
1769
+ return /** @class */ (function (_super) {
1770
+ __extends(CreateFirestore, _super);
1771
+ function CreateFirestore() {
1772
+ return _super !== null && _super.apply(this, arguments) || this;
1773
+ }
1774
+ CreateFirestore.prototype.create = function (data) {
1775
+ return __awaiter(this, void 0, void 0, function () {
1776
+ var docRef, doc;
1777
+ return __generator(this, function (_b) {
1778
+ switch (_b.label) {
1779
+ case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
1780
+ case 1:
1781
+ docRef = _b.sent();
1782
+ return [4 /*yield*/, docRef.get()];
1783
+ case 2:
1784
+ doc = _b.sent();
1785
+ return [2 /*return*/, doc.data()];
1786
+ }
1787
+ });
1788
+ });
1789
+ };
1790
+ CreateFirestore.prototype.save = function (data) {
1791
+ var _a;
1792
+ return __awaiter(this, void 0, void 0, function () {
1793
+ var id, collectionPath, docRef;
1794
+ return __generator(this, function (_b) {
1795
+ switch (_b.label) {
1796
+ case 0:
1797
+ id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
1798
+ collectionPath = this.buildCollectionPathForAdd(data);
1799
+ if (lodash.isEmpty(id))
1800
+ return [2 /*return*/, this.collection(collectionPath).add(data)];
1801
+ docRef = this.collection(collectionPath).doc(id);
1802
+ return [4 /*yield*/, docRef.set(data)];
1803
+ case 1:
1804
+ _b.sent();
1805
+ return [2 /*return*/, docRef];
1806
+ }
1807
+ });
1808
+ });
1809
+ };
1810
+ CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
1811
+ return this.isSubCollection(this)
1812
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1813
+ : this.collectionName;
1814
+ };
1815
+ return CreateFirestore;
1816
+ }(MixinBase));
1820
1817
  };
1821
1818
 
1822
- var withUpdateFirestore = function (MixinBase) {
1823
- var getValueFromParams = function (params, field) { var _a; return (lodash.isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
1824
- var getValueByAction = function (options) {
1825
- var fieldValues = firebase__default["default"].firestore.FieldValue;
1826
- if (lodash.isNil(options.action))
1827
- return options;
1828
- if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
1829
- return fieldValues.delete();
1830
- if (Array.isArray(options.value)) {
1831
- if (options.action === exports.UpdateOptionActions.MERGE)
1832
- return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
1833
- if (options.action === exports.UpdateOptionActions.REMOVE)
1834
- return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
1835
- }
1836
- return options.value;
1837
- };
1838
- return /** @class */ (function (_super) {
1839
- __extends(UpdateFirestore, _super);
1840
- function UpdateFirestore() {
1841
- return _super !== null && _super.apply(this, arguments) || this;
1842
- }
1843
- UpdateFirestore.prototype.update = function (data) {
1844
- return __awaiter(this, void 0, void 0, function () {
1845
- var model, keyField, docRef, doc;
1846
- return __generator(this, function (_b) {
1847
- switch (_b.label) {
1848
- case 0:
1849
- model = new this.model();
1850
- keyField = model.identifierFields().shift();
1851
- docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
1852
- return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
1853
- case 1:
1854
- _b.sent();
1855
- return [4 /*yield*/, docRef.get()];
1856
- case 2:
1857
- doc = _b.sent();
1858
- return [2 /*return*/, doc.data()];
1859
- }
1860
- });
1861
- });
1862
- };
1863
- UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
1864
- return this.isSubCollection(this)
1865
- ? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
1866
- : this.collectionName;
1867
- };
1868
- UpdateFirestore.prototype.paramsToPlain = function (params) {
1869
- var model = this.model;
1870
- if (params instanceof model)
1871
- return params;
1872
- return Object.keys(params).reduce(function (data, currentKey) {
1873
- var _b;
1874
- return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
1875
- }, {});
1876
- };
1877
- return UpdateFirestore;
1878
- }(MixinBase));
1819
+ var withUpdateFirestore = function (MixinBase) {
1820
+ var getValueFromParams = function (params, field) { var _a; return (lodash.isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
1821
+ var getValueByAction = function (options) {
1822
+ var fieldValues = firebase__default["default"].firestore.FieldValue;
1823
+ if (lodash.isNil(options.action))
1824
+ return options;
1825
+ if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
1826
+ return fieldValues.delete();
1827
+ if (Array.isArray(options.value)) {
1828
+ if (options.action === exports.UpdateOptionActions.MERGE)
1829
+ return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
1830
+ if (options.action === exports.UpdateOptionActions.REMOVE)
1831
+ return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
1832
+ }
1833
+ return options.value;
1834
+ };
1835
+ return /** @class */ (function (_super) {
1836
+ __extends(UpdateFirestore, _super);
1837
+ function UpdateFirestore() {
1838
+ return _super !== null && _super.apply(this, arguments) || this;
1839
+ }
1840
+ UpdateFirestore.prototype.update = function (data) {
1841
+ return __awaiter(this, void 0, void 0, function () {
1842
+ var model, keyField, docRef, doc;
1843
+ return __generator(this, function (_b) {
1844
+ switch (_b.label) {
1845
+ case 0:
1846
+ model = new this.model();
1847
+ keyField = model.identifierFields().shift();
1848
+ docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
1849
+ return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
1850
+ case 1:
1851
+ _b.sent();
1852
+ return [4 /*yield*/, docRef.get()];
1853
+ case 2:
1854
+ doc = _b.sent();
1855
+ return [2 /*return*/, doc.data()];
1856
+ }
1857
+ });
1858
+ });
1859
+ };
1860
+ UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
1861
+ return this.isSubCollection(this)
1862
+ ? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
1863
+ : this.collectionName;
1864
+ };
1865
+ UpdateFirestore.prototype.paramsToPlain = function (params) {
1866
+ var model = this.model;
1867
+ if (params instanceof model)
1868
+ return params;
1869
+ return Object.keys(params).reduce(function (data, currentKey) {
1870
+ var _b;
1871
+ return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
1872
+ }, {});
1873
+ };
1874
+ return UpdateFirestore;
1875
+ }(MixinBase));
1879
1876
  };
1880
1877
 
1881
- var withDeleteFirestore = function (MixinBase) {
1882
- return /** @class */ (function (_super) {
1883
- __extends(DeleteFirestore, _super);
1884
- function DeleteFirestore() {
1885
- return _super !== null && _super.apply(this, arguments) || this;
1886
- }
1887
- DeleteFirestore.prototype.delete = function (identifiers) {
1888
- return __awaiter(this, void 0, void 0, function () {
1889
- return __generator(this, function (_a) {
1890
- switch (_a.label) {
1891
- case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
1892
- .doc(Object.values(identifiers).shift().toString())
1893
- .delete()];
1894
- case 1:
1895
- _a.sent();
1896
- return [2 /*return*/];
1897
- }
1898
- });
1899
- });
1900
- };
1901
- DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
1902
- return this.isSubCollection(this)
1903
- ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1904
- : this.collectionName;
1905
- };
1906
- return DeleteFirestore;
1907
- }(MixinBase));
1878
+ var withDeleteFirestore = function (MixinBase) {
1879
+ return /** @class */ (function (_super) {
1880
+ __extends(DeleteFirestore, _super);
1881
+ function DeleteFirestore() {
1882
+ return _super !== null && _super.apply(this, arguments) || this;
1883
+ }
1884
+ DeleteFirestore.prototype.delete = function (identifiers) {
1885
+ return __awaiter(this, void 0, void 0, function () {
1886
+ return __generator(this, function (_a) {
1887
+ switch (_a.label) {
1888
+ case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
1889
+ .doc(Object.values(identifiers).shift().toString())
1890
+ .delete()];
1891
+ case 1:
1892
+ _a.sent();
1893
+ return [2 /*return*/];
1894
+ }
1895
+ });
1896
+ });
1897
+ };
1898
+ DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
1899
+ return this.isSubCollection(this)
1900
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1901
+ : this.collectionName;
1902
+ };
1903
+ return DeleteFirestore;
1904
+ }(MixinBase));
1908
1905
  };
1909
1906
 
1910
- var withSubCollection = function (MixinBase, ParentModel) {
1911
- return /** @class */ (function (_super) {
1912
- __extends(SubCollectionMix, _super);
1913
- function SubCollectionMix() {
1914
- var args = [];
1915
- for (var _i = 0; _i < arguments.length; _i++) {
1916
- args[_i] = arguments[_i];
1917
- }
1918
- return _super.call(this, args) || this;
1919
- }
1920
- SubCollectionMix.prototype.collection = function (path) {
1921
- return _super.prototype.collection.call(this, path);
1922
- };
1923
- return SubCollectionMix;
1924
- }(MixinBase));
1907
+ var withSubCollection = function (MixinBase, ParentModel) {
1908
+ return /** @class */ (function (_super) {
1909
+ __extends(SubCollectionMix, _super);
1910
+ function SubCollectionMix() {
1911
+ var args = [];
1912
+ for (var _i = 0; _i < arguments.length; _i++) {
1913
+ args[_i] = arguments[_i];
1914
+ }
1915
+ return _super.call(this, args) || this;
1916
+ }
1917
+ SubCollectionMix.prototype.collection = function (path) {
1918
+ return _super.prototype.collection.call(this, path);
1919
+ };
1920
+ return SubCollectionMix;
1921
+ }(MixinBase));
1925
1922
  };
1926
1923
 
1927
- var withCrudFirestore = function (MixinBase) {
1928
- return /** @class */ (function (_super) {
1929
- __extends(CrudFirestore, _super);
1930
- function CrudFirestore() {
1931
- return _super !== null && _super.apply(this, arguments) || this;
1932
- }
1933
- return CrudFirestore;
1934
- }(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
1924
+ var withCrudFirestore = function (MixinBase) {
1925
+ return /** @class */ (function (_super) {
1926
+ __extends(CrudFirestore, _super);
1927
+ function CrudFirestore() {
1928
+ return _super !== null && _super.apply(this, arguments) || this;
1929
+ }
1930
+ return CrudFirestore;
1931
+ }(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
1935
1932
  };
1936
1933
 
1937
- var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
1938
- __extends(SubscriptionFirestoreRepository, _super);
1939
- function SubscriptionFirestoreRepository(firestore) {
1940
- var _this = _super.call(this) || this;
1941
- _this.firestore = firestore;
1942
- _this.collectionName = 'subscription';
1943
- _this.model = Subscription;
1944
- return _this;
1945
- }
1946
- return SubscriptionFirestoreRepository;
1934
+ var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
1935
+ __extends(SubscriptionFirestoreRepository, _super);
1936
+ function SubscriptionFirestoreRepository(firestore) {
1937
+ var _this = _super.call(this) || this;
1938
+ _this.firestore = firestore;
1939
+ _this.collectionName = 'subscription';
1940
+ _this.model = Subscription;
1941
+ return _this;
1942
+ }
1943
+ return SubscriptionFirestoreRepository;
1947
1944
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1948
1945
 
1949
- var UserSearch = /** @class */ (function (_super) {
1950
- __extends(UserSearch, _super);
1951
- function UserSearch() {
1952
- return _super !== null && _super.apply(this, arguments) || this;
1953
- }
1954
- UserSearch.prototype.identifierFields = function () {
1955
- return ['id'];
1956
- };
1957
- return UserSearch;
1946
+ var UserSearch = /** @class */ (function (_super) {
1947
+ __extends(UserSearch, _super);
1948
+ function UserSearch() {
1949
+ return _super !== null && _super.apply(this, arguments) || this;
1950
+ }
1951
+ UserSearch.prototype.identifierFields = function () {
1952
+ return ['id'];
1953
+ };
1954
+ return UserSearch;
1958
1955
  }(BaseModel));
1959
1956
 
1960
- var UserSearchFirestoreRepository = /** @class */ (function (_super) {
1961
- __extends(UserSearchFirestoreRepository, _super);
1962
- function UserSearchFirestoreRepository(firestore) {
1963
- var _this = _super.call(this) || this;
1964
- _this.firestore = firestore;
1965
- _this.collectionName = 'userSearch';
1966
- _this.model = UserSearch;
1967
- return _this;
1968
- }
1969
- return UserSearchFirestoreRepository;
1957
+ var UserSearchFirestoreRepository = /** @class */ (function (_super) {
1958
+ __extends(UserSearchFirestoreRepository, _super);
1959
+ function UserSearchFirestoreRepository(firestore) {
1960
+ var _this = _super.call(this) || this;
1961
+ _this.firestore = firestore;
1962
+ _this.collectionName = 'userSearch';
1963
+ _this.model = UserSearch;
1964
+ return _this;
1965
+ }
1966
+ return UserSearchFirestoreRepository;
1970
1967
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1971
1968
 
1972
- var UserFirestoreRepository = /** @class */ (function (_super_1) {
1973
- __extends(UserFirestoreRepository, _super_1);
1974
- function UserFirestoreRepository(firestore, userSearchFirestoreRepository) {
1975
- if (userSearchFirestoreRepository === void 0) { userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore); }
1976
- var _this = _super_1.call(this) || this;
1977
- _this.firestore = firestore;
1978
- _this.userSearchFirestoreRepository = userSearchFirestoreRepository;
1979
- _this.collectionName = 'users';
1980
- _this.model = User;
1981
- return _this;
1982
- }
1983
- UserFirestoreRepository.prototype.get = function (identifiers) {
1984
- var _super = Object.create(null, {
1985
- get: { get: function () { return _super_1.prototype.get; } }
1986
- });
1987
- return __awaiter(this, void 0, void 0, function () {
1988
- var user, _a, _b;
1989
- return __generator(this, function (_c) {
1990
- switch (_c.label) {
1991
- case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
1992
- case 1:
1993
- user = _c.sent();
1994
- _a = user;
1995
- return [4 /*yield*/, this.getBeautyProfile(user.id)];
1996
- case 2:
1997
- _a.beautyProfile = _c.sent();
1998
- _b = user;
1999
- return [4 /*yield*/, this.checkIfIsSubscriber(user.id)];
2000
- case 3:
2001
- _b.isSubscriber = _c.sent();
2002
- return [2 /*return*/, user];
2003
- }
2004
- });
2005
- });
2006
- };
2007
- UserFirestoreRepository.prototype.checkIfExistsByField = function (field, value) {
2008
- return __awaiter(this, void 0, void 0, function () {
2009
- var result;
2010
- var _a;
2011
- return __generator(this, function (_b) {
2012
- switch (_b.label) {
2013
- case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find([(_a = {}, _a[field] = { operator: exports.Where.EQUALS, value: value }, _a)])];
2014
- case 1:
2015
- result = _b.sent();
2016
- return [2 /*return*/, result.count > 0];
2017
- }
2018
- });
2019
- });
2020
- };
2021
- UserFirestoreRepository.prototype.buildModelInstance = function () {
2022
- var _a = _super_1.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2023
- return {
2024
- toFirestore: function (data) {
2025
- var plain = toFirestore(data);
2026
- delete plain.isSubscriber;
2027
- return plain;
2028
- },
2029
- fromFirestore: fromFirestore,
2030
- };
2031
- };
2032
- UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
2033
- return __awaiter(this, void 0, void 0, function () {
2034
- var beautyProfile;
2035
- return __generator(this, function (_a) {
2036
- switch (_a.label) {
2037
- case 0: return [4 /*yield*/, this.collection()
2038
- .doc(userId)
2039
- .collection('CX')
2040
- .withConverter(this.buildBeautyProfileModelInstance())
2041
- .doc('beautyProfile')
2042
- .get()];
2043
- case 1:
2044
- beautyProfile = _a.sent();
2045
- return [2 /*return*/, beautyProfile.data()];
2046
- }
2047
- });
2048
- });
2049
- };
2050
- UserFirestoreRepository.prototype.checkIfIsSubscriber = function (userId) {
2051
- return __awaiter(this, void 0, void 0, function () {
2052
- var docs;
2053
- return __generator(this, function (_a) {
2054
- switch (_a.label) {
2055
- case 0: return [4 /*yield*/, this.firestore
2056
- .collection('subscription')
2057
- .where('user.id', '==', userId)
2058
- .where('status', '==', 'active')
2059
- .get()];
2060
- case 1:
2061
- docs = _a.sent();
2062
- return [2 /*return*/, !!docs && !!docs.size];
2063
- }
2064
- });
2065
- });
2066
- };
2067
- UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
2068
- return {
2069
- toFirestore: function (data) { return data.toPlain(); },
2070
- fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
2071
- };
2072
- };
2073
- return UserFirestoreRepository;
1969
+ var UserFirestoreRepository = /** @class */ (function (_super_1) {
1970
+ __extends(UserFirestoreRepository, _super_1);
1971
+ function UserFirestoreRepository(firestore, userSearchFirestoreRepository) {
1972
+ if (userSearchFirestoreRepository === void 0) { userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore); }
1973
+ var _this = _super_1.call(this) || this;
1974
+ _this.firestore = firestore;
1975
+ _this.userSearchFirestoreRepository = userSearchFirestoreRepository;
1976
+ _this.collectionName = 'users';
1977
+ _this.model = User;
1978
+ return _this;
1979
+ }
1980
+ UserFirestoreRepository.prototype.get = function (identifiers) {
1981
+ var _super = Object.create(null, {
1982
+ get: { get: function () { return _super_1.prototype.get; } }
1983
+ });
1984
+ return __awaiter(this, void 0, void 0, function () {
1985
+ var user, _a, _b;
1986
+ return __generator(this, function (_c) {
1987
+ switch (_c.label) {
1988
+ case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
1989
+ case 1:
1990
+ user = _c.sent();
1991
+ _a = user;
1992
+ return [4 /*yield*/, this.getBeautyProfile(user.id)];
1993
+ case 2:
1994
+ _a.beautyProfile = _c.sent();
1995
+ _b = user;
1996
+ return [4 /*yield*/, this.checkIfIsSubscriber(user.id)];
1997
+ case 3:
1998
+ _b.isSubscriber = _c.sent();
1999
+ return [2 /*return*/, user];
2000
+ }
2001
+ });
2002
+ });
2003
+ };
2004
+ UserFirestoreRepository.prototype.checkIfExistsByField = function (field, value) {
2005
+ return __awaiter(this, void 0, void 0, function () {
2006
+ var result;
2007
+ var _a;
2008
+ return __generator(this, function (_b) {
2009
+ switch (_b.label) {
2010
+ case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find([(_a = {}, _a[field] = { operator: exports.Where.EQUALS, value: value }, _a)])];
2011
+ case 1:
2012
+ result = _b.sent();
2013
+ return [2 /*return*/, result.count > 0];
2014
+ }
2015
+ });
2016
+ });
2017
+ };
2018
+ UserFirestoreRepository.prototype.buildModelInstance = function () {
2019
+ var _a = _super_1.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2020
+ return {
2021
+ toFirestore: function (data) {
2022
+ var plain = toFirestore(data);
2023
+ delete plain.isSubscriber;
2024
+ return plain;
2025
+ },
2026
+ fromFirestore: fromFirestore,
2027
+ };
2028
+ };
2029
+ UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
2030
+ return __awaiter(this, void 0, void 0, function () {
2031
+ var beautyProfile;
2032
+ return __generator(this, function (_a) {
2033
+ switch (_a.label) {
2034
+ case 0: return [4 /*yield*/, this.collection()
2035
+ .doc(userId)
2036
+ .collection('CX')
2037
+ .withConverter(this.buildBeautyProfileModelInstance())
2038
+ .doc('beautyProfile')
2039
+ .get()];
2040
+ case 1:
2041
+ beautyProfile = _a.sent();
2042
+ return [2 /*return*/, beautyProfile.data()];
2043
+ }
2044
+ });
2045
+ });
2046
+ };
2047
+ UserFirestoreRepository.prototype.checkIfIsSubscriber = function (userId) {
2048
+ return __awaiter(this, void 0, void 0, function () {
2049
+ var docs;
2050
+ return __generator(this, function (_a) {
2051
+ switch (_a.label) {
2052
+ case 0: return [4 /*yield*/, this.firestore
2053
+ .collection('subscription')
2054
+ .where('user.id', '==', userId)
2055
+ .where('status', '==', 'active')
2056
+ .get()];
2057
+ case 1:
2058
+ docs = _a.sent();
2059
+ return [2 /*return*/, !!docs && !!docs.size];
2060
+ }
2061
+ });
2062
+ });
2063
+ };
2064
+ UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
2065
+ return {
2066
+ toFirestore: function (data) { return data.toPlain(); },
2067
+ fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
2068
+ };
2069
+ };
2070
+ return UserFirestoreRepository;
2074
2071
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2075
2072
 
2076
- var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
2077
- __extends(SubscriptionEditionFirestoreRepository, _super);
2078
- function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
2079
- var _this = _super.call(this) || this;
2080
- _this.firestore = firestore;
2081
- _this.parentRepository = parentRepository;
2082
- _this.collectionName = 'editions';
2083
- _this.parentIdField = 'subscriptionId';
2084
- _this.model = Edition;
2085
- return _this;
2086
- }
2087
- return SubscriptionEditionFirestoreRepository;
2073
+ var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
2074
+ __extends(SubscriptionEditionFirestoreRepository, _super);
2075
+ function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
2076
+ var _this = _super.call(this) || this;
2077
+ _this.firestore = firestore;
2078
+ _this.parentRepository = parentRepository;
2079
+ _this.collectionName = 'editions';
2080
+ _this.parentIdField = 'subscriptionId';
2081
+ _this.model = Edition;
2082
+ return _this;
2083
+ }
2084
+ return SubscriptionEditionFirestoreRepository;
2088
2085
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2089
2086
 
2090
- var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
2091
- __extends(UserBeautyProfileFirestoreRepository, _super);
2092
- function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
2093
- var _this = _super.call(this) || this;
2094
- _this.firestore = firestore;
2095
- _this.parentRepository = parentRepository;
2096
- _this.collectionName = 'CX';
2097
- _this.parentIdField = 'userId';
2098
- _this.model = BeautyProfile;
2099
- return _this;
2100
- }
2101
- return UserBeautyProfileFirestoreRepository;
2087
+ var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
2088
+ __extends(UserBeautyProfileFirestoreRepository, _super);
2089
+ function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
2090
+ var _this = _super.call(this) || this;
2091
+ _this.firestore = firestore;
2092
+ _this.parentRepository = parentRepository;
2093
+ _this.collectionName = 'CX';
2094
+ _this.parentIdField = 'userId';
2095
+ _this.model = BeautyProfile;
2096
+ return _this;
2097
+ }
2098
+ return UserBeautyProfileFirestoreRepository;
2102
2099
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2103
2100
 
2104
- var UserAddressFirestoreRepository = /** @class */ (function (_super) {
2105
- __extends(UserAddressFirestoreRepository, _super);
2106
- function UserAddressFirestoreRepository(firestore, parentRepository) {
2107
- var _this = _super.call(this) || this;
2108
- _this.firestore = firestore;
2109
- _this.parentRepository = parentRepository;
2110
- _this.collectionName = 'address';
2111
- _this.parentIdField = 'userId';
2112
- _this.model = UserAddress;
2113
- return _this;
2114
- }
2115
- return UserAddressFirestoreRepository;
2101
+ var UserAddressFirestoreRepository = /** @class */ (function (_super) {
2102
+ __extends(UserAddressFirestoreRepository, _super);
2103
+ function UserAddressFirestoreRepository(firestore, parentRepository) {
2104
+ var _this = _super.call(this) || this;
2105
+ _this.firestore = firestore;
2106
+ _this.parentRepository = parentRepository;
2107
+ _this.collectionName = 'address';
2108
+ _this.parentIdField = 'userId';
2109
+ _this.model = UserAddress;
2110
+ return _this;
2111
+ }
2112
+ return UserAddressFirestoreRepository;
2116
2113
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2117
2114
 
2118
- var UserPaymentMethodFirestoreRepository = /** @class */ (function (_super) {
2119
- __extends(UserPaymentMethodFirestoreRepository, _super);
2120
- function UserPaymentMethodFirestoreRepository(firestore, parentRepository) {
2121
- var _this = _super.call(this) || this;
2122
- _this.firestore = firestore;
2123
- _this.parentRepository = parentRepository;
2124
- _this.collectionName = 'payment_method';
2125
- _this.parentIdField = 'userId';
2126
- _this.model = UserPaymentMethod;
2127
- return _this;
2128
- }
2129
- return UserPaymentMethodFirestoreRepository;
2115
+ var UserPaymentMethodFirestoreRepository = /** @class */ (function (_super) {
2116
+ __extends(UserPaymentMethodFirestoreRepository, _super);
2117
+ function UserPaymentMethodFirestoreRepository(firestore, parentRepository) {
2118
+ var _this = _super.call(this) || this;
2119
+ _this.firestore = firestore;
2120
+ _this.parentRepository = parentRepository;
2121
+ _this.collectionName = 'payment_method';
2122
+ _this.parentIdField = 'userId';
2123
+ _this.model = UserPaymentMethod;
2124
+ return _this;
2125
+ }
2126
+ return UserPaymentMethodFirestoreRepository;
2130
2127
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2131
2128
 
2132
- var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
2133
- __extends(SubscriptionPaymentFirestoreRepository, _super);
2134
- function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
2135
- var _this = _super.call(this) || this;
2136
- _this.firestore = firestore;
2137
- _this.parentRepository = parentRepository;
2138
- _this.collectionName = 'payments';
2139
- _this.parentIdField = 'subscriptionId';
2140
- _this.model = SubscriptionPayment;
2141
- return _this;
2142
- }
2143
- return SubscriptionPaymentFirestoreRepository;
2129
+ var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
2130
+ __extends(SubscriptionPaymentFirestoreRepository, _super);
2131
+ function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
2132
+ var _this = _super.call(this) || this;
2133
+ _this.firestore = firestore;
2134
+ _this.parentRepository = parentRepository;
2135
+ _this.collectionName = 'payments';
2136
+ _this.parentIdField = 'subscriptionId';
2137
+ _this.model = SubscriptionPayment;
2138
+ return _this;
2139
+ }
2140
+ return SubscriptionPaymentFirestoreRepository;
2144
2141
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2145
2142
 
2146
- var LeadFirestoreRepository = /** @class */ (function (_super) {
2147
- __extends(LeadFirestoreRepository, _super);
2148
- function LeadFirestoreRepository(firestore) {
2149
- var _this = _super.call(this) || this;
2150
- _this.firestore = firestore;
2151
- _this.collectionName = 'leads';
2152
- _this.model = Lead;
2153
- return _this;
2154
- }
2155
- return LeadFirestoreRepository;
2143
+ var LeadFirestoreRepository = /** @class */ (function (_super) {
2144
+ __extends(LeadFirestoreRepository, _super);
2145
+ function LeadFirestoreRepository(firestore) {
2146
+ var _this = _super.call(this) || this;
2147
+ _this.firestore = firestore;
2148
+ _this.collectionName = 'leads';
2149
+ _this.model = Lead;
2150
+ return _this;
2151
+ }
2152
+ return LeadFirestoreRepository;
2156
2153
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2157
2154
 
2158
- var CategoryFirestoreRepository = /** @class */ (function (_super) {
2159
- __extends(CategoryFirestoreRepository, _super);
2160
- function CategoryFirestoreRepository(firestore) {
2161
- var _this = _super.call(this) || this;
2162
- _this.firestore = firestore;
2163
- _this.collectionName = 'categories';
2164
- _this.model = Category;
2165
- return _this;
2166
- }
2167
- CategoryFirestoreRepository.prototype.getCategoryBySlug = function (slug, shop) {
2168
- return this.collection(this.collectionName)
2169
- .where('slug', '==', slug)
2170
- .where('shop', '==', shop)
2171
- .where('published', '==', true)
2172
- .get()
2173
- .then(function (snap) {
2174
- if (snap.size > 1)
2175
- throw new DuplicatedResultsError('Query returned duplicated values');
2176
- if (snap.empty)
2177
- throw new NotFoundError("Document with slug " + slug + " not found");
2178
- return snap.docs[0].data();
2179
- })
2180
- .catch(function (error) { return error; });
2181
- };
2182
- CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
2183
- if (limit === void 0) { limit = 4; }
2184
- return __awaiter(this, void 0, void 0, function () {
2185
- var categorySnap, categories, homeSections;
2186
- var _this = this;
2187
- return __generator(this, function (_a) {
2188
- switch (_a.label) {
2189
- case 0: return [4 /*yield*/, this.collection(this.collectionName)
2190
- .where('id', 'in', categoryIds.filter(Boolean))
2191
- .where('published', '==', true)
2192
- .get()];
2193
- case 1:
2194
- categorySnap = _a.sent();
2195
- if (categorySnap.empty)
2196
- throw new NotFoundError('Categories not found');
2197
- categories = categorySnap.docs.map(function (doc) { return doc.data(); });
2198
- return [4 /*yield*/, Promise.all(categories.map(function (category) { return __awaiter(_this, void 0, void 0, function () {
2199
- var _a;
2200
- return __generator(this, function (_b) {
2201
- switch (_b.label) {
2202
- case 0:
2203
- _a = {
2204
- category: category
2205
- };
2206
- return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
2207
- case 1: return [2 /*return*/, (_a.products = _b.sent(),
2208
- _a)];
2209
- }
2210
- });
2211
- }); }))];
2212
- case 2:
2213
- homeSections = _a.sent();
2214
- return [2 /*return*/, homeSections];
2215
- }
2216
- });
2217
- });
2218
- };
2219
- CategoryFirestoreRepository.prototype.mountCategory = function (category, options) {
2220
- return __awaiter(this, void 0, void 0, function () {
2221
- var chunks, products, publishedField, chunks_1, chunks_1_1, productIds, query, productSnap, e_1_1;
2222
- var e_1, _a;
2223
- return __generator(this, function (_b) {
2224
- switch (_b.label) {
2225
- case 0:
2226
- if (!category.products)
2227
- throw new RequiredArgumentError(['Category products is empty']);
2228
- chunks = lodash.chunk(category.products, 10);
2229
- products = [];
2230
- publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
2231
- _b.label = 1;
2232
- case 1:
2233
- _b.trys.push([1, 7, 8, 9]);
2234
- chunks_1 = __values(chunks), chunks_1_1 = chunks_1.next();
2235
- _b.label = 2;
2236
- case 2:
2237
- if (!!chunks_1_1.done) return [3 /*break*/, 6];
2238
- productIds = chunks_1_1.value;
2239
- if ((options === null || options === void 0 ? void 0 : options.limit) && products.length >= (options === null || options === void 0 ? void 0 : options.limit))
2240
- return [3 /*break*/, 6];
2241
- return [4 /*yield*/, this.collection('products').where(publishedField, '==', true).where('id', 'in', productIds)];
2242
- case 3:
2243
- query = _b.sent();
2244
- if (options === null || options === void 0 ? void 0 : options.hasStock)
2245
- query = query.where('stock.quantity', '>', 0);
2246
- if (options === null || options === void 0 ? void 0 : options.limit)
2247
- query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
2248
- return [4 /*yield*/, query.get()];
2249
- case 4:
2250
- productSnap = _b.sent();
2251
- if (productSnap.empty)
2252
- return [3 /*break*/, 5];
2253
- products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
2254
- _b.label = 5;
2255
- case 5:
2256
- chunks_1_1 = chunks_1.next();
2257
- return [3 /*break*/, 2];
2258
- case 6: return [3 /*break*/, 9];
2259
- case 7:
2260
- e_1_1 = _b.sent();
2261
- e_1 = { error: e_1_1 };
2262
- return [3 /*break*/, 9];
2263
- case 8:
2264
- try {
2265
- if (chunks_1_1 && !chunks_1_1.done && (_a = chunks_1.return)) _a.call(chunks_1);
2266
- }
2267
- finally { if (e_1) throw e_1.error; }
2268
- return [7 /*endfinally*/];
2269
- case 9: return [2 /*return*/, products];
2270
- }
2271
- });
2272
- });
2273
- };
2274
- return CategoryFirestoreRepository;
2155
+ var CategoryFirestoreRepository = /** @class */ (function (_super) {
2156
+ __extends(CategoryFirestoreRepository, _super);
2157
+ function CategoryFirestoreRepository(firestore) {
2158
+ var _this = _super.call(this) || this;
2159
+ _this.firestore = firestore;
2160
+ _this.collectionName = 'categories';
2161
+ _this.model = Category;
2162
+ return _this;
2163
+ }
2164
+ CategoryFirestoreRepository.prototype.getCategoryBySlug = function (slug, shop) {
2165
+ return this.collection(this.collectionName)
2166
+ .where('slug', '==', slug)
2167
+ .where('shop', '==', shop)
2168
+ .where('published', '==', true)
2169
+ .get()
2170
+ .then(function (snap) {
2171
+ if (snap.size > 1)
2172
+ throw new DuplicatedResultsError('Query returned duplicated values');
2173
+ if (snap.empty)
2174
+ throw new NotFoundError("Document with slug " + slug + " not found");
2175
+ return snap.docs[0].data();
2176
+ })
2177
+ .catch(function (error) { return error; });
2178
+ };
2179
+ CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
2180
+ if (limit === void 0) { limit = 4; }
2181
+ return __awaiter(this, void 0, void 0, function () {
2182
+ var categorySnap, categories, homeSections;
2183
+ var _this = this;
2184
+ return __generator(this, function (_a) {
2185
+ switch (_a.label) {
2186
+ case 0: return [4 /*yield*/, this.collection(this.collectionName)
2187
+ .where('id', 'in', categoryIds.filter(Boolean))
2188
+ .where('published', '==', true)
2189
+ .get()];
2190
+ case 1:
2191
+ categorySnap = _a.sent();
2192
+ if (categorySnap.empty)
2193
+ throw new NotFoundError('Categories not found');
2194
+ categories = categorySnap.docs.map(function (doc) { return doc.data(); });
2195
+ return [4 /*yield*/, Promise.all(categories.map(function (category) { return __awaiter(_this, void 0, void 0, function () {
2196
+ var _a;
2197
+ return __generator(this, function (_b) {
2198
+ switch (_b.label) {
2199
+ case 0:
2200
+ _a = {
2201
+ category: category
2202
+ };
2203
+ return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
2204
+ case 1: return [2 /*return*/, (_a.products = _b.sent(),
2205
+ _a)];
2206
+ }
2207
+ });
2208
+ }); }))];
2209
+ case 2:
2210
+ homeSections = _a.sent();
2211
+ return [2 /*return*/, homeSections];
2212
+ }
2213
+ });
2214
+ });
2215
+ };
2216
+ CategoryFirestoreRepository.prototype.mountCategory = function (category, options) {
2217
+ return __awaiter(this, void 0, void 0, function () {
2218
+ var chunks, products, publishedField, chunks_1, chunks_1_1, productIds, query, productSnap, e_1_1;
2219
+ var e_1, _a;
2220
+ return __generator(this, function (_b) {
2221
+ switch (_b.label) {
2222
+ case 0:
2223
+ if (!category.products)
2224
+ throw new RequiredArgumentError(['Category products is empty']);
2225
+ chunks = lodash.chunk(category.products, 10);
2226
+ products = [];
2227
+ publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
2228
+ _b.label = 1;
2229
+ case 1:
2230
+ _b.trys.push([1, 7, 8, 9]);
2231
+ chunks_1 = __values(chunks), chunks_1_1 = chunks_1.next();
2232
+ _b.label = 2;
2233
+ case 2:
2234
+ if (!!chunks_1_1.done) return [3 /*break*/, 6];
2235
+ productIds = chunks_1_1.value;
2236
+ if ((options === null || options === void 0 ? void 0 : options.limit) && products.length >= (options === null || options === void 0 ? void 0 : options.limit))
2237
+ return [3 /*break*/, 6];
2238
+ return [4 /*yield*/, this.collection('products').where(publishedField, '==', true).where('id', 'in', productIds)];
2239
+ case 3:
2240
+ query = _b.sent();
2241
+ if (options === null || options === void 0 ? void 0 : options.hasStock)
2242
+ query = query.where('stock.quantity', '>', 0);
2243
+ if (options === null || options === void 0 ? void 0 : options.limit)
2244
+ query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
2245
+ return [4 /*yield*/, query.get()];
2246
+ case 4:
2247
+ productSnap = _b.sent();
2248
+ if (productSnap.empty)
2249
+ return [3 /*break*/, 5];
2250
+ products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
2251
+ _b.label = 5;
2252
+ case 5:
2253
+ chunks_1_1 = chunks_1.next();
2254
+ return [3 /*break*/, 2];
2255
+ case 6: return [3 /*break*/, 9];
2256
+ case 7:
2257
+ e_1_1 = _b.sent();
2258
+ e_1 = { error: e_1_1 };
2259
+ return [3 /*break*/, 9];
2260
+ case 8:
2261
+ try {
2262
+ if (chunks_1_1 && !chunks_1_1.done && (_a = chunks_1.return)) _a.call(chunks_1);
2263
+ }
2264
+ finally { if (e_1) throw e_1.error; }
2265
+ return [7 /*endfinally*/];
2266
+ case 9: return [2 /*return*/, products];
2267
+ }
2268
+ });
2269
+ });
2270
+ };
2271
+ return CategoryFirestoreRepository;
2275
2272
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2276
2273
 
2277
- var ProductFirestoreRepository = /** @class */ (function (_super) {
2278
- __extends(ProductFirestoreRepository, _super);
2279
- function ProductFirestoreRepository(firestore) {
2280
- var _this = _super.call(this) || this;
2281
- _this.firestore = firestore;
2282
- _this.collectionName = 'products';
2283
- _this.model = Product;
2284
- return _this;
2285
- }
2286
- ProductFirestoreRepository.prototype.getBySlug = function (slug, shop) {
2287
- var _a;
2288
- return __awaiter(this, void 0, void 0, function () {
2289
- var result;
2290
- return __generator(this, function (_b) {
2291
- switch (_b.label) {
2292
- case 0: return [4 /*yield*/, this.find([
2293
- { slug: { operator: exports.Where.EQUALS, value: slug } },
2294
- { shopAvailability: { operator: exports.Where.IN, value: [shop] } },
2295
- ])];
2296
- case 1:
2297
- result = _b.sent();
2298
- return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
2299
- }
2300
- });
2301
- });
2302
- };
2303
- return ProductFirestoreRepository;
2274
+ var ProductFirestoreRepository = /** @class */ (function (_super) {
2275
+ __extends(ProductFirestoreRepository, _super);
2276
+ function ProductFirestoreRepository(firestore) {
2277
+ var _this = _super.call(this) || this;
2278
+ _this.firestore = firestore;
2279
+ _this.collectionName = 'products';
2280
+ _this.model = Product;
2281
+ return _this;
2282
+ }
2283
+ ProductFirestoreRepository.prototype.getBySlug = function (slug, shop) {
2284
+ var _a;
2285
+ return __awaiter(this, void 0, void 0, function () {
2286
+ var result;
2287
+ return __generator(this, function (_b) {
2288
+ switch (_b.label) {
2289
+ case 0: return [4 /*yield*/, this.find([
2290
+ { slug: { operator: exports.Where.EQUALS, value: slug } },
2291
+ { shopAvailability: { operator: exports.Where.IN, value: [shop] } },
2292
+ ])];
2293
+ case 1:
2294
+ result = _b.sent();
2295
+ return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
2296
+ }
2297
+ });
2298
+ });
2299
+ };
2300
+ return ProductFirestoreRepository;
2304
2301
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2305
2302
 
2306
- var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
2307
- __extends(ProductVariantFirestoreRepository, _super);
2308
- function ProductVariantFirestoreRepository(firestore, parentRepository) {
2309
- var _this = _super.call(this) || this;
2310
- _this.firestore = firestore;
2311
- _this.parentRepository = parentRepository;
2312
- _this.collectionName = 'variants';
2313
- _this.parentIdField = 'productId';
2314
- _this.model = Variant;
2315
- return _this;
2316
- }
2317
- return ProductVariantFirestoreRepository;
2303
+ var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
2304
+ __extends(ProductVariantFirestoreRepository, _super);
2305
+ function ProductVariantFirestoreRepository(firestore, parentRepository) {
2306
+ var _this = _super.call(this) || this;
2307
+ _this.firestore = firestore;
2308
+ _this.parentRepository = parentRepository;
2309
+ _this.collectionName = 'variants';
2310
+ _this.parentIdField = 'productId';
2311
+ _this.model = Variant;
2312
+ return _this;
2313
+ }
2314
+ return ProductVariantFirestoreRepository;
2318
2315
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product)));
2319
2316
 
2320
- var SubscriptionProductFirestoreRepository = /** @class */ (function (_super) {
2321
- __extends(SubscriptionProductFirestoreRepository, _super);
2322
- function SubscriptionProductFirestoreRepository(firestore) {
2323
- var _this = _super.call(this) || this;
2324
- _this.firestore = firestore;
2325
- _this.collectionName = 'subscriptionProducts';
2326
- _this.model = Product;
2327
- return _this;
2328
- }
2329
- return SubscriptionProductFirestoreRepository;
2317
+ var SubscriptionProductFirestoreRepository = /** @class */ (function (_super) {
2318
+ __extends(SubscriptionProductFirestoreRepository, _super);
2319
+ function SubscriptionProductFirestoreRepository(firestore) {
2320
+ var _this = _super.call(this) || this;
2321
+ _this.firestore = firestore;
2322
+ _this.collectionName = 'subscriptionProducts';
2323
+ _this.model = Product;
2324
+ return _this;
2325
+ }
2326
+ return SubscriptionProductFirestoreRepository;
2330
2327
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2331
2328
 
2332
- var CheckoutFirestoreRepository = /** @class */ (function (_super) {
2333
- __extends(CheckoutFirestoreRepository, _super);
2334
- function CheckoutFirestoreRepository(firestore) {
2335
- var _this = _super.call(this) || this;
2336
- _this.firestore = firestore;
2337
- _this.collectionName = 'checkouts';
2338
- _this.model = Checkout;
2339
- return _this;
2340
- }
2341
- return CheckoutFirestoreRepository;
2329
+ var CheckoutFirestoreRepository = /** @class */ (function (_super) {
2330
+ __extends(CheckoutFirestoreRepository, _super);
2331
+ function CheckoutFirestoreRepository(firestore) {
2332
+ var _this = _super.call(this) || this;
2333
+ _this.firestore = firestore;
2334
+ _this.collectionName = 'checkouts';
2335
+ _this.model = Checkout;
2336
+ return _this;
2337
+ }
2338
+ return CheckoutFirestoreRepository;
2342
2339
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2343
2340
 
2344
- var CouponFirestoreRepository = /** @class */ (function (_super) {
2345
- __extends(CouponFirestoreRepository, _super);
2346
- function CouponFirestoreRepository(firestore) {
2347
- var _this = _super.call(this) || this;
2348
- _this.firestore = firestore;
2349
- _this.collectionName = 'coupons';
2350
- _this.model = Coupon;
2351
- return _this;
2352
- }
2353
- CouponFirestoreRepository.prototype.buildModelInstance = function () {
2354
- var _a = _super.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2355
- return {
2356
- toFirestore: function (data) {
2357
- var plain = toFirestore(data);
2358
- if (!!data.expiresIn)
2359
- plain.expiresIn = data.expiresIn.getTime();
2360
- return plain;
2361
- },
2362
- fromFirestore: function (snap) {
2363
- var instance = fromFirestore(snap);
2364
- if (!lodash.isNil(instance.expiresIn))
2365
- instance.expiresIn = new Date(snap.data().expiresIn);
2366
- return instance;
2367
- },
2368
- };
2369
- };
2370
- return CouponFirestoreRepository;
2341
+ var CouponFirestoreRepository = /** @class */ (function (_super) {
2342
+ __extends(CouponFirestoreRepository, _super);
2343
+ function CouponFirestoreRepository(firestore) {
2344
+ var _this = _super.call(this) || this;
2345
+ _this.firestore = firestore;
2346
+ _this.collectionName = 'coupons';
2347
+ _this.model = Coupon;
2348
+ return _this;
2349
+ }
2350
+ CouponFirestoreRepository.prototype.buildModelInstance = function () {
2351
+ var _a = _super.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2352
+ return {
2353
+ toFirestore: function (data) {
2354
+ var plain = toFirestore(data);
2355
+ if (!!data.expiresIn)
2356
+ plain.expiresIn = data.expiresIn.getTime();
2357
+ return plain;
2358
+ },
2359
+ fromFirestore: function (snap) {
2360
+ var instance = fromFirestore(snap);
2361
+ if (!lodash.isNil(instance.expiresIn))
2362
+ instance.expiresIn = new Date(snap.data().expiresIn);
2363
+ return instance;
2364
+ },
2365
+ };
2366
+ };
2367
+ return CouponFirestoreRepository;
2371
2368
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2372
2369
 
2373
- var OrderFirestoreRepository = /** @class */ (function (_super) {
2374
- __extends(OrderFirestoreRepository, _super);
2375
- function OrderFirestoreRepository(firestore) {
2376
- var _this = _super.call(this) || this;
2377
- _this.firestore = firestore;
2378
- _this.collectionName = 'orders';
2379
- _this.model = Order;
2380
- return _this;
2381
- }
2382
- return OrderFirestoreRepository;
2370
+ var OrderFirestoreRepository = /** @class */ (function (_super) {
2371
+ __extends(OrderFirestoreRepository, _super);
2372
+ function OrderFirestoreRepository(firestore) {
2373
+ var _this = _super.call(this) || this;
2374
+ _this.firestore = firestore;
2375
+ _this.collectionName = 'orders';
2376
+ _this.model = Order;
2377
+ return _this;
2378
+ }
2379
+ return OrderFirestoreRepository;
2383
2380
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2384
2381
 
2385
- var PaymentFirestoreRepository = /** @class */ (function (_super) {
2386
- __extends(PaymentFirestoreRepository, _super);
2387
- function PaymentFirestoreRepository(firestore) {
2388
- var _this = _super.call(this) || this;
2389
- _this.firestore = firestore;
2390
- _this.collectionName = 'payments';
2391
- _this.model = Payment;
2392
- return _this;
2393
- }
2394
- return PaymentFirestoreRepository;
2382
+ var PaymentFirestoreRepository = /** @class */ (function (_super) {
2383
+ __extends(PaymentFirestoreRepository, _super);
2384
+ function PaymentFirestoreRepository(firestore) {
2385
+ var _this = _super.call(this) || this;
2386
+ _this.firestore = firestore;
2387
+ _this.collectionName = 'payments';
2388
+ _this.model = Payment;
2389
+ return _this;
2390
+ }
2391
+ return PaymentFirestoreRepository;
2395
2392
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2396
2393
 
2397
- var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
2398
- __extends(CheckoutSubscriptionFirestoreRepository, _super);
2399
- function CheckoutSubscriptionFirestoreRepository(firestore) {
2400
- var _this = _super.call(this) || this;
2401
- _this.firestore = firestore;
2402
- _this.collectionName = 'checkoutsSubscription';
2403
- _this.model = CheckoutSubscription;
2404
- return _this;
2405
- }
2406
- return CheckoutSubscriptionFirestoreRepository;
2394
+ var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
2395
+ __extends(CheckoutSubscriptionFirestoreRepository, _super);
2396
+ function CheckoutSubscriptionFirestoreRepository(firestore) {
2397
+ var _this = _super.call(this) || this;
2398
+ _this.firestore = firestore;
2399
+ _this.collectionName = 'checkoutsSubscription';
2400
+ _this.model = CheckoutSubscription;
2401
+ return _this;
2402
+ }
2403
+ return CheckoutSubscriptionFirestoreRepository;
2407
2404
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2408
2405
 
2409
- var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
2410
- __extends(SubscriptionPlanFirestoreRepository, _super);
2411
- function SubscriptionPlanFirestoreRepository(firestore) {
2412
- var _this = _super.call(this) || this;
2413
- _this.firestore = firestore;
2414
- _this.collectionName = 'subscriptionPlans';
2415
- _this.model = SubscriptionPlan;
2416
- return _this;
2417
- }
2418
- return SubscriptionPlanFirestoreRepository;
2406
+ var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
2407
+ __extends(SubscriptionPlanFirestoreRepository, _super);
2408
+ function SubscriptionPlanFirestoreRepository(firestore) {
2409
+ var _this = _super.call(this) || this;
2410
+ _this.firestore = firestore;
2411
+ _this.collectionName = 'subscriptionPlans';
2412
+ _this.model = SubscriptionPlan;
2413
+ return _this;
2414
+ }
2415
+ return SubscriptionPlanFirestoreRepository;
2419
2416
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2420
2417
 
2421
- var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
2422
- __extends(Buy2WinFirestoreRepository, _super);
2423
- function Buy2WinFirestoreRepository(firestore) {
2424
- var _this = _super.call(this) || this;
2425
- _this.firestore = firestore;
2426
- _this.collectionName = 'buy2win';
2427
- _this.model = Buy2Win;
2428
- return _this;
2429
- }
2430
- return Buy2WinFirestoreRepository;
2418
+ var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
2419
+ __extends(Buy2WinFirestoreRepository, _super);
2420
+ function Buy2WinFirestoreRepository(firestore) {
2421
+ var _this = _super.call(this) || this;
2422
+ _this.firestore = firestore;
2423
+ _this.collectionName = 'buy2win';
2424
+ _this.model = Buy2Win;
2425
+ return _this;
2426
+ }
2427
+ return Buy2WinFirestoreRepository;
2431
2428
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2432
2429
 
2433
- var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
2434
- __extends(LegacyOrderFirestoreRepository, _super);
2435
- function LegacyOrderFirestoreRepository(firestore) {
2436
- var _this = _super.call(this, firestore) || this;
2437
- _this.firestore = firestore;
2438
- _this.collectionName = 'legacyOrders';
2439
- return _this;
2440
- }
2441
- return LegacyOrderFirestoreRepository;
2430
+ var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
2431
+ __extends(LegacyOrderFirestoreRepository, _super);
2432
+ function LegacyOrderFirestoreRepository(firestore) {
2433
+ var _this = _super.call(this, firestore) || this;
2434
+ _this.firestore = firestore;
2435
+ _this.collectionName = 'legacyOrders';
2436
+ return _this;
2437
+ }
2438
+ return LegacyOrderFirestoreRepository;
2442
2439
  }(OrderFirestoreRepository));
2443
2440
 
2444
- var HomeFirestoreRepository = /** @class */ (function (_super) {
2445
- __extends(HomeFirestoreRepository, _super);
2446
- function HomeFirestoreRepository(firestore) {
2447
- var _this = _super.call(this) || this;
2448
- _this.firestore = firestore;
2449
- _this.homeToFirestore = function (home) {
2450
- var _a;
2451
- if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
2452
- home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.homeCategoryGroupToPlain);
2453
- home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.homeCategoryGroupToPlain);
2454
- home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.homeCategoryGroupToPlain);
2455
- }
2456
- return home;
2457
- };
2458
- _this.homeCategoryGroupToPlain = function (homeCategoryGroup) { return ({
2459
- category: homeCategoryGroup.category.toPlain(),
2460
- products: homeCategoryGroup.products.map(function (product) { return product.toPlain(); }),
2461
- }); };
2462
- _this.homeFromFirestore = function (home) {
2463
- var _a;
2464
- if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
2465
- home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.plainToHomeCategoryGroup);
2466
- home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.plainToHomeCategoryGroup);
2467
- home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.plainToHomeCategoryGroup);
2468
- home.data.createdAt =
2469
- home.data.createdAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.createdAt.toDate() : home.data.createdAt;
2470
- home.data.expiresAt =
2471
- home.data.expiresAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.expiresAt.toDate() : home.data.expiresAt;
2472
- }
2473
- return home;
2474
- };
2475
- _this.plainToHomeCategoryGroup = function (homeCategoryGroup) { return ({
2476
- category: Category.toInstance(homeCategoryGroup.category),
2477
- products: homeCategoryGroup.products.map(function (product) { return Product.toInstance(product); }),
2478
- }); };
2479
- _this.collectionName = 'dms';
2480
- _this.model = Home;
2481
- return _this;
2482
- }
2483
- HomeFirestoreRepository.prototype.buildModelInstance = function () {
2484
- var _this = this;
2485
- var _b = _super.prototype.buildModelInstance.call(this), fromFirestore = _b.fromFirestore, toFirestore = _b.toFirestore;
2486
- return {
2487
- toFirestore: function (data) {
2488
- var modifiedData = _this.homeToFirestore(data);
2489
- return toFirestore(modifiedData);
2490
- },
2491
- fromFirestore: function (snap) {
2492
- var instance = fromFirestore(snap);
2493
- return _this.homeFromFirestore(instance);
2494
- },
2495
- };
2496
- };
2497
- return HomeFirestoreRepository;
2441
+ var HomeFirestoreRepository = /** @class */ (function (_super) {
2442
+ __extends(HomeFirestoreRepository, _super);
2443
+ function HomeFirestoreRepository(firestore) {
2444
+ var _this = _super.call(this) || this;
2445
+ _this.firestore = firestore;
2446
+ _this.homeToFirestore = function (home) {
2447
+ var _a;
2448
+ if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
2449
+ home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.homeCategoryGroupToPlain);
2450
+ home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.homeCategoryGroupToPlain);
2451
+ home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.homeCategoryGroupToPlain);
2452
+ }
2453
+ return home;
2454
+ };
2455
+ _this.homeCategoryGroupToPlain = function (homeCategoryGroup) { return ({
2456
+ category: homeCategoryGroup.category.toPlain(),
2457
+ products: homeCategoryGroup.products.map(function (product) { return product.toPlain(); }),
2458
+ }); };
2459
+ _this.homeFromFirestore = function (home) {
2460
+ var _a;
2461
+ if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
2462
+ home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.plainToHomeCategoryGroup);
2463
+ home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.plainToHomeCategoryGroup);
2464
+ home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.plainToHomeCategoryGroup);
2465
+ home.data.createdAt =
2466
+ home.data.createdAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.createdAt.toDate() : home.data.createdAt;
2467
+ home.data.expiresAt =
2468
+ home.data.expiresAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.expiresAt.toDate() : home.data.expiresAt;
2469
+ }
2470
+ return home;
2471
+ };
2472
+ _this.plainToHomeCategoryGroup = function (homeCategoryGroup) { return ({
2473
+ category: Category.toInstance(homeCategoryGroup.category),
2474
+ products: homeCategoryGroup.products.map(function (product) { return Product.toInstance(product); }),
2475
+ }); };
2476
+ _this.collectionName = 'dms';
2477
+ _this.model = Home;
2478
+ return _this;
2479
+ }
2480
+ HomeFirestoreRepository.prototype.buildModelInstance = function () {
2481
+ var _this = this;
2482
+ var _b = _super.prototype.buildModelInstance.call(this), fromFirestore = _b.fromFirestore, toFirestore = _b.toFirestore;
2483
+ return {
2484
+ toFirestore: function (data) {
2485
+ var modifiedData = _this.homeToFirestore(data);
2486
+ return toFirestore(modifiedData);
2487
+ },
2488
+ fromFirestore: function (snap) {
2489
+ var instance = fromFirestore(snap);
2490
+ return _this.homeFromFirestore(instance);
2491
+ },
2492
+ };
2493
+ };
2494
+ return HomeFirestoreRepository;
2498
2495
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2499
2496
 
2500
- var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
2501
- __extends(ShopMenuFirestoreRepository, _super);
2502
- function ShopMenuFirestoreRepository(firestore) {
2503
- var _this = _super.call(this) || this;
2504
- _this.firestore = firestore;
2505
- _this.collectionName = 'shopMenus';
2506
- _this.model = ShopMenu;
2507
- return _this;
2508
- }
2509
- return ShopMenuFirestoreRepository;
2497
+ var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
2498
+ __extends(ShopMenuFirestoreRepository, _super);
2499
+ function ShopMenuFirestoreRepository(firestore) {
2500
+ var _this = _super.call(this) || this;
2501
+ _this.firestore = firestore;
2502
+ _this.collectionName = 'shopMenus';
2503
+ _this.model = ShopMenu;
2504
+ return _this;
2505
+ }
2506
+ return ShopMenuFirestoreRepository;
2510
2507
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2511
2508
 
2512
- var AuthenticationFirebaseAuthService = /** @class */ (function () {
2513
- function AuthenticationFirebaseAuthService(firebaseAuth) {
2514
- this.firebaseAuth = firebaseAuth;
2515
- }
2516
- AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
2517
- return __awaiter(this, void 0, void 0, function () {
2518
- var credentials, user;
2519
- return __generator(this, function (_a) {
2520
- switch (_a.label) {
2521
- case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
2522
- case 1:
2523
- credentials = _a.sent();
2524
- user = credentials.user;
2525
- return [2 /*return*/, {
2526
- id: user.uid,
2527
- displayName: user.displayName,
2528
- email: user.email,
2529
- phone: user.phoneNumber,
2530
- isAnonymous: false,
2531
- }];
2532
- }
2533
- });
2534
- });
2535
- };
2536
- AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
2537
- return __awaiter(this, void 0, void 0, function () {
2538
- var credentials, user;
2539
- return __generator(this, function (_a) {
2540
- switch (_a.label) {
2541
- case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
2542
- case 1:
2543
- credentials = _a.sent();
2544
- user = credentials.user;
2545
- return [2 /*return*/, {
2546
- id: user.uid,
2547
- displayName: user.displayName,
2548
- email: user.email,
2549
- phone: user.phoneNumber,
2550
- isAnonymous: false,
2551
- }];
2552
- }
2553
- });
2554
- });
2555
- };
2556
- AuthenticationFirebaseAuthService.prototype.signOut = function () {
2557
- return __awaiter(this, void 0, void 0, function () {
2558
- return __generator(this, function (_a) {
2559
- this.firebaseAuth.signOut();
2560
- return [2 /*return*/];
2561
- });
2562
- });
2563
- };
2564
- AuthenticationFirebaseAuthService.prototype.signInAnonymously = function () {
2565
- return __awaiter(this, void 0, void 0, function () {
2566
- var auth, user;
2567
- return __generator(this, function (_a) {
2568
- switch (_a.label) {
2569
- case 0: return [4 /*yield*/, this.firebaseAuth.signInAnonymously()];
2570
- case 1:
2571
- auth = _a.sent();
2572
- user = auth.user;
2573
- user.id = auth.user.uid;
2574
- return [2 /*return*/, user];
2575
- }
2576
- });
2577
- });
2578
- };
2579
- AuthenticationFirebaseAuthService.prototype.sendPasswordResetEmail = function (email) {
2580
- return __awaiter(this, void 0, void 0, function () {
2581
- return __generator(this, function (_a) {
2582
- return [2 /*return*/, this.firebaseAuth.sendPasswordResetEmail(email)];
2583
- });
2584
- });
2585
- };
2586
- return AuthenticationFirebaseAuthService;
2509
+ var AuthenticationFirebaseAuthService = /** @class */ (function () {
2510
+ function AuthenticationFirebaseAuthService(firebaseAuth) {
2511
+ this.firebaseAuth = firebaseAuth;
2512
+ }
2513
+ AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
2514
+ return __awaiter(this, void 0, void 0, function () {
2515
+ var credentials, user;
2516
+ return __generator(this, function (_a) {
2517
+ switch (_a.label) {
2518
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
2519
+ case 1:
2520
+ credentials = _a.sent();
2521
+ user = credentials.user;
2522
+ return [2 /*return*/, {
2523
+ id: user.uid,
2524
+ displayName: user.displayName,
2525
+ email: user.email,
2526
+ phone: user.phoneNumber,
2527
+ isAnonymous: false,
2528
+ }];
2529
+ }
2530
+ });
2531
+ });
2532
+ };
2533
+ AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
2534
+ return __awaiter(this, void 0, void 0, function () {
2535
+ var credentials, user;
2536
+ return __generator(this, function (_a) {
2537
+ switch (_a.label) {
2538
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
2539
+ case 1:
2540
+ credentials = _a.sent();
2541
+ user = credentials.user;
2542
+ return [2 /*return*/, {
2543
+ id: user.uid,
2544
+ displayName: user.displayName,
2545
+ email: user.email,
2546
+ phone: user.phoneNumber,
2547
+ isAnonymous: false,
2548
+ }];
2549
+ }
2550
+ });
2551
+ });
2552
+ };
2553
+ AuthenticationFirebaseAuthService.prototype.signOut = function () {
2554
+ return __awaiter(this, void 0, void 0, function () {
2555
+ return __generator(this, function (_a) {
2556
+ this.firebaseAuth.signOut();
2557
+ return [2 /*return*/];
2558
+ });
2559
+ });
2560
+ };
2561
+ AuthenticationFirebaseAuthService.prototype.signInAnonymously = function () {
2562
+ return __awaiter(this, void 0, void 0, function () {
2563
+ var auth, user;
2564
+ return __generator(this, function (_a) {
2565
+ switch (_a.label) {
2566
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInAnonymously()];
2567
+ case 1:
2568
+ auth = _a.sent();
2569
+ user = auth.user;
2570
+ user.id = auth.user.uid;
2571
+ return [2 /*return*/, user];
2572
+ }
2573
+ });
2574
+ });
2575
+ };
2576
+ AuthenticationFirebaseAuthService.prototype.sendPasswordResetEmail = function (email) {
2577
+ return __awaiter(this, void 0, void 0, function () {
2578
+ return __generator(this, function (_a) {
2579
+ return [2 /*return*/, this.firebaseAuth.sendPasswordResetEmail(email)];
2580
+ });
2581
+ });
2582
+ };
2583
+ return AuthenticationFirebaseAuthService;
2587
2584
  }());
2588
2585
 
2589
- var RegisterFirebaseAuthService = /** @class */ (function () {
2590
- function RegisterFirebaseAuthService(firebaseAuth) {
2591
- this.firebaseAuth = firebaseAuth;
2592
- }
2593
- RegisterFirebaseAuthService.prototype.register = function (params) {
2594
- return __awaiter(this, void 0, void 0, function () {
2595
- var auth, user, error_1;
2596
- return __generator(this, function (_a) {
2597
- switch (_a.label) {
2598
- case 0:
2599
- _a.trys.push([0, 2, , 3]);
2600
- return [4 /*yield*/, this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password)];
2601
- case 1:
2602
- auth = _a.sent();
2603
- user = auth.user;
2604
- user.sendEmailVerification();
2605
- user.id = auth.user.uid;
2606
- return [2 /*return*/, user];
2607
- case 2:
2608
- error_1 = _a.sent();
2609
- if (error_1.code === 'auth/email-already-in-use')
2610
- throw new UserAlreadyRegisteredError('Email already registered');
2611
- if (error_1.code === 'auth/weak-password')
2612
- throw new WeakPasswordError();
2613
- throw error_1;
2614
- case 3: return [2 /*return*/];
2615
- }
2616
- });
2617
- });
2618
- };
2619
- return RegisterFirebaseAuthService;
2586
+ var RegisterFirebaseAuthService = /** @class */ (function () {
2587
+ function RegisterFirebaseAuthService(firebaseAuth) {
2588
+ this.firebaseAuth = firebaseAuth;
2589
+ }
2590
+ RegisterFirebaseAuthService.prototype.register = function (params) {
2591
+ return __awaiter(this, void 0, void 0, function () {
2592
+ var auth, user, error_1;
2593
+ return __generator(this, function (_a) {
2594
+ switch (_a.label) {
2595
+ case 0:
2596
+ _a.trys.push([0, 2, , 3]);
2597
+ return [4 /*yield*/, this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password)];
2598
+ case 1:
2599
+ auth = _a.sent();
2600
+ user = auth.user;
2601
+ user.sendEmailVerification();
2602
+ user.id = auth.user.uid;
2603
+ return [2 /*return*/, user];
2604
+ case 2:
2605
+ error_1 = _a.sent();
2606
+ if (error_1.code === 'auth/email-already-in-use')
2607
+ throw new UserAlreadyRegisteredError('Email already registered');
2608
+ if (error_1.code === 'auth/weak-password')
2609
+ throw new WeakPasswordError();
2610
+ throw error_1;
2611
+ case 3: return [2 /*return*/];
2612
+ }
2613
+ });
2614
+ });
2615
+ };
2616
+ return RegisterFirebaseAuthService;
2620
2617
  }());
2621
2618
 
2622
- /**
2623
- * Generated bundle index. Do not edit.
2619
+ /**
2620
+ * Generated bundle index. Do not edit.
2624
2621
  */
2625
2622
 
2626
2623
  Object.defineProperty(exports, 'add', {