@infrab4a/connect-angular 5.5.0 → 5.6.1

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, BrandCategoryFirestoreRepository, 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, BrandCategoryFirestoreRepository, 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';
@@ -919,6 +919,17 @@ AngularHasuraGraphQLModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.
919
919
  provide: 'ProductErrorsRepository',
920
920
  useExisting: ProductErrorsHasuraGraphQLRepository,
921
921
  },
922
+ {
923
+ provide: ProductCatalogHasuraGraphQLRepository,
924
+ useFactory: (options) => {
925
+ return new ProductCatalogHasuraGraphQLRepository(options);
926
+ },
927
+ deps: ['HasuraConfig'],
928
+ },
929
+ {
930
+ provide: 'ProductCatalogRepository',
931
+ useExisting: ProductCatalogHasuraGraphQLRepository,
932
+ },
922
933
  ] });
923
934
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularHasuraGraphQLModule, decorators: [{
924
935
  type: NgModule,
@@ -1078,6 +1089,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
1078
1089
  provide: 'ProductErrorsRepository',
1079
1090
  useExisting: ProductErrorsHasuraGraphQLRepository,
1080
1091
  },
1092
+ {
1093
+ provide: ProductCatalogHasuraGraphQLRepository,
1094
+ useFactory: (options) => {
1095
+ return new ProductCatalogHasuraGraphQLRepository(options);
1096
+ },
1097
+ deps: ['HasuraConfig'],
1098
+ },
1099
+ {
1100
+ provide: 'ProductCatalogRepository',
1101
+ useExisting: ProductCatalogHasuraGraphQLRepository,
1102
+ },
1081
1103
  ],
1082
1104
  }]
1083
1105
  }] });
@@ -1211,7 +1233,7 @@ ConfigurationFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", vers
1211
1233
  ConfigurationFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ConfigurationFacade });
1212
1234
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ConfigurationFacade, decorators: [{
1213
1235
  type: Injectable
1214
- }], ctorParameters: function () { return [{ type: i3.Shops, decorators: [{
1236
+ }], ctorParameters: function () { return [{ type: i1$3.Shops, decorators: [{
1215
1237
  type: Inject,
1216
1238
  args: [DEFAULT_SHOP]
1217
1239
  }] }, { type: undefined, decorators: [{
@@ -1560,12 +1582,12 @@ class CategorySearchStrategy {
1560
1582
  distinct: ['brand'],
1561
1583
  },
1562
1584
  };
1563
- return productCatalog.productRepository.findCatalog(repoParams, null, optionsCache);
1585
+ return productCatalog.productCatalogRepository.findCatalog(repoParams, null, optionsCache);
1564
1586
  }
1565
1587
  async getProductIds(category, filters, optionsCache) {
1566
1588
  const productCatalog = this.repositoryService.getProductCatalog();
1567
1589
  const filterHelper = this.helpersService.getFilterHelper();
1568
- return productCatalog.productRepository
1590
+ return productCatalog.productCatalogRepository
1569
1591
  .findCatalog({
1570
1592
  fields: ['id'],
1571
1593
  filters: {
@@ -1581,7 +1603,7 @@ class CategorySearchStrategy {
1581
1603
  const filterHelper = this.helpersService.getFilterHelper();
1582
1604
  const sortHelper = this.helpersService.getSortHelper();
1583
1605
  const mostRelevantProductsIds = [...new Set(mostRelevants.concat(productIds))];
1584
- const totalResult = await productCatalog.productRepository.findCatalog({
1606
+ const totalResult = await productCatalog.productCatalogRepository.findCatalog({
1585
1607
  fields,
1586
1608
  filters: {
1587
1609
  id: { operator: Where.IN, value: mostRelevantProductsIds },
@@ -1649,7 +1671,7 @@ class ProfileSearchStrategy {
1649
1671
  distinct: ['brand'],
1650
1672
  },
1651
1673
  };
1652
- return productCatalog.productRepository.findCatalog(repoParams, mainGender || (shop === Shops.MENSMARKET ? 'male' : 'female'), optionsCache);
1674
+ return productCatalog.productCatalogRepository.findCatalog(repoParams, mainGender || (shop === Shops.MENSMARKET ? 'male' : 'female'), optionsCache);
1653
1675
  }
1654
1676
  }
1655
1677
  ProfileSearchStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProfileSearchStrategy, deps: [{ token: CatalogRepositoryService }, { token: CatalogHelpersService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1685,6 +1707,7 @@ class TermSearchStrategy {
1685
1707
  limits,
1686
1708
  shop,
1687
1709
  mainGender,
1710
+ sort,
1688
1711
  fields: this.helpersService.getFieldsHelper().getStandardFields(),
1689
1712
  });
1690
1713
  }
@@ -1692,7 +1715,7 @@ class TermSearchStrategy {
1692
1715
  const { productIds, filters, shop, mainGender } = params;
1693
1716
  const productCatalog = this.repositoryService.getProductCatalog();
1694
1717
  const filterHelper = this.helpersService.getFilterHelper();
1695
- const totalResult = await productCatalog.productRepository.findCatalog({
1718
+ const totalResult = await productCatalog.productCatalogRepository.findCatalog({
1696
1719
  fields: ['id', 'stock', 'gender'],
1697
1720
  filters: {
1698
1721
  id: { operator: Where.IN, value: productIds },
@@ -1714,10 +1737,11 @@ class TermSearchStrategy {
1714
1737
  });
1715
1738
  }
1716
1739
  async searchDefault(params) {
1717
- const { productIds, filters, limits, shop, mainGender, fields } = params;
1740
+ const { productIds, filters, limits, sort, shop, mainGender, fields } = params;
1718
1741
  const productCatalog = this.repositoryService.getProductCatalog();
1719
1742
  const filterHelper = this.helpersService.getFilterHelper();
1720
- return productCatalog.productRepository.findCatalog({
1743
+ const sortHelper = this.helpersService.getSortHelper();
1744
+ return productCatalog.productCatalogRepository.findCatalog({
1721
1745
  fields,
1722
1746
  filters: {
1723
1747
  id: { operator: Where.IN, value: productIds },
@@ -1725,6 +1749,7 @@ class TermSearchStrategy {
1725
1749
  ...filterHelper.buildFilterQuery(filters || {}),
1726
1750
  },
1727
1751
  limits,
1752
+ ...(sort ? { orderBy: sortHelper.buildSortQuery(sort) } : {}),
1728
1753
  options: {
1729
1754
  minimal: ['price'],
1730
1755
  maximum: ['price'],
@@ -1747,7 +1772,7 @@ class TermSearchStrategy {
1747
1772
  async getDetailedProducts(orderedId, totalResult, fieldsHelper) {
1748
1773
  const productCatalog = this.repositoryService.getProductCatalog();
1749
1774
  const fields = fieldsHelper.getStandardFields();
1750
- const productResult = await productCatalog.productRepository.findCatalog({
1775
+ const productResult = await productCatalog.productCatalogRepository.findCatalog({
1751
1776
  filters: {
1752
1777
  id: { operator: Where.IN, value: orderedId },
1753
1778
  },
@@ -1805,7 +1830,7 @@ CatalogServiceFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ver
1805
1830
  CatalogServiceFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogServiceFacade });
1806
1831
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogServiceFacade, decorators: [{
1807
1832
  type: Injectable
1808
- }], ctorParameters: function () { return [{ type: CatalogHelpersService }, { type: CatalogStrategiesFacade }, { type: i3.Shops, decorators: [{
1833
+ }], ctorParameters: function () { return [{ type: CatalogHelpersService }, { type: CatalogStrategiesFacade }, { type: i1$3.Shops, decorators: [{
1809
1834
  type: Inject,
1810
1835
  args: [DEFAULT_SHOP]
1811
1836
  }] }]; } });
@@ -1835,7 +1860,7 @@ class CategoryService {
1835
1860
  this.shop = shop;
1836
1861
  }
1837
1862
  async fetchBrands(category, options, optionsCache) {
1838
- const brands = await this.productCatalog.productRepository
1863
+ const brands = await this.productCatalog.productCatalogRepository
1839
1864
  .findCatalog({
1840
1865
  filters: await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(category),
1841
1866
  fields: ['brand'],
@@ -1858,24 +1883,24 @@ CategoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
1858
1883
  CategoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService });
1859
1884
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService, decorators: [{
1860
1885
  type: Injectable
1861
- }], ctorParameters: function () { return [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i3.Shops, decorators: [{
1886
+ }], ctorParameters: function () { return [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i1$3.Shops, decorators: [{
1862
1887
  type: Inject,
1863
1888
  args: [DEFAULT_SHOP]
1864
1889
  }] }]; } });
1865
1890
 
1866
1891
  class ProductCatalogFacade {
1867
- constructor(productRepository, categoryStructureAdapter) {
1868
- this.productRepository = productRepository;
1892
+ constructor(productCatalogRepository, categoryStructureAdapter) {
1893
+ this.productCatalogRepository = productCatalogRepository;
1869
1894
  this.categoryStructureAdapter = categoryStructureAdapter;
1870
1895
  }
1871
1896
  }
1872
- ProductCatalogFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProductCatalogFacade, deps: [{ token: 'ProductRepository' }, { token: CATEGORY_STRUCTURE }], target: i0.ɵɵFactoryTarget.Injectable });
1897
+ ProductCatalogFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProductCatalogFacade, deps: [{ token: 'ProductCatalogRepository' }, { token: CATEGORY_STRUCTURE }], target: i0.ɵɵFactoryTarget.Injectable });
1873
1898
  ProductCatalogFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProductCatalogFacade });
1874
1899
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProductCatalogFacade, decorators: [{
1875
1900
  type: Injectable
1876
1901
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1877
1902
  type: Inject,
1878
- args: ['ProductRepository']
1903
+ args: ['ProductCatalogRepository']
1879
1904
  }] }, { type: undefined, decorators: [{
1880
1905
  type: Inject,
1881
1906
  args: [CATEGORY_STRUCTURE]
@@ -1896,7 +1921,7 @@ CategoryServiceFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ve
1896
1921
  CategoryServiceFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryServiceFacade });
1897
1922
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryServiceFacade, decorators: [{
1898
1923
  type: Injectable
1899
- }], ctorParameters: function () { return [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i3.Shops, decorators: [{
1924
+ }], ctorParameters: function () { return [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i1$3.Shops, decorators: [{
1900
1925
  type: Inject,
1901
1926
  args: [DEFAULT_SHOP]
1902
1927
  }] }]; } });
@@ -1938,7 +1963,7 @@ class BrandManagerHelper {
1938
1963
  if (options.category) {
1939
1964
  filters = await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(options.category);
1940
1965
  }
1941
- return this.productCatalog.productRepository
1966
+ return this.productCatalog.productCatalogRepository
1942
1967
  .findCatalog({
1943
1968
  fields: ['id'],
1944
1969
  filters: {
@@ -2056,6 +2081,7 @@ class ProductFieldsHelper {
2056
2081
  'name',
2057
2082
  'slug',
2058
2083
  'images',
2084
+ 'imagesCard',
2059
2085
  'miniatures',
2060
2086
  'price',
2061
2087
  'stock',
@@ -2078,6 +2104,8 @@ class ProductFieldsHelper {
2078
2104
  'label',
2079
2105
  'outlet',
2080
2106
  'group',
2107
+ 'variantSlug',
2108
+ 'filters',
2081
2109
  ];
2082
2110
  }
2083
2111
  }
@@ -2275,7 +2303,7 @@ CatalogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
2275
2303
  CatalogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService });
2276
2304
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, decorators: [{
2277
2305
  type: Injectable
2278
- }], ctorParameters: function () { return [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i3.Shops, decorators: [{
2306
+ }], ctorParameters: function () { return [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i1$3.Shops, decorators: [{
2279
2307
  type: Inject,
2280
2308
  args: [DEFAULT_SHOP]
2281
2309
  }] }]; } });
@@ -2299,9 +2327,10 @@ __decorate([
2299
2327
  ], CategoryWithTree.prototype, "children", void 0);
2300
2328
 
2301
2329
  class WishlistService {
2302
- constructor(wishlistRepository, productRepository, logRepository, shop) {
2330
+ constructor(wishlistRepository, productRepository, productCatalogRepository, logRepository, shop) {
2303
2331
  this.wishlistRepository = wishlistRepository;
2304
2332
  this.productRepository = productRepository;
2333
+ this.productCatalogRepository = productCatalogRepository;
2305
2334
  this.logRepository = logRepository;
2306
2335
  this.shop = shop;
2307
2336
  }
@@ -2452,7 +2481,7 @@ class WishlistService {
2452
2481
  .then((res) => res.data.at(0));
2453
2482
  }
2454
2483
  async findProductById(id) {
2455
- return this.productRepository
2484
+ return this.productCatalogRepository
2456
2485
  .find({
2457
2486
  fields: ['id', 'sku', 'EAN', 'name', 'brand'],
2458
2487
  filters: {
@@ -2529,7 +2558,7 @@ class WishlistService {
2529
2558
  };
2530
2559
  }
2531
2560
  }
2532
- WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'ProductRepository' }, { token: 'LogRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
2561
+ WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'ProductRepository' }, { token: 'ProductCatalogRepository' }, { token: 'LogRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
2533
2562
  WishlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService });
2534
2563
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, decorators: [{
2535
2564
  type: Injectable
@@ -2539,10 +2568,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
2539
2568
  }] }, { type: undefined, decorators: [{
2540
2569
  type: Inject,
2541
2570
  args: ['ProductRepository']
2571
+ }] }, { type: undefined, decorators: [{
2572
+ type: Inject,
2573
+ args: ['ProductCatalogRepository']
2542
2574
  }] }, { type: undefined, decorators: [{
2543
2575
  type: Inject,
2544
2576
  args: ['LogRepository']
2545
- }] }, { type: i3.Shops, decorators: [{
2577
+ }] }, { type: i1$3.Shops, decorators: [{
2546
2578
  type: Inject,
2547
2579
  args: [DEFAULT_SHOP]
2548
2580
  }] }]; } });
@@ -3007,10 +3039,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
3007
3039
  }], ctorParameters: function () { return [{ type: HomeShopRepositoriesFacade }, { type: ConfigurationFacade }]; } });
3008
3040
 
3009
3041
  class OrderProductReviewService {
3010
- constructor(orderRepository, productReviewRepository, variantRepository) {
3042
+ constructor(orderRepository, productReviewRepository, variantRepository, defaultShop) {
3011
3043
  this.orderRepository = orderRepository;
3012
3044
  this.productReviewRepository = productReviewRepository;
3013
3045
  this.variantRepository = variantRepository;
3046
+ this.defaultShop = defaultShop;
3014
3047
  }
3015
3048
  async getPendingReviewsByEmail(email) {
3016
3049
  const products = [];
@@ -3034,6 +3067,7 @@ class OrderProductReviewService {
3034
3067
  user: {
3035
3068
  email: email,
3036
3069
  },
3070
+ shop: this.defaultShop,
3037
3071
  status: OrderStatus.ENTREGUE,
3038
3072
  createdAt: {
3039
3073
  operator: Where.GTE,
@@ -3096,12 +3130,22 @@ class OrderProductReviewService {
3096
3130
  orderId: review.orderId,
3097
3131
  }));
3098
3132
  }
3133
+ async verifyReviewProductAndOrder(orderId, productId) {
3134
+ return this.productReviewRepository
3135
+ .find({
3136
+ filters: {
3137
+ orderId: { operator: Where.IN, value: orderId },
3138
+ productId: productId,
3139
+ },
3140
+ })
3141
+ .then((res) => res.data);
3142
+ }
3099
3143
  }
3100
- OrderProductReviewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService, deps: [{ token: 'OrderRepository' }, { token: 'ProductReviewRepository' }, { token: 'VariantRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
3144
+ OrderProductReviewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService, deps: [{ token: 'OrderRepository' }, { token: 'ProductReviewRepository' }, { token: 'VariantRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
3101
3145
  OrderProductReviewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService });
3102
3146
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService, decorators: [{
3103
3147
  type: Injectable
3104
- }], ctorParameters: function () { return [{ type: i3.OrderFirestoreRepository, decorators: [{
3148
+ }], ctorParameters: function () { return [{ type: i1$3.OrderFirestoreRepository, decorators: [{
3105
3149
  type: Inject,
3106
3150
  args: ['OrderRepository']
3107
3151
  }] }, { type: undefined, decorators: [{
@@ -3110,6 +3154,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
3110
3154
  }] }, { type: undefined, decorators: [{
3111
3155
  type: Inject,
3112
3156
  args: ['VariantRepository']
3157
+ }] }, { type: i1$3.Shops, decorators: [{
3158
+ type: Inject,
3159
+ args: [DEFAULT_SHOP]
3113
3160
  }] }]; } });
3114
3161
 
3115
3162
  class OrderService {
@@ -3129,7 +3176,7 @@ OrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "1
3129
3176
  OrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService });
3130
3177
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService, decorators: [{
3131
3178
  type: Injectable
3132
- }], ctorParameters: function () { return [{ type: i1$1.Firestore }, { type: i3.OrderFirestoreRepository, decorators: [{
3179
+ }], ctorParameters: function () { return [{ type: i1$1.Firestore }, { type: i1$3.OrderFirestoreRepository, decorators: [{
3133
3180
  type: Inject,
3134
3181
  args: ['OrderRepository']
3135
3182
  }] }]; } });
@@ -3176,7 +3223,7 @@ class AngularConnectModule {
3176
3223
  }
3177
3224
  }
3178
3225
  AngularConnectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3179
- AngularConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, imports: [i1$3.FirebaseAppModule, i2.AppCheckModule, i3$1.StorageModule, AngularElasticSeachModule,
3226
+ AngularConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, i2.AppCheckModule, i3.StorageModule, AngularElasticSeachModule,
3180
3227
  AngularVertexSeachModule,
3181
3228
  AngularFirebaseAuthModule,
3182
3229
  AngularFirestoreModule,