@infrab4a/connect-angular 6.0.0-beta.12 → 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 +7 -23
- 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 +79 -59
- 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,8 +1915,6 @@ 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) {
|
|
@@ -1903,8 +1922,6 @@ class BrandManagerHelper {
|
|
|
1903
1922
|
}
|
|
1904
1923
|
this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (await this.fetchBrandsOnly(options));
|
|
1905
1924
|
this.brandsList[indexKey] = this.brandsList[indexKey].filter(Boolean);
|
|
1906
|
-
// eslint-disable-next-line no-console
|
|
1907
|
-
console.log('setBrandsList indexKey', this.brandsList[indexKey]);
|
|
1908
1925
|
if (options.filters) {
|
|
1909
1926
|
options.filters = {
|
|
1910
1927
|
...options.filters,
|
|
@@ -1924,28 +1941,16 @@ class BrandManagerHelper {
|
|
|
1924
1941
|
return `profile-${options.profile.join(',')}`;
|
|
1925
1942
|
return '';
|
|
1926
1943
|
}
|
|
1927
|
-
async fetchBrandsOnly(options
|
|
1944
|
+
async fetchBrandsOnly(options) {
|
|
1945
|
+
let filters = {};
|
|
1928
1946
|
if (options.category) {
|
|
1929
|
-
|
|
1930
|
-
// eslint-disable-next-line no-console
|
|
1931
|
-
console.log('fetchBrandsOnly', filters);
|
|
1932
|
-
return this.productCatalog.productRepository
|
|
1933
|
-
.findCatalog({
|
|
1934
|
-
fields: ['id'],
|
|
1935
|
-
filters: {
|
|
1936
|
-
...filters,
|
|
1937
|
-
published: { operator: Where.EQUALS, value: true },
|
|
1938
|
-
},
|
|
1939
|
-
options: {
|
|
1940
|
-
distinct: ['brand'],
|
|
1941
|
-
},
|
|
1942
|
-
}, options.mainGender)
|
|
1943
|
-
.then((result) => result.distinct.brand);
|
|
1947
|
+
filters = await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(options.category);
|
|
1944
1948
|
}
|
|
1945
|
-
return this.productCatalog.
|
|
1949
|
+
return this.productCatalog.productCatalogRepository
|
|
1946
1950
|
.findCatalog({
|
|
1947
1951
|
fields: ['id'],
|
|
1948
1952
|
filters: {
|
|
1953
|
+
...filters,
|
|
1949
1954
|
published: { operator: Where.EQUALS, value: true },
|
|
1950
1955
|
},
|
|
1951
1956
|
options: {
|
|
@@ -2059,6 +2064,7 @@ class ProductFieldsHelper {
|
|
|
2059
2064
|
'name',
|
|
2060
2065
|
'slug',
|
|
2061
2066
|
'images',
|
|
2067
|
+
'imagesCard',
|
|
2062
2068
|
'miniatures',
|
|
2063
2069
|
'price',
|
|
2064
2070
|
'stock',
|
|
@@ -2081,6 +2087,7 @@ class ProductFieldsHelper {
|
|
|
2081
2087
|
'label',
|
|
2082
2088
|
'outlet',
|
|
2083
2089
|
'group',
|
|
2090
|
+
'variantSlug',
|
|
2084
2091
|
];
|
|
2085
2092
|
}
|
|
2086
2093
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ProductFieldsHelper, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -2190,14 +2197,8 @@ class CatalogService {
|
|
|
2190
2197
|
async fetchProducts(options, optionsCache) {
|
|
2191
2198
|
this.validateRequest(options);
|
|
2192
2199
|
const searchParams = this.buildSearchParams(options);
|
|
2193
|
-
// eslint-disable-next-line no-console
|
|
2194
|
-
console.log('searchParams', searchParams);
|
|
2195
2200
|
const { data, count: total, maximum, minimal, distinct, } = await this.searchContext.executeSearch(searchParams, this.shop, optionsCache);
|
|
2196
|
-
// eslint-disable-next-line no-console
|
|
2197
|
-
console.log('distinct', distinct);
|
|
2198
2201
|
await this.helpersService.getBrandManager().setBrandsList(searchParams, distinct?.brand);
|
|
2199
|
-
// eslint-disable-next-line no-console
|
|
2200
|
-
console.log('searchParams 2', searchParams);
|
|
2201
2202
|
return this.buildResponse({
|
|
2202
2203
|
data,
|
|
2203
2204
|
total,
|
|
@@ -2284,7 +2285,7 @@ class CatalogService {
|
|
|
2284
2285
|
}
|
|
2285
2286
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogService, decorators: [{
|
|
2286
2287
|
type: Injectable
|
|
2287
|
-
}], ctorParameters: () => [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type:
|
|
2288
|
+
}], ctorParameters: () => [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i1$3.Shops, decorators: [{
|
|
2288
2289
|
type: Inject,
|
|
2289
2290
|
args: [DEFAULT_SHOP]
|
|
2290
2291
|
}] }] });
|
|
@@ -2308,9 +2309,10 @@ __decorate([
|
|
|
2308
2309
|
], CategoryWithTree.prototype, "children", void 0);
|
|
2309
2310
|
|
|
2310
2311
|
class WishlistService {
|
|
2311
|
-
constructor(wishlistRepository, productRepository, logRepository, shop) {
|
|
2312
|
+
constructor(wishlistRepository, productRepository, productCatalogRepository, logRepository, shop) {
|
|
2312
2313
|
this.wishlistRepository = wishlistRepository;
|
|
2313
2314
|
this.productRepository = productRepository;
|
|
2315
|
+
this.productCatalogRepository = productCatalogRepository;
|
|
2314
2316
|
this.logRepository = logRepository;
|
|
2315
2317
|
this.shop = shop;
|
|
2316
2318
|
}
|
|
@@ -2461,7 +2463,7 @@ class WishlistService {
|
|
|
2461
2463
|
.then((res) => res.data.at(0));
|
|
2462
2464
|
}
|
|
2463
2465
|
async findProductById(id) {
|
|
2464
|
-
return this.
|
|
2466
|
+
return this.productCatalogRepository
|
|
2465
2467
|
.find({
|
|
2466
2468
|
fields: ['id', 'sku', 'EAN', 'name', 'brand'],
|
|
2467
2469
|
filters: {
|
|
@@ -2537,7 +2539,7 @@ class WishlistService {
|
|
|
2537
2539
|
productBrand: product.brand,
|
|
2538
2540
|
};
|
|
2539
2541
|
}
|
|
2540
|
-
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 }); }
|
|
2541
2543
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService }); }
|
|
2542
2544
|
}
|
|
2543
2545
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService, decorators: [{
|
|
@@ -2548,10 +2550,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
2548
2550
|
}] }, { type: undefined, decorators: [{
|
|
2549
2551
|
type: Inject,
|
|
2550
2552
|
args: ['ProductRepository']
|
|
2553
|
+
}] }, { type: undefined, decorators: [{
|
|
2554
|
+
type: Inject,
|
|
2555
|
+
args: ['ProductCatalogRepository']
|
|
2551
2556
|
}] }, { type: undefined, decorators: [{
|
|
2552
2557
|
type: Inject,
|
|
2553
2558
|
args: ['LogRepository']
|
|
2554
|
-
}] }, { type:
|
|
2559
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
2555
2560
|
type: Inject,
|
|
2556
2561
|
args: [DEFAULT_SHOP]
|
|
2557
2562
|
}] }] });
|
|
@@ -3016,10 +3021,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
3016
3021
|
}], ctorParameters: () => [{ type: HomeShopRepositoriesFacade }, { type: ConfigurationFacade }] });
|
|
3017
3022
|
|
|
3018
3023
|
class OrderProductReviewService {
|
|
3019
|
-
constructor(orderRepository, productReviewRepository, variantRepository) {
|
|
3024
|
+
constructor(orderRepository, productReviewRepository, variantRepository, defaultShop) {
|
|
3020
3025
|
this.orderRepository = orderRepository;
|
|
3021
3026
|
this.productReviewRepository = productReviewRepository;
|
|
3022
3027
|
this.variantRepository = variantRepository;
|
|
3028
|
+
this.defaultShop = defaultShop;
|
|
3023
3029
|
}
|
|
3024
3030
|
async getPendingReviewsByEmail(email) {
|
|
3025
3031
|
const products = [];
|
|
@@ -3043,6 +3049,7 @@ class OrderProductReviewService {
|
|
|
3043
3049
|
user: {
|
|
3044
3050
|
email: email,
|
|
3045
3051
|
},
|
|
3052
|
+
shop: this.defaultShop,
|
|
3046
3053
|
status: OrderStatus.ENTREGUE,
|
|
3047
3054
|
createdAt: {
|
|
3048
3055
|
operator: Where.GTE,
|
|
@@ -3105,12 +3112,22 @@ class OrderProductReviewService {
|
|
|
3105
3112
|
orderId: review.orderId,
|
|
3106
3113
|
}));
|
|
3107
3114
|
}
|
|
3108
|
-
|
|
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 }); }
|
|
3109
3126
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderProductReviewService }); }
|
|
3110
3127
|
}
|
|
3111
3128
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderProductReviewService, decorators: [{
|
|
3112
3129
|
type: Injectable
|
|
3113
|
-
}], ctorParameters: () => [{ type:
|
|
3130
|
+
}], ctorParameters: () => [{ type: i1$3.OrderFirestoreRepository, decorators: [{
|
|
3114
3131
|
type: Inject,
|
|
3115
3132
|
args: ['OrderRepository']
|
|
3116
3133
|
}] }, { type: undefined, decorators: [{
|
|
@@ -3119,6 +3136,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
3119
3136
|
}] }, { type: undefined, decorators: [{
|
|
3120
3137
|
type: Inject,
|
|
3121
3138
|
args: ['VariantRepository']
|
|
3139
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
3140
|
+
type: Inject,
|
|
3141
|
+
args: [DEFAULT_SHOP]
|
|
3122
3142
|
}] }] });
|
|
3123
3143
|
|
|
3124
3144
|
class OrderService {
|
|
@@ -3138,7 +3158,7 @@ class OrderService {
|
|
|
3138
3158
|
}
|
|
3139
3159
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderService, decorators: [{
|
|
3140
3160
|
type: Injectable
|
|
3141
|
-
}], ctorParameters: () => [{ type: i1$1.Firestore }, { type:
|
|
3161
|
+
}], ctorParameters: () => [{ type: i1$1.Firestore }, { type: i1$3.OrderFirestoreRepository, decorators: [{
|
|
3142
3162
|
type: Inject,
|
|
3143
3163
|
args: ['OrderRepository']
|
|
3144
3164
|
}] }] });
|
|
@@ -3184,7 +3204,7 @@ class AngularConnectModule {
|
|
|
3184
3204
|
return isNil(value) ? [] : [{ provide: token, useValue: value }];
|
|
3185
3205
|
}
|
|
3186
3206
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3187
|
-
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,
|
|
3188
3208
|
AngularVertexSeachModule,
|
|
3189
3209
|
AngularFirebaseAuthModule,
|
|
3190
3210
|
AngularFirestoreModule,
|