@infrab4a/connect 1.0.0-beta.39 → 1.0.0-beta.4

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 (364) hide show
  1. package/bundles/infrab4a-connect.umd.js +212 -2113
  2. package/bundles/infrab4a-connect.umd.js.map +1 -1
  3. package/domain/catalog/models/category.d.ts +4 -5
  4. package/domain/catalog/models/index.d.ts +2 -3
  5. package/domain/catalog/models/product.d.ts +4 -9
  6. package/domain/catalog/models/types/product-review.type.d.ts +8 -10
  7. package/domain/catalog/models/variant.d.ts +3 -7
  8. package/domain/catalog/repositories/category.repository.d.ts +1 -1
  9. package/domain/catalog/repositories/product.repository.d.ts +3 -10
  10. package/domain/catalog/repositories/subscription-product.repository.d.ts +1 -1
  11. package/domain/catalog/repositories/variant.repository.d.ts +1 -1
  12. package/domain/general/model/base-model-with-identifier-fields.d.ts +3 -0
  13. package/domain/general/model/base.model.d.ts +6 -0
  14. package/domain/{generic → general}/model/index.d.ts +1 -0
  15. package/domain/general/model/types/base-model-builder.type.d.ts +5 -0
  16. package/domain/{generic → general}/model/types/index.d.ts +0 -2
  17. package/domain/general/model/types/non-function-properties.type.d.ts +2 -0
  18. package/domain/general/model/types/non-function-property-name.type.d.ts +3 -0
  19. package/domain/general/repository/create.repository.d.ts +5 -0
  20. package/domain/general/repository/crud.repository.d.ts +7 -0
  21. package/domain/general/repository/delete.repository.d.ts +5 -0
  22. package/domain/{generic → general}/repository/enums/where.enum.d.ts +2 -5
  23. package/domain/general/repository/find.repository.d.ts +5 -0
  24. package/domain/general/repository/get.repository.d.ts +5 -0
  25. package/domain/general/repository/read.repository.d.ts +5 -0
  26. package/domain/{generic → general}/repository/types/index.d.ts +0 -1
  27. package/domain/general/repository/types/repository-find-filters.type.d.ts +14 -0
  28. package/domain/{generic → general}/repository/types/repository-update-params.type.d.ts +4 -4
  29. package/domain/general/repository/update.repository.d.ts +5 -0
  30. package/domain/index.d.ts +1 -1
  31. package/domain/location/models/address.d.ts +2 -3
  32. package/domain/shop-settings/models/home.d.ts +3 -3
  33. package/domain/shop-settings/models/shop-menu.d.ts +3 -3
  34. package/domain/shop-settings/repositories/home.repository.d.ts +1 -1
  35. package/domain/shop-settings/repositories/shop-menu.repository.d.ts +1 -1
  36. package/domain/shopping/models/buy-2-win.d.ts +5 -3
  37. package/domain/shopping/models/checkout.d.ts +9 -7
  38. package/domain/shopping/models/coupons/club-coupon.d.ts +7 -0
  39. package/domain/shopping/models/coupons/coupon.d.ts +15 -13
  40. package/domain/shopping/models/coupons/enums/discount-type.enum.d.ts +5 -0
  41. package/domain/shopping/models/coupons/enums/index.d.ts +1 -2
  42. package/domain/shopping/models/coupons/index.d.ts +2 -1
  43. package/domain/shopping/models/coupons/store-coupon.d.ts +8 -0
  44. package/domain/shopping/models/payment.d.ts +5 -3
  45. package/domain/shopping/models/shipping-method.d.ts +5 -3
  46. package/domain/shopping/models/subscription/checkout.d.ts +5 -3
  47. package/domain/shopping/models/subscription/plan.d.ts +5 -3
  48. package/domain/shopping/repositories/buy-2-win.repository.d.ts +1 -1
  49. package/domain/shopping/repositories/checkout.repository.d.ts +1 -1
  50. package/domain/shopping/repositories/coupon.repository.d.ts +1 -1
  51. package/domain/shopping/repositories/order.repository.d.ts +1 -1
  52. package/domain/shopping/repositories/payment.repository.d.ts +1 -1
  53. package/domain/shopping/repositories/subscription/checkout.repository.d.ts +1 -1
  54. package/domain/shopping/repositories/subscription/plan.repository.d.ts +1 -1
  55. package/domain/users/errors/unauthorized.error.d.ts +1 -2
  56. package/domain/users/errors/user-already-registered.error.d.ts +1 -2
  57. package/domain/users/errors/weak-password.error.d.ts +1 -2
  58. package/domain/users/models/beauty-profile.d.ts +5 -4
  59. package/domain/users/models/lead.d.ts +5 -3
  60. package/domain/users/models/subscription/edition.d.ts +5 -4
  61. package/domain/users/models/subscription/payment.d.ts +5 -4
  62. package/domain/users/models/subscription/subscription.d.ts +5 -3
  63. package/domain/users/models/user-address.d.ts +3 -3
  64. package/domain/users/models/user-payment-method.d.ts +4 -4
  65. package/domain/users/models/user.d.ts +10 -11
  66. package/domain/users/repositories/beauty-profile.repository.d.ts +1 -1
  67. package/domain/users/repositories/edition.repository.d.ts +1 -1
  68. package/domain/users/repositories/lead.repository.d.ts +1 -1
  69. package/domain/users/repositories/subscription-payment.repository.d.ts +1 -1
  70. package/domain/users/repositories/subscription.repository.d.ts +1 -1
  71. package/domain/users/repositories/user-address.repository.d.ts +1 -1
  72. package/domain/users/repositories/user-payment-method.repository.d.ts +1 -1
  73. package/domain/users/repositories/user.repository.d.ts +2 -2
  74. package/errors/duplicated-results.error.d.ts +1 -2
  75. package/errors/invalid-argument.error.d.ts +1 -2
  76. package/errors/not-found.error.d.ts +1 -2
  77. package/errors/required-argument.error.d.ts +1 -2
  78. package/esm2015/domain/catalog/models/category.js +2 -5
  79. package/esm2015/domain/catalog/models/index.js +3 -4
  80. package/esm2015/domain/catalog/models/product.js +2 -12
  81. package/esm2015/domain/catalog/models/types/product-review.type.js +1 -1
  82. package/esm2015/domain/catalog/models/variant.js +2 -5
  83. package/esm2015/domain/catalog/repositories/category.repository.js +1 -1
  84. package/esm2015/domain/catalog/repositories/product.repository.js +1 -1
  85. package/esm2015/domain/catalog/repositories/subscription-product.repository.js +1 -1
  86. package/esm2015/domain/catalog/repositories/variant.repository.js +1 -1
  87. package/esm2015/domain/{generic → general}/index.js +1 -1
  88. package/esm2015/domain/general/model/base-model-with-identifier-fields.js +2 -0
  89. package/esm2015/domain/general/model/base.model.js +13 -0
  90. package/esm2015/domain/{generic → general}/model/identifier-fields.js +1 -1
  91. package/esm2015/domain/general/model/index.js +5 -0
  92. package/esm2015/domain/general/model/types/base-model-builder.type.js +2 -0
  93. package/esm2015/domain/general/model/types/index.js +4 -0
  94. package/esm2015/domain/general/model/types/non-function-properties.type.js +2 -0
  95. package/esm2015/domain/general/model/types/non-function-property-name.type.js +2 -0
  96. package/esm2015/domain/general/repository/create.repository.js +2 -0
  97. package/esm2015/domain/general/repository/crud.repository.js +2 -0
  98. package/esm2015/domain/general/repository/delete.repository.js +2 -0
  99. package/esm2015/domain/{generic → general}/repository/enums/index.js +1 -1
  100. package/esm2015/domain/{generic → general}/repository/enums/update-option-actions.enum.js +1 -1
  101. package/esm2015/domain/general/repository/enums/where.enum.js +12 -0
  102. package/esm2015/domain/general/repository/find.repository.js +2 -0
  103. package/esm2015/domain/general/repository/get.repository.js +2 -0
  104. package/esm2015/domain/{generic → general}/repository/index.js +1 -1
  105. package/esm2015/domain/general/repository/read.repository.js +2 -0
  106. package/esm2015/domain/general/repository/types/index.js +6 -0
  107. package/esm2015/domain/general/repository/types/repository-find-filters.type.js +2 -0
  108. package/esm2015/domain/{generic → general}/repository/types/repository-find-result.type.js +1 -1
  109. package/esm2015/domain/{generic → general}/repository/types/repository-limit-options.type.js +1 -1
  110. package/esm2015/domain/{generic → general}/repository/types/repository-order-by-list.type.js +1 -1
  111. package/esm2015/domain/general/repository/types/repository-update-params.type.js +2 -0
  112. package/esm2015/domain/general/repository/update.repository.js +2 -0
  113. package/esm2015/domain/index.js +2 -2
  114. package/esm2015/domain/location/models/address.js +2 -5
  115. package/esm2015/domain/shop-settings/models/home.js +3 -3
  116. package/esm2015/domain/shop-settings/models/shop-menu.js +3 -3
  117. package/esm2015/domain/shop-settings/repositories/home.repository.js +1 -1
  118. package/esm2015/domain/shop-settings/repositories/shop-menu.repository.js +1 -1
  119. package/esm2015/domain/shopping/models/buy-2-win.js +3 -3
  120. package/esm2015/domain/shopping/models/checkout.js +14 -6
  121. package/esm2015/domain/shopping/models/coupons/club-coupon.js +18 -0
  122. package/esm2015/domain/shopping/models/coupons/coupon.js +12 -4
  123. package/esm2015/domain/shopping/models/coupons/enums/discount-type.enum.js +7 -0
  124. package/esm2015/domain/shopping/models/coupons/enums/index.js +2 -3
  125. package/esm2015/domain/shopping/models/coupons/index.js +3 -2
  126. package/esm2015/domain/shopping/models/coupons/store-coupon.js +23 -0
  127. package/esm2015/domain/shopping/models/payment.js +3 -3
  128. package/esm2015/domain/shopping/models/shipping-method.js +3 -3
  129. package/esm2015/domain/shopping/models/subscription/checkout.js +3 -3
  130. package/esm2015/domain/shopping/models/subscription/plan.js +3 -3
  131. package/esm2015/domain/shopping/repositories/buy-2-win.repository.js +1 -1
  132. package/esm2015/domain/shopping/repositories/checkout.repository.js +1 -1
  133. package/esm2015/domain/shopping/repositories/coupon.repository.js +1 -1
  134. package/esm2015/domain/shopping/repositories/order.repository.js +1 -1
  135. package/esm2015/domain/shopping/repositories/payment.repository.js +1 -1
  136. package/esm2015/domain/shopping/repositories/subscription/checkout.repository.js +1 -1
  137. package/esm2015/domain/shopping/repositories/subscription/plan.repository.js +1 -1
  138. package/esm2015/domain/users/errors/unauthorized.error.js +2 -3
  139. package/esm2015/domain/users/errors/user-already-registered.error.js +2 -3
  140. package/esm2015/domain/users/errors/weak-password.error.js +2 -3
  141. package/esm2015/domain/users/models/beauty-profile.js +4 -4
  142. package/esm2015/domain/users/models/lead.js +3 -3
  143. package/esm2015/domain/users/models/subscription/edition.js +4 -4
  144. package/esm2015/domain/users/models/subscription/payment.js +4 -4
  145. package/esm2015/domain/users/models/subscription/subscription.js +3 -3
  146. package/esm2015/domain/users/models/user-address.js +3 -3
  147. package/esm2015/domain/users/models/user-payment-method.js +4 -4
  148. package/esm2015/domain/users/models/user.js +5 -5
  149. package/esm2015/domain/users/repositories/beauty-profile.repository.js +1 -1
  150. package/esm2015/domain/users/repositories/edition.repository.js +1 -1
  151. package/esm2015/domain/users/repositories/lead.repository.js +1 -1
  152. package/esm2015/domain/users/repositories/subscription-payment.repository.js +1 -1
  153. package/esm2015/domain/users/repositories/subscription.repository.js +1 -1
  154. package/esm2015/domain/users/repositories/user-address.repository.js +1 -1
  155. package/esm2015/domain/users/repositories/user-payment-method.repository.js +1 -1
  156. package/esm2015/domain/users/repositories/user.repository.js +1 -1
  157. package/esm2015/errors/duplicated-results.error.js +2 -3
  158. package/esm2015/errors/invalid-argument.error.js +2 -3
  159. package/esm2015/errors/not-found.error.js +2 -3
  160. package/esm2015/errors/required-argument.error.js +2 -3
  161. package/esm2015/infra/elasticsearch/adapters/axios.adapter.js +1 -36
  162. package/esm2015/infra/elasticsearch/adapters/elastic-search.adapter.js +1 -1
  163. package/esm2015/infra/elasticsearch/indexes/products-index.js +1 -35
  164. package/esm2015/infra/firebase/auth/authentication-firebase-auth.service.js +2 -2
  165. package/esm2015/infra/firebase/auth/register-firebase-auth.service.js +1 -1
  166. package/esm2015/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +2 -2
  167. package/esm2015/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +1 -1
  168. package/esm2015/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +1 -1
  169. package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +10 -9
  170. package/esm2015/infra/firebase/firestore/mixins/with-firestore.mixin.js +6 -2
  171. package/esm2015/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +1 -1
  172. package/esm2015/infra/firebase/firestore/mixins/with-helpers.mixin.js +1 -1
  173. package/esm2015/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +1 -1
  174. package/esm2015/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +4 -4
  175. package/esm2015/infra/firebase/firestore/models/user-search.js +3 -3
  176. package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +2 -4
  177. package/esm2015/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +8 -37
  178. package/esm2015/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +21 -11
  179. package/esm2015/infra/firebase/firestore/repositories/users/user-firestore.repository.js +2 -2
  180. package/esm2015/infra/firebase/firestore/types/firestore-sub.repository.type.js +1 -1
  181. package/esm2015/infra/firebase/firestore/types/firestore.helpers.type.js +1 -1
  182. package/esm2015/infra/firebase/firestore/types/firestore.repository.type.js +1 -1
  183. package/esm2015/infra/index.js +1 -2
  184. package/esm2015/utils/index.js +4 -6
  185. package/esm2015/utils/mixins/index.js +1 -2
  186. package/esm2015/utils/mixins/mixin-ctor.type.js +1 -1
  187. package/esm2015/utils/types/index.js +1 -2
  188. package/fesm2015/infrab4a-connect.js +141 -1369
  189. package/fesm2015/infrab4a-connect.js.map +1 -1
  190. package/infra/elasticsearch/adapters/axios.adapter.d.ts +0 -3
  191. package/infra/elasticsearch/adapters/elastic-search.adapter.d.ts +0 -3
  192. package/infra/elasticsearch/indexes/products-index.d.ts +1 -5
  193. package/infra/firebase/auth/authentication-firebase-auth.service.d.ts +1 -1
  194. package/infra/firebase/auth/register-firebase-auth.service.d.ts +1 -1
  195. package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +16 -3
  196. package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +28 -3
  197. package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +14 -3
  198. package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +19 -3
  199. package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +14 -3
  200. package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +14 -3
  201. package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +4 -5
  202. package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +14 -7
  203. package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +15 -6
  204. package/infra/firebase/firestore/models/user-search.d.ts +3 -3
  205. package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +42 -1
  206. package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +44 -5
  207. package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +51 -4
  208. package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +42 -1
  209. package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +42 -1
  210. package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +42 -1
  211. package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +42 -1
  212. package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +42 -1
  213. package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +42 -1
  214. package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +42 -1
  215. package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +42 -1
  216. package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +42 -1
  217. package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +42 -1
  218. package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +42 -1
  219. package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +51 -4
  220. package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +42 -1
  221. package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +51 -4
  222. package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +51 -4
  223. package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +51 -4
  224. package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +42 -1
  225. package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +51 -4
  226. package/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +42 -1
  227. package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +3 -3
  228. package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +3 -3
  229. package/infra/firebase/firestore/types/firestore.repository.type.d.ts +3 -7
  230. package/infra/index.d.ts +0 -1
  231. package/package.json +3 -5
  232. package/utils/index.d.ts +4 -5
  233. package/utils/mixins/index.d.ts +0 -1
  234. package/utils/mixins/mixin-ctor.type.d.ts +1 -1
  235. package/utils/types/index.d.ts +0 -1
  236. package/domain/catalog/models/kit-product.d.ts +0 -12
  237. package/domain/generic/model/base.model.d.ts +0 -10
  238. package/domain/generic/model/types/base-model-builder.type.d.ts +0 -15
  239. package/domain/generic/model/types/identifier-model.type.d.ts +0 -7
  240. package/domain/generic/model/types/model-base-structure.type.d.ts +0 -6
  241. package/domain/generic/model/types/non-function-properties.type.d.ts +0 -12
  242. package/domain/generic/model/types/non-function-property-name.type.d.ts +0 -4
  243. package/domain/generic/repository/create.repository.d.ts +0 -8
  244. package/domain/generic/repository/crud.repository.d.ts +0 -19
  245. package/domain/generic/repository/delete.repository.d.ts +0 -7
  246. package/domain/generic/repository/find.repository.d.ts +0 -11
  247. package/domain/generic/repository/get.repository.d.ts +0 -5
  248. package/domain/generic/repository/read.repository.d.ts +0 -14
  249. package/domain/generic/repository/types/repository-find-filters.type.d.ts +0 -13
  250. package/domain/generic/repository/types/where-options.type.d.ts +0 -2
  251. package/domain/generic/repository/update.repository.d.ts +0 -6
  252. package/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +0 -4
  253. package/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +0 -6
  254. package/domain/shopping/models/coupons/financial-coupon.d.ts +0 -9
  255. package/esm2015/domain/catalog/models/kit-product.js +0 -18
  256. package/esm2015/domain/generic/model/base.model.js +0 -23
  257. package/esm2015/domain/generic/model/index.js +0 -4
  258. package/esm2015/domain/generic/model/types/base-model-builder.type.js +0 -2
  259. package/esm2015/domain/generic/model/types/identifier-model.type.js +0 -2
  260. package/esm2015/domain/generic/model/types/index.js +0 -6
  261. package/esm2015/domain/generic/model/types/model-base-structure.type.js +0 -2
  262. package/esm2015/domain/generic/model/types/non-function-properties.type.js +0 -2
  263. package/esm2015/domain/generic/model/types/non-function-property-name.type.js +0 -2
  264. package/esm2015/domain/generic/repository/create.repository.js +0 -2
  265. package/esm2015/domain/generic/repository/crud.repository.js +0 -2
  266. package/esm2015/domain/generic/repository/delete.repository.js +0 -2
  267. package/esm2015/domain/generic/repository/enums/where.enum.js +0 -15
  268. package/esm2015/domain/generic/repository/find.repository.js +0 -2
  269. package/esm2015/domain/generic/repository/get.repository.js +0 -2
  270. package/esm2015/domain/generic/repository/read.repository.js +0 -2
  271. package/esm2015/domain/generic/repository/types/index.js +0 -7
  272. package/esm2015/domain/generic/repository/types/repository-find-filters.type.js +0 -2
  273. package/esm2015/domain/generic/repository/types/repository-update-params.type.js +0 -2
  274. package/esm2015/domain/generic/repository/types/where-options.type.js +0 -2
  275. package/esm2015/domain/generic/repository/update.repository.js +0 -2
  276. package/esm2015/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +0 -6
  277. package/esm2015/domain/shopping/models/coupons/enums/coupon-types.enum.js +0 -8
  278. package/esm2015/domain/shopping/models/coupons/financial-coupon.js +0 -28
  279. package/esm2015/infra/hasura-graphql/enums/hasura-graphql-column-type.enum.js +0 -13
  280. package/esm2015/infra/hasura-graphql/enums/hasura-graphql-where.enum.js +0 -15
  281. package/esm2015/infra/hasura-graphql/enums/index.js +0 -3
  282. package/esm2015/infra/hasura-graphql/index.js +0 -5
  283. package/esm2015/infra/hasura-graphql/mixins/helpers/attribute-option.helper.js +0 -31
  284. package/esm2015/infra/hasura-graphql/mixins/helpers/filter-option.helper.js +0 -18
  285. package/esm2015/infra/hasura-graphql/mixins/helpers/graphql-field.helper.js +0 -72
  286. package/esm2015/infra/hasura-graphql/mixins/helpers/index.js +0 -4
  287. package/esm2015/infra/hasura-graphql/mixins/index.js +0 -8
  288. package/esm2015/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.js +0 -45
  289. package/esm2015/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.js +0 -10
  290. package/esm2015/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.js +0 -29
  291. package/esm2015/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.js +0 -93
  292. package/esm2015/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.js +0 -35
  293. package/esm2015/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.js +0 -94
  294. package/esm2015/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.js +0 -56
  295. package/esm2015/infra/hasura-graphql/models/category-hasura-graphql.js +0 -4
  296. package/esm2015/infra/hasura-graphql/models/index.js +0 -5
  297. package/esm2015/infra/hasura-graphql/models/kit-product-hasura-graphql.js +0 -15
  298. package/esm2015/infra/hasura-graphql/models/product-hasura-graphql.js +0 -11
  299. package/esm2015/infra/hasura-graphql/models/variant-hasura-graphql.js +0 -9
  300. package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +0 -136
  301. package/esm2015/infra/hasura-graphql/repositories/catalog/index.js +0 -4
  302. package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +0 -375
  303. package/esm2015/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.js +0 -100
  304. package/esm2015/infra/hasura-graphql/repositories/index.js +0 -2
  305. package/esm2015/infra/hasura-graphql/types/fields.type.js +0 -2
  306. package/esm2015/infra/hasura-graphql/types/graphql.repository.type.js +0 -2
  307. package/esm2015/infra/hasura-graphql/types/hasura-graphql-auth-options.type.js +0 -2
  308. package/esm2015/infra/hasura-graphql/types/hasura-graphql-fields.type.js +0 -2
  309. package/esm2015/infra/hasura-graphql/types/hasura-graphql-headers.type.js +0 -2
  310. package/esm2015/infra/hasura-graphql/types/index.js +0 -9
  311. package/esm2015/infra/hasura-graphql/types/nested-field.type.js +0 -2
  312. package/esm2015/infra/hasura-graphql/types/query-builder-options.type.js +0 -2
  313. package/esm2015/infra/hasura-graphql/types/variable-options.type.js +0 -2
  314. package/esm2015/utils/is-uuid.js +0 -3
  315. package/esm2015/utils/mixins/merge-constructor-params.type.js +0 -2
  316. package/esm2015/utils/parse-datetime.js +0 -14
  317. package/esm2015/utils/types/array-element.type.js +0 -2
  318. package/infra/hasura-graphql/enums/hasura-graphql-column-type.enum.d.ts +0 -11
  319. package/infra/hasura-graphql/enums/hasura-graphql-where.enum.d.ts +0 -13
  320. package/infra/hasura-graphql/enums/index.d.ts +0 -2
  321. package/infra/hasura-graphql/index.d.ts +0 -4
  322. package/infra/hasura-graphql/mixins/helpers/attribute-option.helper.d.ts +0 -13
  323. package/infra/hasura-graphql/mixins/helpers/filter-option.helper.d.ts +0 -6
  324. package/infra/hasura-graphql/mixins/helpers/graphql-field.helper.d.ts +0 -8
  325. package/infra/hasura-graphql/mixins/helpers/index.d.ts +0 -3
  326. package/infra/hasura-graphql/mixins/index.d.ts +0 -7
  327. package/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.d.ts +0 -8
  328. package/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.d.ts +0 -11
  329. package/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.d.ts +0 -7
  330. package/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.d.ts +0 -31
  331. package/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.d.ts +0 -24
  332. package/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.d.ts +0 -11
  333. package/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.d.ts +0 -14
  334. package/infra/hasura-graphql/models/category-hasura-graphql.d.ts +0 -6
  335. package/infra/hasura-graphql/models/index.d.ts +0 -4
  336. package/infra/hasura-graphql/models/kit-product-hasura-graphql.d.ts +0 -6
  337. package/infra/hasura-graphql/models/product-hasura-graphql.d.ts +0 -9
  338. package/infra/hasura-graphql/models/variant-hasura-graphql.d.ts +0 -9
  339. package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +0 -22
  340. package/infra/hasura-graphql/repositories/catalog/index.d.ts +0 -3
  341. package/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +0 -26
  342. package/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +0 -13
  343. package/infra/hasura-graphql/repositories/index.d.ts +0 -1
  344. package/infra/hasura-graphql/types/fields.type.d.ts +0 -2
  345. package/infra/hasura-graphql/types/graphql.repository.type.d.ts +0 -21
  346. package/infra/hasura-graphql/types/hasura-graphql-auth-options.type.d.ts +0 -8
  347. package/infra/hasura-graphql/types/hasura-graphql-fields.type.d.ts +0 -36
  348. package/infra/hasura-graphql/types/hasura-graphql-headers.type.d.ts +0 -7
  349. package/infra/hasura-graphql/types/index.d.ts +0 -8
  350. package/infra/hasura-graphql/types/nested-field.type.d.ts +0 -7
  351. package/infra/hasura-graphql/types/query-builder-options.type.d.ts +0 -7
  352. package/infra/hasura-graphql/types/variable-options.type.d.ts +0 -9
  353. package/utils/is-uuid.d.ts +0 -1
  354. package/utils/mixins/merge-constructor-params.type.d.ts +0 -3
  355. package/utils/parse-datetime.d.ts +0 -1
  356. package/utils/types/array-element.type.d.ts +0 -1
  357. /package/domain/{generic → general}/index.d.ts +0 -0
  358. /package/domain/{generic → general}/model/identifier-fields.d.ts +0 -0
  359. /package/domain/{generic → general}/repository/enums/index.d.ts +0 -0
  360. /package/domain/{generic → general}/repository/enums/update-option-actions.enum.d.ts +0 -0
  361. /package/domain/{generic → general}/repository/index.d.ts +0 -0
  362. /package/domain/{generic → general}/repository/types/repository-find-result.type.d.ts +0 -0
  363. /package/domain/{generic → general}/repository/types/repository-limit-options.type.d.ts +0 -0
  364. /package/domain/{generic → general}/repository/types/repository-order-by-list.type.d.ts +0 -0
@@ -1,7 +1,7 @@
1
- import { BaseModel, GenericIdentifier, NonFunctionPropertyNames } from '../../generic/model';
1
+ import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model';
2
2
  import { Shops } from './enums';
3
3
  import { CategoryCondition, CategoryFilter } from './types';
4
- export declare class Category extends BaseModel<Category> {
4
+ export declare class Category extends BaseModel<Category> implements IdentifierFields<Category> {
5
5
  id: string;
6
6
  brandCategory: boolean;
7
7
  brandLogo?: string;
@@ -14,10 +14,9 @@ export declare class Category extends BaseModel<Category> {
14
14
  conditions?: CategoryCondition;
15
15
  products?: string[];
16
16
  filters?: CategoryFilter[];
17
- createdAt?: Date;
18
- updatedAt?: Date;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
19
  shop: Shops;
20
20
  published: boolean;
21
21
  identifierFields(): NonFunctionPropertyNames<Category>[];
22
- static get identifiersFields(): GenericIdentifier[];
23
22
  }
@@ -1,6 +1,5 @@
1
- export * from './category';
2
1
  export * from './enums';
3
- export * from './kit-product';
4
- export * from './product';
5
2
  export * from './types';
3
+ export * from './category';
4
+ export * from './product';
6
5
  export * from './variant';
@@ -1,9 +1,8 @@
1
- import { BaseModel, GenericIdentifier, NonFunctionPropertyNames } from '../../generic/model';
1
+ import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model';
2
2
  import { Shops } from './enums/shops.enum';
3
- import { KitProduct } from './kit-product';
4
3
  import { ProductReview, ShopDescription, ShopPrice, ShopsDescription, ShopsPrice, Stock } from './types';
5
4
  import { Variant } from './variant';
6
- export declare class Product extends BaseModel<Product> {
5
+ export declare class Product extends BaseModel<Product> implements IdentifierFields<Product> {
7
6
  id: string;
8
7
  name: string;
9
8
  slug: string;
@@ -22,8 +21,8 @@ export declare class Product extends BaseModel<Product> {
22
21
  miniatures?: string[];
23
22
  published: boolean;
24
23
  publishedGlam: boolean;
25
- createdAt?: Date;
26
- updatedAt?: Date;
24
+ createdAt: Date;
25
+ updatedAt: Date;
27
26
  brand: string;
28
27
  tags?: string[];
29
28
  type?: string;
@@ -31,10 +30,6 @@ export declare class Product extends BaseModel<Product> {
31
30
  reviews?: ProductReview[];
32
31
  variant?: Variant;
33
32
  video?: string;
34
- isKit?: boolean;
35
- rate?: number;
36
- kitProducts?: KitProduct[];
37
33
  identifierFields(): NonFunctionPropertyNames<Product>[];
38
34
  getInfoByShop(shop: Shops): ShopDescription & ShopPrice & Stock;
39
- static get identifiersFields(): GenericIdentifier[];
40
35
  }
@@ -1,17 +1,15 @@
1
1
  import { Shops } from '../enums/shops.enum';
2
2
  export declare type ProductReview = {
3
- id?: string;
4
- shop: Shops;
3
+ author: string;
4
+ createdAt: Date;
5
+ email: string;
6
+ location: string;
5
7
  rate: number;
6
- author?: string;
7
- email?: string;
8
- location?: string;
9
- review?: string;
10
- status?: boolean;
11
- title?: string;
8
+ review: string;
9
+ status: boolean;
10
+ title: string;
11
+ shop?: Shops;
12
12
  personId?: number;
13
13
  points?: number;
14
14
  orderId?: string;
15
- createdAt?: Date;
16
- updatedAt?: Date;
17
15
  };
@@ -1,18 +1,14 @@
1
- import { BaseModel, NonFunctionPropertyNames } from '../../generic/model';
1
+ import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model';
2
2
  import { ShopsPrice, Stock, VariantGrade } from './types';
3
- export declare type ProductVariantIdentifiers = 'id' | 'productId';
4
- export declare class Variant extends BaseModel<Variant, ProductVariantIdentifiers> {
3
+ export declare class Variant extends BaseModel<Variant> implements IdentifierFields<Variant> {
5
4
  id: string;
6
5
  productId: string;
7
6
  sku: string;
8
7
  price: ShopsPrice;
9
8
  EAN: string;
10
9
  stock: Stock;
11
- grade?: VariantGrade[];
10
+ grade: VariantGrade[];
12
11
  costPrice: number;
13
12
  weight: number;
14
- createdAt?: Date;
15
- updatedAt?: Date;
16
13
  identifierFields(): NonFunctionPropertyNames<Variant>[];
17
- static get identifiersFields(): ProductVariantIdentifiers[];
18
14
  }
@@ -1,5 +1,5 @@
1
1
  import { Category } from '../models/category';
2
- import { CrudRepository } from '../../generic/repository/crud.repository';
2
+ import { CrudRepository } from '../../general/repository/crud.repository';
3
3
  import { Shops } from '../models/enums/shops.enum';
4
4
  import { Product } from '../models';
5
5
  export interface CategoryRepository extends CrudRepository<Category> {
@@ -1,12 +1,5 @@
1
- import { CrudRepository } from '../../generic/repository/crud.repository';
2
- import { Product, ProductReview } from '../models';
3
- export declare type ReviewStatusParams = 'pending' | 'approved' | 'rejected';
4
- export declare type ReviewWithProductData = ProductReview & {
5
- productId: string;
6
- productName: string;
7
- productSku: string;
8
- };
1
+ import { CrudRepository } from '../../general/repository/crud.repository';
2
+ import { Product, Shops } from '../models';
9
3
  export interface ProductRepository extends CrudRepository<Product> {
10
- getBySlug(slug: string): Promise<Product>;
11
- fetchReviews(status: ReviewStatusParams): Promise<ReviewWithProductData[]>;
4
+ getBySlug(slug: string, shop: Shops): Promise<Product>;
12
5
  }
@@ -1,4 +1,4 @@
1
- import { CrudRepository } from '../../generic/repository/crud.repository';
1
+ import { CrudRepository } from '../../general/repository/crud.repository';
2
2
  import { Product } from '../models';
3
3
  export interface SubscriptionProductRepository extends CrudRepository<Product> {
4
4
  }
@@ -1,4 +1,4 @@
1
- import { CrudRepository } from '../../generic/repository/crud.repository';
1
+ import { CrudRepository } from '../../general/repository/crud.repository';
2
2
  import { Variant } from '../models/variant';
3
3
  export interface VariantRepository extends CrudRepository<Variant> {
4
4
  }
@@ -0,0 +1,3 @@
1
+ import { BaseModel } from './base.model';
2
+ import { IdentifierFields } from './identifier-fields';
3
+ export declare type BaseModelWithIdentifier<Model> = BaseModel<Model> & IdentifierFields<Model>;
@@ -0,0 +1,6 @@
1
+ import { NonFunctionProperties } from './types/non-function-properties.type';
2
+ export declare class BaseModel<Model> {
3
+ constructor(args?: Partial<Model>);
4
+ static toInstance<T>(this: new () => Partial<T>, data: NonFunctionProperties<T>): T;
5
+ toPlain(): any;
6
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './base.model';
2
2
  export * from './identifier-fields';
3
+ export * from './base-model-with-identifier-fields';
3
4
  export * from './types';
@@ -0,0 +1,5 @@
1
+ import { NonFunctionProperties } from './non-function-properties.type';
2
+ export interface BaseModelBuilder<T> {
3
+ new (...args: any[]): T;
4
+ toInstance(this: new () => T, data: NonFunctionProperties<T>): T;
5
+ }
@@ -1,5 +1,3 @@
1
1
  export * from './non-function-property-name.type';
2
2
  export * from './non-function-properties.type';
3
3
  export * from './base-model-builder.type';
4
- export * from './model-base-structure.type';
5
- export * from './identifier-model.type';
@@ -0,0 +1,2 @@
1
+ import { NonFunctionPropertyNames } from './non-function-property-name.type';
2
+ export declare type NonFunctionProperties<T> = Pick<Partial<T>, NonFunctionPropertyNames<T>>;
@@ -0,0 +1,3 @@
1
+ export declare type NonFunctionPropertyNames<T> = {
2
+ [K in keyof T]: T[K] extends () => void ? never : K;
3
+ }[keyof T];
@@ -0,0 +1,5 @@
1
+ import { BaseModelWithIdentifier } from '../model/base-model-with-identifier-fields';
2
+ import { NonFunctionProperties } from '../model/types/non-function-properties.type';
3
+ export interface CreateRepository<Model extends BaseModelWithIdentifier<Model>> {
4
+ create(data: NonFunctionProperties<BaseModelWithIdentifier<Model>>): Promise<Model>;
5
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseModelWithIdentifier } from '../model/base-model-with-identifier-fields';
2
+ import { CreateRepository } from './create.repository';
3
+ import { DeleteRepository } from './delete.repository';
4
+ import { ReadRepository } from './read.repository';
5
+ import { UpdateRepository } from './update.repository';
6
+ export interface CrudRepository<Model extends BaseModelWithIdentifier<Model>> extends CreateRepository<Model>, DeleteRepository<Model>, ReadRepository<Model>, UpdateRepository<Model> {
7
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseModelWithIdentifier } from '../model/base-model-with-identifier-fields';
2
+ import { NonFunctionProperties } from '../model/types/non-function-properties.type';
3
+ export interface DeleteRepository<Model extends BaseModelWithIdentifier<Model>> {
4
+ delete(identifiers: NonFunctionProperties<BaseModelWithIdentifier<Model>>): Promise<void>;
5
+ }
@@ -1,13 +1,10 @@
1
1
  export declare enum Where {
2
2
  EQUALS = "==",
3
+ NOTEQUALS = "!=",
3
4
  GT = ">",
4
5
  GTE = ">=",
5
6
  IN = "in",
6
- NOTIN = "not in",
7
7
  LT = "<",
8
8
  LTE = "<=",
9
- LIKE = "like",
10
- NOTLIKE = "not like",
11
- ISNULL = "is null",
12
- ISNOTNULL = "is not null"
9
+ LIKE = "like"
13
10
  }
@@ -0,0 +1,5 @@
1
+ import { BaseModelWithIdentifier } from '../model/base-model-with-identifier-fields';
2
+ import { RepositoryFindFielters, RepositoryFindResult, RepositoryLimitOptions, RepositoryOrderByList } from './types';
3
+ export interface FindRepository<Model extends BaseModelWithIdentifier<Model>> {
4
+ find(filters?: RepositoryFindFielters<Model>[], limits?: RepositoryLimitOptions<Model>, orderBy?: RepositoryOrderByList<Model>): Promise<RepositoryFindResult<Model>>;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseModelWithIdentifier } from '../model/base-model-with-identifier-fields';
2
+ import { NonFunctionProperties } from '../model/types/non-function-properties.type';
3
+ export interface GetRepository<Model extends BaseModelWithIdentifier<Model>> {
4
+ get(identifiers: NonFunctionProperties<BaseModelWithIdentifier<Model>>): Promise<Model>;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseModelWithIdentifier } from '../model/base-model-with-identifier-fields';
2
+ import { FindRepository } from './find.repository';
3
+ import { GetRepository } from './get.repository';
4
+ export interface ReadRepository<Model extends BaseModelWithIdentifier<Model>> extends FindRepository<Model>, GetRepository<Model> {
5
+ }
@@ -3,4 +3,3 @@ export * from './repository-order-by-list.type';
3
3
  export * from './repository-limit-options.type';
4
4
  export * from './repository-find-result.type';
5
5
  export * from './repository-update-params.type';
6
- export * from './where-options.type';
@@ -0,0 +1,14 @@
1
+ import { NonFunctionPropertyNames } from '../../model/types/non-function-property-name.type';
2
+ import { PropType } from '../../../../utils';
3
+ import { Where } from '../enums/where.enum';
4
+ export declare type RepositoryFindFieltersOptions<Model, FieldName extends keyof Model> = {
5
+ operator: Where;
6
+ value: PropType<Model, FieldName> | PropType<Model, FieldName>[];
7
+ };
8
+ export declare type NestedRepositoryFindFieltersOptions<Model> = {
9
+ [key in NonFunctionPropertyNames<Model>]?: RepositoryFindFieltersOptions<Model, key>;
10
+ };
11
+ export declare type RepositoryFindField<Model, FieldName extends keyof Model> = RepositoryFindFieltersOptions<Model, FieldName> | Partial<PropType<Model, FieldName>> | NestedRepositoryFindFieltersOptions<PropType<Model, FieldName>>;
12
+ export declare type RepositoryFindFielters<Model> = {
13
+ [key in NonFunctionPropertyNames<Model>]?: RepositoryFindField<Model, key>;
14
+ };
@@ -1,11 +1,11 @@
1
- import { ModelBaseStructure } from '../..';
2
- import { PropType } from '../../../../utils';
1
+ import { BaseModelWithIdentifier } from '../../model/base-model-with-identifier-fields';
3
2
  import { NonFunctionPropertyNames } from '../../model/types/non-function-property-name.type';
3
+ import { PropType } from '../../../../utils';
4
4
  export declare type UpdateOptionAction = 'removeField' | 'update' | 'merge' | 'remove' | 'null';
5
5
  export declare type UpdateOptions<T> = {
6
6
  action: UpdateOptionAction;
7
7
  value?: T;
8
8
  };
9
- export declare type RepositoryUpdateParams<Model extends ModelBaseStructure> = {
9
+ export declare type RepositoryUpdateParams<Model> = {
10
10
  [key in NonFunctionPropertyNames<Model>]?: UpdateOptions<PropType<Model, key>> | PropType<Model, key>;
11
- };
11
+ } | BaseModelWithIdentifier<Model>;
@@ -0,0 +1,5 @@
1
+ import { BaseModelWithIdentifier } from '../model/base-model-with-identifier-fields';
2
+ import { RepositoryUpdateParams } from './types/repository-update-params.type';
3
+ export interface UpdateRepository<Model extends BaseModelWithIdentifier<Model>> {
4
+ update(data: RepositoryUpdateParams<Model>): Promise<Model>;
5
+ }
package/domain/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './generic';
1
+ export * from './general';
2
2
  export * from './users';
3
3
  export * from './catalog';
4
4
  export * from './location';
@@ -1,6 +1,6 @@
1
- import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
1
+ import { BaseModel } from '../../general/model/base.model';
2
2
  import { LocationGeometry } from './types/location-geometry.type';
3
- export declare abstract class Address<Identifiers = GenericIdentifier> extends BaseModel<Address, Identifiers> {
3
+ export declare abstract class Address extends BaseModel<Address> {
4
4
  default?: boolean;
5
5
  recipient?: string;
6
6
  zip?: string;
@@ -18,5 +18,4 @@ export declare abstract class Address<Identifiers = GenericIdentifier> extends B
18
18
  formattedAddress?: string;
19
19
  placeId?: string;
20
20
  geometry?: LocationGeometry;
21
- static get identifiersFields(): string[];
22
21
  }
@@ -1,6 +1,6 @@
1
- import { BaseModel, GenericIdentifier } from '../../generic/model';
1
+ import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model';
2
2
  import { Banner, Benefit, HomeDataStructure } from './types';
3
- export declare class Home extends BaseModel<Home> {
3
+ export declare class Home extends BaseModel<Home> implements IdentifierFields<Home> {
4
4
  benefitsSection: Benefit[];
5
5
  blockBanners: Banner[];
6
6
  blogBanner: Banner;
@@ -13,5 +13,5 @@ export declare class Home extends BaseModel<Home> {
13
13
  verticalCarousels: string[];
14
14
  id: string;
15
15
  data: HomeDataStructure;
16
- static get identifiersFields(): GenericIdentifier[];
16
+ identifierFields(): NonFunctionPropertyNames<Home>[];
17
17
  }
@@ -1,7 +1,7 @@
1
- import { BaseModel, GenericIdentifier } from '../../generic/model';
1
+ import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model';
2
2
  import { MenuNav } from './types/menu-nav.type';
3
- export declare class ShopMenu extends BaseModel<ShopMenu> {
3
+ export declare class ShopMenu extends BaseModel<ShopMenu> implements IdentifierFields<ShopMenu> {
4
4
  menuNav: MenuNav[];
5
5
  id: string;
6
- static get identifiersFields(): GenericIdentifier[];
6
+ identifierFields(): NonFunctionPropertyNames<ShopMenu>[];
7
7
  }
@@ -1,4 +1,4 @@
1
- import { CrudRepository } from '../../generic/repository/crud.repository';
1
+ import { CrudRepository } from '../../general/repository/crud.repository';
2
2
  import { Home } from '../models/home';
3
3
  export interface HomeRepository extends CrudRepository<Home> {
4
4
  }
@@ -1,4 +1,4 @@
1
- import { CrudRepository } from '../../generic/repository/crud.repository';
1
+ import { CrudRepository } from '../../general/repository/crud.repository';
2
2
  import { ShopMenu } from '../models/shop-menu';
3
3
  export interface ShopMenuRepository extends CrudRepository<ShopMenu> {
4
4
  }
@@ -1,6 +1,8 @@
1
- import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
1
+ import { BaseModel } from '../../general/model/base.model';
2
+ import { IdentifierFields } from '../../general/model/identifier-fields';
3
+ import { NonFunctionPropertyNames } from '../../general/model/types';
2
4
  import { Shops, Category } from '../../catalog/models';
3
- export declare class Buy2Win extends BaseModel<Buy2Win> {
5
+ export declare class Buy2Win extends BaseModel<Buy2Win> implements IdentifierFields<Buy2Win> {
4
6
  active: boolean;
5
7
  cartValue: number;
6
8
  createdAt: Date;
@@ -12,5 +14,5 @@ export declare class Buy2Win extends BaseModel<Buy2Win> {
12
14
  startDate: Date;
13
15
  updatedAt?: Date;
14
16
  categories: Category[];
15
- static get identifiersFields(): GenericIdentifier[];
17
+ identifierFields(): NonFunctionPropertyNames<Buy2Win>[];
16
18
  }
@@ -1,11 +1,13 @@
1
1
  import { Address } from '../../location/models/address';
2
- import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
2
+ import { BaseModel } from '../../general/model/base.model';
3
+ import { IdentifierFields } from '../../general/model/identifier-fields';
4
+ import { NonFunctionPropertyNames } from '../../general/model/types';
3
5
  import { User } from '../../users/models/user';
4
- import { Coupon } from './coupons/coupon';
6
+ import { StoreCoupon } from './coupons/store-coupon';
5
7
  import { LineItem } from './line-item';
6
8
  import { ShippingMethod } from './shipping-method';
7
9
  import { Shops } from '../../catalog/models/enums/shops.enum';
8
- export declare class Checkout extends BaseModel<Checkout> {
10
+ export declare class Checkout extends BaseModel<Checkout> implements IdentifierFields<Checkout> {
9
11
  id?: string;
10
12
  paymentId?: string;
11
13
  status?: string;
@@ -13,8 +15,6 @@ export declare class Checkout extends BaseModel<Checkout> {
13
15
  updatedAt?: Date;
14
16
  completedAt?: Date;
15
17
  discount?: number;
16
- subTotalPrice?: number;
17
- totalPrice?: number;
18
18
  shop: Shops;
19
19
  glampoints?: number;
20
20
  lineItems?: LineItem[];
@@ -22,6 +22,8 @@ export declare class Checkout extends BaseModel<Checkout> {
22
22
  shippingAddress?: Address;
23
23
  billingAddress?: Address;
24
24
  shipping?: ShippingMethod;
25
- coupon?: Coupon;
26
- static get identifiersFields(): GenericIdentifier[];
25
+ coupon?: StoreCoupon;
26
+ get subTotalPrice(): number;
27
+ get totalPrice(): number;
28
+ identifierFields(): NonFunctionPropertyNames<Checkout>[];
27
29
  }
@@ -0,0 +1,7 @@
1
+ import { CheckoutTypes } from '../enums/checkout-types.enum';
2
+ import { Coupon } from './coupon';
3
+ export declare class ClubCoupon extends Coupon<ClubCoupon> {
4
+ plan: string;
5
+ checkoutType: CheckoutTypes;
6
+ static isClubCoupon(coupon: Coupon): coupon is ClubCoupon;
7
+ }
@@ -1,26 +1,28 @@
1
- import { BaseModel, GenericIdentifier } from '../../../generic/model/base.model';
1
+ import { BaseModel } from '../../../general/model/base.model';
2
2
  import { CheckoutTypes } from '../enums/checkout-types.enum';
3
+ import { IdentifierFields } from '../../../general/model/identifier-fields';
4
+ import { NonFunctionPropertyNames } from '../../../general/model/types';
3
5
  import { Shops } from '../../../catalog/models/enums/shops.enum';
4
- import { CouponTypes, Exclusivities } from './enums';
5
- export declare class Coupon extends BaseModel<Coupon> {
6
+ import { DiscountType, Exclusivities } from './enums';
7
+ export declare class Coupon<CouponSubType extends Coupon = any> extends BaseModel<CouponSubType> implements IdentifierFields<Coupon> {
6
8
  id: string;
7
- type: CouponTypes;
8
- discount?: number;
9
- user?: string;
10
- recipient?: string;
11
- store?: Shops;
12
- campaign?: string;
13
9
  name: string;
14
10
  nickname: string;
15
- expiresIn?: Date;
11
+ expiresAt: Date;
12
+ beginAt: Date;
13
+ discountType: DiscountType;
14
+ discount?: number;
16
15
  useLimit?: number;
17
- createdAt: Date;
18
- updatedAt?: Date;
16
+ quantityPerUser?: number;
19
17
  shopAvailability: Shops;
20
18
  personId?: number;
21
19
  influencerEmail?: string;
20
+ recipient?: string;
21
+ createdAt: Date;
22
+ updatedAt?: Date;
22
23
  checkoutType: CheckoutTypes;
23
24
  exclusivityType?: Exclusivities;
24
25
  get isInfluencer(): boolean;
25
- static get identifiersFields(): GenericIdentifier[];
26
+ identifierFields(): NonFunctionPropertyNames<Coupon>[];
27
+ calculeDiscount(amount: number): number;
26
28
  }
@@ -0,0 +1,5 @@
1
+ export declare enum DiscountType {
2
+ ABSOLUTE = 1,
3
+ PERCENTAGE = 2,
4
+ FREE_SHIPPING = 3
5
+ }
@@ -1,3 +1,2 @@
1
- export * from './coupon-types.enum';
2
- export * from './coupon-subtypes.enum';
1
+ export * from './discount-type.enum';
3
2
  export * from './exclusivities.enum';
@@ -1,3 +1,4 @@
1
1
  export * from './enums';
2
2
  export * from './coupon';
3
- export * from './financial-coupon';
3
+ export * from './club-coupon';
4
+ export * from './store-coupon';
@@ -0,0 +1,8 @@
1
+ import { CheckoutTypes } from '../enums/checkout-types.enum';
2
+ import { Category } from '../../../catalog';
3
+ import { Coupon } from './coupon';
4
+ export declare class StoreCoupon extends Coupon<StoreCoupon> {
5
+ checkoutType: CheckoutTypes;
6
+ categories: Category[];
7
+ static isStoreCoupon(coupon: Coupon): coupon is StoreCoupon;
8
+ }
@@ -1,6 +1,8 @@
1
- import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
1
+ import { BaseModel } from '../../general/model/base.model';
2
+ import { IdentifierFields } from '../../general/model/identifier-fields';
3
+ import { NonFunctionPropertyNames } from '../../general/model/types';
2
4
  import { PaymentBilling, PaymentCard, PaymentCustomer, PaymentItem, PaymentShipping } from './types';
3
- export declare class Payment extends BaseModel<Payment> {
5
+ export declare class Payment extends BaseModel<Payment> implements IdentifierFields<Payment> {
4
6
  id: number;
5
7
  object: string;
6
8
  status: string;
@@ -63,5 +65,5 @@ export declare class Payment extends BaseModel<Payment> {
63
65
  privateLabel: string;
64
66
  pixQrCode: string;
65
67
  pixExpirationDate: string;
66
- static get identifiersFields(): GenericIdentifier[];
68
+ identifierFields(): NonFunctionPropertyNames<Payment>[];
67
69
  }
@@ -1,5 +1,7 @@
1
- import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
2
- export declare class ShippingMethod extends BaseModel<ShippingMethod> {
1
+ import { BaseModel } from '../../general/model/base.model';
2
+ import { IdentifierFields } from '../../general/model/identifier-fields';
3
+ import { NonFunctionPropertyNames } from '../../general/model/types';
4
+ export declare class ShippingMethod extends BaseModel<ShippingMethod> implements IdentifierFields<ShippingMethod> {
3
5
  id: string;
4
6
  CNPJ: string;
5
7
  DaysToDelivery: number;
@@ -12,5 +14,5 @@ export declare class ShippingMethod extends BaseModel<ShippingMethod> {
12
14
  State: string;
13
15
  ZipEnd: number;
14
16
  ZipStart: number;
15
- static get identifiersFields(): GenericIdentifier[];
17
+ identifierFields(): NonFunctionPropertyNames<ShippingMethod>[];
16
18
  }
@@ -1,9 +1,11 @@
1
1
  import { Address } from '../../../location/models/address';
2
- import { BaseModel, GenericIdentifier } from '../../../generic/model/base.model';
2
+ import { BaseModel } from '../../../general/model/base.model';
3
3
  import { Coupon } from '../coupons/coupon';
4
+ import { IdentifierFields } from '../../../general/model/identifier-fields';
5
+ import { NonFunctionPropertyNames } from '../../../general/model/types';
4
6
  import { User } from '../../../users/models/user';
5
7
  import { SubscriptionPlan } from './plan';
6
- export declare class CheckoutSubscription extends BaseModel<CheckoutSubscription> {
8
+ export declare class CheckoutSubscription extends BaseModel<CheckoutSubscription> implements IdentifierFields<CheckoutSubscription> {
7
9
  id?: string;
8
10
  user: User;
9
11
  createdAt: Date;
@@ -17,5 +19,5 @@ export declare class CheckoutSubscription extends BaseModel<CheckoutSubscription
17
19
  billingAddress?: Address;
18
20
  subscriptionPlan: SubscriptionPlan;
19
21
  coupon?: Coupon;
20
- static get identifiersFields(): GenericIdentifier[];
22
+ identifierFields(): NonFunctionPropertyNames<CheckoutSubscription>[];
21
23
  }
@@ -1,10 +1,12 @@
1
- import { BaseModel, GenericIdentifier } from '../../../generic/model/base.model';
2
- export declare class SubscriptionPlan extends BaseModel<SubscriptionPlan> {
1
+ import { BaseModel } from '../../../general/model/base.model';
2
+ import { IdentifierFields } from '../../../general/model/identifier-fields';
3
+ import { NonFunctionPropertyNames } from '../../../general/model/types';
4
+ export declare class SubscriptionPlan extends BaseModel<SubscriptionPlan> implements IdentifierFields<SubscriptionPlan> {
3
5
  id: string;
4
6
  name: string;
5
7
  billingPrice: number;
6
8
  recurrencePrice: number;
7
9
  recurrenceCycle: number;
8
10
  maxAttempts: number;
9
- static get identifiersFields(): GenericIdentifier[];
11
+ identifierFields(): NonFunctionPropertyNames<SubscriptionPlan>[];
10
12
  }
@@ -1,4 +1,4 @@
1
1
  import { Buy2Win } from '../models/buy-2-win';
2
- import { CrudRepository } from '../../generic/repository/crud.repository';
2
+ import { CrudRepository } from '../../general/repository/crud.repository';
3
3
  export interface Buy2WinRepository extends CrudRepository<Buy2Win> {
4
4
  }
@@ -1,4 +1,4 @@
1
1
  import { Checkout } from '../models/checkout';
2
- import { CrudRepository } from '../../generic/repository/crud.repository';
2
+ import { CrudRepository } from '../../general/repository/crud.repository';
3
3
  export interface CheckoutRepository extends CrudRepository<Checkout> {
4
4
  }
@@ -1,4 +1,4 @@
1
1
  import { Coupon } from '../models/coupons/coupon';
2
- import { CrudRepository } from '../../generic/repository/crud.repository';
2
+ import { CrudRepository } from '../../general/repository/crud.repository';
3
3
  export interface CouponRepository extends CrudRepository<Coupon> {
4
4
  }
@@ -1,4 +1,4 @@
1
- import { CrudRepository } from '../../generic/repository/crud.repository';
1
+ import { CrudRepository } from '../../general/repository/crud.repository';
2
2
  import { Order } from '../models/order';
3
3
  export interface OrderRepository extends CrudRepository<Order> {
4
4
  }