@infrab4a/connect 4.17.2 → 4.18.0-beta.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/index.cjs.js +751 -83
- package/index.esm.js +728 -86
- package/package.json +1 -1
- package/src/domain/general/models/index.d.ts +1 -0
- package/src/domain/general/models/sequences.d.ts +9 -0
- package/src/domain/general/repositories/index.d.ts +1 -0
- package/src/domain/general/repositories/sequences.repository.d.ts +4 -0
- package/src/domain/shopping/enums/antifraud-providers.enum.d.ts +6 -0
- package/src/domain/shopping/enums/index.d.ts +3 -0
- package/src/domain/shopping/enums/payment-methods.enum.d.ts +6 -0
- package/src/domain/shopping/enums/payment-providers.enum.d.ts +5 -0
- package/src/domain/shopping/factories/adyen-payment-method.factory.d.ts +8 -0
- package/src/domain/shopping/factories/antifraud-provider.factory.d.ts +15 -0
- package/src/domain/shopping/factories/base-payment-method.factory.d.ts +7 -0
- package/src/domain/shopping/factories/glampoints-payment-method.factory.d.ts +8 -0
- package/src/domain/shopping/factories/index.d.ts +5 -0
- package/src/domain/shopping/factories/pagarme-payment-method.factory.d.ts +10 -0
- package/src/domain/shopping/factories/payment-provider.factory.d.ts +15 -0
- package/src/domain/shopping/index.d.ts +4 -0
- package/src/domain/shopping/interfaces/antifraud-method-factory.interface.d.ts +11 -0
- package/src/domain/shopping/interfaces/antifraud-provider.interface.d.ts +5 -0
- package/src/domain/shopping/interfaces/index.d.ts +7 -0
- package/src/domain/shopping/interfaces/payment-method-factory.interface.d.ts +14 -0
- package/src/domain/shopping/interfaces/payment-provider-bank-slip.interface.d.ts +5 -0
- package/src/domain/shopping/interfaces/payment-provider-card.interface.d.ts +7 -0
- package/src/domain/shopping/interfaces/payment-provider-glampoints.interface.d.ts +5 -0
- package/src/domain/shopping/interfaces/payment-provider-pix.interface.d.ts +5 -0
- package/src/domain/shopping/models/index.d.ts +1 -0
- package/src/domain/shopping/models/order.d.ts +2 -2
- package/src/domain/shopping/models/payment-transaction.d.ts +67 -0
- package/src/domain/shopping/models/payment.d.ts +10 -63
- package/src/domain/shopping/models/types/index.d.ts +4 -4
- package/src/domain/shopping/services/adyen-card-payment.service.d.ts +13 -0
- package/src/domain/shopping/services/antifraud-bankslip.service.d.ts +9 -0
- package/src/domain/shopping/services/antifraud-card.service.d.ts +18 -0
- package/src/domain/shopping/services/antifraud-glampoints.service.d.ts +6 -0
- package/src/domain/shopping/services/antifraud-pix.service.d.ts +6 -0
- package/src/domain/shopping/services/glampoints-payment.service.d.ts +8 -0
- package/src/domain/shopping/services/index.d.ts +9 -0
- package/src/domain/shopping/services/pagarme-bank-slip-payment.service.d.ts +11 -0
- package/src/domain/shopping/services/pagarme-card-payment.service.d.ts +13 -0
- package/src/domain/shopping/services/pagarme-pix-payment.service.d.ts +11 -0
- package/src/domain/shopping/types/adyen-credentials.type.d.ts +6 -0
- package/src/domain/shopping/types/antifraud-provider.type.d.ts +2 -0
- package/src/domain/shopping/types/index.d.ts +5 -0
- package/src/domain/shopping/types/pagarme-credentials.type.d.ts +5 -0
- package/src/domain/shopping/types/payment-method.type.d.ts +2 -0
- package/src/domain/shopping/types/payment-provider.type.d.ts +2 -0
- package/src/errors/business.error.d.ts +7 -0
- package/src/errors/fraud-validation.error.d.ts +7 -0
- package/src/errors/index.d.ts +7 -2
- package/src/errors/payment.error.d.ts +7 -0
- package/src/errors/stock-limit.error.d.ts +5 -0
- package/src/errors/stock-out.error.d.ts +5 -0
- package/src/errors/types/checkout-additional-data-erro.type.d.ts +5 -0
- package/src/errors/types/index.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/general/index.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/general/sequences-firestore.repository.d.ts +7 -0
- package/src/infra/firebase/firestore/repositories/shopping/index.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/order-blocked-firestore.repository.d.ts +9 -0
- package/src/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.d.ts +0 -1
- package/src/utils/index.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -19,6 +19,65 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
19
19
|
|
|
20
20
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
21
21
|
|
|
22
|
+
exports.AntifraudProviders = void 0;
|
|
23
|
+
(function (AntifraudProviders) {
|
|
24
|
+
AntifraudProviders["BANKSLIP"] = "bankSlip";
|
|
25
|
+
AntifraudProviders["CARD"] = "card";
|
|
26
|
+
AntifraudProviders["PIX"] = "pix";
|
|
27
|
+
AntifraudProviders["POINTS"] = "glampoints";
|
|
28
|
+
})(exports.AntifraudProviders || (exports.AntifraudProviders = {}));
|
|
29
|
+
|
|
30
|
+
exports.PaymentMethods = void 0;
|
|
31
|
+
(function (PaymentMethods) {
|
|
32
|
+
PaymentMethods["CARD"] = "card";
|
|
33
|
+
PaymentMethods["BANKSLIP"] = "bankSlip";
|
|
34
|
+
PaymentMethods["PIX"] = "pix";
|
|
35
|
+
PaymentMethods["POINTS"] = "glampoints";
|
|
36
|
+
})(exports.PaymentMethods || (exports.PaymentMethods = {}));
|
|
37
|
+
|
|
38
|
+
exports.PaymentProviders = void 0;
|
|
39
|
+
(function (PaymentProviders) {
|
|
40
|
+
PaymentProviders["PAGARME"] = "pagarMe";
|
|
41
|
+
PaymentProviders["ADYEN"] = "adyen";
|
|
42
|
+
PaymentProviders["GLAMPOINTS"] = "glampoints";
|
|
43
|
+
})(exports.PaymentProviders || (exports.PaymentProviders = {}));
|
|
44
|
+
|
|
45
|
+
class BasePaymentMethodFactory {
|
|
46
|
+
constructor(methods) {
|
|
47
|
+
this.methods = methods;
|
|
48
|
+
}
|
|
49
|
+
build(method) {
|
|
50
|
+
return this.methods[method];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
class AdyenPaymentMethodFactory extends BasePaymentMethodFactory {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
class AntifraudProviderFactory {
|
|
58
|
+
constructor(antifraudProviders) {
|
|
59
|
+
this.antifraudProviders = antifraudProviders;
|
|
60
|
+
}
|
|
61
|
+
build(provider) {
|
|
62
|
+
return this.antifraudProviders[provider];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
class GlampointsPaymentMethodFactory extends BasePaymentMethodFactory {
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
class PagarmePaymentMethodFactory extends BasePaymentMethodFactory {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
class PaymentProviderFactory {
|
|
73
|
+
constructor(paymentProviders) {
|
|
74
|
+
this.paymentProviders = paymentProviders;
|
|
75
|
+
}
|
|
76
|
+
build(provider) {
|
|
77
|
+
return this.paymentProviders[provider];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
22
81
|
class BaseModel {
|
|
23
82
|
get identifier() {
|
|
24
83
|
const fields = this.constructor.identifiersFields.filter((field) => field !== 'identifier');
|
|
@@ -565,175 +624,182 @@ exports.Status = void 0;
|
|
|
565
624
|
Status["CANCELLED"] = "Cancelado";
|
|
566
625
|
})(exports.Status || (exports.Status = {}));
|
|
567
626
|
|
|
568
|
-
class
|
|
569
|
-
static get identifiersFields() {
|
|
570
|
-
return ['id'];
|
|
571
|
-
}
|
|
627
|
+
class PaymentTransaction extends BaseModel {
|
|
572
628
|
}
|
|
573
629
|
tslib.__decorate([
|
|
574
630
|
classTransformer.Expose({ name: 'refuse_reason' }),
|
|
575
631
|
tslib.__metadata("design:type", String)
|
|
576
|
-
],
|
|
632
|
+
], PaymentTransaction.prototype, "refuseReason", void 0);
|
|
577
633
|
tslib.__decorate([
|
|
578
634
|
classTransformer.Expose({ name: 'status_reason' }),
|
|
579
635
|
tslib.__metadata("design:type", String)
|
|
580
|
-
],
|
|
636
|
+
], PaymentTransaction.prototype, "statusReason", void 0);
|
|
581
637
|
tslib.__decorate([
|
|
582
638
|
classTransformer.Expose({ name: 'acquirer_response_code' }),
|
|
583
639
|
tslib.__metadata("design:type", String)
|
|
584
|
-
],
|
|
640
|
+
], PaymentTransaction.prototype, "acquirerResponseCode", void 0);
|
|
585
641
|
tslib.__decorate([
|
|
586
642
|
classTransformer.Expose({ name: 'acquirer_name' }),
|
|
587
643
|
tslib.__metadata("design:type", String)
|
|
588
|
-
],
|
|
644
|
+
], PaymentTransaction.prototype, "acquirerName", void 0);
|
|
589
645
|
tslib.__decorate([
|
|
590
646
|
classTransformer.Expose({ name: 'acquirer_id' }),
|
|
591
647
|
tslib.__metadata("design:type", String)
|
|
592
|
-
],
|
|
648
|
+
], PaymentTransaction.prototype, "acquirerId", void 0);
|
|
593
649
|
tslib.__decorate([
|
|
594
650
|
classTransformer.Expose({ name: 'authorization_code' }),
|
|
595
651
|
tslib.__metadata("design:type", String)
|
|
596
|
-
],
|
|
652
|
+
], PaymentTransaction.prototype, "authorizationCode", void 0);
|
|
597
653
|
tslib.__decorate([
|
|
598
654
|
classTransformer.Expose({ name: 'soft_descriptor' }),
|
|
599
655
|
tslib.__metadata("design:type", String)
|
|
600
|
-
],
|
|
656
|
+
], PaymentTransaction.prototype, "softDescriptor", void 0);
|
|
601
657
|
tslib.__decorate([
|
|
602
658
|
classTransformer.Expose({ name: 'date_created' }),
|
|
603
659
|
tslib.__metadata("design:type", String)
|
|
604
|
-
],
|
|
660
|
+
], PaymentTransaction.prototype, "dateCreated", void 0);
|
|
605
661
|
tslib.__decorate([
|
|
606
662
|
classTransformer.Expose({ name: 'date_updated' }),
|
|
607
663
|
tslib.__metadata("design:type", String)
|
|
608
|
-
],
|
|
664
|
+
], PaymentTransaction.prototype, "dateUpdated", void 0);
|
|
609
665
|
tslib.__decorate([
|
|
610
666
|
classTransformer.Expose({ name: 'authorized_amount' }),
|
|
611
667
|
tslib.__metadata("design:type", Number)
|
|
612
|
-
],
|
|
668
|
+
], PaymentTransaction.prototype, "authorizedAmount", void 0);
|
|
613
669
|
tslib.__decorate([
|
|
614
670
|
classTransformer.Expose({ name: 'paid_amount' }),
|
|
615
671
|
tslib.__metadata("design:type", Number)
|
|
616
|
-
],
|
|
672
|
+
], PaymentTransaction.prototype, "paidAmount", void 0);
|
|
617
673
|
tslib.__decorate([
|
|
618
674
|
classTransformer.Expose({ name: 'paid_at' }),
|
|
619
675
|
tslib.__metadata("design:type", String)
|
|
620
|
-
],
|
|
676
|
+
], PaymentTransaction.prototype, "paidAt", void 0);
|
|
621
677
|
tslib.__decorate([
|
|
622
678
|
classTransformer.Expose({ name: 'refunded_amount' }),
|
|
623
679
|
tslib.__metadata("design:type", Number)
|
|
624
|
-
],
|
|
680
|
+
], PaymentTransaction.prototype, "refundedAmount", void 0);
|
|
625
681
|
tslib.__decorate([
|
|
626
682
|
classTransformer.Expose({ name: 'card_holder_name' }),
|
|
627
683
|
tslib.__metadata("design:type", String)
|
|
628
|
-
],
|
|
684
|
+
], PaymentTransaction.prototype, "cardHolderName", void 0);
|
|
629
685
|
tslib.__decorate([
|
|
630
686
|
classTransformer.Expose({ name: 'card_last_digits' }),
|
|
631
687
|
tslib.__metadata("design:type", String)
|
|
632
|
-
],
|
|
688
|
+
], PaymentTransaction.prototype, "cardLastDigits", void 0);
|
|
633
689
|
tslib.__decorate([
|
|
634
690
|
classTransformer.Expose({ name: 'card_first_digits' }),
|
|
635
691
|
tslib.__metadata("design:type", String)
|
|
636
|
-
],
|
|
692
|
+
], PaymentTransaction.prototype, "cardFirstDigits", void 0);
|
|
637
693
|
tslib.__decorate([
|
|
638
694
|
classTransformer.Expose({ name: 'card_brand' }),
|
|
639
695
|
tslib.__metadata("design:type", String)
|
|
640
|
-
],
|
|
696
|
+
], PaymentTransaction.prototype, "cardBrand", void 0);
|
|
641
697
|
tslib.__decorate([
|
|
642
698
|
classTransformer.Expose({ name: 'card_pin_mode' }),
|
|
643
699
|
tslib.__metadata("design:type", String)
|
|
644
|
-
],
|
|
700
|
+
], PaymentTransaction.prototype, "cardPinMode", void 0);
|
|
645
701
|
tslib.__decorate([
|
|
646
702
|
classTransformer.Expose({ name: 'card_magstripe_fallback' }),
|
|
647
703
|
tslib.__metadata("design:type", Boolean)
|
|
648
|
-
],
|
|
704
|
+
], PaymentTransaction.prototype, "cardMagstripeFallback", void 0);
|
|
649
705
|
tslib.__decorate([
|
|
650
706
|
classTransformer.Expose({ name: 'cvm_pin' }),
|
|
651
707
|
tslib.__metadata("design:type", Boolean)
|
|
652
|
-
],
|
|
708
|
+
], PaymentTransaction.prototype, "cvmPin", void 0);
|
|
653
709
|
tslib.__decorate([
|
|
654
710
|
classTransformer.Expose({ name: 'postback_url' }),
|
|
655
711
|
tslib.__metadata("design:type", String)
|
|
656
|
-
],
|
|
712
|
+
], PaymentTransaction.prototype, "postbackUrl", void 0);
|
|
657
713
|
tslib.__decorate([
|
|
658
714
|
classTransformer.Expose({ name: 'payment_method' }),
|
|
659
715
|
tslib.__metadata("design:type", String)
|
|
660
|
-
],
|
|
716
|
+
], PaymentTransaction.prototype, "paymentMethod", void 0);
|
|
661
717
|
tslib.__decorate([
|
|
662
718
|
classTransformer.Expose({ name: 'capture_method' }),
|
|
663
719
|
tslib.__metadata("design:type", String)
|
|
664
|
-
],
|
|
720
|
+
], PaymentTransaction.prototype, "captureMethod", void 0);
|
|
665
721
|
tslib.__decorate([
|
|
666
722
|
classTransformer.Expose({ name: 'antifraud_score' }),
|
|
667
723
|
tslib.__metadata("design:type", String)
|
|
668
|
-
],
|
|
724
|
+
], PaymentTransaction.prototype, "antifraudScore", void 0);
|
|
669
725
|
tslib.__decorate([
|
|
670
726
|
classTransformer.Expose({ name: 'boleto_url' }),
|
|
671
727
|
tslib.__metadata("design:type", String)
|
|
672
|
-
],
|
|
728
|
+
], PaymentTransaction.prototype, "boletoUrl", void 0);
|
|
673
729
|
tslib.__decorate([
|
|
674
730
|
classTransformer.Expose({ name: 'boleto_barcode' }),
|
|
675
731
|
tslib.__metadata("design:type", String)
|
|
676
|
-
],
|
|
732
|
+
], PaymentTransaction.prototype, "boletoBarcode", void 0);
|
|
677
733
|
tslib.__decorate([
|
|
678
734
|
classTransformer.Expose({ name: 'boleto_expiration_date' }),
|
|
679
735
|
tslib.__metadata("design:type", String)
|
|
680
|
-
],
|
|
736
|
+
], PaymentTransaction.prototype, "boletoExpirationDate", void 0);
|
|
681
737
|
tslib.__decorate([
|
|
682
738
|
classTransformer.Expose({ name: 'subscription_id' }),
|
|
683
739
|
tslib.__metadata("design:type", String)
|
|
684
|
-
],
|
|
740
|
+
], PaymentTransaction.prototype, "subscriptionId", void 0);
|
|
685
741
|
tslib.__decorate([
|
|
686
742
|
classTransformer.Expose({ name: 'split_rules' }),
|
|
687
743
|
tslib.__metadata("design:type", String)
|
|
688
|
-
],
|
|
744
|
+
], PaymentTransaction.prototype, "splitRules", void 0);
|
|
689
745
|
tslib.__decorate([
|
|
690
746
|
classTransformer.Expose({ name: 'antifraud_metadata' }),
|
|
691
747
|
tslib.__metadata("design:type", Object)
|
|
692
|
-
],
|
|
748
|
+
], PaymentTransaction.prototype, "antifraudMetadata", void 0);
|
|
693
749
|
tslib.__decorate([
|
|
694
750
|
classTransformer.Expose({ name: 'reference_key' }),
|
|
695
751
|
tslib.__metadata("design:type", String)
|
|
696
|
-
],
|
|
752
|
+
], PaymentTransaction.prototype, "referenceKey", void 0);
|
|
697
753
|
tslib.__decorate([
|
|
698
754
|
classTransformer.Expose({ name: 'local_transaction_id' }),
|
|
699
755
|
tslib.__metadata("design:type", String)
|
|
700
|
-
],
|
|
756
|
+
], PaymentTransaction.prototype, "localTransactionId", void 0);
|
|
701
757
|
tslib.__decorate([
|
|
702
758
|
classTransformer.Expose({ name: 'local_time' }),
|
|
703
759
|
tslib.__metadata("design:type", String)
|
|
704
|
-
],
|
|
760
|
+
], PaymentTransaction.prototype, "localTime", void 0);
|
|
705
761
|
tslib.__decorate([
|
|
706
762
|
classTransformer.Expose({ name: 'fraud_covered' }),
|
|
707
763
|
tslib.__metadata("design:type", Boolean)
|
|
708
|
-
],
|
|
764
|
+
], PaymentTransaction.prototype, "fraudCovered", void 0);
|
|
709
765
|
tslib.__decorate([
|
|
710
766
|
classTransformer.Expose({ name: 'fraud_reimbursed' }),
|
|
711
767
|
tslib.__metadata("design:type", String)
|
|
712
|
-
],
|
|
768
|
+
], PaymentTransaction.prototype, "fraudReimbursed", void 0);
|
|
713
769
|
tslib.__decorate([
|
|
714
770
|
classTransformer.Expose({ name: 'order_id' }),
|
|
715
771
|
tslib.__metadata("design:type", String)
|
|
716
|
-
],
|
|
772
|
+
], PaymentTransaction.prototype, "orderId", void 0);
|
|
717
773
|
tslib.__decorate([
|
|
718
774
|
classTransformer.Expose({ name: 'risk_level' }),
|
|
719
775
|
tslib.__metadata("design:type", String)
|
|
720
|
-
],
|
|
776
|
+
], PaymentTransaction.prototype, "riskLevel", void 0);
|
|
721
777
|
tslib.__decorate([
|
|
722
778
|
classTransformer.Expose({ name: 'receipt_url' }),
|
|
723
779
|
tslib.__metadata("design:type", String)
|
|
724
|
-
],
|
|
780
|
+
], PaymentTransaction.prototype, "receiptUrl", void 0);
|
|
725
781
|
tslib.__decorate([
|
|
726
782
|
classTransformer.Expose({ name: 'private_label' }),
|
|
727
783
|
tslib.__metadata("design:type", String)
|
|
728
|
-
],
|
|
784
|
+
], PaymentTransaction.prototype, "privateLabel", void 0);
|
|
729
785
|
tslib.__decorate([
|
|
730
786
|
classTransformer.Expose({ name: 'pix_qr_code' }),
|
|
731
787
|
tslib.__metadata("design:type", String)
|
|
732
|
-
],
|
|
788
|
+
], PaymentTransaction.prototype, "pixQrCode", void 0);
|
|
733
789
|
tslib.__decorate([
|
|
734
790
|
classTransformer.Expose({ name: 'pix_expiration_date' }),
|
|
735
791
|
tslib.__metadata("design:type", String)
|
|
736
|
-
],
|
|
792
|
+
], PaymentTransaction.prototype, "pixExpirationDate", void 0);
|
|
793
|
+
|
|
794
|
+
class Payment extends BaseModel {
|
|
795
|
+
static get identifiersFields() {
|
|
796
|
+
return ['id'];
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
tslib.__decorate([
|
|
800
|
+
classTransformer.Type(() => PaymentTransaction),
|
|
801
|
+
tslib.__metadata("design:type", PaymentTransaction)
|
|
802
|
+
], Payment.prototype, "transaction", void 0);
|
|
737
803
|
|
|
738
804
|
class SubscriptionPayment extends BaseModel {
|
|
739
805
|
static get identifiersFields() {
|
|
@@ -2197,8 +2263,8 @@ exports.OrderStatus = void 0;
|
|
|
2197
2263
|
class Order extends Checkout {
|
|
2198
2264
|
}
|
|
2199
2265
|
tslib.__decorate([
|
|
2200
|
-
classTransformer.Type(() =>
|
|
2201
|
-
tslib.__metadata("design:type",
|
|
2266
|
+
classTransformer.Type(() => PaymentTransaction),
|
|
2267
|
+
tslib.__metadata("design:type", PaymentTransaction)
|
|
2202
2268
|
], Order.prototype, "payment", void 0);
|
|
2203
2269
|
|
|
2204
2270
|
class OrderBlocked extends BaseModel {
|
|
@@ -2229,6 +2295,592 @@ tslib.__decorate([
|
|
|
2229
2295
|
tslib.__metadata("design:type", Coupon)
|
|
2230
2296
|
], CheckoutSubscription.prototype, "coupon", void 0);
|
|
2231
2297
|
|
|
2298
|
+
class BusinessError extends tsCustomError.CustomError {
|
|
2299
|
+
constructor(message, additionalData, type = '') {
|
|
2300
|
+
super(message);
|
|
2301
|
+
this.additionalData = additionalData;
|
|
2302
|
+
this.type = type;
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
class DuplicatedResultsError extends tsCustomError.CustomError {
|
|
2307
|
+
constructor(message) {
|
|
2308
|
+
super(message);
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
class FraudValidationError extends tsCustomError.CustomError {
|
|
2313
|
+
constructor(message, additionalData) {
|
|
2314
|
+
super(message);
|
|
2315
|
+
this.additionalData = additionalData;
|
|
2316
|
+
this.type = 'antifraud';
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
class InvalidArgumentError extends tsCustomError.CustomError {
|
|
2321
|
+
constructor(message) {
|
|
2322
|
+
super(message);
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
class NotFoundError extends tsCustomError.CustomError {
|
|
2327
|
+
constructor(message) {
|
|
2328
|
+
super(message);
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
class PaymentError extends tsCustomError.CustomError {
|
|
2333
|
+
constructor(message, additionalData) {
|
|
2334
|
+
super(message);
|
|
2335
|
+
this.additionalData = additionalData;
|
|
2336
|
+
this.type = 'payment';
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
class RequiredArgumentError extends tsCustomError.CustomError {
|
|
2341
|
+
constructor(args) {
|
|
2342
|
+
super(`Required arguments: ${args.join(', ')}`);
|
|
2343
|
+
this.args = args;
|
|
2344
|
+
this.arguments = args;
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
class StockLimitError extends BusinessError {
|
|
2349
|
+
constructor(message, additionalData) {
|
|
2350
|
+
super(message, additionalData);
|
|
2351
|
+
this.type = 'stock-limit';
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
class StockOutError extends BusinessError {
|
|
2356
|
+
constructor(message, additionalData) {
|
|
2357
|
+
super(message, additionalData);
|
|
2358
|
+
this.type = 'stock-out';
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
class AdyenCardService {
|
|
2363
|
+
constructor(credentials, paymentRepository, orderBlockedRepository) {
|
|
2364
|
+
this.credentials = credentials;
|
|
2365
|
+
this.paymentRepository = paymentRepository;
|
|
2366
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
2367
|
+
}
|
|
2368
|
+
async pay(checkout, card) {
|
|
2369
|
+
try {
|
|
2370
|
+
const result = await axios__default["default"]({
|
|
2371
|
+
method: 'POST',
|
|
2372
|
+
url: this.credentials.URL_TRANSACTION,
|
|
2373
|
+
headers: {
|
|
2374
|
+
'x-api-key': this.credentials.API_KEY,
|
|
2375
|
+
'content-type': 'application/json',
|
|
2376
|
+
},
|
|
2377
|
+
data: this.createCardPayment(checkout, card),
|
|
2378
|
+
});
|
|
2379
|
+
if (result.data.resultCode !== 'Authorised') {
|
|
2380
|
+
this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'Card not authorized', 'Card', 'day', card);
|
|
2381
|
+
return Promise.reject(new PaymentError(`Seu pagamento com cartão não foi autorizado. Para não perder seus produtos, pague com PIX ou outro cartão de crédito`, {
|
|
2382
|
+
checkoutId: checkout.id,
|
|
2383
|
+
userEmail: checkout.user.email,
|
|
2384
|
+
info: result.data,
|
|
2385
|
+
}));
|
|
2386
|
+
}
|
|
2387
|
+
const payment = await this.paymentRepository.create(Payment.toInstance({
|
|
2388
|
+
createdAt: new Date(),
|
|
2389
|
+
updatedAt: new Date(),
|
|
2390
|
+
userId: checkout.user.id,
|
|
2391
|
+
checkoutId: checkout.id,
|
|
2392
|
+
totalPrice: checkout.totalPrice,
|
|
2393
|
+
paymentProvider: 'adyen',
|
|
2394
|
+
transaction: Object.assign(Object.assign({}, result.data), { status: 'paid' }),
|
|
2395
|
+
}));
|
|
2396
|
+
return payment;
|
|
2397
|
+
}
|
|
2398
|
+
catch (error) {
|
|
2399
|
+
throw new PaymentError('Seu pagamento com cartão não foi autorizado. Para não perder seus produtos, pague com PIX ou outro cartão de crédito', {
|
|
2400
|
+
checkoutId: checkout.id,
|
|
2401
|
+
userEmail: checkout.user.email,
|
|
2402
|
+
info: error.message,
|
|
2403
|
+
});
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
createCardPayment(checkout, card) {
|
|
2407
|
+
return {
|
|
2408
|
+
amount: {
|
|
2409
|
+
currency: 'BRL',
|
|
2410
|
+
value: ((checkout === null || checkout === void 0 ? void 0 : checkout.totalPrice) || 0) * 100,
|
|
2411
|
+
},
|
|
2412
|
+
paymentMethod: {
|
|
2413
|
+
type: 'scheme',
|
|
2414
|
+
storedPaymentMethodId: card.cardId,
|
|
2415
|
+
},
|
|
2416
|
+
reference: checkout.id,
|
|
2417
|
+
shopperInteraction: 'Ecommerce',
|
|
2418
|
+
merchantAccount: this.credentials.MERCHANT_ACCOUNT,
|
|
2419
|
+
shopperReference: checkout.user.id,
|
|
2420
|
+
recurringProcessingModel: 'CardOnFile',
|
|
2421
|
+
returnUrl: this.credentials.URL_POSTBACK,
|
|
2422
|
+
installments: {
|
|
2423
|
+
value: card.installments,
|
|
2424
|
+
},
|
|
2425
|
+
};
|
|
2426
|
+
}
|
|
2427
|
+
addCard() {
|
|
2428
|
+
throw new Error('Method not implemented.');
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
class AntifraudBankSlipService {
|
|
2433
|
+
constructor(orderBlockedRepository) {
|
|
2434
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
2435
|
+
this.MAX_ORDER_VALUE = 5000;
|
|
2436
|
+
}
|
|
2437
|
+
async validate(checkout) {
|
|
2438
|
+
var _a, _b;
|
|
2439
|
+
if (checkout.totalPrice && checkout.totalPrice > this.MAX_ORDER_VALUE && !((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.isSubscriber)) {
|
|
2440
|
+
await this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'Boleto not authorized', 'Boleto', 'day');
|
|
2441
|
+
throw new FraudValidationError('Boleto não autorizado para cliente não assinante', {
|
|
2442
|
+
checkoutId: checkout.id,
|
|
2443
|
+
userEmail: checkout.user.email,
|
|
2444
|
+
info: {
|
|
2445
|
+
isSubscriber: (_b = checkout.user) === null || _b === void 0 ? void 0 : _b.isSubscriber,
|
|
2446
|
+
subtotal: checkout.subTotalPrice,
|
|
2447
|
+
total: checkout.totalPrice,
|
|
2448
|
+
},
|
|
2449
|
+
});
|
|
2450
|
+
}
|
|
2451
|
+
return true;
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
class AntifraudCardService {
|
|
2456
|
+
constructor(orderRepository, orderBlockedRepository) {
|
|
2457
|
+
this.orderRepository = orderRepository;
|
|
2458
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
2459
|
+
this.LIMIT_ORDERS_DAY = 2;
|
|
2460
|
+
this.LIMIT_ORDERS_WEEK = 7;
|
|
2461
|
+
this.LIMIT_BLOCKED_ORDERS_DAY = 5;
|
|
2462
|
+
}
|
|
2463
|
+
async validate(checkout, card) {
|
|
2464
|
+
var _a, _b;
|
|
2465
|
+
if (!(await this.verifyBlockedOrderAttempts(checkout, card)))
|
|
2466
|
+
throw new FraudValidationError('Cliente com mais de 5 compras negadas/bloqueadas no dia', {
|
|
2467
|
+
checkoutId: checkout.id,
|
|
2468
|
+
userEmail: checkout.user.email,
|
|
2469
|
+
info: {
|
|
2470
|
+
isSubscriber: (_a = checkout.user) === null || _a === void 0 ? void 0 : _a.isSubscriber,
|
|
2471
|
+
subtotal: checkout.subTotalPrice,
|
|
2472
|
+
total: checkout.totalPrice,
|
|
2473
|
+
},
|
|
2474
|
+
});
|
|
2475
|
+
if (!(await this.verifyDayAndWeekOrders(checkout, card)))
|
|
2476
|
+
throw new FraudValidationError('Cliente tentando comprar mais de 2 vezes no dia ou 7 vezes na semana', {
|
|
2477
|
+
checkoutId: checkout.id,
|
|
2478
|
+
userEmail: checkout.user.email,
|
|
2479
|
+
info: {
|
|
2480
|
+
isSubscriber: (_b = checkout.user) === null || _b === void 0 ? void 0 : _b.isSubscriber,
|
|
2481
|
+
subtotal: checkout.subTotalPrice,
|
|
2482
|
+
total: checkout.totalPrice,
|
|
2483
|
+
},
|
|
2484
|
+
});
|
|
2485
|
+
return true;
|
|
2486
|
+
}
|
|
2487
|
+
async verifyBlockedOrderAttempts(checkout, card) {
|
|
2488
|
+
var _a, _b, _c, _d;
|
|
2489
|
+
const day = `${dateFns.format(new Date(), 'YYYY-MM-DD')}T00:00:00`;
|
|
2490
|
+
const endOfDay = `${dateFns.format(new Date(), 'YYYY-MM-DD')}T23:59:59`;
|
|
2491
|
+
const ordersBlockedWithCpf = await this.orderBlockedRepository
|
|
2492
|
+
.find({
|
|
2493
|
+
filters: {
|
|
2494
|
+
customer: { cpf: { operator: exports.Where.EQUALS, value: (_a = checkout.user) === null || _a === void 0 ? void 0 : _a.cpf } },
|
|
2495
|
+
date: [
|
|
2496
|
+
{ operator: exports.Where.GTE, value: new Date(day) },
|
|
2497
|
+
{ operator: exports.Where.LTE, value: new Date(endOfDay) },
|
|
2498
|
+
],
|
|
2499
|
+
},
|
|
2500
|
+
})
|
|
2501
|
+
.then((data) => data.data);
|
|
2502
|
+
const ordersBlockedWithEmail = await this.orderBlockedRepository
|
|
2503
|
+
.find({
|
|
2504
|
+
filters: {
|
|
2505
|
+
customer: { email: { operator: exports.Where.EQUALS, value: (_b = checkout.user) === null || _b === void 0 ? void 0 : _b.email } },
|
|
2506
|
+
date: [
|
|
2507
|
+
{ operator: exports.Where.GTE, value: new Date(day) },
|
|
2508
|
+
{ operator: exports.Where.LTE, value: new Date(endOfDay) },
|
|
2509
|
+
],
|
|
2510
|
+
},
|
|
2511
|
+
})
|
|
2512
|
+
.then((data) => data.data);
|
|
2513
|
+
const ordersBlockedWithCep = await this.orderBlockedRepository
|
|
2514
|
+
.find({
|
|
2515
|
+
filters: {
|
|
2516
|
+
customer: { shippingAddress: { zip: { operator: exports.Where.EQUALS, value: (_c = checkout.shippingAddress) === null || _c === void 0 ? void 0 : _c.zip } } },
|
|
2517
|
+
date: [
|
|
2518
|
+
{ operator: exports.Where.GTE, value: new Date(day) },
|
|
2519
|
+
{ operator: exports.Where.LTE, value: new Date(endOfDay) },
|
|
2520
|
+
],
|
|
2521
|
+
},
|
|
2522
|
+
})
|
|
2523
|
+
.then((data) => data.data);
|
|
2524
|
+
const ordersBlockedWithPhone = await this.orderBlockedRepository
|
|
2525
|
+
.find({
|
|
2526
|
+
filters: {
|
|
2527
|
+
customer: { phoneNumber: { operator: exports.Where.EQUALS, value: (_d = checkout.user) === null || _d === void 0 ? void 0 : _d.phone } },
|
|
2528
|
+
date: [
|
|
2529
|
+
{ operator: exports.Where.GTE, value: new Date(day) },
|
|
2530
|
+
{ operator: exports.Where.LTE, value: new Date(endOfDay) },
|
|
2531
|
+
],
|
|
2532
|
+
},
|
|
2533
|
+
})
|
|
2534
|
+
.then((data) => data.data);
|
|
2535
|
+
const blockedUniqueEmails = ordersBlockedWithEmail.filter((e) => {
|
|
2536
|
+
var _a;
|
|
2537
|
+
return e.customer.cpf !== ((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.cpf);
|
|
2538
|
+
});
|
|
2539
|
+
const blockedUniqueCeps = ordersBlockedWithCep.filter((e) => {
|
|
2540
|
+
var _a, _b;
|
|
2541
|
+
return e.customer.cpf !== ((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.cpf) && e.customer.email !== ((_b = checkout.user) === null || _b === void 0 ? void 0 : _b.email);
|
|
2542
|
+
});
|
|
2543
|
+
const blockedUniquePhone = ordersBlockedWithPhone.filter((e) => {
|
|
2544
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2545
|
+
return (e.customer.cpf !== ((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.cpf) &&
|
|
2546
|
+
e.customer.email !== ((_b = checkout.user) === null || _b === void 0 ? void 0 : _b.email) &&
|
|
2547
|
+
((_d = (_c = e.customer.shippingAddress) === null || _c === void 0 ? void 0 : _c.zip) === null || _d === void 0 ? void 0 : _d.toString()) !== ((_f = (_e = checkout.shippingAddress) === null || _e === void 0 ? void 0 : _e.zip) === null || _f === void 0 ? void 0 : _f.toString()));
|
|
2548
|
+
});
|
|
2549
|
+
const blockedAttempts = ordersBlockedWithCpf
|
|
2550
|
+
.concat(blockedUniqueEmails)
|
|
2551
|
+
.concat(blockedUniqueCeps)
|
|
2552
|
+
.concat(blockedUniquePhone);
|
|
2553
|
+
if (blockedAttempts.length >= this.LIMIT_BLOCKED_ORDERS_DAY) {
|
|
2554
|
+
await this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'More than 5 attempts have failed', 'Failed attempts', 'day', card || null);
|
|
2555
|
+
return false;
|
|
2556
|
+
}
|
|
2557
|
+
return true;
|
|
2558
|
+
}
|
|
2559
|
+
async verifyDayAndWeekOrders(checkout, card) {
|
|
2560
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2561
|
+
const ordersPerDay = await this.validateOrdersByRange((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.cpf, (_b = checkout.user) === null || _b === void 0 ? void 0 : _b.email, (_c = checkout.user) === null || _c === void 0 ? void 0 : _c.phone, (_d = checkout.shippingAddress) === null || _d === void 0 ? void 0 : _d.zip, card, this.getDateRange('day'));
|
|
2562
|
+
for (const key in ordersPerDay) {
|
|
2563
|
+
if (ordersPerDay[key] > this.LIMIT_ORDERS_DAY) {
|
|
2564
|
+
await this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'Order limit', key, 'day');
|
|
2565
|
+
return false;
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
const ordersPerWeek = await this.validateOrdersByRange((_e = checkout.user) === null || _e === void 0 ? void 0 : _e.cpf, (_f = checkout.user) === null || _f === void 0 ? void 0 : _f.email, (_g = checkout.user) === null || _g === void 0 ? void 0 : _g.phone, (_h = checkout.shippingAddress) === null || _h === void 0 ? void 0 : _h.zip, card, this.getDateRange('week'));
|
|
2569
|
+
for (const key in ordersPerWeek) {
|
|
2570
|
+
if (ordersPerDay[key] > this.LIMIT_ORDERS_WEEK) {
|
|
2571
|
+
await this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'Order limit', key, 'week');
|
|
2572
|
+
return false;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
return true;
|
|
2576
|
+
}
|
|
2577
|
+
async validateOrdersByRange(cpf, email, phone, zip, card, range) {
|
|
2578
|
+
const ordersCpf = await this.countOrdersByField('user', 'cpf', cpf, range);
|
|
2579
|
+
const ordersByEmail = await this.countOrdersByField('user', 'email', email, range);
|
|
2580
|
+
const ordersByPhone = await this.countOrdersByField('user', 'phone', phone, range);
|
|
2581
|
+
const ordersByZip = await this.countOrdersByField('shippingAddress', 'zip', zip, range);
|
|
2582
|
+
return {
|
|
2583
|
+
cpf: ordersCpf,
|
|
2584
|
+
email: ordersByEmail,
|
|
2585
|
+
phone: ordersByPhone,
|
|
2586
|
+
zip: ordersByZip,
|
|
2587
|
+
};
|
|
2588
|
+
}
|
|
2589
|
+
async countOrdersByField(property, field, value, range) {
|
|
2590
|
+
const filters = {
|
|
2591
|
+
[property]: {
|
|
2592
|
+
[field]: value,
|
|
2593
|
+
},
|
|
2594
|
+
['createdAt']: [
|
|
2595
|
+
{ operator: exports.Where.GTE, value: range.firstDate },
|
|
2596
|
+
{ operator: exports.Where.LTE, value: range.lastDate },
|
|
2597
|
+
],
|
|
2598
|
+
};
|
|
2599
|
+
const docs = await (await this.orderRepository.find({ filters })).count;
|
|
2600
|
+
return docs;
|
|
2601
|
+
}
|
|
2602
|
+
getDateRange(range = 'day') {
|
|
2603
|
+
switch (range) {
|
|
2604
|
+
case 'day':
|
|
2605
|
+
return {
|
|
2606
|
+
firstDate: dateFns.startOfDay(new Date()).getTime(),
|
|
2607
|
+
lastDate: dateFns.endOfDay(new Date()).getTime(),
|
|
2608
|
+
};
|
|
2609
|
+
case 'week':
|
|
2610
|
+
return {
|
|
2611
|
+
firstDate: dateFns.startOfDay(dateFns.subDays(new Date(), 7)).getTime(),
|
|
2612
|
+
lastDate: dateFns.endOfDay(new Date()).getTime(),
|
|
2613
|
+
};
|
|
2614
|
+
default:
|
|
2615
|
+
return {
|
|
2616
|
+
firstDate: dateFns.startOfDay(new Date()).getTime(),
|
|
2617
|
+
lastDate: dateFns.endOfDay(new Date()).getTime(),
|
|
2618
|
+
};
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
class AntifraudGlampointsService {
|
|
2624
|
+
constructor() { }
|
|
2625
|
+
async validate(checkout) {
|
|
2626
|
+
return true;
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
class AntifraudPixService {
|
|
2631
|
+
constructor() { }
|
|
2632
|
+
async validate(checkout) {
|
|
2633
|
+
return true;
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
class GlampointsPaymentService {
|
|
2638
|
+
constructor(paymentRepository) {
|
|
2639
|
+
this.paymentRepository = paymentRepository;
|
|
2640
|
+
}
|
|
2641
|
+
async pay(checkout) {
|
|
2642
|
+
const payment = await this.paymentRepository.create(Payment.toInstance({
|
|
2643
|
+
createdAt: new Date(),
|
|
2644
|
+
updatedAt: new Date(),
|
|
2645
|
+
userId: checkout.user.id,
|
|
2646
|
+
checkoutId: checkout.id,
|
|
2647
|
+
totalPrice: checkout.totalPrice,
|
|
2648
|
+
paymentProvider: 'glampoints',
|
|
2649
|
+
transaction: {
|
|
2650
|
+
amount: 0,
|
|
2651
|
+
acquirerResponseCode: '0000',
|
|
2652
|
+
acquirerName: 'glampoints',
|
|
2653
|
+
authorizedAmount: 0,
|
|
2654
|
+
captureMethod: 'ecommerce',
|
|
2655
|
+
installments: 1,
|
|
2656
|
+
cost: 0,
|
|
2657
|
+
paidAmount: 0,
|
|
2658
|
+
paidAt: new Date().toISOString(),
|
|
2659
|
+
paymentMethod: 'glampoints',
|
|
2660
|
+
referer: 'api_key',
|
|
2661
|
+
refundedAmount: 0,
|
|
2662
|
+
status: 'paid',
|
|
2663
|
+
statusReason: 'acquirer',
|
|
2664
|
+
},
|
|
2665
|
+
}));
|
|
2666
|
+
return payment;
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
class PagarmeBankSlipService {
|
|
2671
|
+
constructor(credentials, paymentRepository) {
|
|
2672
|
+
this.credentials = credentials;
|
|
2673
|
+
this.paymentRepository = paymentRepository;
|
|
2674
|
+
}
|
|
2675
|
+
async pay(checkout) {
|
|
2676
|
+
try {
|
|
2677
|
+
const result = await axios__default["default"]({
|
|
2678
|
+
method: 'POST',
|
|
2679
|
+
url: this.credentials.URL_TRANSACTION,
|
|
2680
|
+
data: this.createBoletoPayment(checkout),
|
|
2681
|
+
});
|
|
2682
|
+
if (result.data.status !== 'processing') {
|
|
2683
|
+
return Promise.reject(new PaymentError(`Houve uma falha ao gerar o boleto. Tente novamente`, {
|
|
2684
|
+
checkoutId: checkout.id,
|
|
2685
|
+
userEmail: checkout.user.email,
|
|
2686
|
+
info: result.data,
|
|
2687
|
+
}));
|
|
2688
|
+
}
|
|
2689
|
+
const payment = await this.paymentRepository.create(Payment.toInstance({
|
|
2690
|
+
createdAt: new Date(),
|
|
2691
|
+
updatedAt: new Date(),
|
|
2692
|
+
userId: checkout.user.id,
|
|
2693
|
+
checkoutId: checkout.id,
|
|
2694
|
+
totalPrice: checkout.totalPrice,
|
|
2695
|
+
paymentProvider: 'pagarMe',
|
|
2696
|
+
transaction: result.data,
|
|
2697
|
+
}));
|
|
2698
|
+
return payment;
|
|
2699
|
+
}
|
|
2700
|
+
catch (error) {
|
|
2701
|
+
throw new PaymentError('Houve uma falha ao gerar o boleto. Tente novamente', {
|
|
2702
|
+
checkoutId: checkout.id,
|
|
2703
|
+
userEmail: checkout.user.email,
|
|
2704
|
+
info: error.response.data,
|
|
2705
|
+
});
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
createBoletoPayment(checkout) {
|
|
2709
|
+
return {
|
|
2710
|
+
api_key: this.credentials.API_KEY,
|
|
2711
|
+
amount: Math.floor(checkout.totalPrice * 100),
|
|
2712
|
+
boleto_rules: ['strict_expiration_date'],
|
|
2713
|
+
boleto_instructions: 'Sr. Caixa, NÃO aceitar o pagamento após o vencimento.',
|
|
2714
|
+
boleto_expiration_date: dateFns.format(dateFns.addDays(new Date(), 3), 'yyyy-MM-dd'),
|
|
2715
|
+
payment_method: 'boleto',
|
|
2716
|
+
postback_url: this.credentials.URL_POSTBACK,
|
|
2717
|
+
customer: {
|
|
2718
|
+
external_id: checkout.user.id,
|
|
2719
|
+
type: 'individual',
|
|
2720
|
+
country: 'br',
|
|
2721
|
+
name: checkout.user.displayName,
|
|
2722
|
+
documents: [
|
|
2723
|
+
{
|
|
2724
|
+
type: 'cpf',
|
|
2725
|
+
number: checkout.user.cpf,
|
|
2726
|
+
},
|
|
2727
|
+
],
|
|
2728
|
+
},
|
|
2729
|
+
};
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
class PagarmeCardService {
|
|
2734
|
+
constructor(credentials, paymentRepository, orderBlockedRepository) {
|
|
2735
|
+
this.credentials = credentials;
|
|
2736
|
+
this.paymentRepository = paymentRepository;
|
|
2737
|
+
this.orderBlockedRepository = orderBlockedRepository;
|
|
2738
|
+
}
|
|
2739
|
+
async pay(checkout, card) {
|
|
2740
|
+
var _a;
|
|
2741
|
+
try {
|
|
2742
|
+
const result = await axios__default["default"]({
|
|
2743
|
+
method: 'POST',
|
|
2744
|
+
url: this.credentials.URL_TRANSACTION,
|
|
2745
|
+
data: this.createCardPayment(checkout, card),
|
|
2746
|
+
});
|
|
2747
|
+
if (result.data.status !== 'paid') {
|
|
2748
|
+
await this.orderBlockedRepository.createBlockedOrderOrPayment(checkout, 'Card not authorized', 'Card', 'day', card);
|
|
2749
|
+
return Promise.reject(new PaymentError(`Seu pagamento com cartão não foi autorizado. Para não perder seus produtos, pague com PIX ou outro cartão de crédito`, {
|
|
2750
|
+
checkoutId: checkout.id,
|
|
2751
|
+
userEmail: checkout.user.email,
|
|
2752
|
+
info: result.data,
|
|
2753
|
+
}));
|
|
2754
|
+
}
|
|
2755
|
+
const payment = await this.paymentRepository.create(Payment.toInstance({
|
|
2756
|
+
createdAt: new Date(),
|
|
2757
|
+
updatedAt: new Date(),
|
|
2758
|
+
userId: checkout.user.id,
|
|
2759
|
+
checkoutId: checkout.id,
|
|
2760
|
+
totalPrice: checkout.totalPrice,
|
|
2761
|
+
paymentProvider: exports.PaymentProviders.PAGARME,
|
|
2762
|
+
transaction: Object.assign(Object.assign({}, result.data), { paidAt: new Date() }),
|
|
2763
|
+
}));
|
|
2764
|
+
return payment;
|
|
2765
|
+
}
|
|
2766
|
+
catch (error) {
|
|
2767
|
+
throw new PaymentError('Seu pagamento com cartão não foi autorizado. Para não perder seus produtos, pague com PIX ou outro cartão de crédito', {
|
|
2768
|
+
checkoutId: checkout.id,
|
|
2769
|
+
userEmail: checkout.user.email,
|
|
2770
|
+
info: (_a = error.response) === null || _a === void 0 ? void 0 : _a.data,
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
addCard() {
|
|
2775
|
+
throw new Error('Method not implemented.');
|
|
2776
|
+
}
|
|
2777
|
+
createCardPayment(checkout, card) {
|
|
2778
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2779
|
+
return {
|
|
2780
|
+
api_key: this.credentials.API_KEY,
|
|
2781
|
+
amount: Math.floor(checkout.totalPrice * 100),
|
|
2782
|
+
card_id: card.cardId,
|
|
2783
|
+
payment_method: 'credit_card',
|
|
2784
|
+
installments: card.installments,
|
|
2785
|
+
soft_descriptor: checkout.shop === exports.Shops.GLAMSHOP ? 'Glam' : "Men's Market",
|
|
2786
|
+
customer: {
|
|
2787
|
+
external_id: checkout.user.id,
|
|
2788
|
+
name: checkout.user.displayName,
|
|
2789
|
+
type: 'individual',
|
|
2790
|
+
country: 'br',
|
|
2791
|
+
email: checkout.user.email,
|
|
2792
|
+
phone_numbers: checkout.user.phone ? ['+55' + checkout.user.phone] : '',
|
|
2793
|
+
documents: [
|
|
2794
|
+
{
|
|
2795
|
+
type: 'cpf',
|
|
2796
|
+
number: checkout.user.cpf,
|
|
2797
|
+
},
|
|
2798
|
+
],
|
|
2799
|
+
},
|
|
2800
|
+
billing: {
|
|
2801
|
+
name: checkout.user.displayName,
|
|
2802
|
+
address: {
|
|
2803
|
+
country: 'br',
|
|
2804
|
+
state: checkout.billingAddress ? checkout.billingAddress.state : (_a = checkout.shippingAddress) === null || _a === void 0 ? void 0 : _a.state,
|
|
2805
|
+
city: checkout.billingAddress ? checkout.billingAddress.city : (_b = checkout.shippingAddress) === null || _b === void 0 ? void 0 : _b.city,
|
|
2806
|
+
neighborhood: checkout.billingAddress ? checkout.billingAddress.district : (_c = checkout.shippingAddress) === null || _c === void 0 ? void 0 : _c.district,
|
|
2807
|
+
street: checkout.billingAddress ? checkout.billingAddress.street : (_d = checkout.shippingAddress) === null || _d === void 0 ? void 0 : _d.street,
|
|
2808
|
+
street_number: checkout.billingAddress ? checkout.billingAddress.number : (_e = checkout.shippingAddress) === null || _e === void 0 ? void 0 : _e.number,
|
|
2809
|
+
zipcode: checkout.billingAddress
|
|
2810
|
+
? checkout.billingAddress.zip.replace('-', '')
|
|
2811
|
+
: (_f = checkout.shippingAddress) === null || _f === void 0 ? void 0 : _f.zip.replace('-', ''),
|
|
2812
|
+
},
|
|
2813
|
+
},
|
|
2814
|
+
items: checkout.lineItems.map((item) => {
|
|
2815
|
+
return {
|
|
2816
|
+
id: item.id,
|
|
2817
|
+
title: checkout.user.isSubscriber ? `${item.name} - ASSINANTE` : item.name,
|
|
2818
|
+
unit_price: Math.floor(item.pricePaid * 100),
|
|
2819
|
+
quantity: item.quantity,
|
|
2820
|
+
tangible: true,
|
|
2821
|
+
};
|
|
2822
|
+
}),
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
class PagarmePixService {
|
|
2828
|
+
constructor(credentials, paymentRepository) {
|
|
2829
|
+
this.credentials = credentials;
|
|
2830
|
+
this.paymentRepository = paymentRepository;
|
|
2831
|
+
}
|
|
2832
|
+
async pay(checkout) {
|
|
2833
|
+
var _a;
|
|
2834
|
+
try {
|
|
2835
|
+
const result = await axios__default["default"]({
|
|
2836
|
+
method: 'POST',
|
|
2837
|
+
url: this.credentials.URL_TRANSACTION,
|
|
2838
|
+
data: this.createPixPayment(checkout),
|
|
2839
|
+
});
|
|
2840
|
+
const payment = await this.paymentRepository.create(Payment.toInstance({
|
|
2841
|
+
createdAt: new Date(),
|
|
2842
|
+
updatedAt: new Date(),
|
|
2843
|
+
userId: checkout.user.id,
|
|
2844
|
+
checkoutId: checkout.id,
|
|
2845
|
+
totalPrice: checkout.totalPrice,
|
|
2846
|
+
paymentProvider: 'pagarMe',
|
|
2847
|
+
transaction: Object.assign(Object.assign({}, result.data), { paidAt: new Date() }),
|
|
2848
|
+
}));
|
|
2849
|
+
return payment;
|
|
2850
|
+
}
|
|
2851
|
+
catch (error) {
|
|
2852
|
+
throw new PaymentError('Houve uma falha ao processar pagamento com pix', {
|
|
2853
|
+
checkoutId: checkout.id,
|
|
2854
|
+
userEmail: checkout.user.email,
|
|
2855
|
+
info: (_a = error.response) === null || _a === void 0 ? void 0 : _a.data,
|
|
2856
|
+
});
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
createPixPayment(checkout) {
|
|
2860
|
+
return {
|
|
2861
|
+
payment_method: 'pix',
|
|
2862
|
+
amount: Math.floor(checkout.totalPrice * 100),
|
|
2863
|
+
api_key: this.credentials.API_KEY,
|
|
2864
|
+
postback_url: this.credentials.URL_POSTBACK,
|
|
2865
|
+
pix_expiration_date: dateFns.format(dateFns.addDays(new Date(), 1), 'yyyy-MM-dd'),
|
|
2866
|
+
customer: {
|
|
2867
|
+
external_id: checkout.user.id,
|
|
2868
|
+
type: 'individual',
|
|
2869
|
+
country: 'br',
|
|
2870
|
+
name: checkout.user.displayName,
|
|
2871
|
+
email: checkout.user.email.trim(),
|
|
2872
|
+
phone_numbers: checkout.user.phone ? ['+55' + checkout.user.phone] : '',
|
|
2873
|
+
documents: [
|
|
2874
|
+
{
|
|
2875
|
+
type: 'cpf',
|
|
2876
|
+
number: checkout.user.cpf,
|
|
2877
|
+
},
|
|
2878
|
+
],
|
|
2879
|
+
},
|
|
2880
|
+
};
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2232
2884
|
class RoundProductPricesHelper {
|
|
2233
2885
|
static roundProductPrices(product) {
|
|
2234
2886
|
product.price.price = Number(product.price.price.toFixed(2));
|
|
@@ -2249,6 +2901,12 @@ class LogDocument extends BaseModel {
|
|
|
2249
2901
|
}
|
|
2250
2902
|
}
|
|
2251
2903
|
|
|
2904
|
+
class Sequence extends BaseModel {
|
|
2905
|
+
static get identifiersFields() {
|
|
2906
|
+
return ['id'];
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2252
2910
|
exports.FilterType = void 0;
|
|
2253
2911
|
(function (FilterType) {
|
|
2254
2912
|
FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
|
|
@@ -2387,32 +3045,6 @@ class ShopSettings extends BaseModel {
|
|
|
2387
3045
|
}
|
|
2388
3046
|
}
|
|
2389
3047
|
|
|
2390
|
-
class InvalidArgumentError extends tsCustomError.CustomError {
|
|
2391
|
-
constructor(message) {
|
|
2392
|
-
super(message);
|
|
2393
|
-
}
|
|
2394
|
-
}
|
|
2395
|
-
|
|
2396
|
-
class RequiredArgumentError extends tsCustomError.CustomError {
|
|
2397
|
-
constructor(args) {
|
|
2398
|
-
super(`Required arguments: ${args.join(', ')}`);
|
|
2399
|
-
this.args = args;
|
|
2400
|
-
this.arguments = args;
|
|
2401
|
-
}
|
|
2402
|
-
}
|
|
2403
|
-
|
|
2404
|
-
class NotFoundError extends tsCustomError.CustomError {
|
|
2405
|
-
constructor(message) {
|
|
2406
|
-
super(message);
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
|
|
2410
|
-
class DuplicatedResultsError extends tsCustomError.CustomError {
|
|
2411
|
-
constructor(message) {
|
|
2412
|
-
super(message);
|
|
2413
|
-
}
|
|
2414
|
-
}
|
|
2415
|
-
|
|
2416
3048
|
class AxiosAdapter {
|
|
2417
3049
|
constructor(config) {
|
|
2418
3050
|
this.config = config;
|
|
@@ -3311,6 +3943,17 @@ class LogFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore
|
|
|
3311
3943
|
}
|
|
3312
3944
|
}
|
|
3313
3945
|
|
|
3946
|
+
class SequenceFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3947
|
+
constructor({ firestore, interceptors }) {
|
|
3948
|
+
super({
|
|
3949
|
+
firestore,
|
|
3950
|
+
collectionName: 'sequences',
|
|
3951
|
+
model: Sequence,
|
|
3952
|
+
interceptors,
|
|
3953
|
+
});
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3314
3957
|
class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3315
3958
|
constructor({ firestore, interceptors }) {
|
|
3316
3959
|
super({
|
|
@@ -4452,7 +5095,6 @@ const withFindHasuraGraphQL = (MixinBase) => {
|
|
|
4452
5095
|
return class FindHasuraGraphQLMixin extends MixinBase {
|
|
4453
5096
|
constructor() {
|
|
4454
5097
|
super(...arguments);
|
|
4455
|
-
this.lastDistinct = {};
|
|
4456
5098
|
this.bindOrderByAttributes = (orderBy, fields) => Object.keys(orderBy).reduce((acc, current) => [
|
|
4457
5099
|
...acc,
|
|
4458
5100
|
{
|
|
@@ -4488,10 +5130,9 @@ const withFindHasuraGraphQL = (MixinBase) => {
|
|
|
4488
5130
|
});
|
|
4489
5131
|
}
|
|
4490
5132
|
async find(params) {
|
|
4491
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
5133
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4492
5134
|
this.logger = DebugHelper.from(this, 'find');
|
|
4493
5135
|
const { filters, limits, orderBy, options } = params || {};
|
|
4494
|
-
const tableFiltersNamed = `${this.tableName}:${JSON.stringify(filters)}`;
|
|
4495
5136
|
const enableCount = (_a = options === null || options === void 0 ? void 0 : options.enableCount) !== null && _a !== void 0 ? _a : true;
|
|
4496
5137
|
const variablesFilters = lodash.isNil(filters)
|
|
4497
5138
|
? {}
|
|
@@ -4542,8 +5183,8 @@ const withFindHasuraGraphQL = (MixinBase) => {
|
|
|
4542
5183
|
},
|
|
4543
5184
|
]
|
|
4544
5185
|
: []),
|
|
4545
|
-
...((!
|
|
4546
|
-
((
|
|
5186
|
+
...((!((_b = params.limits) === null || _b === void 0 ? void 0 : _b.offset) &&
|
|
5187
|
+
((_d = (_c = params.options) === null || _c === void 0 ? void 0 : _c.distinct) === null || _d === void 0 ? void 0 : _d.map((distinct) => {
|
|
4547
5188
|
var _a, _b;
|
|
4548
5189
|
const distinctOption = (_a = this.fields.find((fieldOption) => fieldOption === distinct)) !== null && _a !== void 0 ? _a : this.fields.find((fieldOption) => Object.keys(fieldOption).shift() === distinct);
|
|
4549
5190
|
const fieldName = ((_b = Object.values(distinctOption).shift()) === null || _b === void 0 ? void 0 : _b.columnName) || distinct;
|
|
@@ -4564,27 +5205,28 @@ const withFindHasuraGraphQL = (MixinBase) => {
|
|
|
4564
5205
|
[]),
|
|
4565
5206
|
]);
|
|
4566
5207
|
const data = result[this.tableName].map((row) => this.convertDataFromHasura(row));
|
|
4567
|
-
return Object.assign(Object.assign(Object.assign({ data, count: enableCount ? result[`${this.tableName}_aggregate`].aggregate.count : Infinity }, (((
|
|
5208
|
+
return Object.assign(Object.assign(Object.assign({ data, count: enableCount ? result[`${this.tableName}_aggregate`].aggregate.count : Infinity }, (((_e = options === null || options === void 0 ? void 0 : options.minimal) === null || _e === void 0 ? void 0 : _e.length)
|
|
4568
5209
|
? {
|
|
4569
5210
|
minimal: options.minimal.reduce((minimals, current) => {
|
|
4570
5211
|
var _a;
|
|
4571
5212
|
return (Object.assign(Object.assign({}, minimals), lodash.set(minimals, current, result[`${this.tableName}_aggregate`].aggregate.min[((_a = AttributeOptionHelper.FindByAttribute(current.toString().split('.').pop(), this.fields)) === null || _a === void 0 ? void 0 : _a.columnName) || current])));
|
|
4572
5213
|
}, {}),
|
|
4573
5214
|
}
|
|
4574
|
-
: {})), (((
|
|
5215
|
+
: {})), (((_f = options === null || options === void 0 ? void 0 : options.maximum) === null || _f === void 0 ? void 0 : _f.length)
|
|
4575
5216
|
? {
|
|
4576
5217
|
maximum: options.maximum.reduce((maximums, current) => {
|
|
4577
5218
|
var _a;
|
|
4578
5219
|
return (Object.assign(Object.assign({}, maximums), lodash.set(maximums, current, result[`${this.tableName}_aggregate`].aggregate.max[((_a = AttributeOptionHelper.FindByAttribute(current.toString().split('.').pop(), this.fields)) === null || _a === void 0 ? void 0 : _a.columnName) || current])));
|
|
4579
5220
|
}, {}),
|
|
4580
5221
|
}
|
|
4581
|
-
: {})), (((
|
|
4582
|
-
|
|
5222
|
+
: {})), (!((_g = params.limits) === null || _g === void 0 ? void 0 : _g.offset) &&
|
|
5223
|
+
((_h = options === null || options === void 0 ? void 0 : options.distinct) === null || _h === void 0 ? void 0 : _h.length) && {
|
|
5224
|
+
distinct: options === null || options === void 0 ? void 0 : options.distinct.reduce((distinct, current) => {
|
|
4583
5225
|
var _a, _b;
|
|
4584
5226
|
const distinctOption = (_a = this.fields.find((fieldOption) => fieldOption === current)) !== null && _a !== void 0 ? _a : this.fields.find((fieldOption) => Object.keys(fieldOption).shift() === current);
|
|
4585
5227
|
const fieldName = ((_b = Object.values(distinctOption).shift()) === null || _b === void 0 ? void 0 : _b.columnName) || current;
|
|
4586
5228
|
return Object.assign(Object.assign({}, distinct), { [current.toString()]: result[`${this.tableName}_${current.toString()}_distinct`].map((obj) => obj[fieldName]) });
|
|
4587
|
-
}, {})
|
|
5229
|
+
}, {}),
|
|
4588
5230
|
}));
|
|
4589
5231
|
}
|
|
4590
5232
|
};
|
|
@@ -6651,6 +7293,10 @@ Object.defineProperty(exports, 'sub', {
|
|
|
6651
7293
|
enumerable: true,
|
|
6652
7294
|
get: function () { return dateFns.sub; }
|
|
6653
7295
|
});
|
|
7296
|
+
Object.defineProperty(exports, 'subDays', {
|
|
7297
|
+
enumerable: true,
|
|
7298
|
+
get: function () { return dateFns.subDays; }
|
|
7299
|
+
});
|
|
6654
7300
|
Object.defineProperty(exports, 'chunk', {
|
|
6655
7301
|
enumerable: true,
|
|
6656
7302
|
get: function () { return lodash.chunk; }
|
|
@@ -6724,6 +7370,13 @@ Object.defineProperty(exports, 'unset', {
|
|
|
6724
7370
|
get: function () { return lodash.unset; }
|
|
6725
7371
|
});
|
|
6726
7372
|
exports.Address = Address;
|
|
7373
|
+
exports.AdyenCardService = AdyenCardService;
|
|
7374
|
+
exports.AdyenPaymentMethodFactory = AdyenPaymentMethodFactory;
|
|
7375
|
+
exports.AntifraudBankSlipService = AntifraudBankSlipService;
|
|
7376
|
+
exports.AntifraudCardService = AntifraudCardService;
|
|
7377
|
+
exports.AntifraudGlampointsService = AntifraudGlampointsService;
|
|
7378
|
+
exports.AntifraudPixService = AntifraudPixService;
|
|
7379
|
+
exports.AntifraudProviderFactory = AntifraudProviderFactory;
|
|
6727
7380
|
exports.Authentication = Authentication;
|
|
6728
7381
|
exports.AuthenticationFirebaseAuthService = AuthenticationFirebaseAuthService;
|
|
6729
7382
|
exports.AxiosAdapter = AxiosAdapter;
|
|
@@ -6731,6 +7384,7 @@ exports.Base = Base;
|
|
|
6731
7384
|
exports.BaseModel = BaseModel;
|
|
6732
7385
|
exports.BeautyProfile = BeautyProfile;
|
|
6733
7386
|
exports.BeautyQuestionsHelper = BeautyQuestionsHelper;
|
|
7387
|
+
exports.BusinessError = BusinessError;
|
|
6734
7388
|
exports.Buy2Win = Buy2Win;
|
|
6735
7389
|
exports.Buy2WinFirestoreRepository = Buy2WinFirestoreRepository;
|
|
6736
7390
|
exports.Campaign = Campaign;
|
|
@@ -6768,6 +7422,9 @@ exports.FilterHasuraGraphQLRepository = FilterHasuraGraphQLRepository;
|
|
|
6768
7422
|
exports.FilterOption = FilterOption;
|
|
6769
7423
|
exports.FilterOptionHasuraGraphQLRepository = FilterOptionHasuraGraphQLRepository;
|
|
6770
7424
|
exports.FirebaseFileUploaderService = FirebaseFileUploaderService;
|
|
7425
|
+
exports.FraudValidationError = FraudValidationError;
|
|
7426
|
+
exports.GlampointsPaymentMethodFactory = GlampointsPaymentMethodFactory;
|
|
7427
|
+
exports.GlampointsPaymentService = GlampointsPaymentService;
|
|
6771
7428
|
exports.Home = Home;
|
|
6772
7429
|
exports.HomeFirestoreRepository = HomeFirestoreRepository;
|
|
6773
7430
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
@@ -6786,8 +7443,15 @@ exports.Order = Order;
|
|
|
6786
7443
|
exports.OrderBlocked = OrderBlocked;
|
|
6787
7444
|
exports.OrderBlockedFirestoreRepository = OrderBlockedFirestoreRepository;
|
|
6788
7445
|
exports.OrderFirestoreRepository = OrderFirestoreRepository;
|
|
7446
|
+
exports.PagarmeBankSlipService = PagarmeBankSlipService;
|
|
7447
|
+
exports.PagarmeCardService = PagarmeCardService;
|
|
7448
|
+
exports.PagarmePaymentMethodFactory = PagarmePaymentMethodFactory;
|
|
7449
|
+
exports.PagarmePixService = PagarmePixService;
|
|
6789
7450
|
exports.Payment = Payment;
|
|
7451
|
+
exports.PaymentError = PaymentError;
|
|
6790
7452
|
exports.PaymentFirestoreRepository = PaymentFirestoreRepository;
|
|
7453
|
+
exports.PaymentProviderFactory = PaymentProviderFactory;
|
|
7454
|
+
exports.PaymentTransaction = PaymentTransaction;
|
|
6791
7455
|
exports.Product = Product;
|
|
6792
7456
|
exports.ProductFirestoreRepository = ProductFirestoreRepository;
|
|
6793
7457
|
exports.ProductHasuraGraphQL = ProductHasuraGraphQL;
|
|
@@ -6805,12 +7469,16 @@ exports.Register = Register;
|
|
|
6805
7469
|
exports.RegisterFirebaseAuthService = RegisterFirebaseAuthService;
|
|
6806
7470
|
exports.RequiredArgumentError = RequiredArgumentError;
|
|
6807
7471
|
exports.RoundProductPricesHelper = RoundProductPricesHelper;
|
|
7472
|
+
exports.Sequence = Sequence;
|
|
7473
|
+
exports.SequenceFirestoreRepository = SequenceFirestoreRepository;
|
|
6808
7474
|
exports.ShippingMethod = ShippingMethod;
|
|
6809
7475
|
exports.ShopMenu = ShopMenu;
|
|
6810
7476
|
exports.ShopMenuFirestoreRepository = ShopMenuFirestoreRepository;
|
|
6811
7477
|
exports.ShopSettings = ShopSettings;
|
|
6812
7478
|
exports.ShopSettingsFirestoreRepository = ShopSettingsFirestoreRepository;
|
|
6813
7479
|
exports.SignOut = SignOut;
|
|
7480
|
+
exports.StockLimitError = StockLimitError;
|
|
7481
|
+
exports.StockOutError = StockOutError;
|
|
6814
7482
|
exports.Subscription = Subscription;
|
|
6815
7483
|
exports.SubscriptionEditionFirestoreRepository = SubscriptionEditionFirestoreRepository;
|
|
6816
7484
|
exports.SubscriptionFirestoreRepository = SubscriptionFirestoreRepository;
|