@infrab4a/connect-angular 0.5.0-beta.9 → 0.5.0
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/bundles/infrab4a-connect-angular.umd.js +131 -90
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/lib/angular-connect.module.js +4 -4
- package/esm2015/lib/services/cart.service.js +47 -46
- package/esm2015/lib/services/checkout.service.js +12 -5
- package/esm2015/lib/services/index.js +2 -1
- package/esm2015/lib/services/order.service.js +32 -0
- package/fesm2015/infrab4a-connect-angular.js +84 -51
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/lib/services/cart.service.d.ts +5 -3
- package/lib/services/checkout.service.d.ts +3 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/order.service.d.ts +13 -0
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('@angular/fire'), require('@angular/fire
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', '@angular/fire', '@angular/fire
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global.ng.fire, global.ng.fire
|
|
5
|
-
})(this, (function (exports, i0, rxjs, operators, i1, i1$1, cookie,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('@angular/fire/firestore'), require('@angular/fire')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', '@angular/fire/firestore', '@angular/fire'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global.ng.fire.firestore, global.ng.fire));
|
|
5
|
+
})(this, (function (exports, i0, rxjs, operators, i1, i1$1, cookie, i1$2, fire) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
29
|
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
30
30
|
var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
|
|
31
|
+
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
31
32
|
|
|
32
33
|
var AuthService = /** @class */ (function () {
|
|
33
34
|
function AuthService(angularFireAuth, userRepository) {
|
|
@@ -388,17 +389,24 @@
|
|
|
388
389
|
};
|
|
389
390
|
CheckoutService.prototype.getUserByCheckout = function (checkoutId) {
|
|
390
391
|
var _this = this;
|
|
391
|
-
return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.
|
|
392
|
+
return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.concatMap(function (checkout) { var _a; return ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.user) === null || _a === void 0 ? void 0 : _a.id) ? rxjs.of(checkout.user) : rxjs.from(_this.userRepository.get({ id: checkout.user.id })); }), operators.concatMap(function (user) { return rxjs.of(user) || rxjs.throwError(function () { return new i1$1.NotFoundError('User is not found'); }); }));
|
|
392
393
|
};
|
|
393
394
|
CheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
|
|
394
395
|
return rxjs.from(this.checkoutRepository.update(i1$1.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
|
|
395
396
|
};
|
|
397
|
+
CheckoutService.prototype.updateCheckoutUser = function (checkout) {
|
|
398
|
+
return rxjs.from(this.checkoutRepository.update(i1$1.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
|
|
399
|
+
};
|
|
400
|
+
CheckoutService.prototype.clearCheckoutFromSession = function () {
|
|
401
|
+
cookie__default["default"].remove('checkoutId');
|
|
402
|
+
return rxjs.of();
|
|
403
|
+
};
|
|
396
404
|
CheckoutService.prototype.createCheckout = function (checkoutData) {
|
|
397
405
|
return __awaiter(this, void 0, void 0, function () {
|
|
398
406
|
var checkout;
|
|
399
407
|
return __generator(this, function (_b) {
|
|
400
408
|
switch (_b.label) {
|
|
401
|
-
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i1$1.Checkout.toInstance(checkoutData).toPlain()), { shop: checkoutData.shop || this.defaultShop }))];
|
|
409
|
+
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i1$1.Checkout.toInstance(i1$1.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
|
|
402
410
|
case 1:
|
|
403
411
|
checkout = _b.sent();
|
|
404
412
|
cookie__default["default"].set('checkoutId', checkout.id);
|
|
@@ -433,18 +441,19 @@
|
|
|
433
441
|
this.checkoutService = checkoutService;
|
|
434
442
|
this.defaultShop = defaultShop;
|
|
435
443
|
this.cartSubject = new rxjs.Subject();
|
|
436
|
-
this.updateLineItemInCart = function (lineItem, quantity) { return _this.checkoutService.getCheckout().pipe(operators.
|
|
444
|
+
this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (i1$1.isNil(checkout) ? _this.checkoutService.getCheckout() : rxjs.of(checkout)).pipe(operators.concatMap(function (checkoutLoaded) {
|
|
437
445
|
var _a;
|
|
438
446
|
var items = [];
|
|
439
447
|
var index = (_a = checkoutLoaded.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (checkoutItem) { return checkoutItem.sku; }).indexOf(lineItem.sku);
|
|
440
448
|
if (index > -1) {
|
|
441
449
|
checkoutLoaded.lineItems[index].quantity += quantity;
|
|
450
|
+
checkoutLoaded.lineItems[index].pricePaid = lineItem.pricePaid;
|
|
442
451
|
}
|
|
443
452
|
else
|
|
444
453
|
checkoutLoaded.lineItems = items.concat(checkoutLoaded.lineItems ? checkoutLoaded.lineItems.concat([lineItem]) : [lineItem]);
|
|
445
454
|
return _this.checkoutService
|
|
446
455
|
.updateCheckoutLineItems(checkoutLoaded)
|
|
447
|
-
.pipe(operators.map(function (
|
|
456
|
+
.pipe(operators.map(function (updatedCheckout) { return _this.generateCartObject(updatedCheckout.lineItems); }));
|
|
448
457
|
})); };
|
|
449
458
|
this.generateCartObject = function (items) {
|
|
450
459
|
var cart = {};
|
|
@@ -454,15 +463,19 @@
|
|
|
454
463
|
});
|
|
455
464
|
return cart;
|
|
456
465
|
};
|
|
457
|
-
this.buildLineItem = function (
|
|
458
|
-
var checkout =
|
|
459
|
-
var _a, _b;
|
|
460
|
-
if (_this.checkMaxStock(item))
|
|
466
|
+
this.buildLineItem = function (_d) {
|
|
467
|
+
var checkout = _d.checkout, item = _d.item, quantity = _d.quantity;
|
|
468
|
+
var _a, _b, _c;
|
|
469
|
+
if (_this.checkMaxStock(item, quantity || 0))
|
|
461
470
|
throw new Error('Desculpe! Temos apenas ' + ((_a = item.stock) === null || _a === void 0 ? void 0 : _a.quantity) + ' em estoque.');
|
|
462
471
|
var image = item.image || ((_b = item.images) === null || _b === void 0 ? void 0 : _b.shift());
|
|
463
|
-
var pricePaid = _this.getProductPrice({ product: item, shop: checkout.shop || _this.defaultShop, isSubscriber: isSubscriber });
|
|
464
472
|
var id = item.id, name = item.name, brand = item.brand, slug = item.slug, stock = item.stock, price = item.price, weight = item.weight, categories = item.categories, sku = item.sku;
|
|
465
473
|
var isGift = item.isGift || null;
|
|
474
|
+
var pricePaid = _this.getProductPrice({
|
|
475
|
+
product: item,
|
|
476
|
+
shop: checkout.shop || _this.defaultShop,
|
|
477
|
+
isSubscriber: (_c = checkout.user) === null || _c === void 0 ? void 0 : _c.isSubscriber,
|
|
478
|
+
});
|
|
466
479
|
return i1$1.LineItem.toInstance({
|
|
467
480
|
id: id,
|
|
468
481
|
name: name,
|
|
@@ -473,57 +486,47 @@
|
|
|
473
486
|
price: price,
|
|
474
487
|
image: image,
|
|
475
488
|
weight: weight,
|
|
476
|
-
quantity: quantity,
|
|
489
|
+
quantity: (item.quantity || 0) + (quantity || 0),
|
|
477
490
|
pricePaid: pricePaid,
|
|
478
491
|
categories: categories,
|
|
479
492
|
isGift: isGift,
|
|
480
493
|
});
|
|
481
494
|
};
|
|
482
|
-
this.getProductPrice = function (
|
|
483
|
-
var product =
|
|
484
|
-
|
|
495
|
+
this.getProductPrice = function (_d) {
|
|
496
|
+
var product = _d.product, shop = _d.shop, isSubscriber = _d.isSubscriber;
|
|
497
|
+
var info = product.getInfoByShop(shop);
|
|
498
|
+
if (product.isGift)
|
|
499
|
+
return 0;
|
|
500
|
+
return isSubscriber && info.subscriberPrice > 0 ? info.subscriberPrice : info.price;
|
|
485
501
|
};
|
|
486
|
-
this.checkMaxStock = function (item) {
|
|
502
|
+
this.checkMaxStock = function (item, quantity) {
|
|
487
503
|
var _a;
|
|
488
504
|
var maxStock = ((_a = item.stock) === null || _a === void 0 ? void 0 : _a.quantity) || 0;
|
|
489
|
-
var
|
|
490
|
-
|
|
491
|
-
return quantity > maxStock || currentItemAmount + quantity > maxStock;
|
|
505
|
+
var currentItemAmount = item.quantity || 0;
|
|
506
|
+
return currentItemAmount + quantity > maxStock;
|
|
492
507
|
};
|
|
493
508
|
}
|
|
494
|
-
CartService.prototype.addItem = function (item, quantity
|
|
509
|
+
CartService.prototype.addItem = function (item, quantity) {
|
|
495
510
|
var _this = this;
|
|
496
511
|
if (quantity === void 0) { quantity = 1; }
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
return rxjs.of((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.isSubscriber).pipe(operators.mergeMap(function (isSubscriber) { return isSubscriber
|
|
502
|
-
? rxjs.of(isSubscriber)
|
|
503
|
-
: _this.checkoutService.getUserByCheckout(checkout.id).pipe(operators.catchError(function () { return rxjs.of({ isSubscriber: false }); }), operators.map(function (user) { return user.isSubscriber; })); }), operators.mergeMap(function (isSubscriber) {
|
|
504
|
-
return _this.buildCartFromCheckout().pipe(operators.map(function () { return _this.buildLineItem({ checkout: checkout, item: item, quantity: quantity, isSubscriber: isSubscriber }); }), operators.mergeMap(function (lineItem) { return _this.updateLineItemInCart(lineItem, quantity); }));
|
|
505
|
-
}));
|
|
506
|
-
}))
|
|
507
|
-
.subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
508
|
-
return this.cartSubject;
|
|
512
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) { return ({ checkout: checkout, lineItem: _this.buildLineItem({ checkout: checkout, item: item, quantity: quantity || 1 }) }); }), operators.concatMap(function (_d) {
|
|
513
|
+
var checkout = _d.checkout, lineItem = _d.lineItem;
|
|
514
|
+
return _this.updateLineItemInCart(lineItem, quantity || 1, checkout);
|
|
515
|
+
}), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
509
516
|
};
|
|
510
517
|
CartService.prototype.decreaseItem = function (item) {
|
|
511
518
|
var _this = this;
|
|
512
|
-
this.checkoutService
|
|
513
|
-
.getCheckout()
|
|
514
|
-
.pipe(operators.map(function (checkout) {
|
|
519
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
515
520
|
var _a;
|
|
516
521
|
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
|
|
517
522
|
if (!i1$1.isNil(checkoutItem))
|
|
518
523
|
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
519
524
|
return checkout;
|
|
520
|
-
}), operators.
|
|
521
|
-
.subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
522
|
-
return this.cartSubject;
|
|
525
|
+
}), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
523
526
|
};
|
|
524
|
-
CartService.prototype.getCart = function () {
|
|
527
|
+
CartService.prototype.getCart = function (checkout) {
|
|
525
528
|
var _this = this;
|
|
526
|
-
this.buildCartFromCheckout().subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
529
|
+
this.buildCartFromCheckout(checkout).subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
527
530
|
return this.cartSubject;
|
|
528
531
|
};
|
|
529
532
|
CartService.prototype.getDiscount = function (coupon) {
|
|
@@ -539,22 +542,31 @@
|
|
|
539
542
|
}
|
|
540
543
|
};
|
|
541
544
|
CartService.prototype.getVariantPriceDiscount = function (item, shop) {
|
|
542
|
-
return this.authService.getUser().pipe(operators.
|
|
545
|
+
return this.authService.getUser().pipe(operators.concatMap(function (user) { return rxjs.iif(function () { return user.isSubscriber && !!item.getInfoByShop(shop).subscriberPrice; }, rxjs.of(item.getInfoByShop(shop).subscriberPrice), rxjs.of(item.getInfoByShop(shop).price)); }), operators.catchError(function () { return rxjs.of(item.getInfoByShop(shop).price); }));
|
|
543
546
|
};
|
|
544
547
|
CartService.prototype.removeItem = function (item) {
|
|
545
548
|
var _this = this;
|
|
546
|
-
this.checkoutService
|
|
547
|
-
.
|
|
548
|
-
|
|
549
|
-
|
|
549
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
550
|
+
var index = checkout.lineItems.findIndex(function (lineItem) { return lineItem.sku === item.sku; });
|
|
551
|
+
if (index >= 0)
|
|
552
|
+
checkout.lineItems.splice(index, 1);
|
|
550
553
|
return checkout;
|
|
551
|
-
}), operators.
|
|
552
|
-
|
|
553
|
-
|
|
554
|
+
}), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
555
|
+
};
|
|
556
|
+
CartService.prototype.updateUserCart = function (user) {
|
|
557
|
+
var _this = this;
|
|
558
|
+
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i1$1.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(i1$1.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { lineItems: checkout.lineItems.map(function (item) { return _this.buildLineItem({ checkout: checkout, item: item }); }) }))); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
559
|
+
};
|
|
560
|
+
CartService.prototype.clearCart = function () {
|
|
561
|
+
var _this = this;
|
|
562
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
563
|
+
_this.checkoutService.clearCheckoutFromSession();
|
|
564
|
+
return checkout;
|
|
565
|
+
}), operators.concatMap(function (oldCheckout) { return _this.buildCartFromCheckout(oldCheckout); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
554
566
|
};
|
|
555
|
-
CartService.prototype.buildCartFromCheckout = function () {
|
|
567
|
+
CartService.prototype.buildCartFromCheckout = function (checkoutData) {
|
|
556
568
|
var _this = this;
|
|
557
|
-
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.
|
|
569
|
+
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
558
570
|
};
|
|
559
571
|
CartService.prototype.getFinancialDiscount = function (coupon) {
|
|
560
572
|
return function (subTotalPrice) {
|
|
@@ -580,6 +592,34 @@
|
|
|
580
592
|
}] }];
|
|
581
593
|
} });
|
|
582
594
|
|
|
595
|
+
var OrderService = /** @class */ (function () {
|
|
596
|
+
function OrderService(angularFirestore, orderRepository) {
|
|
597
|
+
this.angularFirestore = angularFirestore;
|
|
598
|
+
this.orderRepository = orderRepository;
|
|
599
|
+
this.orderSubject = new rxjs.Subject();
|
|
600
|
+
}
|
|
601
|
+
OrderService.prototype.getOrder = function (id) {
|
|
602
|
+
var _this = this;
|
|
603
|
+
this.angularFirestore
|
|
604
|
+
.doc(this.orderRepository.collectionName + "/" + id)
|
|
605
|
+
.valueChanges()
|
|
606
|
+
.pipe(operators.map(function (doc) { return i1$1.Order.toInstance(doc); }))
|
|
607
|
+
.subscribe(function (doc) { return _this.orderSubject.next(doc); });
|
|
608
|
+
return this.orderSubject;
|
|
609
|
+
};
|
|
610
|
+
return OrderService;
|
|
611
|
+
}());
|
|
612
|
+
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$2.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
613
|
+
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: OrderService });
|
|
614
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
615
|
+
type: i0.Injectable
|
|
616
|
+
}], ctorParameters: function () {
|
|
617
|
+
return [{ type: i1__namespace$2.AngularFirestore }, { type: i1__namespace$1.OrderFirestoreRepository, decorators: [{
|
|
618
|
+
type: i0.Inject,
|
|
619
|
+
args: ['OrderRepository']
|
|
620
|
+
}] }];
|
|
621
|
+
} });
|
|
622
|
+
|
|
583
623
|
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
584
624
|
function AngularFirebaseAuthModule() {
|
|
585
625
|
}
|
|
@@ -671,126 +711,126 @@
|
|
|
671
711
|
useFactory: function (firestore, userRepository) {
|
|
672
712
|
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
673
713
|
},
|
|
674
|
-
deps: [
|
|
714
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
675
715
|
},
|
|
676
716
|
{
|
|
677
717
|
provide: 'Buy2WinRepository',
|
|
678
718
|
useFactory: function (firestore) {
|
|
679
719
|
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
680
720
|
},
|
|
681
|
-
deps: [
|
|
721
|
+
deps: [i1$2.AngularFirestore],
|
|
682
722
|
},
|
|
683
723
|
{
|
|
684
724
|
provide: 'CategoryRepository',
|
|
685
725
|
useFactory: function (firestore) {
|
|
686
726
|
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
687
727
|
},
|
|
688
|
-
deps: [
|
|
728
|
+
deps: [i1$2.AngularFirestore],
|
|
689
729
|
},
|
|
690
730
|
{
|
|
691
731
|
provide: 'CheckoutRepository',
|
|
692
732
|
useFactory: function (firestore) {
|
|
693
733
|
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
694
734
|
},
|
|
695
|
-
deps: [
|
|
735
|
+
deps: [i1$2.AngularFirestore],
|
|
696
736
|
},
|
|
697
737
|
{
|
|
698
738
|
provide: 'CheckoutSubscriptionRepository',
|
|
699
739
|
useFactory: function (firestore) {
|
|
700
740
|
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
701
741
|
},
|
|
702
|
-
deps: [
|
|
742
|
+
deps: [i1$2.AngularFirestore],
|
|
703
743
|
},
|
|
704
744
|
{
|
|
705
745
|
provide: 'CouponRepository',
|
|
706
746
|
useFactory: function (firestore) {
|
|
707
747
|
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
708
748
|
},
|
|
709
|
-
deps: [
|
|
749
|
+
deps: [i1$2.AngularFirestore],
|
|
710
750
|
},
|
|
711
751
|
{
|
|
712
752
|
provide: 'EditionRepository',
|
|
713
753
|
useFactory: function (firestore, subscriptionRepository) {
|
|
714
754
|
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
715
755
|
},
|
|
716
|
-
deps: [
|
|
756
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
717
757
|
},
|
|
718
758
|
{
|
|
719
759
|
provide: 'HomeRepository',
|
|
720
760
|
useFactory: function (firestore) {
|
|
721
761
|
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
722
762
|
},
|
|
723
|
-
deps: [
|
|
763
|
+
deps: [i1$2.AngularFirestore],
|
|
724
764
|
},
|
|
725
765
|
{
|
|
726
766
|
provide: 'ShopMenuRepository',
|
|
727
767
|
useFactory: function (firestore) {
|
|
728
768
|
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
729
769
|
},
|
|
730
|
-
deps: [
|
|
770
|
+
deps: [i1$2.AngularFirestore],
|
|
731
771
|
},
|
|
732
772
|
{
|
|
733
773
|
provide: 'OrderRepository',
|
|
734
774
|
useFactory: function (firestore) {
|
|
735
775
|
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
736
776
|
},
|
|
737
|
-
deps: [
|
|
777
|
+
deps: [i1$2.AngularFirestore],
|
|
738
778
|
},
|
|
739
779
|
{
|
|
740
780
|
provide: 'PaymentRepository',
|
|
741
781
|
useFactory: function (firestore) {
|
|
742
782
|
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
743
783
|
},
|
|
744
|
-
deps: [
|
|
784
|
+
deps: [i1$2.AngularFirestore],
|
|
745
785
|
},
|
|
746
786
|
{
|
|
747
787
|
provide: 'ProductRepository',
|
|
748
788
|
useFactory: function (firestore) {
|
|
749
789
|
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
750
790
|
},
|
|
751
|
-
deps: [
|
|
791
|
+
deps: [i1$2.AngularFirestore],
|
|
752
792
|
},
|
|
753
793
|
{
|
|
754
794
|
provide: 'SubscriptionPaymentRepository',
|
|
755
795
|
useFactory: function (firestore, subscriptionRepository) {
|
|
756
796
|
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
757
797
|
},
|
|
758
|
-
deps: [
|
|
798
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
759
799
|
},
|
|
760
800
|
{
|
|
761
801
|
provide: 'SubscriptionPlanRepository',
|
|
762
802
|
useFactory: function (firestore) {
|
|
763
803
|
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
764
804
|
},
|
|
765
|
-
deps: [
|
|
805
|
+
deps: [i1$2.AngularFirestore],
|
|
766
806
|
},
|
|
767
807
|
{
|
|
768
808
|
provide: 'SubscriptionRepository',
|
|
769
809
|
useFactory: function (firestore) {
|
|
770
810
|
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
771
811
|
},
|
|
772
|
-
deps: [
|
|
812
|
+
deps: [i1$2.AngularFirestore],
|
|
773
813
|
},
|
|
774
814
|
{
|
|
775
815
|
provide: 'UserRepository',
|
|
776
816
|
useFactory: function (firestore) {
|
|
777
817
|
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
778
818
|
},
|
|
779
|
-
deps: [
|
|
819
|
+
deps: [i1$2.AngularFirestore],
|
|
780
820
|
},
|
|
781
821
|
{
|
|
782
822
|
provide: 'UserAddressRepository',
|
|
783
823
|
useFactory: function (firestore, userRepository) {
|
|
784
824
|
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
785
825
|
},
|
|
786
|
-
deps: [
|
|
826
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
787
827
|
},
|
|
788
828
|
{
|
|
789
829
|
provide: 'VariantRepository',
|
|
790
830
|
useFactory: function (firestore, productRepository) {
|
|
791
831
|
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
792
832
|
},
|
|
793
|
-
deps: [
|
|
833
|
+
deps: [i1$2.AngularFirestore, 'ProductRepository'],
|
|
794
834
|
},
|
|
795
835
|
], imports: [[fire.AngularFireModule]] });
|
|
796
836
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
|
|
@@ -803,126 +843,126 @@
|
|
|
803
843
|
useFactory: function (firestore, userRepository) {
|
|
804
844
|
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
805
845
|
},
|
|
806
|
-
deps: [
|
|
846
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
807
847
|
},
|
|
808
848
|
{
|
|
809
849
|
provide: 'Buy2WinRepository',
|
|
810
850
|
useFactory: function (firestore) {
|
|
811
851
|
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
812
852
|
},
|
|
813
|
-
deps: [
|
|
853
|
+
deps: [i1$2.AngularFirestore],
|
|
814
854
|
},
|
|
815
855
|
{
|
|
816
856
|
provide: 'CategoryRepository',
|
|
817
857
|
useFactory: function (firestore) {
|
|
818
858
|
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
819
859
|
},
|
|
820
|
-
deps: [
|
|
860
|
+
deps: [i1$2.AngularFirestore],
|
|
821
861
|
},
|
|
822
862
|
{
|
|
823
863
|
provide: 'CheckoutRepository',
|
|
824
864
|
useFactory: function (firestore) {
|
|
825
865
|
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
826
866
|
},
|
|
827
|
-
deps: [
|
|
867
|
+
deps: [i1$2.AngularFirestore],
|
|
828
868
|
},
|
|
829
869
|
{
|
|
830
870
|
provide: 'CheckoutSubscriptionRepository',
|
|
831
871
|
useFactory: function (firestore) {
|
|
832
872
|
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
833
873
|
},
|
|
834
|
-
deps: [
|
|
874
|
+
deps: [i1$2.AngularFirestore],
|
|
835
875
|
},
|
|
836
876
|
{
|
|
837
877
|
provide: 'CouponRepository',
|
|
838
878
|
useFactory: function (firestore) {
|
|
839
879
|
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
840
880
|
},
|
|
841
|
-
deps: [
|
|
881
|
+
deps: [i1$2.AngularFirestore],
|
|
842
882
|
},
|
|
843
883
|
{
|
|
844
884
|
provide: 'EditionRepository',
|
|
845
885
|
useFactory: function (firestore, subscriptionRepository) {
|
|
846
886
|
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
847
887
|
},
|
|
848
|
-
deps: [
|
|
888
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
849
889
|
},
|
|
850
890
|
{
|
|
851
891
|
provide: 'HomeRepository',
|
|
852
892
|
useFactory: function (firestore) {
|
|
853
893
|
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
854
894
|
},
|
|
855
|
-
deps: [
|
|
895
|
+
deps: [i1$2.AngularFirestore],
|
|
856
896
|
},
|
|
857
897
|
{
|
|
858
898
|
provide: 'ShopMenuRepository',
|
|
859
899
|
useFactory: function (firestore) {
|
|
860
900
|
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
861
901
|
},
|
|
862
|
-
deps: [
|
|
902
|
+
deps: [i1$2.AngularFirestore],
|
|
863
903
|
},
|
|
864
904
|
{
|
|
865
905
|
provide: 'OrderRepository',
|
|
866
906
|
useFactory: function (firestore) {
|
|
867
907
|
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
868
908
|
},
|
|
869
|
-
deps: [
|
|
909
|
+
deps: [i1$2.AngularFirestore],
|
|
870
910
|
},
|
|
871
911
|
{
|
|
872
912
|
provide: 'PaymentRepository',
|
|
873
913
|
useFactory: function (firestore) {
|
|
874
914
|
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
875
915
|
},
|
|
876
|
-
deps: [
|
|
916
|
+
deps: [i1$2.AngularFirestore],
|
|
877
917
|
},
|
|
878
918
|
{
|
|
879
919
|
provide: 'ProductRepository',
|
|
880
920
|
useFactory: function (firestore) {
|
|
881
921
|
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
882
922
|
},
|
|
883
|
-
deps: [
|
|
923
|
+
deps: [i1$2.AngularFirestore],
|
|
884
924
|
},
|
|
885
925
|
{
|
|
886
926
|
provide: 'SubscriptionPaymentRepository',
|
|
887
927
|
useFactory: function (firestore, subscriptionRepository) {
|
|
888
928
|
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
889
929
|
},
|
|
890
|
-
deps: [
|
|
930
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
891
931
|
},
|
|
892
932
|
{
|
|
893
933
|
provide: 'SubscriptionPlanRepository',
|
|
894
934
|
useFactory: function (firestore) {
|
|
895
935
|
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
896
936
|
},
|
|
897
|
-
deps: [
|
|
937
|
+
deps: [i1$2.AngularFirestore],
|
|
898
938
|
},
|
|
899
939
|
{
|
|
900
940
|
provide: 'SubscriptionRepository',
|
|
901
941
|
useFactory: function (firestore) {
|
|
902
942
|
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
903
943
|
},
|
|
904
|
-
deps: [
|
|
944
|
+
deps: [i1$2.AngularFirestore],
|
|
905
945
|
},
|
|
906
946
|
{
|
|
907
947
|
provide: 'UserRepository',
|
|
908
948
|
useFactory: function (firestore) {
|
|
909
949
|
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
910
950
|
},
|
|
911
|
-
deps: [
|
|
951
|
+
deps: [i1$2.AngularFirestore],
|
|
912
952
|
},
|
|
913
953
|
{
|
|
914
954
|
provide: 'UserAddressRepository',
|
|
915
955
|
useFactory: function (firestore, userRepository) {
|
|
916
956
|
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
917
957
|
},
|
|
918
|
-
deps: [
|
|
958
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
919
959
|
},
|
|
920
960
|
{
|
|
921
961
|
provide: 'VariantRepository',
|
|
922
962
|
useFactory: function (firestore, productRepository) {
|
|
923
963
|
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
924
964
|
},
|
|
925
|
-
deps: [
|
|
965
|
+
deps: [i1$2.AngularFirestore, 'ProductRepository'],
|
|
926
966
|
},
|
|
927
967
|
],
|
|
928
968
|
}]
|
|
@@ -941,12 +981,12 @@
|
|
|
941
981
|
}());
|
|
942
982
|
AngularConnectModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
943
983
|
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, imports: [fire.AngularFireModule, AngularFirestoreModule] });
|
|
944
|
-
AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, providers: [AuthService, CartService, CheckoutService], imports: [[fire.AngularFireModule, AngularFirestoreModule]] });
|
|
984
|
+
AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, providers: [AuthService, CartService, CheckoutService, OrderService], imports: [[fire.AngularFireModule, AngularFirestoreModule]] });
|
|
945
985
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
946
986
|
type: i0.NgModule,
|
|
947
987
|
args: [{
|
|
948
988
|
imports: [fire.AngularFireModule, AngularFirestoreModule],
|
|
949
|
-
providers: [AuthService, CartService, CheckoutService],
|
|
989
|
+
providers: [AuthService, CartService, CheckoutService, OrderService],
|
|
950
990
|
}]
|
|
951
991
|
}] });
|
|
952
992
|
|
|
@@ -960,6 +1000,7 @@
|
|
|
960
1000
|
exports.AuthService = AuthService;
|
|
961
1001
|
exports.CartService = CartService;
|
|
962
1002
|
exports.CheckoutService = CheckoutService;
|
|
1003
|
+
exports.OrderService = OrderService;
|
|
963
1004
|
|
|
964
1005
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
965
1006
|
|