@infrab4a/connect-angular 6.0.0-beta.2 → 6.0.0-beta.21

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.
@@ -1,13 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { NgModule, InjectionToken, PLATFORM_ID, Injectable, Inject } from '@angular/core';
3
- import * as i1$3 from '@angular/fire/app';
3
+ import * as i1$4 from '@angular/fire/app';
4
4
  import { FirebaseApp, provideFirebaseApp, getApp, initializeApp } from '@angular/fire/app';
5
5
  import * as i2 from '@angular/fire/app-check';
6
6
  import { provideAppCheck, initializeAppCheck } from '@angular/fire/app-check';
7
- import * as i3$1 from '@angular/fire/storage';
7
+ import * as i3 from '@angular/fire/storage';
8
8
  import { Storage, provideStorage, getStorage } from '@angular/fire/storage';
9
- import * as i3 from '@infrab4a/connect';
10
- import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, GroupFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, OrderBlockedFirestoreRepository, LogFirestoreRepository, SequenceFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductErrorsHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, isNil, NotFoundError, Checkout, pick, LineItem, Where, isEmpty, Shops, set, InvalidArgumentError, RoundProductPricesHelper, Category, WishlistLogType, PersonTypes, Wishlist, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, CheckoutSubscription, Product, RequiredArgumentError, add, ProductReview, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
9
+ import * as i1$3 from '@infrab4a/connect';
10
+ import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, GroupFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, OrderBlockedFirestoreRepository, LogFirestoreRepository, SequenceFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductErrorsHasuraGraphQLRepository, ProductCatalogHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, isNil, NotFoundError, Checkout, pick, LineItem, Where, isEmpty, Shops, set, InvalidArgumentError, RoundProductPricesHelper, Category, WishlistLogType, PersonTypes, Wishlist, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, CheckoutSubscription, Product, RequiredArgumentError, add, ProductReview, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
11
11
  import * as i1 from '@angular/fire/auth';
12
12
  import { Auth, provideAuth, initializeAuth, indexedDBLocalPersistence, browserLocalPersistence, browserSessionPersistence, getAuth, getIdToken, authState } from '@angular/fire/auth';
13
13
  import { isPlatformBrowser, isPlatformServer } from '@angular/common';
@@ -904,6 +904,17 @@ class AngularHasuraGraphQLModule {
904
904
  provide: 'ProductErrorsRepository',
905
905
  useExisting: ProductErrorsHasuraGraphQLRepository,
906
906
  },
907
+ {
908
+ provide: ProductCatalogHasuraGraphQLRepository,
909
+ useFactory: (options) => {
910
+ return new ProductCatalogHasuraGraphQLRepository(options);
911
+ },
912
+ deps: ['HasuraConfig'],
913
+ },
914
+ {
915
+ provide: 'ProductCatalogRepository',
916
+ useExisting: ProductCatalogHasuraGraphQLRepository,
917
+ },
907
918
  ] }); }
908
919
  }
909
920
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularHasuraGraphQLModule, decorators: [{
@@ -1064,6 +1075,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
1064
1075
  provide: 'ProductErrorsRepository',
1065
1076
  useExisting: ProductErrorsHasuraGraphQLRepository,
1066
1077
  },
1078
+ {
1079
+ provide: ProductCatalogHasuraGraphQLRepository,
1080
+ useFactory: (options) => {
1081
+ return new ProductCatalogHasuraGraphQLRepository(options);
1082
+ },
1083
+ deps: ['HasuraConfig'],
1084
+ },
1085
+ {
1086
+ provide: 'ProductCatalogRepository',
1087
+ useExisting: ProductCatalogHasuraGraphQLRepository,
1088
+ },
1067
1089
  ],
1068
1090
  }]
1069
1091
  }] });
@@ -1197,7 +1219,7 @@ class ConfigurationFacade {
1197
1219
  }
1198
1220
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ConfigurationFacade, decorators: [{
1199
1221
  type: Injectable
1200
- }], ctorParameters: () => [{ type: i3.Shops, decorators: [{
1222
+ }], ctorParameters: () => [{ type: i1$3.Shops, decorators: [{
1201
1223
  type: Inject,
1202
1224
  args: [DEFAULT_SHOP]
1203
1225
  }] }, { type: undefined, decorators: [{
@@ -1278,7 +1300,7 @@ class CheckoutService {
1278
1300
  })), concatMap(() => this.getCheckout()));
1279
1301
  }
1280
1302
  createOrder(checkoutPayload, paymentProvider, applicationVersion) {
1281
- return this.dependenciesFacade.httpClient.post(`${this.checkoutUrl}/checkout`, {
1303
+ return this.dependenciesFacade.httpClient.post(`${this.checkoutUrl}/checkoutV5`, {
1282
1304
  data: {
1283
1305
  ...checkoutPayload,
1284
1306
  applicationVersion,
@@ -1546,12 +1568,12 @@ class CategorySearchStrategy {
1546
1568
  distinct: ['brand'],
1547
1569
  },
1548
1570
  };
1549
- return productCatalog.productRepository.findCatalog(repoParams, null, optionsCache);
1571
+ return productCatalog.productCatalogRepository.findCatalog(repoParams, null, optionsCache);
1550
1572
  }
1551
1573
  async getProductIds(category, filters, optionsCache) {
1552
1574
  const productCatalog = this.repositoryService.getProductCatalog();
1553
1575
  const filterHelper = this.helpersService.getFilterHelper();
1554
- return productCatalog.productRepository
1576
+ return productCatalog.productCatalogRepository
1555
1577
  .findCatalog({
1556
1578
  fields: ['id'],
1557
1579
  filters: {
@@ -1567,7 +1589,7 @@ class CategorySearchStrategy {
1567
1589
  const filterHelper = this.helpersService.getFilterHelper();
1568
1590
  const sortHelper = this.helpersService.getSortHelper();
1569
1591
  const mostRelevantProductsIds = [...new Set(mostRelevants.concat(productIds))];
1570
- const totalResult = await productCatalog.productRepository.findCatalog({
1592
+ const totalResult = await productCatalog.productCatalogRepository.findCatalog({
1571
1593
  fields,
1572
1594
  filters: {
1573
1595
  id: { operator: Where.IN, value: mostRelevantProductsIds },
@@ -1635,7 +1657,7 @@ class ProfileSearchStrategy {
1635
1657
  distinct: ['brand'],
1636
1658
  },
1637
1659
  };
1638
- return productCatalog.productRepository.findCatalog(repoParams, mainGender || (shop === Shops.MENSMARKET ? 'male' : 'female'), optionsCache);
1660
+ return productCatalog.productCatalogRepository.findCatalog(repoParams, mainGender || (shop === Shops.MENSMARKET ? 'male' : 'female'), optionsCache);
1639
1661
  }
1640
1662
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProfileSearchStrategy, deps: [{ token: CatalogRepositoryService }, { token: CatalogHelpersService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1641
1663
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProfileSearchStrategy }); }
@@ -1671,6 +1693,7 @@ class TermSearchStrategy {
1671
1693
  limits,
1672
1694
  shop,
1673
1695
  mainGender,
1696
+ sort,
1674
1697
  fields: this.helpersService.getFieldsHelper().getStandardFields(),
1675
1698
  });
1676
1699
  }
@@ -1678,7 +1701,7 @@ class TermSearchStrategy {
1678
1701
  const { productIds, filters, shop, mainGender } = params;
1679
1702
  const productCatalog = this.repositoryService.getProductCatalog();
1680
1703
  const filterHelper = this.helpersService.getFilterHelper();
1681
- const totalResult = await productCatalog.productRepository.findCatalog({
1704
+ const totalResult = await productCatalog.productCatalogRepository.findCatalog({
1682
1705
  fields: ['id', 'stock', 'gender'],
1683
1706
  filters: {
1684
1707
  id: { operator: Where.IN, value: productIds },
@@ -1700,10 +1723,11 @@ class TermSearchStrategy {
1700
1723
  });
1701
1724
  }
1702
1725
  async searchDefault(params) {
1703
- const { productIds, filters, limits, shop, mainGender, fields } = params;
1726
+ const { productIds, filters, limits, sort, shop, mainGender, fields } = params;
1704
1727
  const productCatalog = this.repositoryService.getProductCatalog();
1705
1728
  const filterHelper = this.helpersService.getFilterHelper();
1706
- return productCatalog.productRepository.findCatalog({
1729
+ const sortHelper = this.helpersService.getSortHelper();
1730
+ return productCatalog.productCatalogRepository.findCatalog({
1707
1731
  fields,
1708
1732
  filters: {
1709
1733
  id: { operator: Where.IN, value: productIds },
@@ -1711,6 +1735,7 @@ class TermSearchStrategy {
1711
1735
  ...filterHelper.buildFilterQuery(filters || {}),
1712
1736
  },
1713
1737
  limits,
1738
+ ...(sort ? { orderBy: sortHelper.buildSortQuery(sort) } : {}),
1714
1739
  options: {
1715
1740
  minimal: ['price'],
1716
1741
  maximum: ['price'],
@@ -1733,7 +1758,7 @@ class TermSearchStrategy {
1733
1758
  async getDetailedProducts(orderedId, totalResult, fieldsHelper) {
1734
1759
  const productCatalog = this.repositoryService.getProductCatalog();
1735
1760
  const fields = fieldsHelper.getStandardFields();
1736
- const productResult = await productCatalog.productRepository.findCatalog({
1761
+ const productResult = await productCatalog.productCatalogRepository.findCatalog({
1737
1762
  filters: {
1738
1763
  id: { operator: Where.IN, value: orderedId },
1739
1764
  },
@@ -1791,7 +1816,7 @@ class CatalogServiceFacade {
1791
1816
  }
1792
1817
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogServiceFacade, decorators: [{
1793
1818
  type: Injectable
1794
- }], ctorParameters: () => [{ type: CatalogHelpersService }, { type: CatalogStrategiesFacade }, { type: i3.Shops, decorators: [{
1819
+ }], ctorParameters: () => [{ type: CatalogHelpersService }, { type: CatalogStrategiesFacade }, { type: i1$3.Shops, decorators: [{
1795
1820
  type: Inject,
1796
1821
  args: [DEFAULT_SHOP]
1797
1822
  }] }] });
@@ -1821,7 +1846,7 @@ class CategoryService {
1821
1846
  this.shop = shop;
1822
1847
  }
1823
1848
  async fetchBrands(category, options, optionsCache) {
1824
- const brands = await this.productCatalog.productRepository
1849
+ const brands = await this.productCatalog.productCatalogRepository
1825
1850
  .findCatalog({
1826
1851
  filters: await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(category),
1827
1852
  fields: ['brand'],
@@ -1831,6 +1856,9 @@ class CategoryService {
1831
1856
  .find({ filters: { brandCategory: true, shop: options?.shop || this.shop }, orderBy: { name: 'asc' } }, optionsCache)
1832
1857
  .then(({ data }) => data.filter((category) => brands.includes(category.conditions.brand)));
1833
1858
  }
1859
+ async getMenuBrands() {
1860
+ return this.categoryFacade.categoryRepository.getBrandsWithProducts();
1861
+ }
1834
1862
  async fetchFilterOptions(category, optionsCache) {
1835
1863
  return await this.categoryFacade.categoryFilterRepository
1836
1864
  .find({ filters: { categoryId: +category.id } }, optionsCache)
@@ -1841,24 +1869,24 @@ class CategoryService {
1841
1869
  }
1842
1870
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryService, decorators: [{
1843
1871
  type: Injectable
1844
- }], ctorParameters: () => [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i3.Shops, decorators: [{
1872
+ }], ctorParameters: () => [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i1$3.Shops, decorators: [{
1845
1873
  type: Inject,
1846
1874
  args: [DEFAULT_SHOP]
1847
1875
  }] }] });
1848
1876
 
1849
1877
  class ProductCatalogFacade {
1850
- constructor(productRepository, categoryStructureAdapter) {
1851
- this.productRepository = productRepository;
1878
+ constructor(productCatalogRepository, categoryStructureAdapter) {
1879
+ this.productCatalogRepository = productCatalogRepository;
1852
1880
  this.categoryStructureAdapter = categoryStructureAdapter;
1853
1881
  }
1854
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductCatalogFacade, deps: [{ token: 'ProductRepository' }, { token: CATEGORY_STRUCTURE }], target: i0.ɵɵFactoryTarget.Injectable }); }
1882
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductCatalogFacade, deps: [{ token: 'ProductCatalogRepository' }, { token: CATEGORY_STRUCTURE }], target: i0.ɵɵFactoryTarget.Injectable }); }
1855
1883
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductCatalogFacade }); }
1856
1884
  }
1857
1885
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductCatalogFacade, decorators: [{
1858
1886
  type: Injectable
1859
1887
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1860
1888
  type: Inject,
1861
- args: ['ProductRepository']
1889
+ args: ['ProductCatalogRepository']
1862
1890
  }] }, { type: undefined, decorators: [{
1863
1891
  type: Inject,
1864
1892
  args: [CATEGORY_STRUCTURE]
@@ -1879,7 +1907,7 @@ class CategoryServiceFacade {
1879
1907
  }
1880
1908
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryServiceFacade, decorators: [{
1881
1909
  type: Injectable
1882
- }], ctorParameters: () => [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i3.Shops, decorators: [{
1910
+ }], ctorParameters: () => [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i1$3.Shops, decorators: [{
1883
1911
  type: Inject,
1884
1912
  args: [DEFAULT_SHOP]
1885
1913
  }] }] });
@@ -1917,10 +1945,15 @@ class BrandManagerHelper {
1917
1945
  return '';
1918
1946
  }
1919
1947
  async fetchBrandsOnly(options) {
1920
- return this.productCatalog.productRepository
1948
+ let filters = {};
1949
+ if (options.category) {
1950
+ filters = await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(options.category);
1951
+ }
1952
+ return this.productCatalog.productCatalogRepository
1921
1953
  .findCatalog({
1922
1954
  fields: ['id'],
1923
1955
  filters: {
1956
+ ...filters,
1924
1957
  published: { operator: Where.EQUALS, value: true },
1925
1958
  },
1926
1959
  options: {
@@ -2034,6 +2067,7 @@ class ProductFieldsHelper {
2034
2067
  'name',
2035
2068
  'slug',
2036
2069
  'images',
2070
+ 'imagesCard',
2037
2071
  'miniatures',
2038
2072
  'price',
2039
2073
  'stock',
@@ -2056,6 +2090,8 @@ class ProductFieldsHelper {
2056
2090
  'label',
2057
2091
  'outlet',
2058
2092
  'group',
2093
+ 'variantSlug',
2094
+ 'filters',
2059
2095
  ];
2060
2096
  }
2061
2097
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductFieldsHelper, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -2253,7 +2289,7 @@ class CatalogService {
2253
2289
  }
2254
2290
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogService, decorators: [{
2255
2291
  type: Injectable
2256
- }], ctorParameters: () => [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i3.Shops, decorators: [{
2292
+ }], ctorParameters: () => [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i1$3.Shops, decorators: [{
2257
2293
  type: Inject,
2258
2294
  args: [DEFAULT_SHOP]
2259
2295
  }] }] });
@@ -2277,9 +2313,10 @@ __decorate([
2277
2313
  ], CategoryWithTree.prototype, "children", void 0);
2278
2314
 
2279
2315
  class WishlistService {
2280
- constructor(wishlistRepository, productRepository, logRepository, shop) {
2316
+ constructor(wishlistRepository, productRepository, productCatalogRepository, logRepository, shop) {
2281
2317
  this.wishlistRepository = wishlistRepository;
2282
2318
  this.productRepository = productRepository;
2319
+ this.productCatalogRepository = productCatalogRepository;
2283
2320
  this.logRepository = logRepository;
2284
2321
  this.shop = shop;
2285
2322
  }
@@ -2430,7 +2467,7 @@ class WishlistService {
2430
2467
  .then((res) => res.data.at(0));
2431
2468
  }
2432
2469
  async findProductById(id) {
2433
- return this.productRepository
2470
+ return this.productCatalogRepository
2434
2471
  .find({
2435
2472
  fields: ['id', 'sku', 'EAN', 'name', 'brand'],
2436
2473
  filters: {
@@ -2506,7 +2543,7 @@ class WishlistService {
2506
2543
  productBrand: product.brand,
2507
2544
  };
2508
2545
  }
2509
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'ProductRepository' }, { token: 'LogRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
2546
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'ProductRepository' }, { token: 'ProductCatalogRepository' }, { token: 'LogRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
2510
2547
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService }); }
2511
2548
  }
2512
2549
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService, decorators: [{
@@ -2517,10 +2554,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
2517
2554
  }] }, { type: undefined, decorators: [{
2518
2555
  type: Inject,
2519
2556
  args: ['ProductRepository']
2557
+ }] }, { type: undefined, decorators: [{
2558
+ type: Inject,
2559
+ args: ['ProductCatalogRepository']
2520
2560
  }] }, { type: undefined, decorators: [{
2521
2561
  type: Inject,
2522
2562
  args: ['LogRepository']
2523
- }] }, { type: i3.Shops, decorators: [{
2563
+ }] }, { type: i1$3.Shops, decorators: [{
2524
2564
  type: Inject,
2525
2565
  args: [DEFAULT_SHOP]
2526
2566
  }] }] });
@@ -2985,10 +3025,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
2985
3025
  }], ctorParameters: () => [{ type: HomeShopRepositoriesFacade }, { type: ConfigurationFacade }] });
2986
3026
 
2987
3027
  class OrderProductReviewService {
2988
- constructor(orderRepository, productReviewRepository, variantRepository) {
3028
+ constructor(orderRepository, productReviewRepository, variantRepository, defaultShop) {
2989
3029
  this.orderRepository = orderRepository;
2990
3030
  this.productReviewRepository = productReviewRepository;
2991
3031
  this.variantRepository = variantRepository;
3032
+ this.defaultShop = defaultShop;
2992
3033
  }
2993
3034
  async getPendingReviewsByEmail(email) {
2994
3035
  const products = [];
@@ -3012,6 +3053,7 @@ class OrderProductReviewService {
3012
3053
  user: {
3013
3054
  email: email,
3014
3055
  },
3056
+ shop: this.defaultShop,
3015
3057
  status: OrderStatus.ENTREGUE,
3016
3058
  createdAt: {
3017
3059
  operator: Where.GTE,
@@ -3074,12 +3116,22 @@ class OrderProductReviewService {
3074
3116
  orderId: review.orderId,
3075
3117
  }));
3076
3118
  }
3077
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderProductReviewService, deps: [{ token: 'OrderRepository' }, { token: 'ProductReviewRepository' }, { token: 'VariantRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
3119
+ async verifyReviewProductAndOrder(orderId, productId) {
3120
+ return this.productReviewRepository
3121
+ .find({
3122
+ filters: {
3123
+ orderId: { operator: Where.IN, value: orderId },
3124
+ productId: productId,
3125
+ },
3126
+ })
3127
+ .then((res) => res.data);
3128
+ }
3129
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderProductReviewService, deps: [{ token: 'OrderRepository' }, { token: 'ProductReviewRepository' }, { token: 'VariantRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
3078
3130
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderProductReviewService }); }
3079
3131
  }
3080
3132
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderProductReviewService, decorators: [{
3081
3133
  type: Injectable
3082
- }], ctorParameters: () => [{ type: i3.OrderFirestoreRepository, decorators: [{
3134
+ }], ctorParameters: () => [{ type: i1$3.OrderFirestoreRepository, decorators: [{
3083
3135
  type: Inject,
3084
3136
  args: ['OrderRepository']
3085
3137
  }] }, { type: undefined, decorators: [{
@@ -3088,6 +3140,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
3088
3140
  }] }, { type: undefined, decorators: [{
3089
3141
  type: Inject,
3090
3142
  args: ['VariantRepository']
3143
+ }] }, { type: i1$3.Shops, decorators: [{
3144
+ type: Inject,
3145
+ args: [DEFAULT_SHOP]
3091
3146
  }] }] });
3092
3147
 
3093
3148
  class OrderService {
@@ -3107,7 +3162,7 @@ class OrderService {
3107
3162
  }
3108
3163
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderService, decorators: [{
3109
3164
  type: Injectable
3110
- }], ctorParameters: () => [{ type: i1$1.Firestore }, { type: i3.OrderFirestoreRepository, decorators: [{
3165
+ }], ctorParameters: () => [{ type: i1$1.Firestore }, { type: i1$3.OrderFirestoreRepository, decorators: [{
3111
3166
  type: Inject,
3112
3167
  args: ['OrderRepository']
3113
3168
  }] }] });
@@ -3153,7 +3208,7 @@ class AngularConnectModule {
3153
3208
  return isNil(value) ? [] : [{ provide: token, useValue: value }];
3154
3209
  }
3155
3210
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3156
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, imports: [i1$3.FirebaseAppModule, i2.AppCheckModule, i3$1.StorageModule, AngularElasticSeachModule,
3211
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, i2.AppCheckModule, i3.StorageModule, AngularElasticSeachModule,
3157
3212
  AngularVertexSeachModule,
3158
3213
  AngularFirebaseAuthModule,
3159
3214
  AngularFirestoreModule,