@infrab4a/connect-angular 0.5.0-beta.8 → 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 +133 -83
- 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 +48 -39
- 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 +85 -44
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/lib/services/cart.service.d.ts +6 -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,55 +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
|
-
var
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
? rxjs.of(isSubscriber)
|
|
502
|
-
: _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) {
|
|
503
|
-
return _this.getCart().pipe(operators.map(function () { return _this.buildLineItem({ checkout: checkout, item: item, quantity: quantity, isSubscriber: isSubscriber }); }), operators.mergeMap(function (lineItem) { return _this.updateLineItemInCart(lineItem, quantity); }));
|
|
504
|
-
}));
|
|
505
|
-
})).subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
506
|
-
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); }));
|
|
507
516
|
};
|
|
508
517
|
CartService.prototype.decreaseItem = function (item) {
|
|
509
518
|
var _this = this;
|
|
510
|
-
this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
519
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
511
520
|
var _a;
|
|
512
521
|
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
|
|
513
522
|
if (!i1$1.isNil(checkoutItem))
|
|
514
523
|
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
515
524
|
return checkout;
|
|
516
|
-
}), operators.
|
|
517
|
-
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); }));
|
|
518
526
|
};
|
|
519
|
-
CartService.prototype.getCart = function () {
|
|
527
|
+
CartService.prototype.getCart = function (checkout) {
|
|
520
528
|
var _this = this;
|
|
521
|
-
this.
|
|
522
|
-
.getCheckout()
|
|
523
|
-
.pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.mergeMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }))
|
|
524
|
-
.subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
529
|
+
this.buildCartFromCheckout(checkout).subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
525
530
|
return this.cartSubject;
|
|
526
531
|
};
|
|
527
532
|
CartService.prototype.getDiscount = function (coupon) {
|
|
@@ -537,15 +542,31 @@
|
|
|
537
542
|
}
|
|
538
543
|
};
|
|
539
544
|
CartService.prototype.getVariantPriceDiscount = function (item, shop) {
|
|
540
|
-
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); }));
|
|
541
546
|
};
|
|
542
547
|
CartService.prototype.removeItem = function (item) {
|
|
543
548
|
var _this = this;
|
|
544
|
-
this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
545
|
-
checkout.lineItems.
|
|
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);
|
|
546
553
|
return checkout;
|
|
547
|
-
}), operators.
|
|
548
|
-
|
|
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); }));
|
|
566
|
+
};
|
|
567
|
+
CartService.prototype.buildCartFromCheckout = function (checkoutData) {
|
|
568
|
+
var _this = this;
|
|
569
|
+
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
549
570
|
};
|
|
550
571
|
CartService.prototype.getFinancialDiscount = function (coupon) {
|
|
551
572
|
return function (subTotalPrice) {
|
|
@@ -571,6 +592,34 @@
|
|
|
571
592
|
}] }];
|
|
572
593
|
} });
|
|
573
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
|
+
|
|
574
623
|
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
575
624
|
function AngularFirebaseAuthModule() {
|
|
576
625
|
}
|
|
@@ -662,126 +711,126 @@
|
|
|
662
711
|
useFactory: function (firestore, userRepository) {
|
|
663
712
|
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
664
713
|
},
|
|
665
|
-
deps: [
|
|
714
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
666
715
|
},
|
|
667
716
|
{
|
|
668
717
|
provide: 'Buy2WinRepository',
|
|
669
718
|
useFactory: function (firestore) {
|
|
670
719
|
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
671
720
|
},
|
|
672
|
-
deps: [
|
|
721
|
+
deps: [i1$2.AngularFirestore],
|
|
673
722
|
},
|
|
674
723
|
{
|
|
675
724
|
provide: 'CategoryRepository',
|
|
676
725
|
useFactory: function (firestore) {
|
|
677
726
|
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
678
727
|
},
|
|
679
|
-
deps: [
|
|
728
|
+
deps: [i1$2.AngularFirestore],
|
|
680
729
|
},
|
|
681
730
|
{
|
|
682
731
|
provide: 'CheckoutRepository',
|
|
683
732
|
useFactory: function (firestore) {
|
|
684
733
|
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
685
734
|
},
|
|
686
|
-
deps: [
|
|
735
|
+
deps: [i1$2.AngularFirestore],
|
|
687
736
|
},
|
|
688
737
|
{
|
|
689
738
|
provide: 'CheckoutSubscriptionRepository',
|
|
690
739
|
useFactory: function (firestore) {
|
|
691
740
|
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
692
741
|
},
|
|
693
|
-
deps: [
|
|
742
|
+
deps: [i1$2.AngularFirestore],
|
|
694
743
|
},
|
|
695
744
|
{
|
|
696
745
|
provide: 'CouponRepository',
|
|
697
746
|
useFactory: function (firestore) {
|
|
698
747
|
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
699
748
|
},
|
|
700
|
-
deps: [
|
|
749
|
+
deps: [i1$2.AngularFirestore],
|
|
701
750
|
},
|
|
702
751
|
{
|
|
703
752
|
provide: 'EditionRepository',
|
|
704
753
|
useFactory: function (firestore, subscriptionRepository) {
|
|
705
754
|
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
706
755
|
},
|
|
707
|
-
deps: [
|
|
756
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
708
757
|
},
|
|
709
758
|
{
|
|
710
759
|
provide: 'HomeRepository',
|
|
711
760
|
useFactory: function (firestore) {
|
|
712
761
|
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
713
762
|
},
|
|
714
|
-
deps: [
|
|
763
|
+
deps: [i1$2.AngularFirestore],
|
|
715
764
|
},
|
|
716
765
|
{
|
|
717
766
|
provide: 'ShopMenuRepository',
|
|
718
767
|
useFactory: function (firestore) {
|
|
719
768
|
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
720
769
|
},
|
|
721
|
-
deps: [
|
|
770
|
+
deps: [i1$2.AngularFirestore],
|
|
722
771
|
},
|
|
723
772
|
{
|
|
724
773
|
provide: 'OrderRepository',
|
|
725
774
|
useFactory: function (firestore) {
|
|
726
775
|
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
727
776
|
},
|
|
728
|
-
deps: [
|
|
777
|
+
deps: [i1$2.AngularFirestore],
|
|
729
778
|
},
|
|
730
779
|
{
|
|
731
780
|
provide: 'PaymentRepository',
|
|
732
781
|
useFactory: function (firestore) {
|
|
733
782
|
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
734
783
|
},
|
|
735
|
-
deps: [
|
|
784
|
+
deps: [i1$2.AngularFirestore],
|
|
736
785
|
},
|
|
737
786
|
{
|
|
738
787
|
provide: 'ProductRepository',
|
|
739
788
|
useFactory: function (firestore) {
|
|
740
789
|
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
741
790
|
},
|
|
742
|
-
deps: [
|
|
791
|
+
deps: [i1$2.AngularFirestore],
|
|
743
792
|
},
|
|
744
793
|
{
|
|
745
794
|
provide: 'SubscriptionPaymentRepository',
|
|
746
795
|
useFactory: function (firestore, subscriptionRepository) {
|
|
747
796
|
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
748
797
|
},
|
|
749
|
-
deps: [
|
|
798
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
750
799
|
},
|
|
751
800
|
{
|
|
752
801
|
provide: 'SubscriptionPlanRepository',
|
|
753
802
|
useFactory: function (firestore) {
|
|
754
803
|
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
755
804
|
},
|
|
756
|
-
deps: [
|
|
805
|
+
deps: [i1$2.AngularFirestore],
|
|
757
806
|
},
|
|
758
807
|
{
|
|
759
808
|
provide: 'SubscriptionRepository',
|
|
760
809
|
useFactory: function (firestore) {
|
|
761
810
|
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
762
811
|
},
|
|
763
|
-
deps: [
|
|
812
|
+
deps: [i1$2.AngularFirestore],
|
|
764
813
|
},
|
|
765
814
|
{
|
|
766
815
|
provide: 'UserRepository',
|
|
767
816
|
useFactory: function (firestore) {
|
|
768
817
|
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
769
818
|
},
|
|
770
|
-
deps: [
|
|
819
|
+
deps: [i1$2.AngularFirestore],
|
|
771
820
|
},
|
|
772
821
|
{
|
|
773
822
|
provide: 'UserAddressRepository',
|
|
774
823
|
useFactory: function (firestore, userRepository) {
|
|
775
824
|
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
776
825
|
},
|
|
777
|
-
deps: [
|
|
826
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
778
827
|
},
|
|
779
828
|
{
|
|
780
829
|
provide: 'VariantRepository',
|
|
781
830
|
useFactory: function (firestore, productRepository) {
|
|
782
831
|
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
783
832
|
},
|
|
784
|
-
deps: [
|
|
833
|
+
deps: [i1$2.AngularFirestore, 'ProductRepository'],
|
|
785
834
|
},
|
|
786
835
|
], imports: [[fire.AngularFireModule]] });
|
|
787
836
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
|
|
@@ -794,126 +843,126 @@
|
|
|
794
843
|
useFactory: function (firestore, userRepository) {
|
|
795
844
|
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
796
845
|
},
|
|
797
|
-
deps: [
|
|
846
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
798
847
|
},
|
|
799
848
|
{
|
|
800
849
|
provide: 'Buy2WinRepository',
|
|
801
850
|
useFactory: function (firestore) {
|
|
802
851
|
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
803
852
|
},
|
|
804
|
-
deps: [
|
|
853
|
+
deps: [i1$2.AngularFirestore],
|
|
805
854
|
},
|
|
806
855
|
{
|
|
807
856
|
provide: 'CategoryRepository',
|
|
808
857
|
useFactory: function (firestore) {
|
|
809
858
|
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
810
859
|
},
|
|
811
|
-
deps: [
|
|
860
|
+
deps: [i1$2.AngularFirestore],
|
|
812
861
|
},
|
|
813
862
|
{
|
|
814
863
|
provide: 'CheckoutRepository',
|
|
815
864
|
useFactory: function (firestore) {
|
|
816
865
|
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
817
866
|
},
|
|
818
|
-
deps: [
|
|
867
|
+
deps: [i1$2.AngularFirestore],
|
|
819
868
|
},
|
|
820
869
|
{
|
|
821
870
|
provide: 'CheckoutSubscriptionRepository',
|
|
822
871
|
useFactory: function (firestore) {
|
|
823
872
|
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
824
873
|
},
|
|
825
|
-
deps: [
|
|
874
|
+
deps: [i1$2.AngularFirestore],
|
|
826
875
|
},
|
|
827
876
|
{
|
|
828
877
|
provide: 'CouponRepository',
|
|
829
878
|
useFactory: function (firestore) {
|
|
830
879
|
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
831
880
|
},
|
|
832
|
-
deps: [
|
|
881
|
+
deps: [i1$2.AngularFirestore],
|
|
833
882
|
},
|
|
834
883
|
{
|
|
835
884
|
provide: 'EditionRepository',
|
|
836
885
|
useFactory: function (firestore, subscriptionRepository) {
|
|
837
886
|
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
838
887
|
},
|
|
839
|
-
deps: [
|
|
888
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
840
889
|
},
|
|
841
890
|
{
|
|
842
891
|
provide: 'HomeRepository',
|
|
843
892
|
useFactory: function (firestore) {
|
|
844
893
|
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
845
894
|
},
|
|
846
|
-
deps: [
|
|
895
|
+
deps: [i1$2.AngularFirestore],
|
|
847
896
|
},
|
|
848
897
|
{
|
|
849
898
|
provide: 'ShopMenuRepository',
|
|
850
899
|
useFactory: function (firestore) {
|
|
851
900
|
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
852
901
|
},
|
|
853
|
-
deps: [
|
|
902
|
+
deps: [i1$2.AngularFirestore],
|
|
854
903
|
},
|
|
855
904
|
{
|
|
856
905
|
provide: 'OrderRepository',
|
|
857
906
|
useFactory: function (firestore) {
|
|
858
907
|
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
859
908
|
},
|
|
860
|
-
deps: [
|
|
909
|
+
deps: [i1$2.AngularFirestore],
|
|
861
910
|
},
|
|
862
911
|
{
|
|
863
912
|
provide: 'PaymentRepository',
|
|
864
913
|
useFactory: function (firestore) {
|
|
865
914
|
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
866
915
|
},
|
|
867
|
-
deps: [
|
|
916
|
+
deps: [i1$2.AngularFirestore],
|
|
868
917
|
},
|
|
869
918
|
{
|
|
870
919
|
provide: 'ProductRepository',
|
|
871
920
|
useFactory: function (firestore) {
|
|
872
921
|
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
873
922
|
},
|
|
874
|
-
deps: [
|
|
923
|
+
deps: [i1$2.AngularFirestore],
|
|
875
924
|
},
|
|
876
925
|
{
|
|
877
926
|
provide: 'SubscriptionPaymentRepository',
|
|
878
927
|
useFactory: function (firestore, subscriptionRepository) {
|
|
879
928
|
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
880
929
|
},
|
|
881
|
-
deps: [
|
|
930
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
882
931
|
},
|
|
883
932
|
{
|
|
884
933
|
provide: 'SubscriptionPlanRepository',
|
|
885
934
|
useFactory: function (firestore) {
|
|
886
935
|
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
887
936
|
},
|
|
888
|
-
deps: [
|
|
937
|
+
deps: [i1$2.AngularFirestore],
|
|
889
938
|
},
|
|
890
939
|
{
|
|
891
940
|
provide: 'SubscriptionRepository',
|
|
892
941
|
useFactory: function (firestore) {
|
|
893
942
|
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
894
943
|
},
|
|
895
|
-
deps: [
|
|
944
|
+
deps: [i1$2.AngularFirestore],
|
|
896
945
|
},
|
|
897
946
|
{
|
|
898
947
|
provide: 'UserRepository',
|
|
899
948
|
useFactory: function (firestore) {
|
|
900
949
|
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
901
950
|
},
|
|
902
|
-
deps: [
|
|
951
|
+
deps: [i1$2.AngularFirestore],
|
|
903
952
|
},
|
|
904
953
|
{
|
|
905
954
|
provide: 'UserAddressRepository',
|
|
906
955
|
useFactory: function (firestore, userRepository) {
|
|
907
956
|
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
908
957
|
},
|
|
909
|
-
deps: [
|
|
958
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
910
959
|
},
|
|
911
960
|
{
|
|
912
961
|
provide: 'VariantRepository',
|
|
913
962
|
useFactory: function (firestore, productRepository) {
|
|
914
963
|
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
915
964
|
},
|
|
916
|
-
deps: [
|
|
965
|
+
deps: [i1$2.AngularFirestore, 'ProductRepository'],
|
|
917
966
|
},
|
|
918
967
|
],
|
|
919
968
|
}]
|
|
@@ -932,12 +981,12 @@
|
|
|
932
981
|
}());
|
|
933
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 });
|
|
934
983
|
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, imports: [fire.AngularFireModule, AngularFirestoreModule] });
|
|
935
|
-
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]] });
|
|
936
985
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
937
986
|
type: i0.NgModule,
|
|
938
987
|
args: [{
|
|
939
988
|
imports: [fire.AngularFireModule, AngularFirestoreModule],
|
|
940
|
-
providers: [AuthService, CartService, CheckoutService],
|
|
989
|
+
providers: [AuthService, CartService, CheckoutService, OrderService],
|
|
941
990
|
}]
|
|
942
991
|
}] });
|
|
943
992
|
|
|
@@ -951,6 +1000,7 @@
|
|
|
951
1000
|
exports.AuthService = AuthService;
|
|
952
1001
|
exports.CartService = CartService;
|
|
953
1002
|
exports.CheckoutService = CheckoutService;
|
|
1003
|
+
exports.OrderService = OrderService;
|
|
954
1004
|
|
|
955
1005
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
956
1006
|
|