@infrab4a/connect 0.17.0-beta.6 → 0.17.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. package/README.md +24 -24
  2. package/bundles/infrab4a-connect.umd.js +2392 -2390
  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 +32 -32
  80. package/domain/shopping/models/coupons/enums/coupon-club-mens.enum.d.ts +5 -5
  81. package/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +4 -4
  82. package/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +4 -4
  83. package/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +7 -5
  84. package/domain/shopping/models/coupons/enums/index.d.ts +3 -3
  85. package/domain/shopping/models/coupons/index.d.ts +2 -2
  86. package/domain/shopping/models/enums/checkout-types.enum.d.ts +5 -5
  87. package/domain/shopping/models/enums/index.d.ts +2 -2
  88. package/domain/shopping/models/enums/order-status.enum.d.ts +10 -10
  89. package/domain/shopping/models/index.d.ts +11 -11
  90. package/domain/shopping/models/line-item.d.ts +8 -8
  91. package/domain/shopping/models/order.d.ts +9 -9
  92. package/domain/shopping/models/payment.d.ts +69 -69
  93. package/domain/shopping/models/shipping-method.d.ts +18 -18
  94. package/domain/shopping/models/subscription/checkout.d.ts +23 -23
  95. package/domain/shopping/models/subscription/index.d.ts +2 -2
  96. package/domain/shopping/models/subscription/plan.d.ts +12 -12
  97. package/domain/shopping/models/types/index.d.ts +7 -7
  98. package/domain/shopping/models/types/payment-address.type.d.ts +12 -12
  99. package/domain/shopping/models/types/payment-billing.type.d.ts +7 -7
  100. package/domain/shopping/models/types/payment-card.type.d.ts +14 -14
  101. package/domain/shopping/models/types/payment-customer.type.d.ts +18 -18
  102. package/domain/shopping/models/types/payment-document.type.d.ts +6 -6
  103. package/domain/shopping/models/types/payment-item.type.d.ts +11 -11
  104. package/domain/shopping/models/types/payment-shipping.type.d.ts +10 -10
  105. package/domain/shopping/repositories/buy-2-win.repository.d.ts +4 -4
  106. package/domain/shopping/repositories/checkout.repository.d.ts +4 -4
  107. package/domain/shopping/repositories/coupon.repository.d.ts +4 -4
  108. package/domain/shopping/repositories/index.d.ts +7 -7
  109. package/domain/shopping/repositories/legacy-order.repository.d.ts +3 -3
  110. package/domain/shopping/repositories/order.repository.d.ts +4 -4
  111. package/domain/shopping/repositories/payment.repository.d.ts +4 -4
  112. package/domain/shopping/repositories/subscription/checkout.repository.d.ts +4 -4
  113. package/domain/shopping/repositories/subscription/index.d.ts +2 -2
  114. package/domain/shopping/repositories/subscription/plan.repository.d.ts +4 -4
  115. package/domain/users/errors/index.d.ts +3 -3
  116. package/domain/users/errors/unauthorized.error.d.ts +4 -4
  117. package/domain/users/errors/user-already-registered.error.d.ts +4 -4
  118. package/domain/users/errors/weak-password.error.d.ts +4 -4
  119. package/domain/users/index.d.ts +5 -5
  120. package/domain/users/models/beauty-profile.d.ts +12 -12
  121. package/domain/users/models/enums/accessory-importances.enum.d.ts +5 -5
  122. package/domain/users/models/enums/area.enum.d.ts +11 -11
  123. package/domain/users/models/enums/beard-problems.enum.d.ts +9 -9
  124. package/domain/users/models/enums/beard-sizes.enum.d.ts +7 -7
  125. package/domain/users/models/enums/beauty-product-importances.enum.d.ts +6 -6
  126. package/domain/users/models/enums/body-problems.enum.d.ts +11 -11
  127. package/domain/users/models/enums/body-shapes.enum.d.ts +7 -7
  128. package/domain/users/models/enums/body-tattoos.enum.d.ts +5 -5
  129. package/domain/users/models/enums/face-skin-oilinesses.enum.d.ts +7 -7
  130. package/domain/users/models/enums/face-skin-problems.enum.d.ts +10 -10
  131. package/domain/users/models/enums/face-skin-tones.enum.d.ts +8 -8
  132. package/domain/users/models/enums/family-incomes.enum.d.ts +8 -8
  133. package/domain/users/models/enums/fragrance-importances.enum.d.ts +5 -5
  134. package/domain/users/models/enums/hair-colors.enum.d.ts +10 -10
  135. package/domain/users/models/enums/hair-problems.enum.d.ts +10 -10
  136. package/domain/users/models/enums/hair-strands.enum.d.ts +8 -8
  137. package/domain/users/models/enums/hair-types.enum.d.ts +7 -7
  138. package/domain/users/models/enums/index.d.ts +20 -20
  139. package/domain/users/models/enums/office-position.enum.d.ts +6 -6
  140. package/domain/users/models/enums/product-spents.enum.d.ts +8 -8
  141. package/domain/users/models/enums/user-type.enum.d.ts +8 -8
  142. package/domain/users/models/index.d.ts +7 -7
  143. package/domain/users/models/lead.d.ts +9 -9
  144. package/domain/users/models/subscription/edition.d.ts +17 -17
  145. package/domain/users/models/subscription/enums/billing-status.enum.d.ts +3 -3
  146. package/domain/users/models/subscription/enums/edition-status.enum.d.ts +4 -4
  147. package/domain/users/models/subscription/enums/index.d.ts +4 -4
  148. package/domain/users/models/subscription/enums/payment-type.enum.d.ts +5 -5
  149. package/domain/users/models/subscription/enums/status.enum.d.ts +4 -4
  150. package/domain/users/models/subscription/index.d.ts +4 -4
  151. package/domain/users/models/subscription/payment.d.ts +14 -14
  152. package/domain/users/models/subscription/subscription.d.ts +30 -30
  153. package/domain/users/models/user-address.d.ts +7 -7
  154. package/domain/users/models/user-payment-method.d.ts +14 -14
  155. package/domain/users/models/user.d.ts +25 -25
  156. package/domain/users/repositories/beauty-profile.repository.d.ts +4 -4
  157. package/domain/users/repositories/edition.repository.d.ts +4 -4
  158. package/domain/users/repositories/index.d.ts +8 -8
  159. package/domain/users/repositories/lead.repository.d.ts +4 -4
  160. package/domain/users/repositories/subscription-payment.repository.d.ts +4 -4
  161. package/domain/users/repositories/subscription.repository.d.ts +4 -4
  162. package/domain/users/repositories/user-address.repository.d.ts +4 -4
  163. package/domain/users/repositories/user-payment-method.repository.d.ts +4 -4
  164. package/domain/users/repositories/user.repository.d.ts +6 -6
  165. package/domain/users/services/authentication.service.d.ts +12 -12
  166. package/domain/users/services/index.d.ts +3 -3
  167. package/domain/users/services/register.service.d.ts +7 -7
  168. package/domain/users/services/types/basic-user-data.type.d.ts +4 -4
  169. package/domain/users/services/types/index.d.ts +1 -1
  170. package/domain/users/use-cases/authentication.d.ts +21 -21
  171. package/domain/users/use-cases/index.d.ts +4 -4
  172. package/domain/users/use-cases/recovery-password.d.ts +6 -6
  173. package/domain/users/use-cases/register.d.ts +13 -13
  174. package/domain/users/use-cases/signout.d.ts +6 -6
  175. package/errors/duplicated-results.error.d.ts +4 -4
  176. package/errors/index.d.ts +4 -4
  177. package/errors/invalid-argument.error.d.ts +4 -4
  178. package/errors/not-found.error.d.ts +4 -4
  179. package/errors/required-argument.error.d.ts +5 -5
  180. package/esm2015/domain/catalog/index.js +3 -3
  181. package/esm2015/domain/catalog/models/category.js +7 -7
  182. package/esm2015/domain/catalog/models/enums/index.js +2 -2
  183. package/esm2015/domain/catalog/models/enums/shops.enum.js +8 -8
  184. package/esm2015/domain/catalog/models/index.js +6 -6
  185. package/esm2015/domain/catalog/models/product.js +11 -11
  186. package/esm2015/domain/catalog/models/types/category-condition.type.js +2 -2
  187. package/esm2015/domain/catalog/models/types/category-filter.type.js +2 -2
  188. package/esm2015/domain/catalog/models/types/index.js +8 -8
  189. package/esm2015/domain/catalog/models/types/product-review.type.js +2 -2
  190. package/esm2015/domain/catalog/models/types/shops-description.type.js +2 -2
  191. package/esm2015/domain/catalog/models/types/shops-price.type.js +2 -2
  192. package/esm2015/domain/catalog/models/types/stock.type.js +2 -2
  193. package/esm2015/domain/catalog/models/types/variant-grade.type.js +2 -2
  194. package/esm2015/domain/catalog/models/variant.js +7 -7
  195. package/esm2015/domain/catalog/repositories/category.repository.js +2 -2
  196. package/esm2015/domain/catalog/repositories/index.js +5 -5
  197. package/esm2015/domain/catalog/repositories/product.repository.js +2 -2
  198. package/esm2015/domain/catalog/repositories/subscription-product.repository.js +2 -2
  199. package/esm2015/domain/catalog/repositories/variant.repository.js +2 -2
  200. package/esm2015/domain/general/index.js +3 -3
  201. package/esm2015/domain/general/model/base-model-with-identifier-fields.js +2 -2
  202. package/esm2015/domain/general/model/base.model.js +13 -13
  203. package/esm2015/domain/general/model/identifier-fields.js +2 -2
  204. package/esm2015/domain/general/model/index.js +5 -5
  205. package/esm2015/domain/general/model/types/base-model-builder.type.js +2 -2
  206. package/esm2015/domain/general/model/types/index.js +4 -4
  207. package/esm2015/domain/general/model/types/non-function-properties.type.js +2 -2
  208. package/esm2015/domain/general/model/types/non-function-property-name.type.js +2 -2
  209. package/esm2015/domain/general/repository/create.repository.js +2 -2
  210. package/esm2015/domain/general/repository/crud.repository.js +2 -2
  211. package/esm2015/domain/general/repository/delete.repository.js +2 -2
  212. package/esm2015/domain/general/repository/enums/index.js +3 -3
  213. package/esm2015/domain/general/repository/enums/update-option-actions.enum.js +9 -9
  214. package/esm2015/domain/general/repository/enums/where.enum.js +12 -12
  215. package/esm2015/domain/general/repository/find.repository.js +2 -2
  216. package/esm2015/domain/general/repository/get.repository.js +2 -2
  217. package/esm2015/domain/general/repository/index.js +10 -10
  218. package/esm2015/domain/general/repository/read.repository.js +2 -2
  219. package/esm2015/domain/general/repository/types/index.js +6 -6
  220. package/esm2015/domain/general/repository/types/repository-find-filters.type.js +2 -2
  221. package/esm2015/domain/general/repository/types/repository-find-result.type.js +2 -2
  222. package/esm2015/domain/general/repository/types/repository-limit-options.type.js +2 -2
  223. package/esm2015/domain/general/repository/types/repository-order-by-list.type.js +2 -2
  224. package/esm2015/domain/general/repository/types/repository-update-params.type.js +2 -2
  225. package/esm2015/domain/general/repository/update.repository.js +2 -2
  226. package/esm2015/domain/index.js +7 -7
  227. package/esm2015/domain/location/index.js +2 -2
  228. package/esm2015/domain/location/models/address.js +4 -4
  229. package/esm2015/domain/location/models/index.js +3 -3
  230. package/esm2015/domain/location/models/types/index.js +4 -4
  231. package/esm2015/domain/location/models/types/location-bound.type.js +2 -2
  232. package/esm2015/domain/location/models/types/location-geometry.type.js +2 -2
  233. package/esm2015/domain/location/models/types/location-lat-lng.type.js +2 -2
  234. package/esm2015/domain/shop-settings/enums/filter-type.enum.js +21 -21
  235. package/esm2015/domain/shop-settings/enums/index.js +3 -3
  236. package/esm2015/domain/shop-settings/enums/questions-filters.enum.js +21 -21
  237. package/esm2015/domain/shop-settings/helpers/beauty-questions.helper.js +46 -46
  238. package/esm2015/domain/shop-settings/helpers/index.js +2 -2
  239. package/esm2015/domain/shop-settings/index.js +5 -5
  240. package/esm2015/domain/shop-settings/models/home.js +7 -7
  241. package/esm2015/domain/shop-settings/models/index.js +4 -4
  242. package/esm2015/domain/shop-settings/models/shop-menu.js +7 -7
  243. package/esm2015/domain/shop-settings/models/types/banner.type.js +2 -2
  244. package/esm2015/domain/shop-settings/models/types/benefit.type.js +2 -2
  245. package/esm2015/domain/shop-settings/models/types/home-data.type.js +2 -2
  246. package/esm2015/domain/shop-settings/models/types/index.js +6 -6
  247. package/esm2015/domain/shop-settings/models/types/menu-nav.type.js +2 -2
  248. package/esm2015/domain/shop-settings/models/types/sub-menu.type.js +2 -2
  249. package/esm2015/domain/shop-settings/repositories/home.repository.js +2 -2
  250. package/esm2015/domain/shop-settings/repositories/index.js +3 -3
  251. package/esm2015/domain/shop-settings/repositories/shop-menu.repository.js +2 -2
  252. package/esm2015/domain/shopping/index.js +3 -3
  253. package/esm2015/domain/shopping/models/buy-2-win.js +14 -14
  254. package/esm2015/domain/shopping/models/checkout.js +38 -38
  255. package/esm2015/domain/shopping/models/coupons/coupon.js +38 -38
  256. package/esm2015/domain/shopping/models/coupons/enums/coupon-club-mens.enum.js +7 -7
  257. package/esm2015/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +6 -6
  258. package/esm2015/domain/shopping/models/coupons/enums/coupon-types.enum.js +10 -10
  259. package/esm2015/domain/shopping/models/coupons/enums/exclusivities.enum.js +9 -7
  260. package/esm2015/domain/shopping/models/coupons/enums/index.js +4 -4
  261. package/esm2015/domain/shopping/models/coupons/index.js +3 -3
  262. package/esm2015/domain/shopping/models/enums/checkout-types.enum.js +7 -7
  263. package/esm2015/domain/shopping/models/enums/index.js +3 -3
  264. package/esm2015/domain/shopping/models/enums/order-status.enum.js +12 -12
  265. package/esm2015/domain/shopping/models/index.js +12 -12
  266. package/esm2015/domain/shopping/models/line-item.js +4 -4
  267. package/esm2015/domain/shopping/models/order.js +11 -11
  268. package/esm2015/domain/shopping/models/payment.js +169 -169
  269. package/esm2015/domain/shopping/models/shipping-method.js +7 -7
  270. package/esm2015/domain/shopping/models/subscription/checkout.js +28 -28
  271. package/esm2015/domain/shopping/models/subscription/index.js +3 -3
  272. package/esm2015/domain/shopping/models/subscription/plan.js +7 -7
  273. package/esm2015/domain/shopping/models/types/index.js +8 -8
  274. package/esm2015/domain/shopping/models/types/payment-address.type.js +2 -2
  275. package/esm2015/domain/shopping/models/types/payment-billing.type.js +2 -2
  276. package/esm2015/domain/shopping/models/types/payment-card.type.js +2 -2
  277. package/esm2015/domain/shopping/models/types/payment-customer.type.js +2 -2
  278. package/esm2015/domain/shopping/models/types/payment-document.type.js +2 -2
  279. package/esm2015/domain/shopping/models/types/payment-item.type.js +2 -2
  280. package/esm2015/domain/shopping/models/types/payment-shipping.type.js +2 -2
  281. package/esm2015/domain/shopping/repositories/buy-2-win.repository.js +2 -2
  282. package/esm2015/domain/shopping/repositories/checkout.repository.js +2 -2
  283. package/esm2015/domain/shopping/repositories/coupon.repository.js +2 -2
  284. package/esm2015/domain/shopping/repositories/index.js +8 -8
  285. package/esm2015/domain/shopping/repositories/legacy-order.repository.js +2 -2
  286. package/esm2015/domain/shopping/repositories/order.repository.js +2 -2
  287. package/esm2015/domain/shopping/repositories/payment.repository.js +2 -2
  288. package/esm2015/domain/shopping/repositories/subscription/checkout.repository.js +2 -2
  289. package/esm2015/domain/shopping/repositories/subscription/index.js +3 -3
  290. package/esm2015/domain/shopping/repositories/subscription/plan.repository.js +2 -2
  291. package/esm2015/domain/users/errors/index.js +4 -4
  292. package/esm2015/domain/users/errors/unauthorized.error.js +7 -7
  293. package/esm2015/domain/users/errors/user-already-registered.error.js +7 -7
  294. package/esm2015/domain/users/errors/weak-password.error.js +7 -7
  295. package/esm2015/domain/users/index.js +6 -6
  296. package/esm2015/domain/users/models/beauty-profile.js +12 -12
  297. package/esm2015/domain/users/models/enums/accessory-importances.enum.js +7 -7
  298. package/esm2015/domain/users/models/enums/area.enum.js +13 -13
  299. package/esm2015/domain/users/models/enums/beard-problems.enum.js +11 -11
  300. package/esm2015/domain/users/models/enums/beard-sizes.enum.js +9 -9
  301. package/esm2015/domain/users/models/enums/beauty-product-importances.enum.js +8 -8
  302. package/esm2015/domain/users/models/enums/body-problems.enum.js +13 -13
  303. package/esm2015/domain/users/models/enums/body-shapes.enum.js +9 -9
  304. package/esm2015/domain/users/models/enums/body-tattoos.enum.js +7 -7
  305. package/esm2015/domain/users/models/enums/face-skin-oilinesses.enum.js +9 -9
  306. package/esm2015/domain/users/models/enums/face-skin-problems.enum.js +12 -12
  307. package/esm2015/domain/users/models/enums/face-skin-tones.enum.js +10 -10
  308. package/esm2015/domain/users/models/enums/family-incomes.enum.js +10 -10
  309. package/esm2015/domain/users/models/enums/fragrance-importances.enum.js +7 -7
  310. package/esm2015/domain/users/models/enums/hair-colors.enum.js +12 -12
  311. package/esm2015/domain/users/models/enums/hair-problems.enum.js +12 -12
  312. package/esm2015/domain/users/models/enums/hair-strands.enum.js +10 -10
  313. package/esm2015/domain/users/models/enums/hair-types.enum.js +9 -9
  314. package/esm2015/domain/users/models/enums/index.js +21 -21
  315. package/esm2015/domain/users/models/enums/office-position.enum.js +8 -8
  316. package/esm2015/domain/users/models/enums/product-spents.enum.js +10 -10
  317. package/esm2015/domain/users/models/enums/user-type.enum.js +10 -10
  318. package/esm2015/domain/users/models/index.js +8 -8
  319. package/esm2015/domain/users/models/lead.js +7 -7
  320. package/esm2015/domain/users/models/subscription/edition.js +7 -7
  321. package/esm2015/domain/users/models/subscription/enums/billing-status.enum.js +5 -5
  322. package/esm2015/domain/users/models/subscription/enums/edition-status.enum.js +6 -6
  323. package/esm2015/domain/users/models/subscription/enums/index.js +5 -5
  324. package/esm2015/domain/users/models/subscription/enums/payment-type.enum.js +7 -7
  325. package/esm2015/domain/users/models/subscription/enums/status.enum.js +6 -6
  326. package/esm2015/domain/users/models/subscription/index.js +5 -5
  327. package/esm2015/domain/users/models/subscription/payment.js +14 -14
  328. package/esm2015/domain/users/models/subscription/subscription.js +43 -43
  329. package/esm2015/domain/users/models/user-address.js +7 -7
  330. package/esm2015/domain/users/models/user-payment-method.js +7 -7
  331. package/esm2015/domain/users/models/user.js +26 -26
  332. package/esm2015/domain/users/repositories/beauty-profile.repository.js +2 -2
  333. package/esm2015/domain/users/repositories/edition.repository.js +2 -2
  334. package/esm2015/domain/users/repositories/index.js +9 -9
  335. package/esm2015/domain/users/repositories/lead.repository.js +2 -2
  336. package/esm2015/domain/users/repositories/subscription-payment.repository.js +2 -2
  337. package/esm2015/domain/users/repositories/subscription.repository.js +2 -2
  338. package/esm2015/domain/users/repositories/user-address.repository.js +2 -2
  339. package/esm2015/domain/users/repositories/user-payment-method.repository.js +2 -2
  340. package/esm2015/domain/users/repositories/user.repository.js +2 -2
  341. package/esm2015/domain/users/services/authentication.service.js +2 -2
  342. package/esm2015/domain/users/services/index.js +4 -4
  343. package/esm2015/domain/users/services/register.service.js +2 -2
  344. package/esm2015/domain/users/services/types/basic-user-data.type.js +2 -2
  345. package/esm2015/domain/users/services/types/index.js +2 -2
  346. package/esm2015/domain/users/use-cases/authentication.js +40 -40
  347. package/esm2015/domain/users/use-cases/index.js +5 -5
  348. package/esm2015/domain/users/use-cases/recovery-password.js +12 -12
  349. package/esm2015/domain/users/use-cases/register.js +34 -34
  350. package/esm2015/domain/users/use-cases/signout.js +12 -12
  351. package/esm2015/errors/duplicated-results.error.js +7 -7
  352. package/esm2015/errors/index.js +5 -5
  353. package/esm2015/errors/invalid-argument.error.js +7 -7
  354. package/esm2015/errors/not-found.error.js +7 -7
  355. package/esm2015/errors/required-argument.error.js +8 -8
  356. package/esm2015/index.js +6 -6
  357. package/esm2015/infra/elasticsearch/adapters/axios.adapter.js +22 -22
  358. package/esm2015/infra/elasticsearch/adapters/elastic-search.adapter.js +2 -2
  359. package/esm2015/infra/elasticsearch/adapters/index.js +3 -3
  360. package/esm2015/infra/elasticsearch/index.js +4 -4
  361. package/esm2015/infra/elasticsearch/indexes/index.js +2 -2
  362. package/esm2015/infra/elasticsearch/indexes/products-index.js +59 -59
  363. package/esm2015/infra/elasticsearch/types/elastic-search-result.js +2 -2
  364. package/esm2015/infra/elasticsearch/types/index.js +2 -2
  365. package/esm2015/infra/firebase/auth/authentication-firebase-auth.service.js +52 -52
  366. package/esm2015/infra/firebase/auth/index.js +3 -3
  367. package/esm2015/infra/firebase/auth/register-firebase-auth.service.js +26 -26
  368. package/esm2015/infra/firebase/auth/types/firebase-user-with-id.type.js +2 -2
  369. package/esm2015/infra/firebase/firestore/index.js +4 -4
  370. package/esm2015/infra/firebase/firestore/mixins/index.js +10 -10
  371. package/esm2015/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +31 -31
  372. package/esm2015/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +10 -10
  373. package/esm2015/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +18 -18
  374. package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +87 -87
  375. package/esm2015/infra/firebase/firestore/mixins/with-firestore.mixin.js +26 -26
  376. package/esm2015/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +24 -24
  377. package/esm2015/infra/firebase/firestore/mixins/with-helpers.mixin.js +17 -17
  378. package/esm2015/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +11 -11
  379. package/esm2015/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +45 -45
  380. package/esm2015/infra/firebase/firestore/models/user-search.js +7 -7
  381. package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +70 -70
  382. package/esm2015/infra/firebase/firestore/repositories/catalog/index.js +5 -5
  383. package/esm2015/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +23 -23
  384. package/esm2015/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -14
  385. package/esm2015/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.js +12 -12
  386. package/esm2015/infra/firebase/firestore/repositories/index.js +5 -5
  387. package/esm2015/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +56 -56
  388. package/esm2015/infra/firebase/firestore/repositories/shop-settings/index.js +3 -3
  389. package/esm2015/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +12 -12
  390. package/esm2015/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +12 -12
  391. package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -12
  392. package/esm2015/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +12 -12
  393. package/esm2015/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +29 -29
  394. package/esm2015/infra/firebase/firestore/repositories/shopping/index.js +9 -9
  395. package/esm2015/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +9 -9
  396. package/esm2015/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -12
  397. package/esm2015/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -12
  398. package/esm2015/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +12 -12
  399. package/esm2015/infra/firebase/firestore/repositories/users/index.js +10 -10
  400. package/esm2015/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +12 -12
  401. package/esm2015/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +14 -14
  402. package/esm2015/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +12 -12
  403. package/esm2015/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +14 -14
  404. package/esm2015/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -14
  405. package/esm2015/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +14 -14
  406. package/esm2015/infra/firebase/firestore/repositories/users/user-firestore.repository.js +70 -70
  407. package/esm2015/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.js +14 -14
  408. package/esm2015/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +12 -12
  409. package/esm2015/infra/firebase/firestore/types/firestore-sub.repository.type.js +2 -2
  410. package/esm2015/infra/firebase/firestore/types/firestore.helpers.type.js +2 -2
  411. package/esm2015/infra/firebase/firestore/types/firestore.repository.type.js +2 -2
  412. package/esm2015/infra/firebase/firestore/types/index.js +4 -4
  413. package/esm2015/infra/firebase/index.js +3 -3
  414. package/esm2015/infra/index.js +3 -3
  415. package/esm2015/infrab4a-connect.js +4 -4
  416. package/esm2015/utils/index.js +6 -6
  417. package/esm2015/utils/mixins/base.mixin.js +6 -6
  418. package/esm2015/utils/mixins/index.js +3 -3
  419. package/esm2015/utils/mixins/mixin-ctor.type.js +2 -2
  420. package/esm2015/utils/types/index.js +2 -2
  421. package/esm2015/utils/types/prop.type.js +2 -2
  422. package/fesm2015/infrab4a-connect.js +1655 -1653
  423. package/fesm2015/infrab4a-connect.js.map +1 -1
  424. package/index.d.ts +5 -5
  425. package/infra/elasticsearch/adapters/axios.adapter.d.ts +11 -11
  426. package/infra/elasticsearch/adapters/elastic-search.adapter.d.ts +4 -4
  427. package/infra/elasticsearch/adapters/index.d.ts +2 -2
  428. package/infra/elasticsearch/index.d.ts +3 -3
  429. package/infra/elasticsearch/indexes/index.d.ts +1 -1
  430. package/infra/elasticsearch/indexes/products-index.d.ts +11 -11
  431. package/infra/elasticsearch/types/elastic-search-result.d.ts +7 -7
  432. package/infra/elasticsearch/types/index.d.ts +1 -1
  433. package/infra/firebase/auth/authentication-firebase-auth.service.d.ts +12 -12
  434. package/infra/firebase/auth/index.d.ts +2 -2
  435. package/infra/firebase/auth/register-firebase-auth.service.d.ts +8 -8
  436. package/infra/firebase/auth/types/firebase-user-with-id.type.d.ts +3 -3
  437. package/infra/firebase/firestore/index.d.ts +3 -3
  438. package/infra/firebase/firestore/mixins/index.d.ts +9 -9
  439. package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +17 -17
  440. package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +29 -29
  441. package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +15 -15
  442. package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +20 -20
  443. package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +15 -15
  444. package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +15 -15
  445. package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +10 -10
  446. package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +14 -14
  447. package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +16 -16
  448. package/infra/firebase/firestore/models/user-search.d.ts +9 -9
  449. package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +58 -58
  450. package/infra/firebase/firestore/repositories/catalog/index.d.ts +4 -4
  451. package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +50 -50
  452. package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +60 -60
  453. package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +49 -49
  454. package/infra/firebase/firestore/repositories/index.d.ts +4 -4
  455. package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +57 -57
  456. package/infra/firebase/firestore/repositories/shop-settings/index.d.ts +2 -2
  457. package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +49 -49
  458. package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +49 -49
  459. package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +49 -49
  460. package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +49 -49
  461. package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +53 -53
  462. package/infra/firebase/firestore/repositories/shopping/index.d.ts +8 -8
  463. package/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +7 -7
  464. package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +49 -49
  465. package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +49 -49
  466. package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +49 -49
  467. package/infra/firebase/firestore/repositories/users/index.d.ts +9 -9
  468. package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +49 -49
  469. package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +60 -60
  470. package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +49 -49
  471. package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +60 -60
  472. package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +60 -60
  473. package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +60 -60
  474. package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +60 -60
  475. package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +60 -60
  476. package/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +50 -50
  477. package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +6 -6
  478. package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +8 -8
  479. package/infra/firebase/firestore/types/firestore.repository.type.d.ts +8 -8
  480. package/infra/firebase/firestore/types/index.d.ts +3 -3
  481. package/infra/firebase/index.d.ts +2 -2
  482. package/infra/index.d.ts +2 -2
  483. package/infrab4a-connect.d.ts +5 -5
  484. package/package.json +1 -1
  485. package/utils/index.d.ts +6 -6
  486. package/utils/mixins/base.mixin.d.ts +3 -3
  487. package/utils/mixins/index.d.ts +2 -2
  488. package/utils/mixins/mixin-ctor.type.d.ts +1 -1
  489. package/utils/types/index.d.ts +1 -1
  490. package/utils/types/prop.type.d.ts +1 -1
@@ -10,2614 +10,2616 @@
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";
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";
829
831
  })(exports.Exclusivities || (exports.Exclusivities = {}));
830
832
 
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)
833
+ var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
834
+ var Coupon = /** @class */ (function (_super) {
835
+ __extends(Coupon, _super);
836
+ function Coupon() {
837
+ return _super !== null && _super.apply(this, arguments) || this;
838
+ }
839
+ Object.defineProperty(Coupon.prototype, "isInfluencer", {
840
+ get: function () {
841
+ return !lodash.isNil(this.influencerEmail);
842
+ },
843
+ enumerable: false,
844
+ configurable: true
845
+ });
846
+ Coupon.prototype.identifierFields = function () {
847
+ return ['id'];
848
+ };
849
+ Coupon.createCoupon = function (userId) {
850
+ return this.toInstance({
851
+ nickname: "" + Date.now(),
852
+ type: exports.CouponTypes.ABSOLUTE,
853
+ checkoutType: exports.CheckoutTypes.ECOMMERCE,
854
+ discount: 30,
855
+ user: userId,
856
+ useLimit: 1,
857
+ useLimitPerUser: 1,
858
+ createdAt: new Date(Date.now()),
859
+ beginAt: new Date(Date.now()),
860
+ expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
861
+ });
862
+ };
863
+ return Coupon;
864
+ }(BaseModel));
865
+ __decorate([
866
+ classTransformer.Expose({ name: 'checkout_type' }),
867
+ __metadata("design:type", Number)
868
+ ], Coupon.prototype, "checkoutType", void 0);
869
+ __decorate([
870
+ classTransformer.Expose({ name: 'exclusivity_type' }),
871
+ __metadata("design:type", Number)
870
872
  ], Coupon.prototype, "exclusivityType", void 0);
871
873
 
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;
874
+ var SubscriptionPlan = /** @class */ (function (_super) {
875
+ __extends(SubscriptionPlan, _super);
876
+ function SubscriptionPlan() {
877
+ return _super !== null && _super.apply(this, arguments) || this;
878
+ }
879
+ SubscriptionPlan.prototype.identifierFields = function () {
880
+ return ['id'];
881
+ };
882
+ return SubscriptionPlan;
881
883
  }(BaseModel));
882
884
 
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;
885
+ var BeautyProfile = /** @class */ (function (_super) {
886
+ __extends(BeautyProfile, _super);
887
+ function BeautyProfile() {
888
+ return _super !== null && _super.apply(this, arguments) || this;
889
+ }
890
+ BeautyProfile.prototype.toPlain = function () {
891
+ var plain = _super.prototype.toPlain.call(this);
892
+ delete plain.id;
893
+ return plain;
894
+ };
895
+ BeautyProfile.prototype.identifierFields = function () {
896
+ return ['id'];
897
+ };
898
+ return BeautyProfile;
897
899
  }(BaseModel));
898
900
 
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)
901
+ var User = /** @class */ (function (_super) {
902
+ __extends(User, _super);
903
+ function User() {
904
+ return _super !== null && _super.apply(this, arguments) || this;
905
+ }
906
+ User.toInstance = function (data) {
907
+ var instance = _super.toInstance.call(this, data);
908
+ if (!lodash.isNil(data.firstName))
909
+ instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
910
+ return instance;
911
+ };
912
+ User.prototype.identifierFields = function () {
913
+ return ['id'];
914
+ };
915
+ User.prototype.toPlain = function () {
916
+ var plain = _super.prototype.toPlain.call(this);
917
+ delete plain.beautyProfile;
918
+ return plain;
919
+ };
920
+ return User;
921
+ }(BaseModel));
922
+ __decorate([
923
+ classTransformer.Type(function () { return BeautyProfile; }),
924
+ __metadata("design:type", BeautyProfile)
923
925
  ], User.prototype, "beautyProfile", void 0);
924
926
 
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)
927
+ var Subscription = /** @class */ (function (_super) {
928
+ __extends(Subscription, _super);
929
+ function Subscription() {
930
+ return _super !== null && _super.apply(this, arguments) || this;
931
+ }
932
+ Subscription.prototype.identifierFields = function () {
933
+ return ['id'];
934
+ };
935
+ return Subscription;
936
+ }(BaseModel));
937
+ __decorate([
938
+ classTransformer.Type(function () { return User; }),
939
+ __metadata("design:type", User)
940
+ ], Subscription.prototype, "user", void 0);
941
+ __decorate([
942
+ classTransformer.Type(function () { return SubscriptionPlan; }),
943
+ __metadata("design:type", SubscriptionPlan)
944
+ ], Subscription.prototype, "subscriptionPlan", void 0);
945
+ __decorate([
946
+ classTransformer.Type(function () { return Address; }),
947
+ __metadata("design:type", Address)
948
+ ], Subscription.prototype, "shippingAddress", void 0);
949
+ __decorate([
950
+ classTransformer.Type(function () { return Address; }),
951
+ __metadata("design:type", Address)
952
+ ], Subscription.prototype, "billingAddress", void 0);
953
+ __decorate([
954
+ classTransformer.Type(function () { return Coupon; }),
955
+ __metadata("design:type", Coupon)
956
+ ], Subscription.prototype, "coupon", void 0);
957
+ __decorate([
958
+ classTransformer.Type(function () { return Edition; }),
959
+ __metadata("design:type", Array)
960
+ ], Subscription.prototype, "editions", void 0);
961
+ __decorate([
962
+ classTransformer.Type(function () { return SubscriptionPayment; }),
963
+ __metadata("design:type", Array)
962
964
  ], Subscription.prototype, "payment", void 0);
963
965
 
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;
966
+ var UserAddress = /** @class */ (function (_super) {
967
+ __extends(UserAddress, _super);
968
+ function UserAddress() {
969
+ return _super !== null && _super.apply(this, arguments) || this;
970
+ }
971
+ UserAddress.prototype.identifierFields = function () {
972
+ return ['id'];
973
+ };
974
+ return UserAddress;
973
975
  }(Address));
974
976
 
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;
977
+ var UserPaymentMethod = /** @class */ (function (_super) {
978
+ __extends(UserPaymentMethod, _super);
979
+ function UserPaymentMethod() {
980
+ return _super !== null && _super.apply(this, arguments) || this;
981
+ }
982
+ UserPaymentMethod.prototype.identifierFields = function () {
983
+ return ['id'];
984
+ };
985
+ return UserPaymentMethod;
984
986
  }(BaseModel));
985
987
 
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;
988
+ var Lead = /** @class */ (function (_super) {
989
+ __extends(Lead, _super);
990
+ function Lead() {
991
+ return _super !== null && _super.apply(this, arguments) || this;
992
+ }
993
+ Lead.prototype.identifierFields = function () {
994
+ return ['id'];
995
+ };
996
+ return Lead;
995
997
  }(BaseModel));
996
998
 
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;
999
+ var UnauthorizedError = /** @class */ (function (_super) {
1000
+ __extends(UnauthorizedError, _super);
1001
+ function UnauthorizedError(message) {
1002
+ var _this = _super.call(this, message) || this;
1003
+ _this.message = message;
1004
+ return _this;
1005
+ }
1006
+ return UnauthorizedError;
1005
1007
  }(Error));
1006
1008
 
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;
1009
+ exports.SignInMethods = void 0;
1010
+ (function (SignInMethods) {
1011
+ SignInMethods["EMAIL_PASSWORD"] = "email_password";
1012
+ SignInMethods["GOOGLE"] = "google";
1013
+ })(exports.SignInMethods || (exports.SignInMethods = {}));
1014
+ var Authentication = /** @class */ (function () {
1015
+ function Authentication(authService, userRepository) {
1016
+ this.authService = authService;
1017
+ this.userRepository = userRepository;
1018
+ }
1019
+ Authentication.prototype.signIn = function (_b, signInMethod) {
1020
+ var email = _b.email, password = _b.password;
1021
+ return __awaiter(this, void 0, void 0, function () {
1022
+ var method, userAuth, user;
1023
+ return __generator(this, function (_b) {
1024
+ switch (_b.label) {
1025
+ case 0:
1026
+ method = this.getServiceByMethod(signInMethod);
1027
+ return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
1028
+ case 1:
1029
+ userAuth = _b.sent();
1030
+ user = this.userRepository.get(userAuth);
1031
+ if (!lodash.isNil(user))
1032
+ return [2 /*return*/, user];
1033
+ if (/^.+@b4a.com.br$/.test(userAuth.email))
1034
+ return [2 /*return*/, this.createsUserByCredential(userAuth)];
1035
+ throw new UnauthorizedError('Invalid credentials');
1036
+ }
1037
+ });
1038
+ });
1039
+ };
1040
+ Authentication.prototype.getServiceByMethod = function (signInMethod) {
1041
+ return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
1042
+ };
1043
+ Authentication.prototype.createsUserByCredential = function (user) {
1044
+ var _a;
1045
+ return __awaiter(this, void 0, void 0, function () {
1046
+ var _b, firstName, lastName, person;
1047
+ return __generator(this, function (_c) {
1048
+ _b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
1049
+ person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
1050
+ lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
1051
+ return [2 /*return*/, this.userRepository.create(person)];
1052
+ });
1053
+ });
1054
+ };
1055
+ return Authentication;
1054
1056
  }());
1055
1057
 
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;
1058
+ var UserAlreadyRegisteredError = /** @class */ (function (_super) {
1059
+ __extends(UserAlreadyRegisteredError, _super);
1060
+ function UserAlreadyRegisteredError(message) {
1061
+ var _this = _super.call(this, message) || this;
1062
+ _this.message = message;
1063
+ return _this;
1064
+ }
1065
+ return UserAlreadyRegisteredError;
1064
1066
  }(Error));
1065
1067
 
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;
1068
+ var WeakPasswordError = /** @class */ (function (_super) {
1069
+ __extends(WeakPasswordError, _super);
1070
+ function WeakPasswordError(message) {
1071
+ if (message === void 0) { message = 'Weak password'; }
1072
+ var _this = _super.call(this, message) || this;
1073
+ _this.message = message;
1074
+ return _this;
1075
+ }
1076
+ return WeakPasswordError;
1075
1077
  }(Error));
1076
1078
 
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;
1079
+ var Register = /** @class */ (function () {
1080
+ function Register(registerService, userRepository) {
1081
+ this.registerService = registerService;
1082
+ this.userRepository = userRepository;
1083
+ }
1084
+ Register.prototype.register = function (params) {
1085
+ return __awaiter(this, void 0, void 0, function () {
1086
+ var email, displayName, auth, user;
1087
+ return __generator(this, function (_a) {
1088
+ switch (_a.label) {
1089
+ case 0:
1090
+ email = params.email.toLocaleLowerCase();
1091
+ displayName = params.firstName + " " + params.lastName;
1092
+ return [4 /*yield*/, this.userRepository.checkIfExistsByField('cpf', params.cpf)];
1093
+ case 1:
1094
+ if (_a.sent())
1095
+ throw new UserAlreadyRegisteredError("Usu\u00E1rio com CPF " + params.cpf + " j\u00E1 registrado.");
1096
+ return [4 /*yield*/, this.userRepository.checkIfExistsByField('email', params.email)];
1097
+ case 2:
1098
+ if (_a.sent())
1099
+ throw new UserAlreadyRegisteredError("Usu\u00E1rio com e-mail " + params.email + " j\u00E1 registrado.");
1100
+ return [4 /*yield*/, this.registerService.register({
1101
+ birthday: params.birthday,
1102
+ email: email,
1103
+ firstName: params.firstName,
1104
+ lastName: params.lastName,
1105
+ cpf: params.cpf,
1106
+ displayName: displayName,
1107
+ phone: params.phone,
1108
+ password: params.password,
1109
+ })];
1110
+ case 3:
1111
+ auth = _a.sent();
1112
+ delete params.password;
1113
+ return [4 /*yield*/, this.userRepository.create(Object.assign(Object.assign({}, params), { id: auth.id, email: email,
1114
+ displayName: displayName, type: exports.UserType.B2C, dateCreated: new Date(), dateModified: new Date() }))];
1115
+ case 4:
1116
+ user = _a.sent();
1117
+ return [2 /*return*/, user];
1118
+ }
1119
+ });
1120
+ });
1121
+ };
1122
+ return Register;
1121
1123
  }());
1122
1124
 
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;
1125
+ var SignOut = /** @class */ (function () {
1126
+ function SignOut(authService) {
1127
+ this.authService = authService;
1128
+ }
1129
+ SignOut.prototype.signOut = function () {
1130
+ return __awaiter(this, void 0, void 0, function () {
1131
+ return __generator(this, function (_a) {
1132
+ switch (_a.label) {
1133
+ case 0: return [4 /*yield*/, this.authService.signOut()];
1134
+ case 1:
1135
+ _a.sent();
1136
+ return [2 /*return*/];
1137
+ }
1138
+ });
1139
+ });
1140
+ };
1141
+ return SignOut;
1140
1142
  }());
1141
1143
 
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;
1144
+ var RecoveryPassword = /** @class */ (function () {
1145
+ function RecoveryPassword(authService) {
1146
+ this.authService = authService;
1147
+ }
1148
+ RecoveryPassword.prototype.sendEmail = function (email) {
1149
+ return __awaiter(this, void 0, void 0, function () {
1150
+ return __generator(this, function (_a) {
1151
+ switch (_a.label) {
1152
+ case 0: return [4 /*yield*/, this.authService.sendPasswordResetEmail(email)];
1153
+ case 1:
1154
+ _a.sent();
1155
+ return [2 /*return*/];
1156
+ }
1157
+ });
1158
+ });
1159
+ };
1160
+ return RecoveryPassword;
1159
1161
  }());
1160
1162
 
1161
- exports.Shops = void 0;
1162
- (function (Shops) {
1163
- Shops["MENSMARKET"] = "mensmarket";
1164
- Shops["GLAMSHOP"] = "Glamshop";
1165
- Shops["GLAMPOINTS"] = "Glampoints";
1166
- Shops["ALL"] = "ALL";
1163
+ exports.Shops = void 0;
1164
+ (function (Shops) {
1165
+ Shops["MENSMARKET"] = "mensmarket";
1166
+ Shops["GLAMSHOP"] = "Glamshop";
1167
+ Shops["GLAMPOINTS"] = "Glampoints";
1168
+ Shops["ALL"] = "ALL";
1167
1169
  })(exports.Shops || (exports.Shops = {}));
1168
1170
 
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;
1171
+ var Category = /** @class */ (function (_super) {
1172
+ __extends(Category, _super);
1173
+ function Category() {
1174
+ return _super !== null && _super.apply(this, arguments) || this;
1175
+ }
1176
+ Category.prototype.identifierFields = function () {
1177
+ return ['id'];
1178
+ };
1179
+ return Category;
1178
1180
  }(BaseModel));
1179
1181
 
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;
1182
+ var Product = /** @class */ (function (_super) {
1183
+ __extends(Product, _super);
1184
+ function Product() {
1185
+ return _super !== null && _super.apply(this, arguments) || this;
1186
+ }
1187
+ Product.prototype.identifierFields = function () {
1188
+ return ['id'];
1189
+ };
1190
+ Product.prototype.getInfoByShop = function (shop) {
1191
+ var _a, _b, _c, _d, _e, _f;
1192
+ 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]) || {}));
1193
+ };
1194
+ return Product;
1193
1195
  }(BaseModel));
1194
1196
 
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;
1197
+ var Variant = /** @class */ (function (_super) {
1198
+ __extends(Variant, _super);
1199
+ function Variant() {
1200
+ return _super !== null && _super.apply(this, arguments) || this;
1201
+ }
1202
+ Variant.prototype.identifierFields = function () {
1203
+ return ['id'];
1204
+ };
1205
+ return Variant;
1204
1206
  }(BaseModel));
1205
1207
 
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";
1208
+ exports.OrderStatus = void 0;
1209
+ (function (OrderStatus) {
1210
+ OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
1211
+ OrderStatus["EM_PREPARO"] = "Preparando pedido";
1212
+ OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
1213
+ OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
1214
+ OrderStatus["ENVIADO"] = "Pedido Enviado";
1215
+ OrderStatus["ENTREGUE"] = "Pedido entregue";
1216
+ OrderStatus["CANCELADO"] = "Cancelado";
1217
+ OrderStatus["CREDIT_CARD"] = "credit_card";
1216
1218
  })(exports.OrderStatus || (exports.OrderStatus = {}));
1217
1219
 
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;
1220
+ var LineItem = /** @class */ (function (_super) {
1221
+ __extends(LineItem, _super);
1222
+ function LineItem() {
1223
+ return _super !== null && _super.apply(this, arguments) || this;
1224
+ }
1225
+ return LineItem;
1224
1226
  }(Product));
1225
1227
 
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;
1228
+ var ShippingMethod = /** @class */ (function (_super) {
1229
+ __extends(ShippingMethod, _super);
1230
+ function ShippingMethod() {
1231
+ return _super !== null && _super.apply(this, arguments) || this;
1232
+ }
1233
+ ShippingMethod.prototype.identifierFields = function () {
1234
+ return ['id'];
1235
+ };
1236
+ return ShippingMethod;
1235
1237
  }(BaseModel));
1236
1238
 
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)
1239
+ var Checkout = /** @class */ (function (_super) {
1240
+ __extends(Checkout, _super);
1241
+ function Checkout() {
1242
+ return _super !== null && _super.apply(this, arguments) || this;
1243
+ }
1244
+ Checkout.prototype.identifierFields = function () {
1245
+ return ['id'];
1246
+ };
1247
+ return Checkout;
1248
+ }(BaseModel));
1249
+ __decorate([
1250
+ classTransformer.Type(function () { return LineItem; }),
1251
+ __metadata("design:type", Array)
1252
+ ], Checkout.prototype, "lineItems", void 0);
1253
+ __decorate([
1254
+ classTransformer.Type(function () { return User; }),
1255
+ __metadata("design:type", User)
1256
+ ], Checkout.prototype, "user", void 0);
1257
+ __decorate([
1258
+ classTransformer.Type(function () { return Address; }),
1259
+ __metadata("design:type", Address)
1260
+ ], Checkout.prototype, "shippingAddress", void 0);
1261
+ __decorate([
1262
+ classTransformer.Type(function () { return Address; }),
1263
+ __metadata("design:type", Address)
1264
+ ], Checkout.prototype, "billingAddress", void 0);
1265
+ __decorate([
1266
+ classTransformer.Type(function () { return ShippingMethod; }),
1267
+ __metadata("design:type", ShippingMethod)
1268
+ ], Checkout.prototype, "shipping", void 0);
1269
+ __decorate([
1270
+ classTransformer.Type(function () { return Coupon; }),
1271
+ __metadata("design:type", Coupon)
1270
1272
  ], Checkout.prototype, "coupon", void 0);
1271
1273
 
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)
1274
+ var Order = /** @class */ (function (_super) {
1275
+ __extends(Order, _super);
1276
+ function Order() {
1277
+ return _super !== null && _super.apply(this, arguments) || this;
1278
+ }
1279
+ return Order;
1280
+ }(Checkout));
1281
+ __decorate([
1282
+ classTransformer.Type(function () { return Payment; }),
1283
+ __metadata("design:type", Payment)
1282
1284
  ], Order.prototype, "payment", void 0);
1283
1285
 
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)
1286
+ var CheckoutSubscription = /** @class */ (function (_super) {
1287
+ __extends(CheckoutSubscription, _super);
1288
+ function CheckoutSubscription() {
1289
+ return _super !== null && _super.apply(this, arguments) || this;
1290
+ }
1291
+ CheckoutSubscription.prototype.identifierFields = function () {
1292
+ return ['id'];
1293
+ };
1294
+ return CheckoutSubscription;
1295
+ }(BaseModel));
1296
+ __decorate([
1297
+ classTransformer.Type(function () { return Address; }),
1298
+ __metadata("design:type", Address)
1299
+ ], CheckoutSubscription.prototype, "shippingAddress", void 0);
1300
+ __decorate([
1301
+ classTransformer.Type(function () { return Address; }),
1302
+ __metadata("design:type", Address)
1303
+ ], CheckoutSubscription.prototype, "billingAddress", void 0);
1304
+ __decorate([
1305
+ classTransformer.Type(function () { return SubscriptionPlan; }),
1306
+ __metadata("design:type", SubscriptionPlan)
1307
+ ], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
1308
+ __decorate([
1309
+ classTransformer.Type(function () { return Coupon; }),
1310
+ __metadata("design:type", Coupon)
1309
1311
  ], CheckoutSubscription.prototype, "coupon", void 0);
1310
1312
 
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)
1313
+ var Buy2Win = /** @class */ (function (_super) {
1314
+ __extends(Buy2Win, _super);
1315
+ function Buy2Win() {
1316
+ return _super !== null && _super.apply(this, arguments) || this;
1317
+ }
1318
+ Buy2Win.prototype.identifierFields = function () {
1319
+ return ['id'];
1320
+ };
1321
+ return Buy2Win;
1322
+ }(BaseModel));
1323
+ __decorate([
1324
+ classTransformer.Type(function () { return Category; }),
1325
+ __metadata("design:type", Array)
1324
1326
  ], Buy2Win.prototype, "categories", void 0);
1325
1327
 
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";
1328
+ exports.FilterType = void 0;
1329
+ (function (FilterType) {
1330
+ FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
1331
+ FilterType["BEARD_PROBLEMS"] = "beardProblems";
1332
+ FilterType["BEARD_SIZE"] = "beardSize";
1333
+ FilterType["BEAUTY_PRODUCT_IMPORTANCE"] = "beautyProductImportance";
1334
+ FilterType["BODY_PROBLEMS"] = "bodyProblems";
1335
+ FilterType["BODY_SHAPE"] = "bodyShape";
1336
+ FilterType["BODY_TATTOOS"] = "bodyTattoos";
1337
+ FilterType["FACE_SKIN_OILINESS"] = "faceSkinOiliness";
1338
+ FilterType["FACE_SKIN_PROBLEMS"] = "faceSkinProblems";
1339
+ FilterType["FACE_SKIN_TONE"] = "faceSkinTone";
1340
+ FilterType["FAMILY_INCOME"] = "familyIncome";
1341
+ FilterType["FRAGRANCE_IMPORTANCE"] = "fragranceImportance";
1342
+ FilterType["HAIR_COLOR"] = "hairColor";
1343
+ FilterType["HAIR_PROBLEMS"] = "hairProblems";
1344
+ FilterType["HAIR_STRANDS"] = "hairStrands";
1345
+ FilterType["HAIR_TYPE"] = "hairType";
1346
+ FilterType["PRODUCT_SPENT"] = "productSpent";
1345
1347
  })(exports.FilterType || (exports.FilterType = {}));
1346
1348
 
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?";
1349
+ exports.QuestionsFilters = void 0;
1350
+ (function (QuestionsFilters) {
1351
+ QuestionsFilters["ACCESSORY_IMPORTANCE"] = "Voc\u00EA gosta de usar acess\u00F3rios masculinos?";
1352
+ QuestionsFilters["BEARD_PROBLEMS"] = "Quais problemas de barba voc\u00EA tem?";
1353
+ QuestionsFilters["BEARD_SIZE"] = "Quais caracteristicas se aplicam \u00E0 sua BARBA/BIGODE?";
1354
+ QuestionsFilters["BEAUTY_PRODUCT_IMPORTANCE"] = "O que descreve melhor a sua rela\u00E7\u00E3o com produtos de beleza e cuidados pessoais?";
1355
+ QuestionsFilters["BODY_PROBLEMS"] = "Qual ou quais preocupa\u00E7\u00F5es voc\u00EA tem com a pele do seu corpo?";
1356
+ QuestionsFilters["BODY_SHAPE"] = "Qual e seu tipo de CORPO?";
1357
+ QuestionsFilters["BODY_TATTOOS"] = "Voc\u00EA tem alguma tatuagem?";
1358
+ QuestionsFilters["FACE_SKIN_OILINESS"] = "Quais caracteristicas se aplicam \u00E0 pele do seu ROSTO?";
1359
+ QuestionsFilters["FACE_SKIN_PROBLEMS"] = "Quais problemas a pele do seu rosto tem?";
1360
+ QuestionsFilters["FACE_SKIN_TONE"] = "Qual seu tom de pele?";
1361
+ QuestionsFilters["FAMILY_INCOME"] = "Qual a sua renda familiar mensal (considerando a renda de todas as pessoas que moram com voc\u00EA)?";
1362
+ QuestionsFilters["FRAGRANCE_IMPORTANCE"] = "O quanto voc\u00EA gosta de experimentar perfumes?";
1363
+ QuestionsFilters["HAIR_COLOR"] = "Seu cabelo \u00E9 naturalmente de qual COR?";
1364
+ QuestionsFilters["HAIR_PROBLEMS"] = "Qual ou quais problemas/caracter\u00EDstica de cabelo te preocupam?";
1365
+ QuestionsFilters["HAIR_STRANDS"] = "Como s\u00E3o seus fios?";
1366
+ QuestionsFilters["HAIR_TYPE"] = "Como \u00E9 o seu cabelo?";
1367
+ QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
1366
1368
  })(exports.QuestionsFilters || (exports.QuestionsFilters = {}));
1367
1369
 
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;
1370
+ var BeautyQuestionsHelper = /** @class */ (function () {
1371
+ function BeautyQuestionsHelper() {
1372
+ }
1373
+ BeautyQuestionsHelper.getAnswers = function (filter) {
1374
+ switch (filter) {
1375
+ case exports.FilterType.ACCESSORY_IMPORTANCE:
1376
+ return exports.AccessoryImportances;
1377
+ case exports.FilterType.BEARD_PROBLEMS:
1378
+ return exports.BeardProblems;
1379
+ case exports.FilterType.BEARD_SIZE:
1380
+ return exports.BeardSizes;
1381
+ case exports.FilterType.BEAUTY_PRODUCT_IMPORTANCE:
1382
+ return exports.BeautyProductImportances;
1383
+ case exports.FilterType.BODY_PROBLEMS:
1384
+ return exports.BodyProblems;
1385
+ case exports.FilterType.BODY_SHAPE:
1386
+ return exports.BodyShapes;
1387
+ case exports.FilterType.BODY_TATTOOS:
1388
+ return exports.BodyTattoos;
1389
+ case exports.FilterType.FACE_SKIN_OILINESS:
1390
+ return exports.FaceSkinOilinesses;
1391
+ case exports.FilterType.FACE_SKIN_PROBLEMS:
1392
+ return exports.FaceSkinProblems;
1393
+ case exports.FilterType.FACE_SKIN_TONE:
1394
+ return exports.FaceSkinTones;
1395
+ case exports.FilterType.FAMILY_INCOME:
1396
+ return exports.FamilyIncomes;
1397
+ case exports.FilterType.FRAGRANCE_IMPORTANCE:
1398
+ return exports.FragranceImportances;
1399
+ case exports.FilterType.HAIR_COLOR:
1400
+ return exports.HairColors;
1401
+ case exports.FilterType.HAIR_PROBLEMS:
1402
+ return exports.HairProblems;
1403
+ case exports.FilterType.HAIR_STRANDS:
1404
+ return exports.HairStrands;
1405
+ case exports.FilterType.HAIR_TYPE:
1406
+ return exports.HairTypes;
1407
+ case exports.FilterType.PRODUCT_SPENT:
1408
+ return exports.ProductSpents;
1409
+ }
1410
+ };
1411
+ BeautyQuestionsHelper.getQuestions = function (filter) {
1412
+ return exports.QuestionsFilters[filter];
1413
+ };
1414
+ return BeautyQuestionsHelper;
1413
1415
  }());
1414
1416
 
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;
1417
+ var Home = /** @class */ (function (_super) {
1418
+ __extends(Home, _super);
1419
+ function Home() {
1420
+ return _super !== null && _super.apply(this, arguments) || this;
1421
+ }
1422
+ Home.prototype.identifierFields = function () {
1423
+ return ['id'];
1424
+ };
1425
+ return Home;
1424
1426
  }(BaseModel));
1425
1427
 
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;
1428
+ var ShopMenu = /** @class */ (function (_super) {
1429
+ __extends(ShopMenu, _super);
1430
+ function ShopMenu() {
1431
+ return _super !== null && _super.apply(this, arguments) || this;
1432
+ }
1433
+ ShopMenu.prototype.identifierFields = function () {
1434
+ return ['id'];
1435
+ };
1436
+ return ShopMenu;
1435
1437
  }(BaseModel));
1436
1438
 
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;
1439
+ var InvalidArgumentError = /** @class */ (function (_super) {
1440
+ __extends(InvalidArgumentError, _super);
1441
+ function InvalidArgumentError(message) {
1442
+ var _this = _super.call(this, message) || this;
1443
+ _this.message = message;
1444
+ return _this;
1445
+ }
1446
+ return InvalidArgumentError;
1445
1447
  }(Error));
1446
1448
 
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;
1449
+ var RequiredArgumentError = /** @class */ (function (_super) {
1450
+ __extends(RequiredArgumentError, _super);
1451
+ function RequiredArgumentError(args) {
1452
+ var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
1453
+ _this.args = args;
1454
+ _this.arguments = args;
1455
+ return _this;
1456
+ }
1457
+ return RequiredArgumentError;
1456
1458
  }(Error));
1457
1459
 
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;
1460
+ var NotFoundError = /** @class */ (function (_super) {
1461
+ __extends(NotFoundError, _super);
1462
+ function NotFoundError(message) {
1463
+ var _this = _super.call(this, message) || this;
1464
+ _this.message = message;
1465
+ return _this;
1466
+ }
1467
+ return NotFoundError;
1466
1468
  }(Error));
1467
1469
 
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;
1470
+ var DuplicatedResultsError = /** @class */ (function (_super) {
1471
+ __extends(DuplicatedResultsError, _super);
1472
+ function DuplicatedResultsError(message) {
1473
+ var _this = _super.call(this, message) || this;
1474
+ _this.message = message;
1475
+ return _this;
1476
+ }
1477
+ return DuplicatedResultsError;
1476
1478
  }(Error));
1477
1479
 
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;
1480
+ var AxiosAdapter = /** @class */ (function () {
1481
+ function AxiosAdapter(config) {
1482
+ this.config = config;
1483
+ }
1484
+ AxiosAdapter.prototype.query = function (index, query) {
1485
+ return __awaiter(this, void 0, void 0, function () {
1486
+ var data;
1487
+ return __generator(this, function (_a) {
1488
+ switch (_a.label) {
1489
+ case 0: return [4 /*yield*/, axios__default["default"]({
1490
+ url: this.config.url + "/" + index,
1491
+ method: 'POST',
1492
+ headers: { Authorization: "Basic " + this.config.credential },
1493
+ data: query,
1494
+ })];
1495
+ case 1:
1496
+ data = (_a.sent()).data;
1497
+ return [2 /*return*/, {
1498
+ total: data.hits.total.value,
1499
+ hits: data.hits.hits,
1500
+ }];
1501
+ }
1502
+ });
1503
+ });
1504
+ };
1505
+ return AxiosAdapter;
1504
1506
  }());
1505
1507
 
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;
1508
+ var ProductsIndex = /** @class */ (function () {
1509
+ function ProductsIndex(adapter) {
1510
+ this.adapter = adapter;
1511
+ }
1512
+ ProductsIndex.prototype.findById = function (ids, options) {
1513
+ return __awaiter(this, void 0, void 0, function () {
1514
+ var publishedField, fields, hits;
1515
+ var _a;
1516
+ return __generator(this, function (_b) {
1517
+ switch (_b.label) {
1518
+ case 0:
1519
+ publishedField = options.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
1520
+ fields = [
1521
+ 'brand',
1522
+ 'id',
1523
+ 'images',
1524
+ 'miniatures',
1525
+ 'name',
1526
+ 'price',
1527
+ 'sku',
1528
+ 'stock',
1529
+ 'slug',
1530
+ 'reviews',
1531
+ 'pricePaid',
1532
+ 'isGift',
1533
+ 'stock',
1534
+ 'weight',
1535
+ 'tags',
1536
+ 'hasVariants',
1537
+ ];
1538
+ return [4 /*yield*/, this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
1539
+ bool: {
1540
+ filter: __spreadArray([
1541
+ {
1542
+ terms: {
1543
+ _id: ids,
1544
+ },
1545
+ },
1546
+ {
1547
+ term: (_a = {},
1548
+ _a[publishedField] = true,
1549
+ _a),
1550
+ }
1551
+ ], __read((options.hasStock
1552
+ ? [
1553
+ {
1554
+ range: {
1555
+ 'stock.quantity': {
1556
+ gt: 0,
1557
+ },
1558
+ },
1559
+ },
1560
+ ]
1561
+ : []))),
1562
+ },
1563
+ } }, (options.size ? { size: options.size } : {})))];
1564
+ case 1:
1565
+ hits = (_b.sent()).hits;
1566
+ return [2 /*return*/, hits.map(function (hit) { return Product.toInstance(hit._source); })];
1567
+ }
1568
+ });
1569
+ });
1570
+ };
1571
+ return ProductsIndex;
1570
1572
  }());
1571
1573
 
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));
1574
+ var withFirestore = function (MixinBase) {
1575
+ return /** @class */ (function (_super) {
1576
+ __extends(class_1, _super);
1577
+ function class_1() {
1578
+ var args = [];
1579
+ for (var _i = 0; _i < arguments.length; _i++) {
1580
+ args[_i] = arguments[_i];
1581
+ }
1582
+ return _super.call(this, args) || this;
1583
+ }
1584
+ class_1.prototype.collection = function (path) {
1585
+ return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
1586
+ };
1587
+ class_1.prototype.buildModelInstance = function () {
1588
+ var _this = this;
1589
+ return {
1590
+ toFirestore: function (data) { return ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
1591
+ fromFirestore: function (snap) {
1592
+ var data = snap.data();
1593
+ Object.keys(data).forEach(function (key) {
1594
+ if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
1595
+ data[key] = data[key].toDate();
1596
+ }
1597
+ });
1598
+ return _this.model.toInstance(Object.assign(Object.assign({}, data), { id: snap.id }));
1599
+ },
1600
+ };
1601
+ };
1602
+ return class_1;
1603
+ }(MixinBase));
1602
1604
  };
1603
1605
 
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));
1606
+ var withHelpers = function (MixinBase) {
1607
+ return /** @class */ (function (_super) {
1608
+ __extends(class_1, _super);
1609
+ function class_1() {
1610
+ return _super !== null && _super.apply(this, arguments) || this;
1611
+ }
1612
+ class_1.prototype.toArray = function (snapShot) {
1613
+ if (Array.isArray(snapShot)) {
1614
+ return snapShot.map(function (doc) { return doc.data(); });
1615
+ }
1616
+ else {
1617
+ return snapShot.docs.map(function (doc) { return doc.data(); });
1618
+ }
1619
+ };
1620
+ class_1.prototype.isSubCollection = function (repository) {
1621
+ return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
1622
+ };
1623
+ return class_1;
1624
+ }(MixinBase));
1623
1625
  };
1624
1626
 
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));
1627
+ var withGetFirestore = function (MixinBase) {
1628
+ return /** @class */ (function (_super) {
1629
+ __extends(GetFirestore, _super);
1630
+ function GetFirestore() {
1631
+ return _super !== null && _super.apply(this, arguments) || this;
1632
+ }
1633
+ GetFirestore.prototype.get = function (identifiers) {
1634
+ return __awaiter(this, void 0, void 0, function () {
1635
+ var doc, data;
1636
+ return __generator(this, function (_a) {
1637
+ switch (_a.label) {
1638
+ case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
1639
+ .doc(Object.values(identifiers).shift().toString())
1640
+ .get()];
1641
+ case 1:
1642
+ doc = _a.sent();
1643
+ data = doc.data();
1644
+ if (lodash.isNil(data))
1645
+ throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
1646
+ return [2 /*return*/, data];
1647
+ }
1648
+ });
1649
+ });
1650
+ };
1651
+ GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
1652
+ return this.isSubCollection(this)
1653
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1654
+ : this.collectionName;
1655
+ };
1656
+ return GetFirestore;
1657
+ }(MixinBase));
1656
1658
  };
1657
1659
 
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));
1660
+ var withFindFirestore = function (MixinBase) {
1661
+ var checkIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
1662
+ var getValueFromFilter = function (filter) {
1663
+ return checkIfIsFilterOption(filter) ? filter.value : filter;
1664
+ };
1665
+ var getFinalValueFrom = function (value) { return lodash.isNumber(value) || lodash.isString(value) || lodash.isDate(value) || Array.isArray(value)
1666
+ ? value
1667
+ : Object.values(getFinalValueFrom); };
1668
+ return /** @class */ (function (_super) {
1669
+ __extends(FindFirestore, _super);
1670
+ function FindFirestore() {
1671
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1672
+ _this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
1673
+ _this.buildWhereSentence = function (queryReference, fieldName, options) {
1674
+ if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
1675
+ return queryReference;
1676
+ var value = (options === null || options === void 0 ? void 0 : options.value) || options;
1677
+ var object = {};
1678
+ lodash.set(object, fieldName, value);
1679
+ var plainInstance = new _this.model(object).toPlain();
1680
+ var firestoreFieldName = fieldName.toString().indexOf('.') > -1
1681
+ ? fieldName.toString()
1682
+ : Object.keys(plainInstance).find(function (key) { return plainInstance[key]; });
1683
+ if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
1684
+ if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1685
+ return queryReference.where(firestoreFieldName, 'array-contains-any', options.value);
1686
+ queryReference = queryReference.where(firestoreFieldName, '>=', options.value);
1687
+ queryReference = queryReference.where(firestoreFieldName, '<=', options.value + "~");
1688
+ return queryReference;
1689
+ }
1690
+ if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
1691
+ return queryReference.where(firestoreFieldName, 'array-contains', options.value);
1692
+ 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)) {
1693
+ return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
1694
+ }
1695
+ return queryReference.where(firestoreFieldName, (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
1696
+ };
1697
+ return _this;
1698
+ }
1699
+ FindFirestore.prototype.find = function (filters, limits, orderBy) {
1700
+ return __awaiter(this, void 0, void 0, function () {
1701
+ var query, docs, data;
1702
+ var _this = this;
1703
+ return __generator(this, function (_b) {
1704
+ switch (_b.label) {
1705
+ case 0:
1706
+ query = this.collection(this.buildCollectionPathForFind(filters));
1707
+ filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
1708
+ 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])); }); });
1709
+ return [4 /*yield*/, this.defineLimits(query, filters, limits)];
1710
+ case 1:
1711
+ query = _b.sent();
1712
+ return [4 /*yield*/, query.get()];
1713
+ case 2:
1714
+ docs = _b.sent();
1715
+ data = docs.docs.map(function (doc) { return doc.data(); });
1716
+ return [2 /*return*/, {
1717
+ data: data,
1718
+ count: this.calculateCount(data, limits),
1719
+ }];
1720
+ }
1721
+ });
1722
+ });
1723
+ };
1724
+ FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
1725
+ var _a;
1726
+ if (!this.isSubCollection(this))
1727
+ return this.collectionName;
1728
+ var parentIdField = this.parentIdField;
1729
+ var parentId = getValueFromFilter((_a = filters.find(function (groupFilter) { return Boolean(getValueFromFilter(groupFilter[parentIdField])); })) === null || _a === void 0 ? void 0 : _a[parentIdField]);
1730
+ return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
1731
+ };
1732
+ FindFirestore.prototype.defineLimits = function (query, filters, limits) {
1733
+ return __awaiter(this, void 0, void 0, function () {
1734
+ var _b, _c;
1735
+ return __generator(this, function (_d) {
1736
+ switch (_d.label) {
1737
+ case 0:
1738
+ if (!(limits === null || limits === void 0 ? void 0 : limits.offset)) return [3 /*break*/, 3];
1739
+ if (!(limits.offset instanceof this.model)) return [3 /*break*/, 2];
1740
+ _c = (_b = query).startAfter;
1741
+ return [4 /*yield*/, this.collection(this.buildCollectionPathForFind(filters))
1742
+ .doc(limits.offset[limits.offset.identifierFields().shift()])
1743
+ .get()];
1744
+ case 1:
1745
+ query = _c.apply(_b, [_d.sent()]);
1746
+ return [3 /*break*/, 3];
1747
+ case 2:
1748
+ if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
1749
+ query = query.startAt(limits.offset);
1750
+ _d.label = 3;
1751
+ case 3:
1752
+ if (limits === null || limits === void 0 ? void 0 : limits.limit)
1753
+ query = query.limit(limits.limit);
1754
+ return [2 /*return*/, query];
1755
+ }
1756
+ });
1757
+ });
1758
+ };
1759
+ FindFirestore.prototype.calculateCount = function (data, limits) {
1760
+ if (data.length <= 0)
1761
+ return 0;
1762
+ if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
1763
+ return data.length;
1764
+ return Infinity;
1765
+ };
1766
+ return FindFirestore;
1767
+ }(MixinBase));
1766
1768
  };
1767
1769
 
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));
1770
+ var withCreateFirestore = function (MixinBase) {
1771
+ return /** @class */ (function (_super) {
1772
+ __extends(CreateFirestore, _super);
1773
+ function CreateFirestore() {
1774
+ return _super !== null && _super.apply(this, arguments) || this;
1775
+ }
1776
+ CreateFirestore.prototype.create = function (data) {
1777
+ return __awaiter(this, void 0, void 0, function () {
1778
+ var docRef, doc;
1779
+ return __generator(this, function (_b) {
1780
+ switch (_b.label) {
1781
+ case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
1782
+ case 1:
1783
+ docRef = _b.sent();
1784
+ return [4 /*yield*/, docRef.get()];
1785
+ case 2:
1786
+ doc = _b.sent();
1787
+ return [2 /*return*/, doc.data()];
1788
+ }
1789
+ });
1790
+ });
1791
+ };
1792
+ CreateFirestore.prototype.save = function (data) {
1793
+ var _a;
1794
+ return __awaiter(this, void 0, void 0, function () {
1795
+ var id, collectionPath, docRef;
1796
+ return __generator(this, function (_b) {
1797
+ switch (_b.label) {
1798
+ case 0:
1799
+ id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
1800
+ collectionPath = this.buildCollectionPathForAdd(data);
1801
+ if (lodash.isEmpty(id))
1802
+ return [2 /*return*/, this.collection(collectionPath).add(data)];
1803
+ docRef = this.collection(collectionPath).doc(id);
1804
+ return [4 /*yield*/, docRef.set(data)];
1805
+ case 1:
1806
+ _b.sent();
1807
+ return [2 /*return*/, docRef];
1808
+ }
1809
+ });
1810
+ });
1811
+ };
1812
+ CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
1813
+ return this.isSubCollection(this)
1814
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1815
+ : this.collectionName;
1816
+ };
1817
+ return CreateFirestore;
1818
+ }(MixinBase));
1817
1819
  };
1818
1820
 
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));
1821
+ var withUpdateFirestore = function (MixinBase) {
1822
+ 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; };
1823
+ var getValueByAction = function (options) {
1824
+ var fieldValues = firebase__default["default"].firestore.FieldValue;
1825
+ if (lodash.isNil(options.action))
1826
+ return options;
1827
+ if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
1828
+ return fieldValues.delete();
1829
+ if (Array.isArray(options.value)) {
1830
+ if (options.action === exports.UpdateOptionActions.MERGE)
1831
+ return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
1832
+ if (options.action === exports.UpdateOptionActions.REMOVE)
1833
+ return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
1834
+ }
1835
+ return options.value;
1836
+ };
1837
+ return /** @class */ (function (_super) {
1838
+ __extends(UpdateFirestore, _super);
1839
+ function UpdateFirestore() {
1840
+ return _super !== null && _super.apply(this, arguments) || this;
1841
+ }
1842
+ UpdateFirestore.prototype.update = function (data) {
1843
+ return __awaiter(this, void 0, void 0, function () {
1844
+ var model, keyField, docRef, doc;
1845
+ return __generator(this, function (_b) {
1846
+ switch (_b.label) {
1847
+ case 0:
1848
+ model = new this.model();
1849
+ keyField = model.identifierFields().shift();
1850
+ docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
1851
+ return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
1852
+ case 1:
1853
+ _b.sent();
1854
+ return [4 /*yield*/, docRef.get()];
1855
+ case 2:
1856
+ doc = _b.sent();
1857
+ return [2 /*return*/, doc.data()];
1858
+ }
1859
+ });
1860
+ });
1861
+ };
1862
+ UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
1863
+ return this.isSubCollection(this)
1864
+ ? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
1865
+ : this.collectionName;
1866
+ };
1867
+ UpdateFirestore.prototype.paramsToPlain = function (params) {
1868
+ var model = this.model;
1869
+ if (params instanceof model)
1870
+ return params;
1871
+ return Object.keys(params).reduce(function (data, currentKey) {
1872
+ var _b;
1873
+ return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
1874
+ }, {});
1875
+ };
1876
+ return UpdateFirestore;
1877
+ }(MixinBase));
1876
1878
  };
1877
1879
 
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));
1880
+ var withDeleteFirestore = function (MixinBase) {
1881
+ return /** @class */ (function (_super) {
1882
+ __extends(DeleteFirestore, _super);
1883
+ function DeleteFirestore() {
1884
+ return _super !== null && _super.apply(this, arguments) || this;
1885
+ }
1886
+ DeleteFirestore.prototype.delete = function (identifiers) {
1887
+ return __awaiter(this, void 0, void 0, function () {
1888
+ return __generator(this, function (_a) {
1889
+ switch (_a.label) {
1890
+ case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
1891
+ .doc(Object.values(identifiers).shift().toString())
1892
+ .delete()];
1893
+ case 1:
1894
+ _a.sent();
1895
+ return [2 /*return*/];
1896
+ }
1897
+ });
1898
+ });
1899
+ };
1900
+ DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
1901
+ return this.isSubCollection(this)
1902
+ ? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
1903
+ : this.collectionName;
1904
+ };
1905
+ return DeleteFirestore;
1906
+ }(MixinBase));
1905
1907
  };
1906
1908
 
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));
1909
+ var withSubCollection = function (MixinBase, ParentModel) {
1910
+ return /** @class */ (function (_super) {
1911
+ __extends(SubCollectionMix, _super);
1912
+ function SubCollectionMix() {
1913
+ var args = [];
1914
+ for (var _i = 0; _i < arguments.length; _i++) {
1915
+ args[_i] = arguments[_i];
1916
+ }
1917
+ return _super.call(this, args) || this;
1918
+ }
1919
+ SubCollectionMix.prototype.collection = function (path) {
1920
+ return _super.prototype.collection.call(this, path);
1921
+ };
1922
+ return SubCollectionMix;
1923
+ }(MixinBase));
1922
1924
  };
1923
1925
 
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)))))));
1926
+ var withCrudFirestore = function (MixinBase) {
1927
+ return /** @class */ (function (_super) {
1928
+ __extends(CrudFirestore, _super);
1929
+ function CrudFirestore() {
1930
+ return _super !== null && _super.apply(this, arguments) || this;
1931
+ }
1932
+ return CrudFirestore;
1933
+ }(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
1932
1934
  };
1933
1935
 
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;
1936
+ var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
1937
+ __extends(SubscriptionFirestoreRepository, _super);
1938
+ function SubscriptionFirestoreRepository(firestore) {
1939
+ var _this = _super.call(this) || this;
1940
+ _this.firestore = firestore;
1941
+ _this.collectionName = 'subscription';
1942
+ _this.model = Subscription;
1943
+ return _this;
1944
+ }
1945
+ return SubscriptionFirestoreRepository;
1944
1946
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1945
1947
 
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;
1948
+ var UserSearch = /** @class */ (function (_super) {
1949
+ __extends(UserSearch, _super);
1950
+ function UserSearch() {
1951
+ return _super !== null && _super.apply(this, arguments) || this;
1952
+ }
1953
+ UserSearch.prototype.identifierFields = function () {
1954
+ return ['id'];
1955
+ };
1956
+ return UserSearch;
1955
1957
  }(BaseModel));
1956
1958
 
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;
1959
+ var UserSearchFirestoreRepository = /** @class */ (function (_super) {
1960
+ __extends(UserSearchFirestoreRepository, _super);
1961
+ function UserSearchFirestoreRepository(firestore) {
1962
+ var _this = _super.call(this) || this;
1963
+ _this.firestore = firestore;
1964
+ _this.collectionName = 'userSearch';
1965
+ _this.model = UserSearch;
1966
+ return _this;
1967
+ }
1968
+ return UserSearchFirestoreRepository;
1967
1969
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
1968
1970
 
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;
1971
+ var UserFirestoreRepository = /** @class */ (function (_super_1) {
1972
+ __extends(UserFirestoreRepository, _super_1);
1973
+ function UserFirestoreRepository(firestore, userSearchFirestoreRepository) {
1974
+ if (userSearchFirestoreRepository === void 0) { userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore); }
1975
+ var _this = _super_1.call(this) || this;
1976
+ _this.firestore = firestore;
1977
+ _this.userSearchFirestoreRepository = userSearchFirestoreRepository;
1978
+ _this.collectionName = 'users';
1979
+ _this.model = User;
1980
+ return _this;
1981
+ }
1982
+ UserFirestoreRepository.prototype.get = function (identifiers) {
1983
+ var _super = Object.create(null, {
1984
+ get: { get: function () { return _super_1.prototype.get; } }
1985
+ });
1986
+ return __awaiter(this, void 0, void 0, function () {
1987
+ var user, _a, _b;
1988
+ return __generator(this, function (_c) {
1989
+ switch (_c.label) {
1990
+ case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
1991
+ case 1:
1992
+ user = _c.sent();
1993
+ _a = user;
1994
+ return [4 /*yield*/, this.getBeautyProfile(user.id)];
1995
+ case 2:
1996
+ _a.beautyProfile = _c.sent();
1997
+ _b = user;
1998
+ return [4 /*yield*/, this.checkIfIsSubscriber(user.id)];
1999
+ case 3:
2000
+ _b.isSubscriber = _c.sent();
2001
+ return [2 /*return*/, user];
2002
+ }
2003
+ });
2004
+ });
2005
+ };
2006
+ UserFirestoreRepository.prototype.checkIfExistsByField = function (field, value) {
2007
+ return __awaiter(this, void 0, void 0, function () {
2008
+ var result;
2009
+ var _a;
2010
+ return __generator(this, function (_b) {
2011
+ switch (_b.label) {
2012
+ case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find([(_a = {}, _a[field] = { operator: exports.Where.EQUALS, value: value }, _a)])];
2013
+ case 1:
2014
+ result = _b.sent();
2015
+ return [2 /*return*/, result.count > 0];
2016
+ }
2017
+ });
2018
+ });
2019
+ };
2020
+ UserFirestoreRepository.prototype.buildModelInstance = function () {
2021
+ var _a = _super_1.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2022
+ return {
2023
+ toFirestore: function (data) {
2024
+ var plain = toFirestore(data);
2025
+ delete plain.isSubscriber;
2026
+ return plain;
2027
+ },
2028
+ fromFirestore: fromFirestore,
2029
+ };
2030
+ };
2031
+ UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
2032
+ return __awaiter(this, void 0, void 0, function () {
2033
+ var beautyProfile;
2034
+ return __generator(this, function (_a) {
2035
+ switch (_a.label) {
2036
+ case 0: return [4 /*yield*/, this.collection()
2037
+ .doc(userId)
2038
+ .collection('CX')
2039
+ .withConverter(this.buildBeautyProfileModelInstance())
2040
+ .doc('beautyProfile')
2041
+ .get()];
2042
+ case 1:
2043
+ beautyProfile = _a.sent();
2044
+ return [2 /*return*/, beautyProfile.data()];
2045
+ }
2046
+ });
2047
+ });
2048
+ };
2049
+ UserFirestoreRepository.prototype.checkIfIsSubscriber = function (userId) {
2050
+ return __awaiter(this, void 0, void 0, function () {
2051
+ var docs;
2052
+ return __generator(this, function (_a) {
2053
+ switch (_a.label) {
2054
+ case 0: return [4 /*yield*/, this.firestore
2055
+ .collection('subscription')
2056
+ .where('user.id', '==', userId)
2057
+ .where('status', '==', 'active')
2058
+ .get()];
2059
+ case 1:
2060
+ docs = _a.sent();
2061
+ return [2 /*return*/, !!docs && !!docs.size];
2062
+ }
2063
+ });
2064
+ });
2065
+ };
2066
+ UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
2067
+ return {
2068
+ toFirestore: function (data) { return data.toPlain(); },
2069
+ fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
2070
+ };
2071
+ };
2072
+ return UserFirestoreRepository;
2071
2073
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2072
2074
 
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;
2075
+ var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
2076
+ __extends(SubscriptionEditionFirestoreRepository, _super);
2077
+ function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
2078
+ var _this = _super.call(this) || this;
2079
+ _this.firestore = firestore;
2080
+ _this.parentRepository = parentRepository;
2081
+ _this.collectionName = 'editions';
2082
+ _this.parentIdField = 'subscriptionId';
2083
+ _this.model = Edition;
2084
+ return _this;
2085
+ }
2086
+ return SubscriptionEditionFirestoreRepository;
2085
2087
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2086
2088
 
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;
2089
+ var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
2090
+ __extends(UserBeautyProfileFirestoreRepository, _super);
2091
+ function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
2092
+ var _this = _super.call(this) || this;
2093
+ _this.firestore = firestore;
2094
+ _this.parentRepository = parentRepository;
2095
+ _this.collectionName = 'CX';
2096
+ _this.parentIdField = 'userId';
2097
+ _this.model = BeautyProfile;
2098
+ return _this;
2099
+ }
2100
+ return UserBeautyProfileFirestoreRepository;
2099
2101
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2100
2102
 
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;
2103
+ var UserAddressFirestoreRepository = /** @class */ (function (_super) {
2104
+ __extends(UserAddressFirestoreRepository, _super);
2105
+ function UserAddressFirestoreRepository(firestore, parentRepository) {
2106
+ var _this = _super.call(this) || this;
2107
+ _this.firestore = firestore;
2108
+ _this.parentRepository = parentRepository;
2109
+ _this.collectionName = 'address';
2110
+ _this.parentIdField = 'userId';
2111
+ _this.model = UserAddress;
2112
+ return _this;
2113
+ }
2114
+ return UserAddressFirestoreRepository;
2113
2115
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2114
2116
 
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;
2117
+ var UserPaymentMethodFirestoreRepository = /** @class */ (function (_super) {
2118
+ __extends(UserPaymentMethodFirestoreRepository, _super);
2119
+ function UserPaymentMethodFirestoreRepository(firestore, parentRepository) {
2120
+ var _this = _super.call(this) || this;
2121
+ _this.firestore = firestore;
2122
+ _this.parentRepository = parentRepository;
2123
+ _this.collectionName = 'payment_method';
2124
+ _this.parentIdField = 'userId';
2125
+ _this.model = UserPaymentMethod;
2126
+ return _this;
2127
+ }
2128
+ return UserPaymentMethodFirestoreRepository;
2127
2129
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2128
2130
 
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;
2131
+ var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
2132
+ __extends(SubscriptionPaymentFirestoreRepository, _super);
2133
+ function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
2134
+ var _this = _super.call(this) || this;
2135
+ _this.firestore = firestore;
2136
+ _this.parentRepository = parentRepository;
2137
+ _this.collectionName = 'payments';
2138
+ _this.parentIdField = 'subscriptionId';
2139
+ _this.model = SubscriptionPayment;
2140
+ return _this;
2141
+ }
2142
+ return SubscriptionPaymentFirestoreRepository;
2141
2143
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2142
2144
 
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;
2145
+ var LeadFirestoreRepository = /** @class */ (function (_super) {
2146
+ __extends(LeadFirestoreRepository, _super);
2147
+ function LeadFirestoreRepository(firestore) {
2148
+ var _this = _super.call(this) || this;
2149
+ _this.firestore = firestore;
2150
+ _this.collectionName = 'leads';
2151
+ _this.model = Lead;
2152
+ return _this;
2153
+ }
2154
+ return LeadFirestoreRepository;
2153
2155
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2154
2156
 
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;
2157
+ var CategoryFirestoreRepository = /** @class */ (function (_super) {
2158
+ __extends(CategoryFirestoreRepository, _super);
2159
+ function CategoryFirestoreRepository(firestore) {
2160
+ var _this = _super.call(this) || this;
2161
+ _this.firestore = firestore;
2162
+ _this.collectionName = 'categories';
2163
+ _this.model = Category;
2164
+ return _this;
2165
+ }
2166
+ CategoryFirestoreRepository.prototype.getCategoryBySlug = function (slug, shop) {
2167
+ return this.collection(this.collectionName)
2168
+ .where('slug', '==', slug)
2169
+ .where('shop', '==', shop)
2170
+ .where('published', '==', true)
2171
+ .get()
2172
+ .then(function (snap) {
2173
+ if (snap.size > 1)
2174
+ throw new DuplicatedResultsError('Query returned duplicated values');
2175
+ if (snap.empty)
2176
+ throw new NotFoundError("Document with slug " + slug + " not found");
2177
+ return snap.docs[0].data();
2178
+ })
2179
+ .catch(function (error) { return error; });
2180
+ };
2181
+ CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
2182
+ if (limit === void 0) { limit = 4; }
2183
+ return __awaiter(this, void 0, void 0, function () {
2184
+ var categorySnap, categories, homeSections;
2185
+ var _this = this;
2186
+ return __generator(this, function (_a) {
2187
+ switch (_a.label) {
2188
+ case 0: return [4 /*yield*/, this.collection(this.collectionName)
2189
+ .where('id', 'in', categoryIds.filter(Boolean))
2190
+ .where('published', '==', true)
2191
+ .get()];
2192
+ case 1:
2193
+ categorySnap = _a.sent();
2194
+ if (categorySnap.empty)
2195
+ throw new NotFoundError('Categories not found');
2196
+ categories = categorySnap.docs.map(function (doc) { return doc.data(); });
2197
+ return [4 /*yield*/, Promise.all(categories.map(function (category) { return __awaiter(_this, void 0, void 0, function () {
2198
+ var _a;
2199
+ return __generator(this, function (_b) {
2200
+ switch (_b.label) {
2201
+ case 0:
2202
+ _a = {
2203
+ category: category
2204
+ };
2205
+ return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
2206
+ case 1: return [2 /*return*/, (_a.products = _b.sent(),
2207
+ _a)];
2208
+ }
2209
+ });
2210
+ }); }))];
2211
+ case 2:
2212
+ homeSections = _a.sent();
2213
+ return [2 /*return*/, homeSections];
2214
+ }
2215
+ });
2216
+ });
2217
+ };
2218
+ CategoryFirestoreRepository.prototype.mountCategory = function (category, options) {
2219
+ return __awaiter(this, void 0, void 0, function () {
2220
+ var chunks, products, publishedField, chunks_1, chunks_1_1, productIds, query, productSnap, e_1_1;
2221
+ var e_1, _a;
2222
+ return __generator(this, function (_b) {
2223
+ switch (_b.label) {
2224
+ case 0:
2225
+ if (!category.products)
2226
+ throw new RequiredArgumentError(['Category products is empty']);
2227
+ chunks = lodash.chunk(category.products, 10);
2228
+ products = [];
2229
+ publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
2230
+ _b.label = 1;
2231
+ case 1:
2232
+ _b.trys.push([1, 7, 8, 9]);
2233
+ chunks_1 = __values(chunks), chunks_1_1 = chunks_1.next();
2234
+ _b.label = 2;
2235
+ case 2:
2236
+ if (!!chunks_1_1.done) return [3 /*break*/, 6];
2237
+ productIds = chunks_1_1.value;
2238
+ if ((options === null || options === void 0 ? void 0 : options.limit) && products.length >= (options === null || options === void 0 ? void 0 : options.limit))
2239
+ return [3 /*break*/, 6];
2240
+ return [4 /*yield*/, this.collection('products').where(publishedField, '==', true).where('id', 'in', productIds)];
2241
+ case 3:
2242
+ query = _b.sent();
2243
+ if (options === null || options === void 0 ? void 0 : options.hasStock)
2244
+ query = query.where('stock.quantity', '>', 0);
2245
+ if (options === null || options === void 0 ? void 0 : options.limit)
2246
+ query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
2247
+ return [4 /*yield*/, query.get()];
2248
+ case 4:
2249
+ productSnap = _b.sent();
2250
+ if (productSnap.empty)
2251
+ return [3 /*break*/, 5];
2252
+ products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
2253
+ _b.label = 5;
2254
+ case 5:
2255
+ chunks_1_1 = chunks_1.next();
2256
+ return [3 /*break*/, 2];
2257
+ case 6: return [3 /*break*/, 9];
2258
+ case 7:
2259
+ e_1_1 = _b.sent();
2260
+ e_1 = { error: e_1_1 };
2261
+ return [3 /*break*/, 9];
2262
+ case 8:
2263
+ try {
2264
+ if (chunks_1_1 && !chunks_1_1.done && (_a = chunks_1.return)) _a.call(chunks_1);
2265
+ }
2266
+ finally { if (e_1) throw e_1.error; }
2267
+ return [7 /*endfinally*/];
2268
+ case 9: return [2 /*return*/, products];
2269
+ }
2270
+ });
2271
+ });
2272
+ };
2273
+ return CategoryFirestoreRepository;
2272
2274
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2273
2275
 
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;
2276
+ var ProductFirestoreRepository = /** @class */ (function (_super) {
2277
+ __extends(ProductFirestoreRepository, _super);
2278
+ function ProductFirestoreRepository(firestore) {
2279
+ var _this = _super.call(this) || this;
2280
+ _this.firestore = firestore;
2281
+ _this.collectionName = 'products';
2282
+ _this.model = Product;
2283
+ return _this;
2284
+ }
2285
+ ProductFirestoreRepository.prototype.getBySlug = function (slug, shop) {
2286
+ var _a;
2287
+ return __awaiter(this, void 0, void 0, function () {
2288
+ var result;
2289
+ return __generator(this, function (_b) {
2290
+ switch (_b.label) {
2291
+ case 0: return [4 /*yield*/, this.find([
2292
+ { slug: { operator: exports.Where.EQUALS, value: slug } },
2293
+ { shopAvailability: { operator: exports.Where.IN, value: [shop] } },
2294
+ ])];
2295
+ case 1:
2296
+ result = _b.sent();
2297
+ return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
2298
+ }
2299
+ });
2300
+ });
2301
+ };
2302
+ return ProductFirestoreRepository;
2301
2303
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2302
2304
 
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;
2305
+ var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
2306
+ __extends(ProductVariantFirestoreRepository, _super);
2307
+ function ProductVariantFirestoreRepository(firestore, parentRepository) {
2308
+ var _this = _super.call(this) || this;
2309
+ _this.firestore = firestore;
2310
+ _this.parentRepository = parentRepository;
2311
+ _this.collectionName = 'variants';
2312
+ _this.parentIdField = 'productId';
2313
+ _this.model = Variant;
2314
+ return _this;
2315
+ }
2316
+ return ProductVariantFirestoreRepository;
2315
2317
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product)));
2316
2318
 
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;
2319
+ var SubscriptionProductFirestoreRepository = /** @class */ (function (_super) {
2320
+ __extends(SubscriptionProductFirestoreRepository, _super);
2321
+ function SubscriptionProductFirestoreRepository(firestore) {
2322
+ var _this = _super.call(this) || this;
2323
+ _this.firestore = firestore;
2324
+ _this.collectionName = 'subscriptionProducts';
2325
+ _this.model = Product;
2326
+ return _this;
2327
+ }
2328
+ return SubscriptionProductFirestoreRepository;
2327
2329
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2328
2330
 
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;
2331
+ var CheckoutFirestoreRepository = /** @class */ (function (_super) {
2332
+ __extends(CheckoutFirestoreRepository, _super);
2333
+ function CheckoutFirestoreRepository(firestore) {
2334
+ var _this = _super.call(this) || this;
2335
+ _this.firestore = firestore;
2336
+ _this.collectionName = 'checkouts';
2337
+ _this.model = Checkout;
2338
+ return _this;
2339
+ }
2340
+ return CheckoutFirestoreRepository;
2339
2341
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2340
2342
 
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;
2343
+ var CouponFirestoreRepository = /** @class */ (function (_super) {
2344
+ __extends(CouponFirestoreRepository, _super);
2345
+ function CouponFirestoreRepository(firestore) {
2346
+ var _this = _super.call(this) || this;
2347
+ _this.firestore = firestore;
2348
+ _this.collectionName = 'coupons';
2349
+ _this.model = Coupon;
2350
+ return _this;
2351
+ }
2352
+ CouponFirestoreRepository.prototype.buildModelInstance = function () {
2353
+ var _a = _super.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
2354
+ return {
2355
+ toFirestore: function (data) {
2356
+ var plain = toFirestore(data);
2357
+ if (!!data.expiresIn)
2358
+ plain.expiresIn = data.expiresIn.getTime();
2359
+ return plain;
2360
+ },
2361
+ fromFirestore: function (snap) {
2362
+ var instance = fromFirestore(snap);
2363
+ if (!lodash.isNil(instance.expiresIn))
2364
+ instance.expiresIn = new Date(snap.data().expiresIn);
2365
+ return instance;
2366
+ },
2367
+ };
2368
+ };
2369
+ return CouponFirestoreRepository;
2368
2370
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2369
2371
 
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;
2372
+ var OrderFirestoreRepository = /** @class */ (function (_super) {
2373
+ __extends(OrderFirestoreRepository, _super);
2374
+ function OrderFirestoreRepository(firestore) {
2375
+ var _this = _super.call(this) || this;
2376
+ _this.firestore = firestore;
2377
+ _this.collectionName = 'orders';
2378
+ _this.model = Order;
2379
+ return _this;
2380
+ }
2381
+ return OrderFirestoreRepository;
2380
2382
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2381
2383
 
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;
2384
+ var PaymentFirestoreRepository = /** @class */ (function (_super) {
2385
+ __extends(PaymentFirestoreRepository, _super);
2386
+ function PaymentFirestoreRepository(firestore) {
2387
+ var _this = _super.call(this) || this;
2388
+ _this.firestore = firestore;
2389
+ _this.collectionName = 'payments';
2390
+ _this.model = Payment;
2391
+ return _this;
2392
+ }
2393
+ return PaymentFirestoreRepository;
2392
2394
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2393
2395
 
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;
2396
+ var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
2397
+ __extends(CheckoutSubscriptionFirestoreRepository, _super);
2398
+ function CheckoutSubscriptionFirestoreRepository(firestore) {
2399
+ var _this = _super.call(this) || this;
2400
+ _this.firestore = firestore;
2401
+ _this.collectionName = 'checkoutsSubscription';
2402
+ _this.model = CheckoutSubscription;
2403
+ return _this;
2404
+ }
2405
+ return CheckoutSubscriptionFirestoreRepository;
2404
2406
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2405
2407
 
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;
2408
+ var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
2409
+ __extends(SubscriptionPlanFirestoreRepository, _super);
2410
+ function SubscriptionPlanFirestoreRepository(firestore) {
2411
+ var _this = _super.call(this) || this;
2412
+ _this.firestore = firestore;
2413
+ _this.collectionName = 'subscriptionPlans';
2414
+ _this.model = SubscriptionPlan;
2415
+ return _this;
2416
+ }
2417
+ return SubscriptionPlanFirestoreRepository;
2416
2418
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2417
2419
 
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;
2420
+ var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
2421
+ __extends(Buy2WinFirestoreRepository, _super);
2422
+ function Buy2WinFirestoreRepository(firestore) {
2423
+ var _this = _super.call(this) || this;
2424
+ _this.firestore = firestore;
2425
+ _this.collectionName = 'buy2win';
2426
+ _this.model = Buy2Win;
2427
+ return _this;
2428
+ }
2429
+ return Buy2WinFirestoreRepository;
2428
2430
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2429
2431
 
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;
2432
+ var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
2433
+ __extends(LegacyOrderFirestoreRepository, _super);
2434
+ function LegacyOrderFirestoreRepository(firestore) {
2435
+ var _this = _super.call(this, firestore) || this;
2436
+ _this.firestore = firestore;
2437
+ _this.collectionName = 'legacyOrders';
2438
+ return _this;
2439
+ }
2440
+ return LegacyOrderFirestoreRepository;
2439
2441
  }(OrderFirestoreRepository));
2440
2442
 
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;
2443
+ var HomeFirestoreRepository = /** @class */ (function (_super) {
2444
+ __extends(HomeFirestoreRepository, _super);
2445
+ function HomeFirestoreRepository(firestore) {
2446
+ var _this = _super.call(this) || this;
2447
+ _this.firestore = firestore;
2448
+ _this.homeToFirestore = function (home) {
2449
+ var _a;
2450
+ if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
2451
+ home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.homeCategoryGroupToPlain);
2452
+ home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.homeCategoryGroupToPlain);
2453
+ home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.homeCategoryGroupToPlain);
2454
+ }
2455
+ return home;
2456
+ };
2457
+ _this.homeCategoryGroupToPlain = function (homeCategoryGroup) { return ({
2458
+ category: homeCategoryGroup.category.toPlain(),
2459
+ products: homeCategoryGroup.products.map(function (product) { return product.toPlain(); }),
2460
+ }); };
2461
+ _this.homeFromFirestore = function (home) {
2462
+ var _a;
2463
+ if ((_a = home.data) === null || _a === void 0 ? void 0 : _a.data) {
2464
+ home.data.data.discoverProducts = home.data.data.discoverProducts.map(_this.plainToHomeCategoryGroup);
2465
+ home.data.data.featuredProducts = home.data.data.featuredProducts.map(_this.plainToHomeCategoryGroup);
2466
+ home.data.data.verticalProducts = home.data.data.verticalProducts.map(_this.plainToHomeCategoryGroup);
2467
+ home.data.createdAt =
2468
+ home.data.createdAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.createdAt.toDate() : home.data.createdAt;
2469
+ home.data.expiresAt =
2470
+ home.data.expiresAt instanceof firebase__default["default"].firestore.Timestamp ? home.data.expiresAt.toDate() : home.data.expiresAt;
2471
+ }
2472
+ return home;
2473
+ };
2474
+ _this.plainToHomeCategoryGroup = function (homeCategoryGroup) { return ({
2475
+ category: Category.toInstance(homeCategoryGroup.category),
2476
+ products: homeCategoryGroup.products.map(function (product) { return Product.toInstance(product); }),
2477
+ }); };
2478
+ _this.collectionName = 'dms';
2479
+ _this.model = Home;
2480
+ return _this;
2481
+ }
2482
+ HomeFirestoreRepository.prototype.buildModelInstance = function () {
2483
+ var _this = this;
2484
+ var _b = _super.prototype.buildModelInstance.call(this), fromFirestore = _b.fromFirestore, toFirestore = _b.toFirestore;
2485
+ return {
2486
+ toFirestore: function (data) {
2487
+ var modifiedData = _this.homeToFirestore(data);
2488
+ return toFirestore(modifiedData);
2489
+ },
2490
+ fromFirestore: function (snap) {
2491
+ var instance = fromFirestore(snap);
2492
+ return _this.homeFromFirestore(instance);
2493
+ },
2494
+ };
2495
+ };
2496
+ return HomeFirestoreRepository;
2495
2497
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2496
2498
 
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;
2499
+ var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
2500
+ __extends(ShopMenuFirestoreRepository, _super);
2501
+ function ShopMenuFirestoreRepository(firestore) {
2502
+ var _this = _super.call(this) || this;
2503
+ _this.firestore = firestore;
2504
+ _this.collectionName = 'shopMenus';
2505
+ _this.model = ShopMenu;
2506
+ return _this;
2507
+ }
2508
+ return ShopMenuFirestoreRepository;
2507
2509
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2508
2510
 
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;
2511
+ var AuthenticationFirebaseAuthService = /** @class */ (function () {
2512
+ function AuthenticationFirebaseAuthService(firebaseAuth) {
2513
+ this.firebaseAuth = firebaseAuth;
2514
+ }
2515
+ AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
2516
+ return __awaiter(this, void 0, void 0, function () {
2517
+ var credentials, user;
2518
+ return __generator(this, function (_a) {
2519
+ switch (_a.label) {
2520
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
2521
+ case 1:
2522
+ credentials = _a.sent();
2523
+ user = credentials.user;
2524
+ return [2 /*return*/, {
2525
+ id: user.uid,
2526
+ displayName: user.displayName,
2527
+ email: user.email,
2528
+ phone: user.phoneNumber,
2529
+ isAnonymous: false,
2530
+ }];
2531
+ }
2532
+ });
2533
+ });
2534
+ };
2535
+ AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
2536
+ return __awaiter(this, void 0, void 0, function () {
2537
+ var credentials, user;
2538
+ return __generator(this, function (_a) {
2539
+ switch (_a.label) {
2540
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
2541
+ case 1:
2542
+ credentials = _a.sent();
2543
+ user = credentials.user;
2544
+ return [2 /*return*/, {
2545
+ id: user.uid,
2546
+ displayName: user.displayName,
2547
+ email: user.email,
2548
+ phone: user.phoneNumber,
2549
+ isAnonymous: false,
2550
+ }];
2551
+ }
2552
+ });
2553
+ });
2554
+ };
2555
+ AuthenticationFirebaseAuthService.prototype.signOut = function () {
2556
+ return __awaiter(this, void 0, void 0, function () {
2557
+ return __generator(this, function (_a) {
2558
+ this.firebaseAuth.signOut();
2559
+ return [2 /*return*/];
2560
+ });
2561
+ });
2562
+ };
2563
+ AuthenticationFirebaseAuthService.prototype.signInAnonymously = function () {
2564
+ return __awaiter(this, void 0, void 0, function () {
2565
+ var auth, user;
2566
+ return __generator(this, function (_a) {
2567
+ switch (_a.label) {
2568
+ case 0: return [4 /*yield*/, this.firebaseAuth.signInAnonymously()];
2569
+ case 1:
2570
+ auth = _a.sent();
2571
+ user = auth.user;
2572
+ user.id = auth.user.uid;
2573
+ return [2 /*return*/, user];
2574
+ }
2575
+ });
2576
+ });
2577
+ };
2578
+ AuthenticationFirebaseAuthService.prototype.sendPasswordResetEmail = function (email) {
2579
+ return __awaiter(this, void 0, void 0, function () {
2580
+ return __generator(this, function (_a) {
2581
+ return [2 /*return*/, this.firebaseAuth.sendPasswordResetEmail(email)];
2582
+ });
2583
+ });
2584
+ };
2585
+ return AuthenticationFirebaseAuthService;
2584
2586
  }());
2585
2587
 
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;
2588
+ var RegisterFirebaseAuthService = /** @class */ (function () {
2589
+ function RegisterFirebaseAuthService(firebaseAuth) {
2590
+ this.firebaseAuth = firebaseAuth;
2591
+ }
2592
+ RegisterFirebaseAuthService.prototype.register = function (params) {
2593
+ return __awaiter(this, void 0, void 0, function () {
2594
+ var auth, user, error_1;
2595
+ return __generator(this, function (_a) {
2596
+ switch (_a.label) {
2597
+ case 0:
2598
+ _a.trys.push([0, 2, , 3]);
2599
+ return [4 /*yield*/, this.firebaseAuth.createUserWithEmailAndPassword(params.email, params.password)];
2600
+ case 1:
2601
+ auth = _a.sent();
2602
+ user = auth.user;
2603
+ user.sendEmailVerification();
2604
+ user.id = auth.user.uid;
2605
+ return [2 /*return*/, user];
2606
+ case 2:
2607
+ error_1 = _a.sent();
2608
+ if (error_1.code === 'auth/email-already-in-use')
2609
+ throw new UserAlreadyRegisteredError('Email already registered');
2610
+ if (error_1.code === 'auth/weak-password')
2611
+ throw new WeakPasswordError();
2612
+ throw error_1;
2613
+ case 3: return [2 /*return*/];
2614
+ }
2615
+ });
2616
+ });
2617
+ };
2618
+ return RegisterFirebaseAuthService;
2617
2619
  }());
2618
2620
 
2619
- /**
2620
- * Generated bundle index. Do not edit.
2621
+ /**
2622
+ * Generated bundle index. Do not edit.
2621
2623
  */
2622
2624
 
2623
2625
  Object.defineProperty(exports, 'add', {