@infrab4a/connect-angular 6.0.0-beta.13 → 6.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.
- package/esm2022/angular-hasura-graphql.module.mjs +24 -2
- package/esm2022/services/catalog/catalog.service.mjs +1 -7
- package/esm2022/services/catalog/category.service.mjs +2 -2
- package/esm2022/services/catalog/facades/product-catalog.facade.mjs +5 -5
- package/esm2022/services/catalog/helpers/brand-manager.helper.mjs +8 -30
- package/esm2022/services/catalog/helpers/product-fields.helper.mjs +3 -1
- package/esm2022/services/catalog/strategies/category-search.strategy.mjs +6 -7
- package/esm2022/services/catalog/strategies/profile-search.strategy.mjs +2 -2
- package/esm2022/services/catalog/strategies/term-search.strategy.mjs +4 -4
- package/esm2022/services/catalog/wishlist.service.mjs +8 -4
- package/esm2022/services/order-product-review.service.mjs +20 -4
- package/fesm2022/infrab4a-connect-angular.mjs +80 -66
- package/fesm2022/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +2 -2
- package/services/catalog/facades/product-catalog.facade.d.ts +3 -3
- package/services/catalog/wishlist.service.d.ts +3 -2
- package/services/order-product-review.service.d.ts +4 -2
|
@@ -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
|
+
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
|
|
7
|
+
import * as i3 from '@angular/fire/storage';
|
|
8
8
|
import { Storage, provideStorage, getStorage } from '@angular/fire/storage';
|
|
9
|
-
import * as
|
|
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,
|
|
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:
|
|
1222
|
+
}], ctorParameters: () => [{ type: i1$3.Shops, decorators: [{
|
|
1201
1223
|
type: Inject,
|
|
1202
1224
|
args: [DEFAULT_SHOP]
|
|
1203
1225
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1546,12 +1568,12 @@ class CategorySearchStrategy {
|
|
|
1546
1568
|
distinct: ['brand'],
|
|
1547
1569
|
},
|
|
1548
1570
|
};
|
|
1549
|
-
return productCatalog.
|
|
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.
|
|
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.
|
|
1592
|
+
const totalResult = await productCatalog.productCatalogRepository.findCatalog({
|
|
1571
1593
|
fields,
|
|
1572
1594
|
filters: {
|
|
1573
1595
|
id: { operator: Where.IN, value: mostRelevantProductsIds },
|
|
@@ -1577,8 +1599,7 @@ class CategorySearchStrategy {
|
|
|
1577
1599
|
options: {
|
|
1578
1600
|
minimal: ['price'],
|
|
1579
1601
|
maximum: ['price'],
|
|
1580
|
-
distinct: ['brand'],
|
|
1581
|
-
// ...(isEmpty(filters?.brands) ? { distinct: ['brand'] } : {}),
|
|
1602
|
+
...(isEmpty(filters?.brands) ? { distinct: ['brand'] } : {}),
|
|
1582
1603
|
},
|
|
1583
1604
|
}, mainGender || (shop === Shops.MENSMARKET ? 'male' : 'female'), optionsCache);
|
|
1584
1605
|
return this.sortProductsByRelevance(totalResult, mostRelevants, limits);
|
|
@@ -1636,7 +1657,7 @@ class ProfileSearchStrategy {
|
|
|
1636
1657
|
distinct: ['brand'],
|
|
1637
1658
|
},
|
|
1638
1659
|
};
|
|
1639
|
-
return productCatalog.
|
|
1660
|
+
return productCatalog.productCatalogRepository.findCatalog(repoParams, mainGender || (shop === Shops.MENSMARKET ? 'male' : 'female'), optionsCache);
|
|
1640
1661
|
}
|
|
1641
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 }); }
|
|
1642
1663
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProfileSearchStrategy }); }
|
|
@@ -1679,7 +1700,7 @@ class TermSearchStrategy {
|
|
|
1679
1700
|
const { productIds, filters, shop, mainGender } = params;
|
|
1680
1701
|
const productCatalog = this.repositoryService.getProductCatalog();
|
|
1681
1702
|
const filterHelper = this.helpersService.getFilterHelper();
|
|
1682
|
-
const totalResult = await productCatalog.
|
|
1703
|
+
const totalResult = await productCatalog.productCatalogRepository.findCatalog({
|
|
1683
1704
|
fields: ['id', 'stock', 'gender'],
|
|
1684
1705
|
filters: {
|
|
1685
1706
|
id: { operator: Where.IN, value: productIds },
|
|
@@ -1704,7 +1725,7 @@ class TermSearchStrategy {
|
|
|
1704
1725
|
const { productIds, filters, limits, shop, mainGender, fields } = params;
|
|
1705
1726
|
const productCatalog = this.repositoryService.getProductCatalog();
|
|
1706
1727
|
const filterHelper = this.helpersService.getFilterHelper();
|
|
1707
|
-
return productCatalog.
|
|
1728
|
+
return productCatalog.productCatalogRepository.findCatalog({
|
|
1708
1729
|
fields,
|
|
1709
1730
|
filters: {
|
|
1710
1731
|
id: { operator: Where.IN, value: productIds },
|
|
@@ -1734,7 +1755,7 @@ class TermSearchStrategy {
|
|
|
1734
1755
|
async getDetailedProducts(orderedId, totalResult, fieldsHelper) {
|
|
1735
1756
|
const productCatalog = this.repositoryService.getProductCatalog();
|
|
1736
1757
|
const fields = fieldsHelper.getStandardFields();
|
|
1737
|
-
const productResult = await productCatalog.
|
|
1758
|
+
const productResult = await productCatalog.productCatalogRepository.findCatalog({
|
|
1738
1759
|
filters: {
|
|
1739
1760
|
id: { operator: Where.IN, value: orderedId },
|
|
1740
1761
|
},
|
|
@@ -1792,7 +1813,7 @@ class CatalogServiceFacade {
|
|
|
1792
1813
|
}
|
|
1793
1814
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogServiceFacade, decorators: [{
|
|
1794
1815
|
type: Injectable
|
|
1795
|
-
}], ctorParameters: () => [{ type: CatalogHelpersService }, { type: CatalogStrategiesFacade }, { type:
|
|
1816
|
+
}], ctorParameters: () => [{ type: CatalogHelpersService }, { type: CatalogStrategiesFacade }, { type: i1$3.Shops, decorators: [{
|
|
1796
1817
|
type: Inject,
|
|
1797
1818
|
args: [DEFAULT_SHOP]
|
|
1798
1819
|
}] }] });
|
|
@@ -1822,7 +1843,7 @@ class CategoryService {
|
|
|
1822
1843
|
this.shop = shop;
|
|
1823
1844
|
}
|
|
1824
1845
|
async fetchBrands(category, options, optionsCache) {
|
|
1825
|
-
const brands = await this.productCatalog.
|
|
1846
|
+
const brands = await this.productCatalog.productCatalogRepository
|
|
1826
1847
|
.findCatalog({
|
|
1827
1848
|
filters: await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(category),
|
|
1828
1849
|
fields: ['brand'],
|
|
@@ -1845,24 +1866,24 @@ class CategoryService {
|
|
|
1845
1866
|
}
|
|
1846
1867
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryService, decorators: [{
|
|
1847
1868
|
type: Injectable
|
|
1848
|
-
}], ctorParameters: () => [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type:
|
|
1869
|
+
}], ctorParameters: () => [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i1$3.Shops, decorators: [{
|
|
1849
1870
|
type: Inject,
|
|
1850
1871
|
args: [DEFAULT_SHOP]
|
|
1851
1872
|
}] }] });
|
|
1852
1873
|
|
|
1853
1874
|
class ProductCatalogFacade {
|
|
1854
|
-
constructor(
|
|
1855
|
-
this.
|
|
1875
|
+
constructor(productCatalogRepository, categoryStructureAdapter) {
|
|
1876
|
+
this.productCatalogRepository = productCatalogRepository;
|
|
1856
1877
|
this.categoryStructureAdapter = categoryStructureAdapter;
|
|
1857
1878
|
}
|
|
1858
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductCatalogFacade, deps: [{ token: '
|
|
1879
|
+
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 }); }
|
|
1859
1880
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductCatalogFacade }); }
|
|
1860
1881
|
}
|
|
1861
1882
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductCatalogFacade, decorators: [{
|
|
1862
1883
|
type: Injectable
|
|
1863
1884
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1864
1885
|
type: Inject,
|
|
1865
|
-
args: ['
|
|
1886
|
+
args: ['ProductCatalogRepository']
|
|
1866
1887
|
}] }, { type: undefined, decorators: [{
|
|
1867
1888
|
type: Inject,
|
|
1868
1889
|
args: [CATEGORY_STRUCTURE]
|
|
@@ -1883,7 +1904,7 @@ class CategoryServiceFacade {
|
|
|
1883
1904
|
}
|
|
1884
1905
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryServiceFacade, decorators: [{
|
|
1885
1906
|
type: Injectable
|
|
1886
|
-
}], ctorParameters: () => [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type:
|
|
1907
|
+
}], ctorParameters: () => [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i1$3.Shops, decorators: [{
|
|
1887
1908
|
type: Inject,
|
|
1888
1909
|
args: [DEFAULT_SHOP]
|
|
1889
1910
|
}] }] });
|
|
@@ -1894,21 +1915,13 @@ class BrandManagerHelper {
|
|
|
1894
1915
|
this.brandsList = {};
|
|
1895
1916
|
}
|
|
1896
1917
|
async setBrandsList(options, brands) {
|
|
1897
|
-
// eslint-disable-next-line no-console
|
|
1898
|
-
console.log('setBrandsList', brands);
|
|
1899
1918
|
const filterBrands = options.filters?.brands;
|
|
1900
1919
|
const indexKey = this.buildIndexBrands(options);
|
|
1901
1920
|
if (isEmpty(brands) && options.filters) {
|
|
1902
1921
|
delete options.filters.brands;
|
|
1903
1922
|
}
|
|
1904
|
-
|
|
1905
|
-
console.log('this.brandsList[indexKey]', this.brandsList[indexKey]);
|
|
1906
|
-
// eslint-disable-next-line no-console
|
|
1907
|
-
console.log('brands', brands);
|
|
1908
|
-
this.brandsList[indexKey] = brands || this.brandsList[indexKey] || (await this.fetchBrandsOnly(options));
|
|
1923
|
+
this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (await this.fetchBrandsOnly(options));
|
|
1909
1924
|
this.brandsList[indexKey] = this.brandsList[indexKey].filter(Boolean);
|
|
1910
|
-
// eslint-disable-next-line no-console
|
|
1911
|
-
console.log('setBrandsList indexKey', this.brandsList[indexKey]);
|
|
1912
1925
|
if (options.filters) {
|
|
1913
1926
|
options.filters = {
|
|
1914
1927
|
...options.filters,
|
|
@@ -1928,30 +1941,16 @@ class BrandManagerHelper {
|
|
|
1928
1941
|
return `profile-${options.profile.join(',')}`;
|
|
1929
1942
|
return '';
|
|
1930
1943
|
}
|
|
1931
|
-
async fetchBrandsOnly(options
|
|
1932
|
-
|
|
1933
|
-
console.log('fetchBrandsOnly');
|
|
1944
|
+
async fetchBrandsOnly(options) {
|
|
1945
|
+
let filters = {};
|
|
1934
1946
|
if (options.category) {
|
|
1935
|
-
|
|
1936
|
-
// eslint-disable-next-line no-console
|
|
1937
|
-
console.log('fetchBrandsOnly', filters);
|
|
1938
|
-
return this.productCatalog.productRepository
|
|
1939
|
-
.findCatalog({
|
|
1940
|
-
fields: ['id'],
|
|
1941
|
-
filters: {
|
|
1942
|
-
...filters,
|
|
1943
|
-
published: { operator: Where.EQUALS, value: true },
|
|
1944
|
-
},
|
|
1945
|
-
options: {
|
|
1946
|
-
distinct: ['brand'],
|
|
1947
|
-
},
|
|
1948
|
-
}, options.mainGender)
|
|
1949
|
-
.then((result) => result.distinct.brand);
|
|
1947
|
+
filters = await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(options.category);
|
|
1950
1948
|
}
|
|
1951
|
-
return this.productCatalog.
|
|
1949
|
+
return this.productCatalog.productCatalogRepository
|
|
1952
1950
|
.findCatalog({
|
|
1953
1951
|
fields: ['id'],
|
|
1954
1952
|
filters: {
|
|
1953
|
+
...filters,
|
|
1955
1954
|
published: { operator: Where.EQUALS, value: true },
|
|
1956
1955
|
},
|
|
1957
1956
|
options: {
|
|
@@ -2065,6 +2064,7 @@ class ProductFieldsHelper {
|
|
|
2065
2064
|
'name',
|
|
2066
2065
|
'slug',
|
|
2067
2066
|
'images',
|
|
2067
|
+
'imagesCard',
|
|
2068
2068
|
'miniatures',
|
|
2069
2069
|
'price',
|
|
2070
2070
|
'stock',
|
|
@@ -2087,6 +2087,7 @@ class ProductFieldsHelper {
|
|
|
2087
2087
|
'label',
|
|
2088
2088
|
'outlet',
|
|
2089
2089
|
'group',
|
|
2090
|
+
'variantSlug',
|
|
2090
2091
|
];
|
|
2091
2092
|
}
|
|
2092
2093
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductFieldsHelper, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -2196,14 +2197,8 @@ class CatalogService {
|
|
|
2196
2197
|
async fetchProducts(options, optionsCache) {
|
|
2197
2198
|
this.validateRequest(options);
|
|
2198
2199
|
const searchParams = this.buildSearchParams(options);
|
|
2199
|
-
// eslint-disable-next-line no-console
|
|
2200
|
-
console.log('searchParams', searchParams);
|
|
2201
2200
|
const { data, count: total, maximum, minimal, distinct, } = await this.searchContext.executeSearch(searchParams, this.shop, optionsCache);
|
|
2202
|
-
// eslint-disable-next-line no-console
|
|
2203
|
-
console.log('distinct', distinct);
|
|
2204
2201
|
await this.helpersService.getBrandManager().setBrandsList(searchParams, distinct?.brand);
|
|
2205
|
-
// eslint-disable-next-line no-console
|
|
2206
|
-
console.log('searchParams 2', searchParams);
|
|
2207
2202
|
return this.buildResponse({
|
|
2208
2203
|
data,
|
|
2209
2204
|
total,
|
|
@@ -2290,7 +2285,7 @@ class CatalogService {
|
|
|
2290
2285
|
}
|
|
2291
2286
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogService, decorators: [{
|
|
2292
2287
|
type: Injectable
|
|
2293
|
-
}], ctorParameters: () => [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type:
|
|
2288
|
+
}], ctorParameters: () => [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i1$3.Shops, decorators: [{
|
|
2294
2289
|
type: Inject,
|
|
2295
2290
|
args: [DEFAULT_SHOP]
|
|
2296
2291
|
}] }] });
|
|
@@ -2314,9 +2309,10 @@ __decorate([
|
|
|
2314
2309
|
], CategoryWithTree.prototype, "children", void 0);
|
|
2315
2310
|
|
|
2316
2311
|
class WishlistService {
|
|
2317
|
-
constructor(wishlistRepository, productRepository, logRepository, shop) {
|
|
2312
|
+
constructor(wishlistRepository, productRepository, productCatalogRepository, logRepository, shop) {
|
|
2318
2313
|
this.wishlistRepository = wishlistRepository;
|
|
2319
2314
|
this.productRepository = productRepository;
|
|
2315
|
+
this.productCatalogRepository = productCatalogRepository;
|
|
2320
2316
|
this.logRepository = logRepository;
|
|
2321
2317
|
this.shop = shop;
|
|
2322
2318
|
}
|
|
@@ -2467,7 +2463,7 @@ class WishlistService {
|
|
|
2467
2463
|
.then((res) => res.data.at(0));
|
|
2468
2464
|
}
|
|
2469
2465
|
async findProductById(id) {
|
|
2470
|
-
return this.
|
|
2466
|
+
return this.productCatalogRepository
|
|
2471
2467
|
.find({
|
|
2472
2468
|
fields: ['id', 'sku', 'EAN', 'name', 'brand'],
|
|
2473
2469
|
filters: {
|
|
@@ -2543,7 +2539,7 @@ class WishlistService {
|
|
|
2543
2539
|
productBrand: product.brand,
|
|
2544
2540
|
};
|
|
2545
2541
|
}
|
|
2546
|
-
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 }); }
|
|
2542
|
+
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 }); }
|
|
2547
2543
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService }); }
|
|
2548
2544
|
}
|
|
2549
2545
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService, decorators: [{
|
|
@@ -2554,10 +2550,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
2554
2550
|
}] }, { type: undefined, decorators: [{
|
|
2555
2551
|
type: Inject,
|
|
2556
2552
|
args: ['ProductRepository']
|
|
2553
|
+
}] }, { type: undefined, decorators: [{
|
|
2554
|
+
type: Inject,
|
|
2555
|
+
args: ['ProductCatalogRepository']
|
|
2557
2556
|
}] }, { type: undefined, decorators: [{
|
|
2558
2557
|
type: Inject,
|
|
2559
2558
|
args: ['LogRepository']
|
|
2560
|
-
}] }, { type:
|
|
2559
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
2561
2560
|
type: Inject,
|
|
2562
2561
|
args: [DEFAULT_SHOP]
|
|
2563
2562
|
}] }] });
|
|
@@ -3022,10 +3021,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
3022
3021
|
}], ctorParameters: () => [{ type: HomeShopRepositoriesFacade }, { type: ConfigurationFacade }] });
|
|
3023
3022
|
|
|
3024
3023
|
class OrderProductReviewService {
|
|
3025
|
-
constructor(orderRepository, productReviewRepository, variantRepository) {
|
|
3024
|
+
constructor(orderRepository, productReviewRepository, variantRepository, defaultShop) {
|
|
3026
3025
|
this.orderRepository = orderRepository;
|
|
3027
3026
|
this.productReviewRepository = productReviewRepository;
|
|
3028
3027
|
this.variantRepository = variantRepository;
|
|
3028
|
+
this.defaultShop = defaultShop;
|
|
3029
3029
|
}
|
|
3030
3030
|
async getPendingReviewsByEmail(email) {
|
|
3031
3031
|
const products = [];
|
|
@@ -3049,6 +3049,7 @@ class OrderProductReviewService {
|
|
|
3049
3049
|
user: {
|
|
3050
3050
|
email: email,
|
|
3051
3051
|
},
|
|
3052
|
+
shop: this.defaultShop,
|
|
3052
3053
|
status: OrderStatus.ENTREGUE,
|
|
3053
3054
|
createdAt: {
|
|
3054
3055
|
operator: Where.GTE,
|
|
@@ -3111,12 +3112,22 @@ class OrderProductReviewService {
|
|
|
3111
3112
|
orderId: review.orderId,
|
|
3112
3113
|
}));
|
|
3113
3114
|
}
|
|
3114
|
-
|
|
3115
|
+
async verifyReviewProductAndOrder(orderId, productId) {
|
|
3116
|
+
return this.productReviewRepository
|
|
3117
|
+
.find({
|
|
3118
|
+
filters: {
|
|
3119
|
+
orderId: { operator: Where.IN, value: orderId },
|
|
3120
|
+
productId: productId,
|
|
3121
|
+
},
|
|
3122
|
+
})
|
|
3123
|
+
.then((res) => res.data);
|
|
3124
|
+
}
|
|
3125
|
+
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 }); }
|
|
3115
3126
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderProductReviewService }); }
|
|
3116
3127
|
}
|
|
3117
3128
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderProductReviewService, decorators: [{
|
|
3118
3129
|
type: Injectable
|
|
3119
|
-
}], ctorParameters: () => [{ type:
|
|
3130
|
+
}], ctorParameters: () => [{ type: i1$3.OrderFirestoreRepository, decorators: [{
|
|
3120
3131
|
type: Inject,
|
|
3121
3132
|
args: ['OrderRepository']
|
|
3122
3133
|
}] }, { type: undefined, decorators: [{
|
|
@@ -3125,6 +3136,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
3125
3136
|
}] }, { type: undefined, decorators: [{
|
|
3126
3137
|
type: Inject,
|
|
3127
3138
|
args: ['VariantRepository']
|
|
3139
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
3140
|
+
type: Inject,
|
|
3141
|
+
args: [DEFAULT_SHOP]
|
|
3128
3142
|
}] }] });
|
|
3129
3143
|
|
|
3130
3144
|
class OrderService {
|
|
@@ -3144,7 +3158,7 @@ class OrderService {
|
|
|
3144
3158
|
}
|
|
3145
3159
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderService, decorators: [{
|
|
3146
3160
|
type: Injectable
|
|
3147
|
-
}], ctorParameters: () => [{ type: i1$1.Firestore }, { type:
|
|
3161
|
+
}], ctorParameters: () => [{ type: i1$1.Firestore }, { type: i1$3.OrderFirestoreRepository, decorators: [{
|
|
3148
3162
|
type: Inject,
|
|
3149
3163
|
args: ['OrderRepository']
|
|
3150
3164
|
}] }] });
|
|
@@ -3190,7 +3204,7 @@ class AngularConnectModule {
|
|
|
3190
3204
|
return isNil(value) ? [] : [{ provide: token, useValue: value }];
|
|
3191
3205
|
}
|
|
3192
3206
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3193
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, imports: [i1$
|
|
3207
|
+
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,
|
|
3194
3208
|
AngularVertexSeachModule,
|
|
3195
3209
|
AngularFirebaseAuthModule,
|
|
3196
3210
|
AngularFirestoreModule,
|