@infrab4a/connect-angular 4.17.3-beta.19 → 4.17.3-beta.20
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/angular-connect.module.d.ts +29 -32
- package/angular-elastic-search.module.d.ts +9 -9
- package/angular-firebase-auth.module.d.ts +11 -11
- package/angular-firestore.module.d.ts +17 -17
- package/angular-hasura-graphql.module.d.ts +16 -16
- package/angular-vertex-search.module.d.ts +9 -9
- package/consts/backend-url.const.d.ts +1 -1
- package/consts/category-structure.d.ts +1 -1
- package/consts/default-shop.const.d.ts +1 -1
- package/consts/es-config.const.d.ts +1 -1
- package/consts/firebase-const.d.ts +3 -4
- package/consts/hasura-options.const.d.ts +1 -1
- package/consts/index.d.ts +8 -8
- package/consts/persistence.const.d.ts +1 -1
- package/consts/storage-base-url.const.d.ts +1 -1
- package/consts/vertex-config.const.d.ts +1 -1
- package/esm2020/angular-connect.module.mjs +144 -189
- package/esm2020/angular-elastic-search.module.mjs +34 -34
- package/esm2020/angular-firebase-auth.module.mjs +115 -141
- package/esm2020/angular-firestore.module.mjs +527 -527
- package/esm2020/angular-hasura-graphql.module.mjs +309 -331
- package/esm2020/angular-vertex-search.module.mjs +34 -34
- package/esm2020/consts/backend-url.const.mjs +1 -1
- package/esm2020/consts/category-structure.mjs +2 -2
- package/esm2020/consts/default-shop.const.mjs +2 -2
- package/esm2020/consts/es-config.const.mjs +2 -2
- package/esm2020/consts/firebase-const.mjs +4 -5
- package/esm2020/consts/hasura-options.const.mjs +2 -2
- package/esm2020/consts/index.mjs +9 -9
- package/esm2020/consts/persistence.const.mjs +2 -2
- package/esm2020/consts/storage-base-url.const.mjs +2 -2
- package/esm2020/consts/vertex-config.const.mjs +2 -2
- package/esm2020/helpers/index.mjs +2 -2
- package/esm2020/helpers/mobile-operation-system-checker.helper.mjs +7 -7
- package/esm2020/index.mjs +7 -7
- package/esm2020/infrab4a-connect-angular.mjs +4 -4
- package/esm2020/persistence/cookie-data-persistence.mjs +22 -22
- package/esm2020/persistence/data-persistence.mjs +2 -2
- package/esm2020/persistence/index.mjs +3 -3
- package/esm2020/services/auth.service.mjs +37 -37
- package/esm2020/services/cart.service.mjs +191 -293
- package/esm2020/services/catalog/adapters/category-structure.adapter.mjs +2 -2
- package/esm2020/services/catalog/adapters/index.mjs +4 -4
- package/esm2020/services/catalog/adapters/new-category-structure.adapter.mjs +43 -43
- package/esm2020/services/catalog/adapters/old-category-structure.adapter.mjs +23 -23
- package/esm2020/services/catalog/catalog.service.mjs +295 -295
- package/esm2020/services/catalog/category.service.mjs +51 -51
- package/esm2020/services/catalog/enums/index.mjs +2 -2
- package/esm2020/services/catalog/enums/product-sorts.enum.mjs +11 -11
- package/esm2020/services/catalog/index.mjs +8 -8
- package/esm2020/services/catalog/models/category-with-tree.model.mjs +10 -10
- package/esm2020/services/catalog/models/index.mjs +2 -2
- package/esm2020/services/catalog/types/index.mjs +2 -2
- package/esm2020/services/catalog/types/product-sort.type.mjs +2 -2
- package/esm2020/services/catalog/wishlist.service.mjs +235 -235
- package/esm2020/services/checkout-subscription.service.mjs +50 -50
- package/esm2020/services/checkout.service.mjs +123 -68
- package/esm2020/services/coupon.service.mjs +272 -284
- package/esm2020/services/helpers/index.mjs +2 -2
- package/esm2020/services/helpers/util.helper.mjs +18 -18
- package/esm2020/services/home-shop.service.mjs +125 -125
- package/esm2020/services/index.mjs +10 -11
- package/esm2020/services/order.service.mjs +30 -30
- package/esm2020/services/types/index.mjs +3 -3
- package/esm2020/services/types/required-checkout-data.type.mjs +2 -2
- package/esm2020/services/types/required-checkout-subscription-data.type.mjs +2 -2
- package/esm2020/types/firebase-app-config.type.mjs +2 -2
- package/esm2020/types/index.mjs +2 -2
- package/fesm2015/infrab4a-connect-angular.mjs +2584 -2827
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +2538 -2779
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/helpers/index.d.ts +1 -1
- package/helpers/mobile-operation-system-checker.helper.d.ts +3 -3
- package/index.d.ts +6 -6
- package/package.json +2 -2
- package/persistence/cookie-data-persistence.d.ts +10 -10
- package/persistence/data-persistence.d.ts +6 -6
- package/persistence/index.d.ts +2 -2
- package/services/auth.service.d.ts +18 -18
- package/services/cart.service.d.ts +31 -43
- package/services/catalog/adapters/category-structure.adapter.d.ts +4 -4
- package/services/catalog/adapters/index.d.ts +3 -3
- package/services/catalog/adapters/new-category-structure.adapter.d.ts +12 -12
- package/services/catalog/adapters/old-category-structure.adapter.d.ts +10 -10
- package/services/catalog/catalog.service.d.ts +93 -93
- package/services/catalog/category.service.d.ts +20 -20
- package/services/catalog/enums/index.d.ts +1 -1
- package/services/catalog/enums/product-sorts.enum.d.ts +9 -9
- package/services/catalog/index.d.ts +7 -7
- package/services/catalog/models/category-with-tree.model.d.ts +4 -4
- package/services/catalog/models/index.d.ts +1 -1
- package/services/catalog/types/index.d.ts +1 -1
- package/services/catalog/types/product-sort.type.d.ts +2 -2
- package/services/catalog/wishlist.service.d.ts +50 -50
- package/services/checkout-subscription.service.d.ts +19 -19
- package/services/checkout.service.d.ts +34 -27
- package/services/coupon.service.d.ts +27 -33
- package/services/helpers/index.d.ts +1 -1
- package/services/helpers/util.helper.d.ts +3 -3
- package/services/home-shop.service.d.ts +26 -26
- package/services/index.d.ts +9 -10
- package/services/order.service.d.ts +13 -13
- package/services/types/index.d.ts +2 -2
- package/services/types/required-checkout-data.type.d.ts +2 -2
- package/services/types/required-checkout-subscription-data.type.d.ts +2 -2
- package/types/firebase-app-config.type.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/esm2020/services/shipping.service.mjs +0 -96
- package/esm2020/services/types/shipping-methods.type.mjs +0 -2
- package/services/shipping.service.d.ts +0 -19
- package/services/types/shipping-methods.type.d.ts +0 -12
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { CategoryFilterRepository, CategoryRepository, LogRepository, PersonType, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops, Wishlist, WishlistRepository } from '@infrab4a/connect';
|
|
2
|
-
import { CatalogService } from './catalog.service';
|
|
3
|
-
import { CategoryService } from './category.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class WishlistService {
|
|
6
|
-
private readonly wishlistRepository;
|
|
7
|
-
private readonly shop;
|
|
8
|
-
productRepository: ProductRepository;
|
|
9
|
-
private readonly productSearch;
|
|
10
|
-
private readonly logRepository;
|
|
11
|
-
private catalogService;
|
|
12
|
-
private categoryService;
|
|
13
|
-
constructor(wishlistRepository: WishlistRepository, shop: Shops, productRepository: ProductRepository, categoryFilterRepository: CategoryFilterRepository, categoryRepository: CategoryRepository, productStockNotificationRepository: ProductStockNotificationRepository, productSearch: ProductSearchIndex, logRepository: LogRepository);
|
|
14
|
-
getCatalogService(): CatalogService<import("@infrab4a/connect").Category>;
|
|
15
|
-
getCategoryService(): CategoryService;
|
|
16
|
-
create({ personId, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
|
|
17
|
-
personId: string;
|
|
18
|
-
title: string;
|
|
19
|
-
description: string;
|
|
20
|
-
published: boolean;
|
|
21
|
-
userFullName: string;
|
|
22
|
-
userPhoto?: string;
|
|
23
|
-
theme?: string;
|
|
24
|
-
bannerUrl?: string;
|
|
25
|
-
personType?: PersonType;
|
|
26
|
-
personIsSubscriber?: boolean;
|
|
27
|
-
}): Promise<Wishlist>;
|
|
28
|
-
update({ id, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
|
|
29
|
-
id: string;
|
|
30
|
-
title: string;
|
|
31
|
-
description: string;
|
|
32
|
-
published: boolean;
|
|
33
|
-
userFullName: string;
|
|
34
|
-
userPhoto?: string;
|
|
35
|
-
theme?: string;
|
|
36
|
-
bannerUrl?: string;
|
|
37
|
-
personType?: PersonType;
|
|
38
|
-
personIsSubscriber?: boolean;
|
|
39
|
-
}): Promise<Wishlist>;
|
|
40
|
-
delete(wishlistId: string): Promise<void>;
|
|
41
|
-
getWishlistBySlug(slug: string): Promise<Wishlist>;
|
|
42
|
-
getWishlistsByPerson(personId: string): Promise<Wishlist[]>;
|
|
43
|
-
addProduct(wishlistId: string, productId: string): Promise<Wishlist>;
|
|
44
|
-
removeProduct(wishlistId: string, productId: string): Promise<Wishlist>;
|
|
45
|
-
private findById;
|
|
46
|
-
private findProductById;
|
|
47
|
-
private createWishlistLog;
|
|
48
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<WishlistService, never>;
|
|
49
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<WishlistService>;
|
|
50
|
-
}
|
|
1
|
+
import { CategoryFilterRepository, CategoryRepository, LogRepository, PersonType, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops, Wishlist, WishlistRepository } from '@infrab4a/connect';
|
|
2
|
+
import { CatalogService } from './catalog.service';
|
|
3
|
+
import { CategoryService } from './category.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class WishlistService {
|
|
6
|
+
private readonly wishlistRepository;
|
|
7
|
+
private readonly shop;
|
|
8
|
+
productRepository: ProductRepository;
|
|
9
|
+
private readonly productSearch;
|
|
10
|
+
private readonly logRepository;
|
|
11
|
+
private catalogService;
|
|
12
|
+
private categoryService;
|
|
13
|
+
constructor(wishlistRepository: WishlistRepository, shop: Shops, productRepository: ProductRepository, categoryFilterRepository: CategoryFilterRepository, categoryRepository: CategoryRepository, productStockNotificationRepository: ProductStockNotificationRepository, productSearch: ProductSearchIndex, logRepository: LogRepository);
|
|
14
|
+
getCatalogService(): CatalogService<import("@infrab4a/connect").Category>;
|
|
15
|
+
getCategoryService(): CategoryService;
|
|
16
|
+
create({ personId, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
|
|
17
|
+
personId: string;
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
published: boolean;
|
|
21
|
+
userFullName: string;
|
|
22
|
+
userPhoto?: string;
|
|
23
|
+
theme?: string;
|
|
24
|
+
bannerUrl?: string;
|
|
25
|
+
personType?: PersonType;
|
|
26
|
+
personIsSubscriber?: boolean;
|
|
27
|
+
}): Promise<Wishlist>;
|
|
28
|
+
update({ id, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
|
|
29
|
+
id: string;
|
|
30
|
+
title: string;
|
|
31
|
+
description: string;
|
|
32
|
+
published: boolean;
|
|
33
|
+
userFullName: string;
|
|
34
|
+
userPhoto?: string;
|
|
35
|
+
theme?: string;
|
|
36
|
+
bannerUrl?: string;
|
|
37
|
+
personType?: PersonType;
|
|
38
|
+
personIsSubscriber?: boolean;
|
|
39
|
+
}): Promise<Wishlist>;
|
|
40
|
+
delete(wishlistId: string): Promise<void>;
|
|
41
|
+
getWishlistBySlug(slug: string): Promise<Wishlist>;
|
|
42
|
+
getWishlistsByPerson(personId: string): Promise<Wishlist[]>;
|
|
43
|
+
addProduct(wishlistId: string, productId: string): Promise<Wishlist>;
|
|
44
|
+
removeProduct(wishlistId: string, productId: string): Promise<Wishlist>;
|
|
45
|
+
private findById;
|
|
46
|
+
private findProductById;
|
|
47
|
+
private createWishlistLog;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WishlistService, never>;
|
|
49
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WishlistService>;
|
|
50
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { CheckoutSubscription, CheckoutSubscriptionRepository, Coupon } from '@infrab4a/connect';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RequiredCheckoutSubscriptionData } from './types';
|
|
4
|
-
import { DataPersistence } from '../persistence';
|
|
5
|
-
import { CouponService } from './coupon.service';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class CheckoutSubscriptionService {
|
|
8
|
-
private readonly checkoutSubscriptionRepository;
|
|
9
|
-
private readonly dataPersistence;
|
|
10
|
-
private readonly couponService;
|
|
11
|
-
constructor(checkoutSubscriptionRepository: CheckoutSubscriptionRepository, dataPersistence: DataPersistence, couponService: CouponService);
|
|
12
|
-
getCheckoutSubscription(checkoutData?: RequiredCheckoutSubscriptionData): Observable<CheckoutSubscription>;
|
|
13
|
-
clearCheckoutSubscriptionFromSession(): Observable<void>;
|
|
14
|
-
checkCoupon(nickname: string, userEmail: string): Observable<Coupon>;
|
|
15
|
-
calcDiscountSubscription(coupon: Coupon): Observable<number>;
|
|
16
|
-
private createCheckoutSubscription;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutSubscriptionService, never>;
|
|
18
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutSubscriptionService>;
|
|
19
|
-
}
|
|
1
|
+
import { CheckoutSubscription, CheckoutSubscriptionRepository, Coupon } from '@infrab4a/connect';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RequiredCheckoutSubscriptionData } from './types';
|
|
4
|
+
import { DataPersistence } from '../persistence';
|
|
5
|
+
import { CouponService } from './coupon.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class CheckoutSubscriptionService {
|
|
8
|
+
private readonly checkoutSubscriptionRepository;
|
|
9
|
+
private readonly dataPersistence;
|
|
10
|
+
private readonly couponService;
|
|
11
|
+
constructor(checkoutSubscriptionRepository: CheckoutSubscriptionRepository, dataPersistence: DataPersistence, couponService: CouponService);
|
|
12
|
+
getCheckoutSubscription(checkoutData?: RequiredCheckoutSubscriptionData): Observable<CheckoutSubscription>;
|
|
13
|
+
clearCheckoutSubscriptionFromSession(): Observable<void>;
|
|
14
|
+
checkCoupon(nickname: string, userEmail: string): Observable<Coupon>;
|
|
15
|
+
calcDiscountSubscription(coupon: Coupon): Observable<number>;
|
|
16
|
+
private createCheckoutSubscription;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutSubscriptionService, never>;
|
|
18
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutSubscriptionService>;
|
|
19
|
+
}
|
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
private readonly checkoutRepository;
|
|
10
|
-
private readonly userRepository;
|
|
11
|
-
private readonly defaultShop;
|
|
12
|
-
private readonly dataPersistence;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { FirebaseOptions } from '@angular/fire/app';
|
|
3
|
+
import { Checkout, CheckoutPayloadRequest, CheckoutRepository, CheckoutResponse, CheckoutStockValidation, CheckoutTypes, Coupon, ShippingMethodResponse, ShippingProductRequest, Shops, User, UserAddress, UserRepository } from '@infrab4a/connect';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { DataPersistence } from '../persistence';
|
|
6
|
+
import { RequiredCheckoutData } from './types';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class CheckoutService {
|
|
9
|
+
private readonly checkoutRepository;
|
|
10
|
+
private readonly userRepository;
|
|
11
|
+
private readonly defaultShop;
|
|
12
|
+
private readonly dataPersistence;
|
|
13
|
+
private readonly firebaseOptions;
|
|
14
|
+
private http;
|
|
15
|
+
private checkoutUrl;
|
|
16
|
+
constructor(checkoutRepository: CheckoutRepository, userRepository: UserRepository, defaultShop: Shops, dataPersistence: DataPersistence, firebaseOptions: FirebaseOptions, http: HttpClient);
|
|
17
|
+
getCheckout(checkoutData?: RequiredCheckoutData): Observable<Checkout>;
|
|
18
|
+
getUserByCheckout(checkoutId: string): Observable<User>;
|
|
19
|
+
updateCheckoutLineItems(checkout: Partial<Checkout>): Observable<Checkout>;
|
|
20
|
+
updateCheckoutUser(checkout: Partial<Checkout>): Observable<Checkout>;
|
|
21
|
+
clearCheckoutFromSession(): Observable<void>;
|
|
22
|
+
resetCheckoutValues(): Observable<Checkout>;
|
|
23
|
+
applyCouponDiscount(nickname: string, checkoutType: CheckoutTypes): Observable<Coupon>;
|
|
24
|
+
removeCouponDiscount(): Observable<Checkout>;
|
|
25
|
+
validateStockProducts(): Observable<CheckoutStockValidation>;
|
|
26
|
+
selectShippingAddress(address: UserAddress): Observable<Checkout>;
|
|
27
|
+
getAvailableShippingForProduct(productShipping: ShippingProductRequest): Observable<ShippingMethodResponse[]>;
|
|
28
|
+
getAvailableShippingForCheckout(): Observable<ShippingMethodResponse[]>;
|
|
29
|
+
selectShipping(option: string): Observable<Checkout>;
|
|
30
|
+
createOrder(checkoutPayload: CheckoutPayloadRequest, paymentProvider: string, applicationVersion: string): Observable<CheckoutResponse>;
|
|
31
|
+
private createCheckout;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutService, never>;
|
|
33
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutService>;
|
|
34
|
+
}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
import { CategoryRepository, Checkout, CheckoutSubscription, CheckoutTypes, Coupon, CouponRepository,
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CouponService {
|
|
5
|
-
private readonly couponRepository;
|
|
6
|
-
private readonly defaultShop;
|
|
7
|
-
private readonly orderRepository;
|
|
8
|
-
private readonly categoryRepository;
|
|
9
|
-
constructor(couponRepository: CouponRepository, defaultShop: Shops, orderRepository: OrderRepository, categoryRepository: CategoryRepository);
|
|
10
|
-
checkCoupon(nickname: string, checkoutType: CheckoutTypes, checkout: Partial<Checkout>, plan: string): Observable<Coupon>;
|
|
11
|
-
private couponValidation;
|
|
12
|
-
private couponRulesValidation;
|
|
13
|
-
calcDiscountSubscription(coupon: Coupon, checkout: Partial<CheckoutSubscription>): Observable<number>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
private countOrdersWithUser;
|
|
29
|
-
private getCouponUseLimits;
|
|
30
|
-
private calcLineItenDiscount;
|
|
31
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CouponService, never>;
|
|
32
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CouponService>;
|
|
33
|
-
}
|
|
1
|
+
import { CategoryRepository, Checkout, CheckoutSubscription, CheckoutTypes, Coupon, CouponRepository, OrderRepository, Shops } from '@infrab4a/connect';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CouponService {
|
|
5
|
+
private readonly couponRepository;
|
|
6
|
+
private readonly defaultShop;
|
|
7
|
+
private readonly orderRepository;
|
|
8
|
+
private readonly categoryRepository;
|
|
9
|
+
constructor(couponRepository: CouponRepository, defaultShop: Shops, orderRepository: OrderRepository, categoryRepository: CategoryRepository);
|
|
10
|
+
checkCoupon(nickname: string, checkoutType: CheckoutTypes, checkout: Partial<Checkout>, plan: string): Observable<Coupon>;
|
|
11
|
+
private couponValidation;
|
|
12
|
+
private couponRulesValidation;
|
|
13
|
+
calcDiscountSubscription(coupon: Coupon, checkout: Partial<CheckoutSubscription>): Observable<number>;
|
|
14
|
+
private hasMinSubTotal;
|
|
15
|
+
private hasProductCategories;
|
|
16
|
+
private coupomUserValidation;
|
|
17
|
+
private getCouponCategoriesId;
|
|
18
|
+
private emailIsFromCollaborator;
|
|
19
|
+
private getLineItensEligebleForDiscount;
|
|
20
|
+
private calcCheckoutSubtotal;
|
|
21
|
+
private getOrdersWithCoupon;
|
|
22
|
+
private getOrdersFromUser;
|
|
23
|
+
private countOrdersWithUser;
|
|
24
|
+
private getCouponUseLimits;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CouponService, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CouponService>;
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './util.helper';
|
|
1
|
+
export * from './util.helper';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class UtilHelper {
|
|
2
|
-
static createSlug(name: string): string;
|
|
3
|
-
}
|
|
1
|
+
export declare class UtilHelper {
|
|
2
|
+
static createSlug(name: string): string;
|
|
3
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Banner, CategoryRepository, Home, HomeRepository, ProductRepository, Shops } from '@infrab4a/connect';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
type BannerType = 'brand' | 'buyToWin' | 'block' | 'blog';
|
|
5
|
-
export declare class HomeShopService {
|
|
6
|
-
private readonly categoryRepository;
|
|
7
|
-
private readonly homeRepository;
|
|
8
|
-
private readonly productRepository;
|
|
9
|
-
private readonly defaultShop;
|
|
10
|
-
private homeConfiguration;
|
|
11
|
-
private get homeId();
|
|
12
|
-
constructor(categoryRepository: CategoryRepository, homeRepository: HomeRepository, productRepository: ProductRepository, defaultShop: Shops);
|
|
13
|
-
getHomeData(): Observable<Home>;
|
|
14
|
-
getBanners(type: BannerType): Observable<Banner[]>;
|
|
15
|
-
getMinValueForFreeShipping(): Observable<number>;
|
|
16
|
-
private getDiscoverProducts;
|
|
17
|
-
private getFeaturedProducts;
|
|
18
|
-
private getVerticalProducts;
|
|
19
|
-
private getHomeConfiguration;
|
|
20
|
-
private saveHomeData;
|
|
21
|
-
private buildCategoryGroupWithRequiredData;
|
|
22
|
-
private get gender();
|
|
23
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HomeShopService, never>;
|
|
24
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<HomeShopService>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
1
|
+
import { Banner, CategoryRepository, Home, HomeRepository, ProductRepository, Shops } from '@infrab4a/connect';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
type BannerType = 'brand' | 'buyToWin' | 'block' | 'blog';
|
|
5
|
+
export declare class HomeShopService {
|
|
6
|
+
private readonly categoryRepository;
|
|
7
|
+
private readonly homeRepository;
|
|
8
|
+
private readonly productRepository;
|
|
9
|
+
private readonly defaultShop;
|
|
10
|
+
private homeConfiguration;
|
|
11
|
+
private get homeId();
|
|
12
|
+
constructor(categoryRepository: CategoryRepository, homeRepository: HomeRepository, productRepository: ProductRepository, defaultShop: Shops);
|
|
13
|
+
getHomeData(): Observable<Home>;
|
|
14
|
+
getBanners(type: BannerType): Observable<Banner[]>;
|
|
15
|
+
getMinValueForFreeShipping(): Observable<number>;
|
|
16
|
+
private getDiscoverProducts;
|
|
17
|
+
private getFeaturedProducts;
|
|
18
|
+
private getVerticalProducts;
|
|
19
|
+
private getHomeConfiguration;
|
|
20
|
+
private saveHomeData;
|
|
21
|
+
private buildCategoryGroupWithRequiredData;
|
|
22
|
+
private get gender();
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HomeShopService, never>;
|
|
24
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<HomeShopService>;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
package/services/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export * from './auth.service';
|
|
2
|
-
export * from './cart.service';
|
|
3
|
-
export * from './catalog';
|
|
4
|
-
export * from './checkout-subscription.service';
|
|
5
|
-
export * from './checkout.service';
|
|
6
|
-
export * from './coupon.service';
|
|
7
|
-
export * from './helpers';
|
|
8
|
-
export * from './home-shop.service';
|
|
9
|
-
export * from './order.service';
|
|
10
|
-
export * from './shipping.service';
|
|
1
|
+
export * from './auth.service';
|
|
2
|
+
export * from './cart.service';
|
|
3
|
+
export * from './catalog';
|
|
4
|
+
export * from './checkout-subscription.service';
|
|
5
|
+
export * from './checkout.service';
|
|
6
|
+
export * from './coupon.service';
|
|
7
|
+
export * from './helpers';
|
|
8
|
+
export * from './home-shop.service';
|
|
9
|
+
export * from './order.service';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Firestore } from '@angular/fire/firestore';
|
|
2
|
-
import { Order, OrderFirestoreRepository } from '@infrab4a/connect';
|
|
3
|
-
import { Subject } from 'rxjs';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class OrderService {
|
|
6
|
-
private readonly angularFirestore;
|
|
7
|
-
private readonly orderRepository;
|
|
8
|
-
orderSubject: Subject<Order>;
|
|
9
|
-
constructor(angularFirestore: Firestore, orderRepository: OrderFirestoreRepository);
|
|
10
|
-
getOrder(id: string): Subject<Order>;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<OrderService, never>;
|
|
12
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<OrderService>;
|
|
13
|
-
}
|
|
1
|
+
import { Firestore } from '@angular/fire/firestore';
|
|
2
|
+
import { Order, OrderFirestoreRepository } from '@infrab4a/connect';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class OrderService {
|
|
6
|
+
private readonly angularFirestore;
|
|
7
|
+
private readonly orderRepository;
|
|
8
|
+
orderSubject: Subject<Order>;
|
|
9
|
+
constructor(angularFirestore: Firestore, orderRepository: OrderFirestoreRepository);
|
|
10
|
+
getOrder(id: string): Subject<Order>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OrderService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<OrderService>;
|
|
13
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './required-checkout-data.type';
|
|
2
|
-
export * from './required-checkout-subscription-data.type';
|
|
1
|
+
export * from './required-checkout-data.type';
|
|
2
|
+
export * from './required-checkout-subscription-data.type';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Checkout } from '@infrab4a/connect';
|
|
2
|
-
export type RequiredCheckoutData = Partial<Pick<Checkout, 'id' | 'user' | 'shop' | 'lineItems'>>;
|
|
1
|
+
import { Checkout } from '@infrab4a/connect';
|
|
2
|
+
export type RequiredCheckoutData = Partial<Pick<Checkout, 'id' | 'user' | 'shop' | 'lineItems'>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CheckoutSubscription } from '@infrab4a/connect';
|
|
2
|
-
export type RequiredCheckoutSubscriptionData = Partial<Pick<CheckoutSubscription, 'id'>>;
|
|
1
|
+
import { CheckoutSubscription } from '@infrab4a/connect';
|
|
2
|
+
export type RequiredCheckoutSubscriptionData = Partial<Pick<CheckoutSubscription, 'id'>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type FirebaseAppConfig = Record<string, any>;
|
|
1
|
+
export type FirebaseAppConfig = Record<string, any>;
|
package/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './firebase-app-config.type';
|
|
1
|
+
export * from './firebase-app-config.type';
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { Inject, Injectable } from '@angular/core';
|
|
3
|
-
import { Shops } from '@infrab4a/connect';
|
|
4
|
-
import { combineLatest } from 'rxjs';
|
|
5
|
-
import { map } from 'rxjs/operators';
|
|
6
|
-
import { BACKEND_URL } from '../consts';
|
|
7
|
-
import { HomeShopService } from './home-shop.service';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "@angular/common/http";
|
|
10
|
-
import * as i2 from "./home-shop.service";
|
|
11
|
-
export class ShippingService {
|
|
12
|
-
constructor(http, apiUrl, homeService) {
|
|
13
|
-
this.http = http;
|
|
14
|
-
this.apiUrl = apiUrl;
|
|
15
|
-
this.homeService = homeService;
|
|
16
|
-
}
|
|
17
|
-
getShippingMethods(shop, zip, weightGrams, totalPrice, personId, subscriptionPlan) {
|
|
18
|
-
return combineLatest([
|
|
19
|
-
this.homeService.getHomeData(),
|
|
20
|
-
this.http.get(`${this.apiUrl}open/checkshippingcompany?personId=${personId}&postalCode=${zip}&weightGrams=${weightGrams}`),
|
|
21
|
-
]).pipe(map(([datas, shippingMethodsResponse]) => {
|
|
22
|
-
let shippingMethods = shippingMethodsResponse.result;
|
|
23
|
-
if (!shippingMethods.length)
|
|
24
|
-
return [];
|
|
25
|
-
shippingMethods = shippingMethods.map((shippingMethod) => {
|
|
26
|
-
if (shippingMethod.ShippingCompanyName == 'Same Day EG')
|
|
27
|
-
shippingMethod.ShippingCompanyName = 'Same Day';
|
|
28
|
-
return shippingMethod;
|
|
29
|
-
});
|
|
30
|
-
const datasSameDayNotAvaliable = datas.sameDayNotAvaliable;
|
|
31
|
-
if (this.isHolidays(datasSameDayNotAvaliable)) {
|
|
32
|
-
shippingMethods = shippingMethods.filter((method) => method.serviceName !== 'Same Day');
|
|
33
|
-
}
|
|
34
|
-
if (totalPrice >= 200) {
|
|
35
|
-
shippingMethods = shippingMethods.map((s) => {
|
|
36
|
-
if (s.serviceName !== 'Same Day')
|
|
37
|
-
return { ...s, totalPrice: 0 };
|
|
38
|
-
else
|
|
39
|
-
return s;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
if (shop == Shops.GLAMSHOP)
|
|
43
|
-
return shippingMethods;
|
|
44
|
-
if (this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
45
|
-
shippingMethods = shippingMethods.map((s) => {
|
|
46
|
-
if (s.serviceName == 'Same Day')
|
|
47
|
-
return { ...s, totalPrice: s.totalPrice / 2 };
|
|
48
|
-
else
|
|
49
|
-
return { ...s, totalPrice: 0 };
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
if (this.isHalfShippingBySubscription(shop, subscriptionPlan)) {
|
|
53
|
-
shippingMethods = shippingMethods.map((s) => {
|
|
54
|
-
return { ...s, totalPrice: s.totalPrice / 2 };
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return shippingMethods;
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
|
-
isFreeShippingBySubscription(shop, subscriptionPlan) {
|
|
61
|
-
if (!subscriptionPlan)
|
|
62
|
-
return false;
|
|
63
|
-
if (shop == Shops.MENSMARKET && subscriptionPlan == 'SELECT')
|
|
64
|
-
return true;
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
isHalfShippingBySubscription(shop, subscriptionPlan) {
|
|
68
|
-
if (!subscriptionPlan)
|
|
69
|
-
return false;
|
|
70
|
-
if (shop == Shops.MENSMARKET && subscriptionPlan == 'PRIME') {
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
isHolidays(datas) {
|
|
76
|
-
const today = new Date();
|
|
77
|
-
for (const key in datas) {
|
|
78
|
-
let start = new Date(`${today.getFullYear()}-${datas[key].beginDate}`);
|
|
79
|
-
let end = new Date(`${today.getFullYear()}-${datas[key].endDate}`);
|
|
80
|
-
if (start > end)
|
|
81
|
-
end = new Date(`${today.getFullYear() + 1}-${datas[key].endDate}`);
|
|
82
|
-
if (today >= start && today <= end)
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
ShippingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService, deps: [{ token: i1.HttpClient }, { token: BACKEND_URL }, { token: i2.HomeShopService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
89
|
-
ShippingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService });
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService, decorators: [{
|
|
91
|
-
type: Injectable
|
|
92
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
93
|
-
type: Inject,
|
|
94
|
-
args: [BACKEND_URL]
|
|
95
|
-
}] }, { type: i2.HomeShopService }]; } });
|
|
96
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hpcHBpbmcuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2Nvbm5lY3QtYW5ndWxhci9zcmMvc2VydmljZXMvc2hpcHBpbmcuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sc0JBQXNCLENBQUE7QUFDakQsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFDbEQsT0FBTyxFQUFRLEtBQUssRUFBRSxNQUFNLG1CQUFtQixDQUFBO0FBQy9DLE9BQU8sRUFBYyxhQUFhLEVBQUUsTUFBTSxNQUFNLENBQUE7QUFDaEQsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFBO0FBRXBDLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxXQUFXLENBQUE7QUFDdkMsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHFCQUFxQixDQUFBOzs7O0FBSXJELE1BQU0sT0FBTyxlQUFlO0lBQzFCLFlBQ1UsSUFBZ0IsRUFDSyxNQUFjLEVBQ25DLFdBQTRCO1FBRjVCLFNBQUksR0FBSixJQUFJLENBQVk7UUFDSyxXQUFNLEdBQU4sTUFBTSxDQUFRO1FBQ25DLGdCQUFXLE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|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hpcHBpbmctbWV0aG9kcy50eXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29ubmVjdC1hbmd1bGFyL3NyYy9zZXJ2aWNlcy90eXBlcy9zaGlwcGluZy1tZXRob2RzLnR5cGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgU2hpcHBpbmdNZXRob2RSZXNwb25zZSB7XG4gIGRheXNUb0RlbGl2ZXJ5OiBudW1iZXI7XG4gIGN1cnJlbmN5OiBzdHJpbmc7XG4gIGRlc2NyaXB0aW9uOiBzdHJpbmc7XG4gIG1heERlbGl2ZXJ5RGF0ZTogc3RyaW5nO1xuICBtaW5EZWxpdmVyeURhdGU6IHN0cmluZztcbiAgc2VydmljZUNvZGU6IHN0cmluZztcbiAgc2VydmljZU5hbWU6IHN0cmluZztcbiAgdG90YWxQcmljZTogbnVtYmVyO1xuICBhZGRpdGlvbmFsRGVzY3JpcHRpb246IHN0cmluZztcbiAgY25wajogc3RyaW5nO1xufSJdfQ==
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { HomeShopService } from './home-shop.service';
|
|
4
|
-
import { ShippingMethodResponse } from './types/shipping-methods.type';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class ShippingService {
|
|
7
|
-
private http;
|
|
8
|
-
private apiUrl;
|
|
9
|
-
private homeService;
|
|
10
|
-
constructor(http: HttpClient, apiUrl: string, homeService: HomeShopService);
|
|
11
|
-
getShippingMethods(shop: string, zip: string, weightGrams: number, totalPrice: number, personId: string, subscriptionPlan?: string): Observable<Array<ShippingMethodResponse & {
|
|
12
|
-
ShippingCompanyName?: string;
|
|
13
|
-
}>>;
|
|
14
|
-
private isFreeShippingBySubscription;
|
|
15
|
-
private isHalfShippingBySubscription;
|
|
16
|
-
private isHolidays;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ShippingService, never>;
|
|
18
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ShippingService>;
|
|
19
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface ShippingMethodResponse {
|
|
2
|
-
daysToDelivery: number;
|
|
3
|
-
currency: string;
|
|
4
|
-
description: string;
|
|
5
|
-
maxDeliveryDate: string;
|
|
6
|
-
minDeliveryDate: string;
|
|
7
|
-
serviceCode: string;
|
|
8
|
-
serviceName: string;
|
|
9
|
-
totalPrice: number;
|
|
10
|
-
additionalDescription: string;
|
|
11
|
-
cnpj: string;
|
|
12
|
-
}
|