@infrab4a/connect 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/bundles/infrab4a-connect.umd.js +77 -0
  2. package/bundles/infrab4a-connect.umd.js.map +1 -1
  3. package/esm2015/lib/domain/catalog/index.js +3 -0
  4. package/esm2015/lib/domain/catalog/models/category.js +7 -0
  5. package/esm2015/lib/domain/catalog/models/enums/shops.enum.js +6 -0
  6. package/esm2015/lib/domain/catalog/models/index.js +4 -0
  7. package/esm2015/lib/domain/catalog/models/product.js +7 -0
  8. package/esm2015/lib/domain/catalog/models/types/category-condition.type.js +2 -0
  9. package/esm2015/lib/domain/catalog/models/types/category-filter.type.js +2 -0
  10. package/esm2015/lib/domain/catalog/models/types/index.js +8 -0
  11. package/esm2015/lib/domain/catalog/models/types/product-review.type.js +2 -0
  12. package/esm2015/lib/domain/catalog/models/types/shops-description.type.js +2 -0
  13. package/esm2015/lib/domain/catalog/models/types/shops-price.type.js +2 -0
  14. package/esm2015/lib/domain/catalog/models/types/stock.type.js +2 -0
  15. package/esm2015/lib/domain/catalog/models/types/variant-grade.type.js +2 -0
  16. package/esm2015/lib/domain/catalog/models/variant.js +7 -0
  17. package/esm2015/lib/domain/catalog/repositories/category.repository.js +2 -0
  18. package/esm2015/lib/domain/catalog/repositories/index.js +4 -0
  19. package/esm2015/lib/domain/catalog/repositories/product.repository.js +2 -0
  20. package/esm2015/lib/domain/catalog/repositories/variant.repository.js +2 -0
  21. package/esm2015/lib/domain/index.js +2 -1
  22. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +12 -0
  23. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/index.js +4 -0
  24. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +12 -0
  25. package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -0
  26. package/esm2015/lib/infra/firebase/firestore/repositories/index.js +2 -1
  27. package/fesm2015/infrab4a-connect.js +48 -1
  28. package/fesm2015/infrab4a-connect.js.map +1 -1
  29. package/lib/domain/catalog/index.d.ts +2 -0
  30. package/lib/domain/catalog/models/category.d.ts +18 -0
  31. package/lib/domain/catalog/models/enums/shops.enum.d.ts +4 -0
  32. package/lib/domain/catalog/models/index.d.ts +3 -0
  33. package/lib/domain/catalog/models/product.d.ts +31 -0
  34. package/lib/domain/catalog/models/types/category-condition.type.d.ts +4 -0
  35. package/lib/domain/catalog/models/types/category-filter.type.d.ts +4 -0
  36. package/lib/domain/catalog/models/types/index.d.ts +7 -0
  37. package/lib/domain/catalog/models/types/product-review.type.d.ts +12 -0
  38. package/lib/domain/catalog/models/types/shops-description.type.d.ts +7 -0
  39. package/lib/domain/catalog/models/types/shops-price.type.d.ts +10 -0
  40. package/lib/domain/catalog/models/types/stock.type.d.ts +3 -0
  41. package/lib/domain/catalog/models/types/variant-grade.type.d.ts +4 -0
  42. package/lib/domain/catalog/models/variant.d.ts +12 -0
  43. package/lib/domain/catalog/repositories/category.repository.d.ts +4 -0
  44. package/lib/domain/catalog/repositories/index.d.ts +3 -0
  45. package/lib/domain/catalog/repositories/product.repository.d.ts +4 -0
  46. package/lib/domain/catalog/repositories/variant.repository.d.ts +4 -0
  47. package/lib/domain/index.d.ts +1 -0
  48. package/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +48 -0
  49. package/lib/infra/firebase/firestore/repositories/catalog/index.d.ts +3 -0
  50. package/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +48 -0
  51. package/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +59 -0
  52. package/lib/infra/firebase/firestore/repositories/index.d.ts +1 -0
  53. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFyaWFudC5yZXBvc2l0b3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29ubmVjdC9zcmMvbGliL2RvbWFpbi9jYXRhbG9nL3JlcG9zaXRvcmllcy92YXJpYW50LnJlcG9zaXRvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENydWRSZXBvc2l0b3J5IH0gZnJvbSAnLi4vLi4vZ2VuZXJhbC9yZXBvc2l0b3J5L2NydWQucmVwb3NpdG9yeSdcbmltcG9ydCB7IFZhcmlhbnQgfSBmcm9tICcuLi9tb2RlbHMvdmFyaWFudCdcblxuZXhwb3J0IGludGVyZmFjZSBWYXJpYW50UmVwb3NpdG9yeSBleHRlbmRzIENydWRSZXBvc2l0b3J5PFZhcmlhbnQ+IHt9XG4iXX0=
@@ -1,3 +1,4 @@
1
1
  export * from './general';
2
2
  export * from './users';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb25uZWN0L3NyYy9saWIvZG9tYWluL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsV0FBVyxDQUFBO0FBQ3pCLGNBQWMsU0FBUyxDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9nZW5lcmFsJ1xuZXhwb3J0ICogZnJvbSAnLi91c2VycydcbiJdfQ==
3
+ export * from './catalog';
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb25uZWN0L3NyYy9saWIvZG9tYWluL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsV0FBVyxDQUFBO0FBQ3pCLGNBQWMsU0FBUyxDQUFBO0FBQ3ZCLGNBQWMsV0FBVyxDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9nZW5lcmFsJ1xuZXhwb3J0ICogZnJvbSAnLi91c2VycydcbmV4cG9ydCAqIGZyb20gJy4vY2F0YWxvZydcbiJdfQ==
@@ -0,0 +1,12 @@
1
+ import { Base } from '../../../../../utils';
2
+ import { Category } from '../../../../../domain';
3
+ import { withCrudFirestore, withFirestore, withHelpers } from '../../mixins';
4
+ export class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
5
+ constructor(firestore) {
6
+ super();
7
+ this.firestore = firestore;
8
+ this.collectionName = 'categories';
9
+ this.model = Category;
10
+ }
11
+ }
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2F0ZWdvcnktZmlyZXN0b3JlLnJlcG9zaXRvcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb25uZWN0L3NyYy9saWIvaW5mcmEvZmlyZWJhc2UvZmlyZXN0b3JlL3JlcG9zaXRvcmllcy9jYXRhbG9nL2NhdGVnb3J5LWZpcmVzdG9yZS5yZXBvc2l0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQTtBQUMzQyxPQUFPLEVBQUUsUUFBUSxFQUFzQixNQUFNLHVCQUF1QixDQUFBO0FBRXBFLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxhQUFhLEVBQUUsV0FBVyxFQUFFLE1BQU0sY0FBYyxDQUFBO0FBRTVFLE1BQU0sT0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VxufVxuIl19
@@ -0,0 +1,4 @@
1
+ export * from './category-firestore.repository';
2
+ export * from './product-firestore.repository';
3
+ export * from './product-variant-firestore.repository';
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb25uZWN0L3NyYy9saWIvaW5mcmEvZmlyZWJhc2UvZmlyZXN0b3JlL3JlcG9zaXRvcmllcy9jYXRhbG9nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsaUNBQWlDLENBQUE7QUFDL0MsY0FBYyxnQ0FBZ0MsQ0FBQTtBQUM5QyxjQUFjLHdDQUF3QyxDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9jYXRlZ29yeS1maXJlc3RvcmUucmVwb3NpdG9yeSdcbmV4cG9ydCAqIGZyb20gJy4vcHJvZHVjdC1maXJlc3RvcmUucmVwb3NpdG9yeSdcbmV4cG9ydCAqIGZyb20gJy4vcHJvZHVjdC12YXJpYW50LWZpcmVzdG9yZS5yZXBvc2l0b3J5J1xuIl19
@@ -0,0 +1,12 @@
1
+ import { Base } from '../../../../../utils';
2
+ import { Product } from '../../../../../domain';
3
+ import { withCrudFirestore, withFirestore, withHelpers } from '../../mixins';
4
+ export class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
5
+ constructor(firestore) {
6
+ super();
7
+ this.firestore = firestore;
8
+ this.collectionName = 'products';
9
+ this.model = Product;
10
+ }
11
+ }
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZHVjdC1maXJlc3RvcmUucmVwb3NpdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4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cnMgfSBmcm9tICcuLi8uLi9taXhpbnMnXG5cbmV4cG9ydCBjbGFzcyBQcm9kdWN0RmlyZXN0b3JlUmVwb3NpdG9yeVxuICBleHRlbmRzIHdpdGhDcnVkRmlyZXN0b3JlKHdpdGhIZWxwZXJzKHdpdGhGaXJlc3RvcmU8UHJvZHVjdD4oQmFzZSkpKVxuICBpbXBsZW1lbnRzIFByb2R1Y3RSZXBvc2l0b3J5XG57XG4gIGNvbnN0cnVjdG9yKHJlYWRvbmx5IGZpcmVzdG9yZTogRmlyZWJhc2VGaXJlc3RvcmUpIHtcbiAgICBzdXBlcigpXG4gICAgdGhpcy5jb2xsZWN0aW9uTmFtZSA9ICdwcm9kdWN0cydcbiAgICB0aGlzLm1vZGVsID0gUHJvZHVjdFxuICB9XG59XG4iXX0=
@@ -0,0 +1,14 @@
1
+ import { Base } from '../../../../../utils';
2
+ import { Product, Variant } from '../../../../../domain';
3
+ import { withCrudFirestore, withFirestore, withHelpers, withSubCollection } from '../../mixins';
4
+ export class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product) {
5
+ constructor(firestore, parentRepository) {
6
+ super();
7
+ this.firestore = firestore;
8
+ this.parentRepository = parentRepository;
9
+ this.collectionName = 'Variants';
10
+ this.parentIdField = 'productId';
11
+ this.model = Variant;
12
+ }
13
+ }
14
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZHVjdC12YXJpYW50LWZpcmVzdG9yZS5yZXBvc2l0b3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29ubmVjdC9zcmMvbGliL2luZnJhL2ZpcmViYXNlL2ZpcmVzdG9yZS9yZXBvc2l0b3JpZXMvY2F0YWxvZy9wcm9kdWN0LXZhcmlhbnQtZmlyZXN0b3JlLnJlcG9zaXRvcnkudHMiXSwibmFtZ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W50IjpbImV4cG9ydCAqIGZyb20gJy4vdXNlcnMnXG4iXX0=
2
+ export * from './catalog';
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb25uZWN0L3NyYy9saWIvaW5mcmEvZmlyZWJhc2UvZmlyZXN0b3JlL3JlcG9zaXRvcmllcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLFNBQVMsQ0FBQTtBQUN2QixjQUFjLFdBQVcsQ0FBQSIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vdXNlcnMnXG5leHBvcnQgKiBmcm9tICcuL2NhdGFsb2cnXG4iXX0=
@@ -190,6 +190,24 @@ class SignOut {
190
190
  }
191
191
  }
192
192
 
193
+ class Category extends BaseModel {
194
+ identifierFields() {
195
+ return ['id'];
196
+ }
197
+ }
198
+
199
+ class Product extends BaseModel {
200
+ identifierFields() {
201
+ return ['id'];
202
+ }
203
+ }
204
+
205
+ class Variant extends BaseModel {
206
+ identifierFields() {
207
+ return ['id'];
208
+ }
209
+ }
210
+
193
211
  class InvalidArgumentError extends Error {
194
212
  constructor(message) {
195
213
  super(message);
@@ -468,6 +486,35 @@ class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFir
468
486
  }
469
487
  }
470
488
 
489
+ class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
490
+ constructor(firestore) {
491
+ super();
492
+ this.firestore = firestore;
493
+ this.collectionName = 'categories';
494
+ this.model = Category;
495
+ }
496
+ }
497
+
498
+ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
499
+ constructor(firestore) {
500
+ super();
501
+ this.firestore = firestore;
502
+ this.collectionName = 'products';
503
+ this.model = Product;
504
+ }
505
+ }
506
+
507
+ class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product) {
508
+ constructor(firestore, parentRepository) {
509
+ super();
510
+ this.firestore = firestore;
511
+ this.parentRepository = parentRepository;
512
+ this.collectionName = 'Variants';
513
+ this.parentIdField = 'productId';
514
+ this.model = Variant;
515
+ }
516
+ }
517
+
471
518
  class AuthenticationFirebaseAuthService {
472
519
  constructor(firebaseAuth) {
473
520
  this.firebaseAuth = firebaseAuth;
@@ -497,5 +544,5 @@ class AuthenticationFirebaseAuthService {
497
544
  * Generated bundle index. Do not edit.
498
545
  */
499
546
 
500
- export { Area, Authentication, AuthenticationFirebaseAuthService, Base, BaseModel, BeardSizes, BeautyProfile, BillingStatus, Edition, EditionStatus, HairTypes, InvalidArgumentError, NotFoundError, OfficePosition, RequiredArgumentError, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, UnauthorizedError, User, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserType, Where, withCreateFirestore, withCrudFirestore, withDeleteFirestore, withFindFirestore, withFirestore, withGetFirestore, withHelpers, withSubCollection, withUpdateFirestore };
547
+ export { Area, Authentication, AuthenticationFirebaseAuthService, Base, BaseModel, BeardSizes, BeautyProfile, BillingStatus, Category, CategoryFirestoreRepository, Edition, EditionStatus, HairTypes, InvalidArgumentError, NotFoundError, OfficePosition, Product, ProductFirestoreRepository, ProductVariantFirestoreRepository, RequiredArgumentError, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, UnauthorizedError, User, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserType, Variant, Where, withCreateFirestore, withCrudFirestore, withDeleteFirestore, withFindFirestore, withFirestore, withGetFirestore, withHelpers, withSubCollection, withUpdateFirestore };
501
548
  //# sourceMappingURL=infrab4a-connect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"infrab4a-connect.js","sources":["../../../projects/connect/src/lib/domain/general/model/base.model.ts","../../../projects/connect/src/lib/domain/general/repository/enums/where.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/status.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/user-type.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/billing-status.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/edition-status.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/beard-sizes.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/hair-types.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/area.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/office-position.enum.ts","../../../projects/connect/src/lib/domain/users/models/user.ts","../../../projects/connect/src/lib/domain/users/models/subscription.ts","../../../projects/connect/src/lib/domain/users/models/edition.ts","../../../projects/connect/src/lib/domain/users/models/beauty-profile.ts","../../../projects/connect/src/lib/utils/mixins/base.mixin.ts","../../../projects/connect/src/lib/domain/users/errors/unauthorized.error.ts","../../../projects/connect/src/lib/domain/users/use-cases/authentication.ts","../../../projects/connect/src/lib/domain/users/use-cases/signout.ts","../../../projects/connect/src/lib/errors/invalid-argument.error.ts","../../../projects/connect/src/lib/errors/required-argument.error.ts","../../../projects/connect/src/lib/errors/not-found.error.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-helpers.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/auth/authentication-firebase-auth.service.ts","../../../projects/connect/src/infrab4a-connect.ts"],"sourcesContent":["import { plainToClass, classToPlain } from 'class-transformer'\n\nimport { NonFunctionProperties } from './types/non-function-properties.type'\n\nexport class BaseModel<Model> {\n constructor(args?: Partial<Model>) {\n Object.assign(this, args)\n }\n\n static toInstance<T>(this: new () => Partial<T>, data: NonFunctionProperties<T>): T {\n return plainToClass(this, data) as any\n }\n\n toPlain(): any {\n return classToPlain(this, { exposeUnsetFields: false })\n }\n}\n","export enum Where {\n EQUALS = '==',\n GT = '>',\n GTE = '>=',\n IN = 'in',\n LT = '<',\n LTE = '<=',\n LIKE = 'like',\n}\n","export enum Status {\n ACTIVE = 'active',\n}\n","export enum UserType {\n B2C = 'Cliente Transacional',\n GlamGirl = 'Glamgirl',\n MensBoy = 'Mensboy',\n B2B = 'Company',\n Collaborator = 'Funcionário',\n Influencer = 'Influencer',\n}\n","export enum BillingStatus {\n PAYED = 'PAGO',\n}\n","export enum EditionStatus {\n ALLOCATION_WAITING = 'Aguardando alocação',\n}\n","export enum BeardSizes {\n BIG = 'Grande',\n MEDIUM = 'Média',\n SHORT = 'Curta',\n MUSTACHE = 'Bigode',\n NOTHING = 'Sem Barba',\n}\n","export enum HairTypes {\n Smooth = 'Liso',\n WAVY = 'Ondulado',\n CURLY = 'Cacheado',\n FRIZZY = 'Crespo',\n BALD = 'Sou careca',\n}\n","export enum Area {\n GP = 'Geral',\n CRM = 'CRM',\n MediaProd = 'Media Production',\n Tech = 'Tecnologia',\n Transactional = 'Transacional',\n Operations = 'Opera\\u00E7\\u00F5es',\n Sales = 'Comercial',\n Finantial = 'Financeiro',\n HR = 'RH',\n}\n","export enum OfficePosition {\n Intern = 'Estagi\\u00E1rio',\n Analyst = 'Analista',\n Manager = 'Gerente',\n Director = 'Diretor',\n}\n","import { BaseModel } from '../../general/model/base.model'\nimport { IdentifierFields } from '../../general/model/identifier-fields'\nimport { NonFunctionProperties, NonFunctionPropertyNames } from '../../general/model/types'\n\nimport { Area, OfficePosition, UserType } from './enums'\nimport { BeautyProfile } from './beauty-profile'\n\nexport class User extends BaseModel<User> implements IdentifierFields<User> {\n id: string\n cpf?: string\n email: string\n firstName: string\n lastName: string\n displayName?: string\n phone: string\n birthday?: Date\n acceptsNewsletter: boolean\n type?: UserType\n beautyProfile?: BeautyProfile\n area?: Area\n officePosition?: OfficePosition\n\n static toInstance<T>(this: new () => Partial<T>, data: NonFunctionProperties<T> & NonFunctionProperties<User>): T {\n const instance = super.toInstance<User>(data)\n\n instance.displayName = `${data.firstName} ${data.lastName}`\n\n return instance as any\n }\n\n identifierFields(): NonFunctionPropertyNames<User>[] {\n return ['id']\n }\n\n toPlain(): any {\n const plain = super.toPlain()\n\n delete plain.beautyProfile\n\n return plain\n }\n}\n","import { BaseModel } from '../../general/model/base.model'\nimport { IdentifierFields } from '../../general/model/identifier-fields'\nimport { NonFunctionPropertyNames } from '../../general/model/types/non-function-property-name.type'\n\nimport { Edition } from './edition'\nimport { Status } from './enums/status.enum'\nimport { User } from './user'\n\nexport class Subscription extends BaseModel<Subscription> implements IdentifierFields<Subscription> {\n id: string\n nextPayment: Date\n recurrence: boolean\n status: Status\n editions: Edition[]\n user: User\n\n identifierFields(): NonFunctionPropertyNames<Subscription>[] {\n return ['id']\n }\n}\n","import { BaseModel } from '../../general/model/base.model'\nimport { IdentifierFields } from '../../general/model/identifier-fields'\nimport { NonFunctionPropertyNames } from '../../general/model/types/non-function-property-name.type'\n\nimport { EditionStatus, BillingStatus } from './enums'\n\nexport class Edition extends BaseModel<Edition> implements IdentifierFields<Edition> {\n id: string\n subscriptionId: string\n billingStatus: BillingStatus\n editionId: number\n editionStatus: EditionStatus\n installment: number\n paymentId: string\n draftId?: string\n\n identifierFields(): NonFunctionPropertyNames<Edition>[] {\n return ['id']\n }\n}\n","import { BaseModel } from '../../general/model/base.model'\nimport { IdentifierFields } from '../../general/model/identifier-fields'\nimport { NonFunctionPropertyNames } from '../../general/model/types/non-function-property-name.type'\n\nimport { BeardSizes, HairTypes } from './enums'\n\nexport class BeautyProfile extends BaseModel<BeautyProfile> implements IdentifierFields<BeautyProfile> {\n id: string\n userId: string\n beardSize?: BeardSizes\n hairType?: HairTypes\n\n toPlain(): any {\n const plain = super.toPlain()\n\n delete plain.id\n\n return plain\n }\n\n identifierFields(): NonFunctionPropertyNames<BeautyProfile>[] {\n return ['id']\n }\n}\n","export class Base {\n constructor(...args: Array<any>) {\n Object.assign(this, ...args)\n }\n}\n","export class UnauthorizedError extends Error {\n constructor(readonly message) {\n super(message)\n }\n}\n","import { Area, OfficePosition, User, UserType } from '../models'\nimport { AuthenticationService } from '../services/authentication.service'\nimport { isNil } from '../../../utils'\nimport { UnauthorizedError } from '../errors/unauthorized.error'\nimport { UserRepository } from '../repositories/user.repository'\n\nexport enum SignInMethods {\n EMAIL_PASSWORD = 'email_password',\n GOOGLE = 'google',\n}\n\ntype SignInMethod = Lowercase<keyof typeof SignInMethods>\n\ntype SignInParams = {\n email?: string\n password?: string\n}\n\nexport class Authentication {\n constructor(private readonly authService: AuthenticationService, private readonly userRepository: UserRepository) {}\n\n async signIn({ email, password }: SignInParams, signInMethod: SignInMethod): Promise<User> {\n const method = this.getServiceByMethod(signInMethod)\n const userAuth = await this.authService[method]({ email, password })\n const user = this.userRepository.get(userAuth)\n\n if (!isNil(user)) return user\n if (/^.+@b4a.com.br$/.test(userAuth.email)) return this.createsUserByCredential(userAuth)\n\n throw new UnauthorizedError('Invalid credentials')\n }\n\n private getServiceByMethod(signInMethod: SignInMethod): string {\n return signInMethod === SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle'\n }\n\n private async createsUserByCredential(user: Partial<User>): Promise<User> {\n const [firstName, lastName] = user.displayName?.split(/\\s/)\n const person = User.toInstance({\n ...user,\n cpf: '',\n birthday: new Date(),\n firstName,\n lastName,\n acceptsNewsletter: false,\n area: Area.Transactional,\n officePosition: OfficePosition.Intern,\n type: UserType.Collaborator,\n })\n\n return this.userRepository.create(person)\n }\n}\n","import { AuthenticationService } from '../services/authentication.service'\n\nexport class SignOut {\n constructor(private readonly authService: AuthenticationService) {}\n\n async signOut(): Promise<void> {\n await this.authService.signOut()\n }\n}\n","export class InvalidArgumentError extends Error {\n constructor(readonly message) {\n super(message)\n }\n}\n","export class RequiredArgumentError extends Error {\n arguments: string[]\n\n constructor(readonly args: string[]) {\n super(`Required arguments: ${args.join(', ')}`)\n\n this.arguments = args\n }\n}\n","export class NotFoundError extends Error {\n constructor(readonly message) {\n super(message)\n }\n}\n","import { CollectionReference, DocumentData, FirebaseFirestore, QueryDocumentSnapshot } from '@firebase/firestore-types'\n\nimport { BaseModelBuilder, BaseModelWithIdentifier } from '../../../../domain'\nimport { FirestoreRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nexport const withFirestore = <TBase extends BaseModelWithIdentifier<TBase>>(MixinBase: MixinCtor) => {\n return class extends MixinBase implements FirestoreRepository<TBase> {\n readonly firestore?: FirebaseFirestore\n collectionName: string\n model: BaseModelBuilder<TBase>\n\n constructor(...args: Array<any>) {\n super(args)\n }\n\n collection(path?: string): CollectionReference<TBase> {\n return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance())\n }\n\n buildModelInstance(): {\n toFirestore: (data: TBase) => DocumentData\n fromFirestore: (snap: QueryDocumentSnapshot<TBase>) => TBase\n } {\n return {\n toFirestore: (data: TBase): DocumentData => data.toPlain(),\n fromFirestore: (snap: QueryDocumentSnapshot<TBase>): TBase =>\n this.model.toInstance({ id: snap.id, ...snap.data() }),\n }\n }\n }\n}\n","import { QuerySnapshot, QueryDocumentSnapshot } from '@firebase/firestore-types'\n\nimport { BaseModelWithIdentifier } from '../../../../domain'\n\nimport { FirestoreHelpers, FirestoreRepository, FirestoreSubRepository } from '../types'\nimport { isNil, MixinCtor } from '../../../../utils'\n\nexport const withHelpers = <Model extends BaseModelWithIdentifier<Model>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor & TMixinBase,\n) => {\n return class extends MixinBase implements FirestoreHelpers {\n toArray<T extends BaseModelWithIdentifier<T>>(snapShot: QuerySnapshot<T> | QueryDocumentSnapshot<T>[]): T[] {\n if (Array.isArray(snapShot)) {\n return snapShot.map((doc: QueryDocumentSnapshot<T>) => doc.data())\n } else {\n return snapShot.docs.map((doc: QueryDocumentSnapshot<T>) => doc.data())\n }\n }\n\n isSubCollection<T extends BaseModelWithIdentifier<T>>(\n repository: FirestoreRepository<T>,\n ): repository is FirestoreSubRepository<T> {\n return !isNil(Object.keys(this).find((key) => key === 'parentRepository'))\n }\n }\n}\n","import { BaseModelWithIdentifier, GetRepository, NonFunctionProperties } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { isNil, MixinCtor } from '../../../../utils'\nimport { NotFoundError } from '../../../../errors'\n\nexport const withGetFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class GetFirestore extends MixinBase implements GetRepository<TBase> {\n async get(identifiers: NonFunctionProperties<TBase>): Promise<TBase> {\n const doc = await this.collection(this.buildCollectionPathForGet(identifiers))\n .doc(Object.values(identifiers).shift().toString())\n .get()\n const data = doc.data()\n\n if (isNil(data)) throw new NotFoundError(`Document ${JSON.stringify(identifiers)} not found`)\n\n return data\n }\n\n buildCollectionPathForGet(identifiers: NonFunctionProperties<TBase>): string {\n return this.isSubCollection(this)\n ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`\n : this.collectionName\n }\n }\n}\n","import { CollectionReference, Query, WhereFilterOp } from '@firebase/firestore-types'\n\nimport {\n BaseModelWithIdentifier,\n FindRepository,\n NonFunctionPropertyNames,\n RepositoryFindFielters,\n RepositoryFindFieltersOptions,\n RepositoryFindResult,\n RepositoryLimitOptions,\n RepositoryOrderByList,\n Where,\n} from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { MixinCtor, isNumber, isString } from '../../../../utils'\n\nexport const withFindFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class FindFirestore extends MixinBase implements FindRepository<TBase> {\n async find(\n filters?: RepositoryFindFielters<TBase>[],\n limits?: RepositoryLimitOptions<TBase>,\n orderBy?: RepositoryOrderByList<TBase>,\n ): Promise<RepositoryFindResult<TBase>> {\n let query: CollectionReference<TBase> | Query<TBase> = this.collection(this.buildCollectionPathForFind(filters))\n\n filters?.forEach((filterer) => (query = this.makeFirestoreWhere(query, filterer)))\n\n orderBy?.forEach((orderer) =>\n Object.keys(orderer).forEach((fieldName) => (query = query.orderBy(fieldName, orderer[fieldName]))),\n )\n\n query = this.defineLimits(query, filters, limits)\n\n const docs = await query.get()\n const data = docs.docs.map((doc) => doc.data())\n\n return {\n data,\n count: this.calculateCount(data, limits),\n }\n }\n\n buildCollectionPathForFind(filters: RepositoryFindFielters<TBase>[]): string {\n if (!this.isSubCollection<TBase>(this)) return this.collectionName\n\n const parentIdField = this.parentIdField\n const parentId = filters.find((groupFilter) => Boolean(groupFilter[parentIdField]?.value))?.[parentIdField].value\n\n return `${this.parentRepository.collectionName}/${parentId}/${this.collectionName}`\n }\n\n makeFirestoreWhere = (\n queryReference: CollectionReference<TBase> | Query<TBase>,\n filter: RepositoryFindFielters<TBase>,\n ): Query<TBase> =>\n Object.keys(filter).reduce(\n (query: Query<TBase>, fieldName: string) =>\n this.buildWhereSentence(query, fieldName as NonFunctionPropertyNames<TBase>, filter[fieldName]),\n queryReference,\n )\n\n buildWhereSentence = (\n queryReference: CollectionReference<TBase> | Query<TBase>,\n fieldName: NonFunctionPropertyNames<TBase>,\n options: RepositoryFindFieltersOptions<TBase, NonFunctionPropertyNames<TBase>>,\n ): Query<TBase> => {\n if (options.operator === Where.LIKE) {\n queryReference = queryReference.where(fieldName.toString(), '>=', options.value)\n queryReference = queryReference.where(fieldName.toString(), '<=', `${options.value}~`)\n }\n\n return queryReference.where(fieldName.toString(), options.operator as WhereFilterOp, options.value)\n }\n\n defineLimits(\n query: CollectionReference<TBase> | Query<TBase>,\n filters: RepositoryFindFielters<TBase>[],\n limits: RepositoryLimitOptions<TBase>,\n ): Query<TBase> {\n if (limits?.offset) {\n if (limits.offset instanceof this.model)\n query.startAfter(\n this.collection(this.buildCollectionPathForFind(filters)).doc(\n limits.offset[limits.offset.identifierFields().shift() as string],\n ),\n )\n if (isNumber(limits.offset) || isString(limits.offset)) query.startAt(limits.offset)\n }\n if (limits?.limit) query.limit(limits.limit)\n\n return query\n }\n\n calculateCount(data: TBase[], limits: RepositoryLimitOptions<TBase>): number {\n if (data.length <= 0) return 0\n if (data.length < limits?.limit) return data.length\n\n return Infinity\n }\n }\n}\n","import { DocumentReference } from '@firebase/firestore-types'\n\nimport { CreateRepository, BaseModelWithIdentifier } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { isEmpty, MixinCtor } from '../../../../utils'\n\nexport const withCreateFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class CreateFirestore extends MixinBase implements CreateRepository<TBase> {\n async create(data: Partial<TBase>): Promise<TBase> {\n const docRef = await this.save(this.model.toInstance(data))\n const doc = await docRef.get()\n\n return doc.data()\n }\n\n async save(data: TBase): Promise<DocumentReference<TBase>> {\n const id = data[data.identifierFields().shift()]?.toString()\n\n if (isEmpty(id)) return this.collection(this.buildCollectionPathForAdd(data)).add(data)\n\n const docRef = this.collection().doc(id)\n await docRef.set(data)\n\n return docRef\n }\n\n buildCollectionPathForAdd(identifiers: Partial<TBase>): string {\n return this.isSubCollection(this)\n ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`\n : this.collectionName\n }\n }\n}\n","import { BaseModelWithIdentifier, UpdateRepository } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nexport const withUpdateFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class UpdateFirestore extends MixinBase implements UpdateRepository<TBase> {\n async update(data: TBase): Promise<TBase> {\n const docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(\n data[data.identifierFields().shift().toString()],\n )\n\n await docRef.update(data.toPlain())\n\n const doc = await docRef.get()\n\n return doc.data()\n }\n\n buildCollectionPathForUpdate(identifiers: TBase): string {\n return this.isSubCollection(this)\n ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`\n : this.collectionName\n }\n }\n}\n","import { BaseModelWithIdentifier, NonFunctionProperties, DeleteRepository } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nexport const withDeleteFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class DeleteFirestore extends MixinBase implements DeleteRepository<TBase> {\n async delete(identifiers: NonFunctionProperties<TBase>): Promise<void> {\n await this.collection(this.buildCollectionPathForRemove(identifiers))\n .doc(Object.values(identifiers).shift().toString())\n .delete()\n }\n\n buildCollectionPathForRemove(identifiers: NonFunctionProperties<TBase>): string {\n return this.isSubCollection(this)\n ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`\n : this.collectionName\n }\n }\n}\n","import { CollectionReference, DocumentData, FirebaseFirestore, QueryDocumentSnapshot } from '@firebase/firestore-types'\n\nimport { BaseModelWithIdentifier, NonFunctionPropertyNames } from '../../../../domain'\nimport { FirestoreRepository, FirestoreSubRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nexport const withSubCollection = <\n TBase extends BaseModelWithIdentifier<TBase>,\n TBaseParent extends BaseModelWithIdentifier<TBaseParent>,\n TMixinBase extends MixinCtor,\n>(\n MixinBase: MixinCtor<FirestoreRepository<TBase>> & TMixinBase,\n ParentModel: new () => TBaseParent,\n) => {\n return class SubCollectionMix\n extends MixinBase\n implements FirestoreSubRepository<TBase, InstanceType<typeof ParentModel>>\n {\n readonly parentRepository: FirestoreRepository<InstanceType<typeof ParentModel>>\n parentIdField: NonFunctionPropertyNames<TBase>\n\n constructor(...args: Array<any>) {\n super(args)\n }\n\n collection(path?: string): CollectionReference<TBase> {\n return super.collection(path)\n }\n }\n}\n","import { BaseModelWithIdentifier, CrudRepository } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nimport { withCreateFirestore } from './with-create-firestore.mixin'\nimport { withDeleteFirestore } from './with-delete-firestore.mixin'\nimport { withFindFirestore } from './with-find-firestore.mixin'\nimport { withGetFirestore } from './with-get-firestore.mixin'\nimport { withUpdateFirestore } from './with-update-firestore.mixin'\n\nexport const withCrudFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class CrudFirestore\n extends withUpdateFirestore(\n withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))),\n )\n implements CrudRepository<TBase> {}\n}\n","import { FirebaseFirestore } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { Subscription, SubscriptionRepository } from '../../../../../domain'\n\nimport { withCrudFirestore, withFirestore, withHelpers } from '../../mixins'\n\nexport class SubscriptionFirestoreRepository\n extends withCrudFirestore(withHelpers(withFirestore<Subscription>(Base)))\n implements SubscriptionRepository\n{\n constructor(readonly firestore: FirebaseFirestore) {\n super()\n this.collectionName = 'subscription'\n this.model = Subscription\n }\n}\n","import { DocumentData, FirebaseFirestore, QueryDocumentSnapshot } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { BeautyProfile, User, UserRepository } from '../../../../../domain'\n\nimport { withCrudFirestore, withFirestore, withHelpers } from '../../mixins'\n\nexport class UserFirestoreRepository\n extends withCrudFirestore(withHelpers(withFirestore<User>(Base)))\n implements UserRepository\n{\n constructor(readonly firestore: FirebaseFirestore) {\n super()\n this.collectionName = 'users'\n this.model = User\n }\n\n async get(identifiers: Partial<User>): Promise<User> {\n const user = await super.get({ id: identifiers.id })\n\n user.beautyProfile = await this.getBeautyProfile(user.id)\n\n return user\n }\n\n private async getBeautyProfile(userId: string): Promise<BeautyProfile> {\n const beautyProfile = await this.collection()\n .doc(userId)\n .collection('CX')\n .withConverter(this.buildBeautyProfileModelInstance())\n .doc('beautyProfile')\n .get()\n\n return beautyProfile.data()\n }\n\n private buildBeautyProfileModelInstance(): {\n toFirestore: (data: BeautyProfile) => DocumentData\n fromFirestore: (snap: QueryDocumentSnapshot<BeautyProfile>) => BeautyProfile\n } {\n return {\n toFirestore: (data: BeautyProfile): DocumentData => data.toPlain(),\n fromFirestore: (snap: QueryDocumentSnapshot<BeautyProfile>): BeautyProfile =>\n BeautyProfile.toInstance(snap.data()),\n }\n }\n}\n","import { FirebaseFirestore } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { Edition, Subscription, EditionRepository } from '../../../../../domain'\nimport { withCrudFirestore, withFirestore, withHelpers, withSubCollection } from '../../mixins'\n\nimport { SubscriptionFirestoreRepository } from './subscription-firestore.repository'\n\nexport class SubscriptionEditionFirestoreRepository\n extends withSubCollection(withCrudFirestore(withHelpers(withFirestore<Edition>(Base))), Subscription)\n implements EditionRepository\n{\n constructor(readonly firestore: FirebaseFirestore, readonly parentRepository: SubscriptionFirestoreRepository) {\n super()\n this.collectionName = 'editions'\n this.parentIdField = 'subscriptionId'\n this.model = Edition\n }\n}\n","import { FirebaseFirestore } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { BeautyProfile, BeautyProfileRepository, User } from '../../../../../domain'\nimport { withCrudFirestore, withFirestore, withHelpers, withSubCollection } from '../../mixins'\n\nimport { UserFirestoreRepository } from './user-firestore.repository'\n\nexport class UserBeautyProfileFirestoreRepository\n extends withSubCollection(withCrudFirestore(withHelpers(withFirestore<BeautyProfile>(Base))), User)\n implements BeautyProfileRepository\n{\n constructor(readonly firestore: FirebaseFirestore, readonly parentRepository: UserFirestoreRepository) {\n super()\n this.collectionName = 'CX'\n this.parentIdField = 'userId'\n this.model = BeautyProfile\n }\n}\n","import firebase from 'firebase/app'\n\nimport { AuthenticationService, LoginAndPasswordParams, User } from '../../../domain'\n\nexport class AuthenticationFirebaseAuthService implements AuthenticationService {\n constructor(private readonly firebaseAuth: firebase.auth.Auth) {}\n\n async signInWithEmailAndPassword(data: LoginAndPasswordParams): Promise<Partial<User>> {\n const credentials = await this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)\n const user = credentials.user\n\n return { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }\n }\n\n async signInWithGoogle(): Promise<Partial<User>> {\n const credentials = await this.firebaseAuth.signInWithPopup(new firebase.auth.GoogleAuthProvider())\n const user = credentials.user\n\n return { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }\n }\n\n async signOut(): Promise<void> {\n this.firebaseAuth.signOut()\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;M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C,iBAAY,GAAZ,YAAY,CAAoB;KAAI;IAE3D,0BAA0B,CAAC,IAA4B;;YAC3D,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,0BAA0B,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACjG,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAA;YAE7B,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAA;SACnG;KAAA;IAEK,gBAAgB;;YACpB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAA;YACnG,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAA;YAE7B,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAA;SACnG;KAAA;IAEK,OAAO;;YACX,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAA;SAC5B;KAAA;;;ACvBH;;;;;;"}
1
+ {"version":3,"file":"infrab4a-connect.js","sources":["../../../projects/connect/src/lib/domain/general/model/base.model.ts","../../../projects/connect/src/lib/domain/general/repository/enums/where.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/status.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/user-type.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/billing-status.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/edition-status.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/beard-sizes.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/hair-types.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/area.enum.ts","../../../projects/connect/src/lib/domain/users/models/enums/office-position.enum.ts","../../../projects/connect/src/lib/domain/users/models/user.ts","../../../projects/connect/src/lib/domain/users/models/subscription.ts","../../../projects/connect/src/lib/domain/users/models/edition.ts","../../../projects/connect/src/lib/domain/users/models/beauty-profile.ts","../../../projects/connect/src/lib/utils/mixins/base.mixin.ts","../../../projects/connect/src/lib/domain/users/errors/unauthorized.error.ts","../../../projects/connect/src/lib/domain/users/use-cases/authentication.ts","../../../projects/connect/src/lib/domain/users/use-cases/signout.ts","../../../projects/connect/src/lib/domain/catalog/models/category.ts","../../../projects/connect/src/lib/domain/catalog/models/product.ts","../../../projects/connect/src/lib/domain/catalog/models/variant.ts","../../../projects/connect/src/lib/errors/invalid-argument.error.ts","../../../projects/connect/src/lib/errors/required-argument.error.ts","../../../projects/connect/src/lib/errors/not-found.error.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-helpers.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.ts","../../../projects/connect/src/lib/infra/firebase/auth/authentication-firebase-auth.service.ts","../../../projects/connect/src/infrab4a-connect.ts"],"sourcesContent":["import { plainToClass, classToPlain } from 'class-transformer'\n\nimport { NonFunctionProperties } from './types/non-function-properties.type'\n\nexport class BaseModel<Model> {\n constructor(args?: Partial<Model>) {\n Object.assign(this, args)\n }\n\n static toInstance<T>(this: new () => Partial<T>, data: NonFunctionProperties<T>): T {\n return plainToClass(this, data) as any\n }\n\n toPlain(): any {\n return classToPlain(this, { exposeUnsetFields: false })\n }\n}\n","export enum Where {\n EQUALS = '==',\n GT = '>',\n GTE = '>=',\n IN = 'in',\n LT = '<',\n LTE = '<=',\n LIKE = 'like',\n}\n","export enum Status {\n ACTIVE = 'active',\n}\n","export enum UserType {\n B2C = 'Cliente Transacional',\n GlamGirl = 'Glamgirl',\n MensBoy = 'Mensboy',\n B2B = 'Company',\n Collaborator = 'Funcionário',\n Influencer = 'Influencer',\n}\n","export enum BillingStatus {\n PAYED = 'PAGO',\n}\n","export enum EditionStatus {\n ALLOCATION_WAITING = 'Aguardando alocação',\n}\n","export enum BeardSizes {\n BIG = 'Grande',\n MEDIUM = 'Média',\n SHORT = 'Curta',\n MUSTACHE = 'Bigode',\n NOTHING = 'Sem Barba',\n}\n","export enum HairTypes {\n Smooth = 'Liso',\n WAVY = 'Ondulado',\n CURLY = 'Cacheado',\n FRIZZY = 'Crespo',\n BALD = 'Sou careca',\n}\n","export enum Area {\n GP = 'Geral',\n CRM = 'CRM',\n MediaProd = 'Media Production',\n Tech = 'Tecnologia',\n Transactional = 'Transacional',\n Operations = 'Opera\\u00E7\\u00F5es',\n Sales = 'Comercial',\n Finantial = 'Financeiro',\n HR = 'RH',\n}\n","export enum OfficePosition {\n Intern = 'Estagi\\u00E1rio',\n Analyst = 'Analista',\n Manager = 'Gerente',\n Director = 'Diretor',\n}\n","import { BaseModel } from '../../general/model/base.model'\nimport { IdentifierFields } from '../../general/model/identifier-fields'\nimport { NonFunctionProperties, NonFunctionPropertyNames } from '../../general/model/types'\n\nimport { Area, OfficePosition, UserType } from './enums'\nimport { BeautyProfile } from './beauty-profile'\n\nexport class User extends BaseModel<User> implements IdentifierFields<User> {\n id: string\n cpf?: string\n email: string\n firstName: string\n lastName: string\n displayName?: string\n phone: string\n birthday?: Date\n acceptsNewsletter: boolean\n type?: UserType\n beautyProfile?: BeautyProfile\n area?: Area\n officePosition?: OfficePosition\n\n static toInstance<T>(this: new () => Partial<T>, data: NonFunctionProperties<T> & NonFunctionProperties<User>): T {\n const instance = super.toInstance<User>(data)\n\n instance.displayName = `${data.firstName} ${data.lastName}`\n\n return instance as any\n }\n\n identifierFields(): NonFunctionPropertyNames<User>[] {\n return ['id']\n }\n\n toPlain(): any {\n const plain = super.toPlain()\n\n delete plain.beautyProfile\n\n return plain\n }\n}\n","import { BaseModel } from '../../general/model/base.model'\nimport { IdentifierFields } from '../../general/model/identifier-fields'\nimport { NonFunctionPropertyNames } from '../../general/model/types/non-function-property-name.type'\n\nimport { Edition } from './edition'\nimport { Status } from './enums/status.enum'\nimport { User } from './user'\n\nexport class Subscription extends BaseModel<Subscription> implements IdentifierFields<Subscription> {\n id: string\n nextPayment: Date\n recurrence: boolean\n status: Status\n editions: Edition[]\n user: User\n\n identifierFields(): NonFunctionPropertyNames<Subscription>[] {\n return ['id']\n }\n}\n","import { BaseModel } from '../../general/model/base.model'\nimport { IdentifierFields } from '../../general/model/identifier-fields'\nimport { NonFunctionPropertyNames } from '../../general/model/types/non-function-property-name.type'\n\nimport { EditionStatus, BillingStatus } from './enums'\n\nexport class Edition extends BaseModel<Edition> implements IdentifierFields<Edition> {\n id: string\n subscriptionId: string\n billingStatus: BillingStatus\n editionId: number\n editionStatus: EditionStatus\n installment: number\n paymentId: string\n draftId?: string\n\n identifierFields(): NonFunctionPropertyNames<Edition>[] {\n return ['id']\n }\n}\n","import { BaseModel } from '../../general/model/base.model'\nimport { IdentifierFields } from '../../general/model/identifier-fields'\nimport { NonFunctionPropertyNames } from '../../general/model/types/non-function-property-name.type'\n\nimport { BeardSizes, HairTypes } from './enums'\n\nexport class BeautyProfile extends BaseModel<BeautyProfile> implements IdentifierFields<BeautyProfile> {\n id: string\n userId: string\n beardSize?: BeardSizes\n hairType?: HairTypes\n\n toPlain(): any {\n const plain = super.toPlain()\n\n delete plain.id\n\n return plain\n }\n\n identifierFields(): NonFunctionPropertyNames<BeautyProfile>[] {\n return ['id']\n }\n}\n","export class Base {\n constructor(...args: Array<any>) {\n Object.assign(this, ...args)\n }\n}\n","export class UnauthorizedError extends Error {\n constructor(readonly message) {\n super(message)\n }\n}\n","import { Area, OfficePosition, User, UserType } from '../models'\nimport { AuthenticationService } from '../services/authentication.service'\nimport { isNil } from '../../../utils'\nimport { UnauthorizedError } from '../errors/unauthorized.error'\nimport { UserRepository } from '../repositories/user.repository'\n\nexport enum SignInMethods {\n EMAIL_PASSWORD = 'email_password',\n GOOGLE = 'google',\n}\n\ntype SignInMethod = Lowercase<keyof typeof SignInMethods>\n\ntype SignInParams = {\n email?: string\n password?: string\n}\n\nexport class Authentication {\n constructor(private readonly authService: AuthenticationService, private readonly userRepository: UserRepository) {}\n\n async signIn({ email, password }: SignInParams, signInMethod: SignInMethod): Promise<User> {\n const method = this.getServiceByMethod(signInMethod)\n const userAuth = await this.authService[method]({ email, password })\n const user = this.userRepository.get(userAuth)\n\n if (!isNil(user)) return user\n if (/^.+@b4a.com.br$/.test(userAuth.email)) return this.createsUserByCredential(userAuth)\n\n throw new UnauthorizedError('Invalid credentials')\n }\n\n private getServiceByMethod(signInMethod: SignInMethod): string {\n return signInMethod === SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle'\n }\n\n private async createsUserByCredential(user: Partial<User>): Promise<User> {\n const [firstName, lastName] = user.displayName?.split(/\\s/)\n const person = User.toInstance({\n ...user,\n cpf: '',\n birthday: new Date(),\n firstName,\n lastName,\n acceptsNewsletter: false,\n area: Area.Transactional,\n officePosition: OfficePosition.Intern,\n type: UserType.Collaborator,\n })\n\n return this.userRepository.create(person)\n }\n}\n","import { AuthenticationService } from '../services/authentication.service'\n\nexport class SignOut {\n constructor(private readonly authService: AuthenticationService) {}\n\n async signOut(): Promise<void> {\n await this.authService.signOut()\n }\n}\n","import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model'\n\nimport { CategoryCondition, CategoryFilter } from './types'\n\nexport class Category extends BaseModel<Category> implements IdentifierFields<Category> {\n id: string\n brandCategory: boolean\n brandLogo?: string\n name: string\n slug: string\n image?: string\n brandCategoryBanner?: string\n description: string\n conditions?: CategoryCondition\n products?: string[]\n filters?: CategoryFilter[]\n createdAt: Date\n updatedAt: Date\n\n identifierFields(): NonFunctionPropertyNames<Category>[] {\n return ['id']\n }\n}\n","import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model'\n\nimport { Shops } from './enums/shops.enum'\nimport { ProductReview, ShopsDescription, ShopsPrice, Stock } from './types'\nimport { Variant } from './variant'\n\nexport class Product extends BaseModel<Product> implements IdentifierFields<Product> {\n id: string\n name: string\n slug: string\n shopAvailability: Shops[]\n description: ShopsDescription\n sku: string\n price: ShopsPrice\n hasVariants: boolean\n NCM: string\n EAN: string\n CEST: string\n weight: number\n stock: Stock\n costPrice: number\n images?: string[]\n published: boolean\n createdAt: Date\n updatedAt: Date\n brand: string\n tags?: string[]\n type?: string\n categories?: string[]\n reviews?: ProductReview[]\n variant?: Variant\n\n identifierFields(): NonFunctionPropertyNames<Product>[] {\n return ['id']\n }\n}\n","import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model'\n\nimport { ShopsPrice, Stock, VariantGrade } from './types'\n\nexport class Variant extends BaseModel<Variant> implements IdentifierFields<Variant> {\n id: string\n productId: string\n sku: string\n price: ShopsPrice\n EAN: string\n stock: Stock\n grade: VariantGrade[]\n\n identifierFields(): NonFunctionPropertyNames<Variant>[] {\n return ['id']\n }\n}\n","export class InvalidArgumentError extends Error {\n constructor(readonly message) {\n super(message)\n }\n}\n","export class RequiredArgumentError extends Error {\n arguments: string[]\n\n constructor(readonly args: string[]) {\n super(`Required arguments: ${args.join(', ')}`)\n\n this.arguments = args\n }\n}\n","export class NotFoundError extends Error {\n constructor(readonly message) {\n super(message)\n }\n}\n","import { CollectionReference, DocumentData, FirebaseFirestore, QueryDocumentSnapshot } from '@firebase/firestore-types'\n\nimport { BaseModelBuilder, BaseModelWithIdentifier } from '../../../../domain'\nimport { FirestoreRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nexport const withFirestore = <TBase extends BaseModelWithIdentifier<TBase>>(MixinBase: MixinCtor) => {\n return class extends MixinBase implements FirestoreRepository<TBase> {\n readonly firestore?: FirebaseFirestore\n collectionName: string\n model: BaseModelBuilder<TBase>\n\n constructor(...args: Array<any>) {\n super(args)\n }\n\n collection(path?: string): CollectionReference<TBase> {\n return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance())\n }\n\n buildModelInstance(): {\n toFirestore: (data: TBase) => DocumentData\n fromFirestore: (snap: QueryDocumentSnapshot<TBase>) => TBase\n } {\n return {\n toFirestore: (data: TBase): DocumentData => data.toPlain(),\n fromFirestore: (snap: QueryDocumentSnapshot<TBase>): TBase =>\n this.model.toInstance({ id: snap.id, ...snap.data() }),\n }\n }\n }\n}\n","import { QuerySnapshot, QueryDocumentSnapshot } from '@firebase/firestore-types'\n\nimport { BaseModelWithIdentifier } from '../../../../domain'\n\nimport { FirestoreHelpers, FirestoreRepository, FirestoreSubRepository } from '../types'\nimport { isNil, MixinCtor } from '../../../../utils'\n\nexport const withHelpers = <Model extends BaseModelWithIdentifier<Model>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor & TMixinBase,\n) => {\n return class extends MixinBase implements FirestoreHelpers {\n toArray<T extends BaseModelWithIdentifier<T>>(snapShot: QuerySnapshot<T> | QueryDocumentSnapshot<T>[]): T[] {\n if (Array.isArray(snapShot)) {\n return snapShot.map((doc: QueryDocumentSnapshot<T>) => doc.data())\n } else {\n return snapShot.docs.map((doc: QueryDocumentSnapshot<T>) => doc.data())\n }\n }\n\n isSubCollection<T extends BaseModelWithIdentifier<T>>(\n repository: FirestoreRepository<T>,\n ): repository is FirestoreSubRepository<T> {\n return !isNil(Object.keys(this).find((key) => key === 'parentRepository'))\n }\n }\n}\n","import { BaseModelWithIdentifier, GetRepository, NonFunctionProperties } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { isNil, MixinCtor } from '../../../../utils'\nimport { NotFoundError } from '../../../../errors'\n\nexport const withGetFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class GetFirestore extends MixinBase implements GetRepository<TBase> {\n async get(identifiers: NonFunctionProperties<TBase>): Promise<TBase> {\n const doc = await this.collection(this.buildCollectionPathForGet(identifiers))\n .doc(Object.values(identifiers).shift().toString())\n .get()\n const data = doc.data()\n\n if (isNil(data)) throw new NotFoundError(`Document ${JSON.stringify(identifiers)} not found`)\n\n return data\n }\n\n buildCollectionPathForGet(identifiers: NonFunctionProperties<TBase>): string {\n return this.isSubCollection(this)\n ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`\n : this.collectionName\n }\n }\n}\n","import { CollectionReference, Query, WhereFilterOp } from '@firebase/firestore-types'\n\nimport {\n BaseModelWithIdentifier,\n FindRepository,\n NonFunctionPropertyNames,\n RepositoryFindFielters,\n RepositoryFindFieltersOptions,\n RepositoryFindResult,\n RepositoryLimitOptions,\n RepositoryOrderByList,\n Where,\n} from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { MixinCtor, isNumber, isString } from '../../../../utils'\n\nexport const withFindFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class FindFirestore extends MixinBase implements FindRepository<TBase> {\n async find(\n filters?: RepositoryFindFielters<TBase>[],\n limits?: RepositoryLimitOptions<TBase>,\n orderBy?: RepositoryOrderByList<TBase>,\n ): Promise<RepositoryFindResult<TBase>> {\n let query: CollectionReference<TBase> | Query<TBase> = this.collection(this.buildCollectionPathForFind(filters))\n\n filters?.forEach((filterer) => (query = this.makeFirestoreWhere(query, filterer)))\n\n orderBy?.forEach((orderer) =>\n Object.keys(orderer).forEach((fieldName) => (query = query.orderBy(fieldName, orderer[fieldName]))),\n )\n\n query = this.defineLimits(query, filters, limits)\n\n const docs = await query.get()\n const data = docs.docs.map((doc) => doc.data())\n\n return {\n data,\n count: this.calculateCount(data, limits),\n }\n }\n\n buildCollectionPathForFind(filters: RepositoryFindFielters<TBase>[]): string {\n if (!this.isSubCollection<TBase>(this)) return this.collectionName\n\n const parentIdField = this.parentIdField\n const parentId = filters.find((groupFilter) => Boolean(groupFilter[parentIdField]?.value))?.[parentIdField].value\n\n return `${this.parentRepository.collectionName}/${parentId}/${this.collectionName}`\n }\n\n makeFirestoreWhere = (\n queryReference: CollectionReference<TBase> | Query<TBase>,\n filter: RepositoryFindFielters<TBase>,\n ): Query<TBase> =>\n Object.keys(filter).reduce(\n (query: Query<TBase>, fieldName: string) =>\n this.buildWhereSentence(query, fieldName as NonFunctionPropertyNames<TBase>, filter[fieldName]),\n queryReference,\n )\n\n buildWhereSentence = (\n queryReference: CollectionReference<TBase> | Query<TBase>,\n fieldName: NonFunctionPropertyNames<TBase>,\n options: RepositoryFindFieltersOptions<TBase, NonFunctionPropertyNames<TBase>>,\n ): Query<TBase> => {\n if (options.operator === Where.LIKE) {\n queryReference = queryReference.where(fieldName.toString(), '>=', options.value)\n queryReference = queryReference.where(fieldName.toString(), '<=', `${options.value}~`)\n }\n\n return queryReference.where(fieldName.toString(), options.operator as WhereFilterOp, options.value)\n }\n\n defineLimits(\n query: CollectionReference<TBase> | Query<TBase>,\n filters: RepositoryFindFielters<TBase>[],\n limits: RepositoryLimitOptions<TBase>,\n ): Query<TBase> {\n if (limits?.offset) {\n if (limits.offset instanceof this.model)\n query.startAfter(\n this.collection(this.buildCollectionPathForFind(filters)).doc(\n limits.offset[limits.offset.identifierFields().shift() as string],\n ),\n )\n if (isNumber(limits.offset) || isString(limits.offset)) query.startAt(limits.offset)\n }\n if (limits?.limit) query.limit(limits.limit)\n\n return query\n }\n\n calculateCount(data: TBase[], limits: RepositoryLimitOptions<TBase>): number {\n if (data.length <= 0) return 0\n if (data.length < limits?.limit) return data.length\n\n return Infinity\n }\n }\n}\n","import { DocumentReference } from '@firebase/firestore-types'\n\nimport { CreateRepository, BaseModelWithIdentifier } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { isEmpty, MixinCtor } from '../../../../utils'\n\nexport const withCreateFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class CreateFirestore extends MixinBase implements CreateRepository<TBase> {\n async create(data: Partial<TBase>): Promise<TBase> {\n const docRef = await this.save(this.model.toInstance(data))\n const doc = await docRef.get()\n\n return doc.data()\n }\n\n async save(data: TBase): Promise<DocumentReference<TBase>> {\n const id = data[data.identifierFields().shift()]?.toString()\n\n if (isEmpty(id)) return this.collection(this.buildCollectionPathForAdd(data)).add(data)\n\n const docRef = this.collection().doc(id)\n await docRef.set(data)\n\n return docRef\n }\n\n buildCollectionPathForAdd(identifiers: Partial<TBase>): string {\n return this.isSubCollection(this)\n ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`\n : this.collectionName\n }\n }\n}\n","import { BaseModelWithIdentifier, UpdateRepository } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nexport const withUpdateFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class UpdateFirestore extends MixinBase implements UpdateRepository<TBase> {\n async update(data: TBase): Promise<TBase> {\n const docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(\n data[data.identifierFields().shift().toString()],\n )\n\n await docRef.update(data.toPlain())\n\n const doc = await docRef.get()\n\n return doc.data()\n }\n\n buildCollectionPathForUpdate(identifiers: TBase): string {\n return this.isSubCollection(this)\n ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`\n : this.collectionName\n }\n }\n}\n","import { BaseModelWithIdentifier, NonFunctionProperties, DeleteRepository } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nexport const withDeleteFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class DeleteFirestore extends MixinBase implements DeleteRepository<TBase> {\n async delete(identifiers: NonFunctionProperties<TBase>): Promise<void> {\n await this.collection(this.buildCollectionPathForRemove(identifiers))\n .doc(Object.values(identifiers).shift().toString())\n .delete()\n }\n\n buildCollectionPathForRemove(identifiers: NonFunctionProperties<TBase>): string {\n return this.isSubCollection(this)\n ? `${this.parentRepository.collectionName}/${identifiers[this.parentIdField]}/${this.collectionName}`\n : this.collectionName\n }\n }\n}\n","import { CollectionReference, DocumentData, FirebaseFirestore, QueryDocumentSnapshot } from '@firebase/firestore-types'\n\nimport { BaseModelWithIdentifier, NonFunctionPropertyNames } from '../../../../domain'\nimport { FirestoreRepository, FirestoreSubRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nexport const withSubCollection = <\n TBase extends BaseModelWithIdentifier<TBase>,\n TBaseParent extends BaseModelWithIdentifier<TBaseParent>,\n TMixinBase extends MixinCtor,\n>(\n MixinBase: MixinCtor<FirestoreRepository<TBase>> & TMixinBase,\n ParentModel: new () => TBaseParent,\n) => {\n return class SubCollectionMix\n extends MixinBase\n implements FirestoreSubRepository<TBase, InstanceType<typeof ParentModel>>\n {\n readonly parentRepository: FirestoreRepository<InstanceType<typeof ParentModel>>\n parentIdField: NonFunctionPropertyNames<TBase>\n\n constructor(...args: Array<any>) {\n super(args)\n }\n\n collection(path?: string): CollectionReference<TBase> {\n return super.collection(path)\n }\n }\n}\n","import { BaseModelWithIdentifier, CrudRepository } from '../../../../domain'\nimport { FirestoreHelpers, FirestoreRepository } from '../types'\nimport { MixinCtor } from '../../../../utils'\n\nimport { withCreateFirestore } from './with-create-firestore.mixin'\nimport { withDeleteFirestore } from './with-delete-firestore.mixin'\nimport { withFindFirestore } from './with-find-firestore.mixin'\nimport { withGetFirestore } from './with-get-firestore.mixin'\nimport { withUpdateFirestore } from './with-update-firestore.mixin'\n\nexport const withCrudFirestore = <TBase extends BaseModelWithIdentifier<TBase>, TMixinBase extends MixinCtor>(\n MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers> & TMixinBase,\n) => {\n return class CrudFirestore\n extends withUpdateFirestore(\n withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))),\n )\n implements CrudRepository<TBase> {}\n}\n","import { FirebaseFirestore } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { Subscription, SubscriptionRepository } from '../../../../../domain'\n\nimport { withCrudFirestore, withFirestore, withHelpers } from '../../mixins'\n\nexport class SubscriptionFirestoreRepository\n extends withCrudFirestore(withHelpers(withFirestore<Subscription>(Base)))\n implements SubscriptionRepository\n{\n constructor(readonly firestore: FirebaseFirestore) {\n super()\n this.collectionName = 'subscription'\n this.model = Subscription\n }\n}\n","import { DocumentData, FirebaseFirestore, QueryDocumentSnapshot } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { BeautyProfile, User, UserRepository } from '../../../../../domain'\n\nimport { withCrudFirestore, withFirestore, withHelpers } from '../../mixins'\n\nexport class UserFirestoreRepository\n extends withCrudFirestore(withHelpers(withFirestore<User>(Base)))\n implements UserRepository\n{\n constructor(readonly firestore: FirebaseFirestore) {\n super()\n this.collectionName = 'users'\n this.model = User\n }\n\n async get(identifiers: Partial<User>): Promise<User> {\n const user = await super.get({ id: identifiers.id })\n\n user.beautyProfile = await this.getBeautyProfile(user.id)\n\n return user\n }\n\n private async getBeautyProfile(userId: string): Promise<BeautyProfile> {\n const beautyProfile = await this.collection()\n .doc(userId)\n .collection('CX')\n .withConverter(this.buildBeautyProfileModelInstance())\n .doc('beautyProfile')\n .get()\n\n return beautyProfile.data()\n }\n\n private buildBeautyProfileModelInstance(): {\n toFirestore: (data: BeautyProfile) => DocumentData\n fromFirestore: (snap: QueryDocumentSnapshot<BeautyProfile>) => BeautyProfile\n } {\n return {\n toFirestore: (data: BeautyProfile): DocumentData => data.toPlain(),\n fromFirestore: (snap: QueryDocumentSnapshot<BeautyProfile>): BeautyProfile =>\n BeautyProfile.toInstance(snap.data()),\n }\n }\n}\n","import { FirebaseFirestore } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { Edition, Subscription, EditionRepository } from '../../../../../domain'\nimport { withCrudFirestore, withFirestore, withHelpers, withSubCollection } from '../../mixins'\n\nimport { SubscriptionFirestoreRepository } from './subscription-firestore.repository'\n\nexport class SubscriptionEditionFirestoreRepository\n extends withSubCollection(withCrudFirestore(withHelpers(withFirestore<Edition>(Base))), Subscription)\n implements EditionRepository\n{\n constructor(readonly firestore: FirebaseFirestore, readonly parentRepository: SubscriptionFirestoreRepository) {\n super()\n this.collectionName = 'editions'\n this.parentIdField = 'subscriptionId'\n this.model = Edition\n }\n}\n","import { FirebaseFirestore } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { BeautyProfile, BeautyProfileRepository, User } from '../../../../../domain'\nimport { withCrudFirestore, withFirestore, withHelpers, withSubCollection } from '../../mixins'\n\nimport { UserFirestoreRepository } from './user-firestore.repository'\n\nexport class UserBeautyProfileFirestoreRepository\n extends withSubCollection(withCrudFirestore(withHelpers(withFirestore<BeautyProfile>(Base))), User)\n implements BeautyProfileRepository\n{\n constructor(readonly firestore: FirebaseFirestore, readonly parentRepository: UserFirestoreRepository) {\n super()\n this.collectionName = 'CX'\n this.parentIdField = 'userId'\n this.model = BeautyProfile\n }\n}\n","import { FirebaseFirestore } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { Category, CategoryRepository } from '../../../../../domain'\n\nimport { withCrudFirestore, withFirestore, withHelpers } from '../../mixins'\n\nexport class CategoryFirestoreRepository\n extends withCrudFirestore(withHelpers(withFirestore<Category>(Base)))\n implements CategoryRepository\n{\n constructor(readonly firestore: FirebaseFirestore) {\n super()\n this.collectionName = 'categories'\n this.model = Category\n }\n}\n","import { FirebaseFirestore } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { Product, ProductRepository } from '../../../../../domain'\n\nimport { withCrudFirestore, withFirestore, withHelpers } from '../../mixins'\n\nexport class ProductFirestoreRepository\n extends withCrudFirestore(withHelpers(withFirestore<Product>(Base)))\n implements ProductRepository\n{\n constructor(readonly firestore: FirebaseFirestore) {\n super()\n this.collectionName = 'products'\n this.model = Product\n }\n}\n","import { FirebaseFirestore } from '@firebase/firestore-types'\n\nimport { Base } from '../../../../../utils'\nimport { Product, Variant, VariantRepository } from '../../../../../domain'\nimport { withCrudFirestore, withFirestore, withHelpers, withSubCollection } from '../../mixins'\n\nimport { ProductFirestoreRepository } from './product-firestore.repository'\n\nexport class ProductVariantFirestoreRepository\n extends withSubCollection(withCrudFirestore(withHelpers(withFirestore<Variant>(Base))), Product)\n implements VariantRepository\n{\n constructor(readonly firestore: FirebaseFirestore, readonly parentRepository: ProductFirestoreRepository) {\n super()\n this.collectionName = 'Variants'\n this.parentIdField = 'productId'\n this.model = Variant\n }\n}\n","import firebase from 'firebase/app'\n\nimport { AuthenticationService, LoginAndPasswordParams, User } from '../../../domain'\n\nexport class AuthenticationFirebaseAuthService implements AuthenticationService {\n constructor(private readonly firebaseAuth: firebase.auth.Auth) {}\n\n async signInWithEmailAndPassword(data: LoginAndPasswordParams): Promise<Partial<User>> {\n const credentials = await this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)\n const user = credentials.user\n\n return { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }\n }\n\n async signInWithGoogle(): Promise<Partial<User>> {\n const credentials = await this.firebaseAuth.signInWithPopup(new firebase.auth.GoogleAuthProvider())\n const user = credentials.user\n\n return { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }\n }\n\n async signOut(): Promise<void> {\n this.firebaseAuth.signOut()\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAIa,SAAS;IACpB,YAAY,IAAqB;QAC/B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;KAC1B;IAED,OAAO,UAAU,CAAgC,IAA8B;QAC7E,OAAO,YAAY,CAAC,IAAI,EAAE,IAAI,CAAQ,CAAA;KACvC;IAED,OAAO;QACL,OAAO,YAAY,CAAC,IAAI,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,CAAA;KACxD;;;ICfS;AAAZ,WAAY,KAAK;IACf,sBAAa,CAAA;IACb,iBAAQ,CAAA;IACR,mBAAU,CAAA;IACV,kBAAS,CAAA;IACT,iBAAQ,CAAA;IACR,mBAAU,CAAA;IACV,sBAAa,CAAA;AACf,CAAC,EARW,KAAK,KAAL,KAAK;;ICAL;AAAZ,WAAY,MAAM;IAChB,2BAAiB,CAAA;AACnB,CAAC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,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAA;SACnG;KAAA;IAEK,OAAO;;YACX,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAA;SAC5B;KAAA;;;ACvBH;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export * from './models';
2
+ export * from './repositories';
@@ -0,0 +1,18 @@
1
+ import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model';
2
+ import { CategoryCondition, CategoryFilter } from './types';
3
+ export declare class Category extends BaseModel<Category> implements IdentifierFields<Category> {
4
+ id: string;
5
+ brandCategory: boolean;
6
+ brandLogo?: string;
7
+ name: string;
8
+ slug: string;
9
+ image?: string;
10
+ brandCategoryBanner?: string;
11
+ description: string;
12
+ conditions?: CategoryCondition;
13
+ products?: string[];
14
+ filters?: CategoryFilter[];
15
+ createdAt: Date;
16
+ updatedAt: Date;
17
+ identifierFields(): NonFunctionPropertyNames<Category>[];
18
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum Shops {
2
+ MENSMARKET = "Men's Market",
3
+ GLAMSHOP = "Glamshop"
4
+ }
@@ -0,0 +1,3 @@
1
+ export * from './category';
2
+ export * from './product';
3
+ export * from './variant';
@@ -0,0 +1,31 @@
1
+ import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model';
2
+ import { Shops } from './enums/shops.enum';
3
+ import { ProductReview, ShopsDescription, ShopsPrice, Stock } from './types';
4
+ import { Variant } from './variant';
5
+ export declare class Product extends BaseModel<Product> implements IdentifierFields<Product> {
6
+ id: string;
7
+ name: string;
8
+ slug: string;
9
+ shopAvailability: Shops[];
10
+ description: ShopsDescription;
11
+ sku: string;
12
+ price: ShopsPrice;
13
+ hasVariants: boolean;
14
+ NCM: string;
15
+ EAN: string;
16
+ CEST: string;
17
+ weight: number;
18
+ stock: Stock;
19
+ costPrice: number;
20
+ images?: string[];
21
+ published: boolean;
22
+ createdAt: Date;
23
+ updatedAt: Date;
24
+ brand: string;
25
+ tags?: string[];
26
+ type?: string;
27
+ categories?: string[];
28
+ reviews?: ProductReview[];
29
+ variant?: Variant;
30
+ identifierFields(): NonFunctionPropertyNames<Product>[];
31
+ }
@@ -0,0 +1,4 @@
1
+ export declare type CategoryCondition = {
2
+ tags?: string[];
3
+ brand?: string;
4
+ };
@@ -0,0 +1,4 @@
1
+ export declare type CategoryFilter = {
2
+ name?: string;
3
+ tags?: string[];
4
+ };
@@ -0,0 +1,7 @@
1
+ export * from './shops-description.type';
2
+ export * from './shops-price.type';
3
+ export * from './stock.type';
4
+ export * from './category-condition.type';
5
+ export * from './category-filter.type';
6
+ export * from './product-review.type';
7
+ export * from './variant-grade.type';
@@ -0,0 +1,12 @@
1
+ import { Shops } from '../enums/shops.enum';
2
+ export declare type ProductReview = {
3
+ author: string;
4
+ createdAt: Date;
5
+ email: string;
6
+ location: string;
7
+ rate: number;
8
+ review: string;
9
+ status: string;
10
+ title: string;
11
+ shop?: Shops;
12
+ };
@@ -0,0 +1,7 @@
1
+ import { Shops } from '../enums/shops.enum';
2
+ export declare type ShopDescription = {
3
+ description: string;
4
+ };
5
+ export declare type ShopsDescription = {
6
+ [K in Shops]?: ShopDescription;
7
+ };
@@ -0,0 +1,10 @@
1
+ import { Shops } from '../enums/shops.enum';
2
+ export declare type ShopPrice = {
3
+ price: number;
4
+ fullPrice: number;
5
+ subscriberDiscountPercentage?: number;
6
+ subscriberPrice?: number;
7
+ };
8
+ export declare type ShopsPrice = {
9
+ [K in Shops]?: ShopPrice;
10
+ };
@@ -0,0 +1,3 @@
1
+ export declare type Stock = {
2
+ quantity: number;
3
+ };
@@ -0,0 +1,4 @@
1
+ export declare type VariantGrade = {
2
+ title: string;
3
+ value: string;
4
+ };
@@ -0,0 +1,12 @@
1
+ import { BaseModel, IdentifierFields, NonFunctionPropertyNames } from '../../general/model';
2
+ import { ShopsPrice, Stock, VariantGrade } from './types';
3
+ export declare class Variant extends BaseModel<Variant> implements IdentifierFields<Variant> {
4
+ id: string;
5
+ productId: string;
6
+ sku: string;
7
+ price: ShopsPrice;
8
+ EAN: string;
9
+ stock: Stock;
10
+ grade: VariantGrade[];
11
+ identifierFields(): NonFunctionPropertyNames<Variant>[];
12
+ }
@@ -0,0 +1,4 @@
1
+ import { Category } from '../models/category';
2
+ import { CrudRepository } from '../../general/repository/crud.repository';
3
+ export interface CategoryRepository extends CrudRepository<Category> {
4
+ }
@@ -0,0 +1,3 @@
1
+ export * from './category.repository';
2
+ export * from './product.repository';
3
+ export * from './variant.repository';
@@ -0,0 +1,4 @@
1
+ import { CrudRepository } from '../../general/repository/crud.repository';
2
+ import { Product } from '../models/product';
3
+ export interface ProductRepository extends CrudRepository<Product> {
4
+ }
@@ -0,0 +1,4 @@
1
+ import { CrudRepository } from '../../general/repository/crud.repository';
2
+ import { Variant } from '../models/variant';
3
+ export interface VariantRepository extends CrudRepository<Variant> {
4
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './general';
2
2
  export * from './users';
3
+ export * from './catalog';