@infrab4a/connect 4.0.0-beta.12 → 4.0.0-beta.14

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 (18) hide show
  1. package/esm2020/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.mjs +3 -2
  2. package/esm2020/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.mjs +3 -2
  3. package/esm2020/infra/firebase/firestore/repositories/users/user-address-firestore.repository.mjs +3 -2
  4. package/esm2020/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.mjs +3 -2
  5. package/esm2020/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.mjs +3 -2
  6. package/esm2020/infra/firebase/firestore/types/firestore-interceptors.type.mjs +1 -1
  7. package/esm2020/infra/hasura-graphql/mixins/helpers/graphql-field.helper.mjs +5 -2
  8. package/fesm2015/infrab4a-connect.mjs +11 -7
  9. package/fesm2015/infrab4a-connect.mjs.map +1 -1
  10. package/fesm2020/infrab4a-connect.mjs +14 -6
  11. package/fesm2020/infrab4a-connect.mjs.map +1 -1
  12. package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +3 -1
  13. package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +3 -1
  14. package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +3 -1
  15. package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +3 -1
  16. package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +3 -1
  17. package/infra/firebase/firestore/types/firestore-interceptors.type.d.ts +7 -7
  18. package/package.json +1 -1
@@ -1510,7 +1510,7 @@ class LeadFirestoreRepository extends withCrudFirestore(withHelpers(withFirestor
1510
1510
  }
1511
1511
 
1512
1512
  class SubscriptionEditionFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
1513
- constructor({ firestore, interceptors }) {
1513
+ constructor({ firestore, interceptors }, parentRepository) {
1514
1514
  super({
1515
1515
  firestore,
1516
1516
  collectionName: 'editions',
@@ -1518,6 +1518,7 @@ class SubscriptionEditionFirestoreRepository extends withSubCollection(withCrudF
1518
1518
  model: Edition,
1519
1519
  interceptors,
1520
1520
  });
1521
+ this.parentRepository = parentRepository;
1521
1522
  }
1522
1523
  }
1523
1524
 
@@ -1533,7 +1534,7 @@ class SubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(with
1533
1534
  }
1534
1535
 
1535
1536
  class SubscriptionPaymentFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription) {
1536
- constructor({ firestore, interceptors, }) {
1537
+ constructor({ firestore, interceptors }, parentRepository) {
1537
1538
  super({
1538
1539
  firestore,
1539
1540
  collectionName: 'payments',
@@ -1541,11 +1542,12 @@ class SubscriptionPaymentFirestoreRepository extends withSubCollection(withCrudF
1541
1542
  model: SubscriptionPayment,
1542
1543
  interceptors,
1543
1544
  });
1545
+ this.parentRepository = parentRepository;
1544
1546
  }
1545
1547
  }
1546
1548
 
1547
1549
  class UserAddressFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
1548
- constructor({ firestore, interceptors, }) {
1550
+ constructor({ firestore, interceptors }, parentRepository) {
1549
1551
  super({
1550
1552
  firestore,
1551
1553
  collectionName: 'address',
@@ -1553,11 +1555,12 @@ class UserAddressFirestoreRepository extends withSubCollection(withCrudFirestore
1553
1555
  model: UserAddress,
1554
1556
  interceptors,
1555
1557
  });
1558
+ this.parentRepository = parentRepository;
1556
1559
  }
1557
1560
  }
1558
1561
 
1559
1562
  class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
1560
- constructor({ firestore, interceptors, }) {
1563
+ constructor({ firestore, interceptors }, parentRepository) {
1561
1564
  super({
1562
1565
  firestore,
1563
1566
  collectionName: 'CX',
@@ -1565,6 +1568,7 @@ class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFir
1565
1568
  model: BeautyProfile,
1566
1569
  interceptors,
1567
1570
  });
1571
+ this.parentRepository = parentRepository;
1568
1572
  }
1569
1573
  }
1570
1574
 
@@ -1615,7 +1619,7 @@ class UserFirestoreRepository extends withCrudFirestore(withHelpers(withFirestor
1615
1619
  }
1616
1620
 
1617
1621
  class UserPaymentMethodFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User) {
1618
- constructor({ firestore, interceptors, }) {
1622
+ constructor({ firestore, interceptors }, parentRepository) {
1619
1623
  super({
1620
1624
  firestore,
1621
1625
  collectionName: 'payment_method',
@@ -1623,6 +1627,7 @@ class UserPaymentMethodFirestoreRepository extends withSubCollection(withCrudFir
1623
1627
  model: UserPaymentMethod,
1624
1628
  interceptors,
1625
1629
  });
1630
+ this.parentRepository = parentRepository;
1626
1631
  }
1627
1632
  }
1628
1633
 
@@ -2213,7 +2218,10 @@ GraphQLFieldHelper.ConvertFieldValueFrom = (data, fields) => Object.keys(data).r
2213
2218
  }
2214
2219
  if (!!from)
2215
2220
  return { ...result, [attributeName]: from(data[columnName], data) };
2216
- return { ...result, [attributeName]: parseDateTime(data[columnName]?.toString()) };
2221
+ return {
2222
+ ...result,
2223
+ [attributeName]: isString(data[columnName]) ? parseDateTime(data[columnName].toString()) : data[columnName],
2224
+ };
2217
2225
  }, {});
2218
2226
  GraphQLFieldHelper.ConvertFieldValueTo = (instance, fields, update = false) => {
2219
2227
  const data = instance.toPlain?.() || instance;