@infrab4a/connect 5.3.0-beta.26 → 5.3.0-beta.27

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.
Files changed (42) hide show
  1. package/index.cjs.js +403 -66
  2. package/index.esm.js +399 -67
  3. package/package.json +1 -1
  4. package/src/domain/catalog/models/enums/shops.enum.d.ts +2 -0
  5. package/src/domain/catalog/models/types/product-competitors-price.d.ts +3 -2
  6. package/src/domain/catalog/repositories/category-product.repository.d.ts +2 -0
  7. package/src/domain/shop-settings/enums/shop-page-name.enum.d.ts +2 -1
  8. package/src/domain/shop-settings/models/shop-page-settings.d.ts +4 -1
  9. package/src/domain/shop-settings/models/types/shop-page-section.type.d.ts +140 -0
  10. package/src/domain/shopping/models/enums/index.d.ts +3 -0
  11. package/src/domain/shopping/models/enums/order-status.enum.d.ts +2 -1
  12. package/src/domain/shopping/models/enums/shopping-recurrence-cycle.enum.d.ts +5 -0
  13. package/src/domain/shopping/models/enums/shopping-recurrence-edition-status.enum.d.ts +11 -0
  14. package/src/domain/shopping/models/enums/shopping-recurrence-status.enum.d.ts +7 -0
  15. package/src/domain/shopping/models/index.d.ts +1 -0
  16. package/src/domain/shopping/models/order.d.ts +12 -0
  17. package/src/domain/shopping/models/recurrence/index.d.ts +2 -0
  18. package/src/domain/shopping/models/recurrence/shopping-recurrence-edition.d.ts +18 -0
  19. package/src/domain/shopping/models/recurrence/shopping-recurrence.d.ts +45 -0
  20. package/src/domain/shopping/models/shipping-method.d.ts +2 -0
  21. package/src/domain/shopping/models/types/index.d.ts +1 -0
  22. package/src/domain/shopping/models/types/line-item-recurrence.type.d.ts +2 -0
  23. package/src/domain/shopping/repositories/index.d.ts +1 -0
  24. package/src/domain/shopping/repositories/recurrence/index.d.ts +2 -0
  25. package/src/domain/shopping/repositories/recurrence/shopping-recurrence-edition.repository.d.ts +4 -0
  26. package/src/domain/shopping/repositories/recurrence/shopping-recurrence.repository.d.ts +9 -0
  27. package/src/domain/shopping/types/create-recurrency-payload.type.d.ts +8 -0
  28. package/src/domain/shopping/types/index.d.ts +1 -0
  29. package/src/domain/shopping/types/payment-card-info.type.d.ts +5 -3
  30. package/src/infra/firebase/firestore/repositories/shopping/index.d.ts +2 -0
  31. package/src/infra/firebase/firestore/repositories/shopping/shopping-recurrence-edition-firestore.repository.d.ts +7 -0
  32. package/src/infra/firebase/firestore/repositories/shopping/shopping-recurrence-firestore.repository.d.ts +10 -0
  33. package/src/infra/hasura-graphql/repositories/catalog/category-product-hasura-graphql.repository.d.ts +2 -0
  34. package/src/infra/mercado-pago/adapters/mercado-pago-base-axios.d.ts +11 -0
  35. package/src/infra/mercado-pago/adapters/mercado-pago-card-payment-axios.adapter.d.ts +5 -4
  36. package/src/infra/mercado-pago/adapters/mercado-pago-pix-payment-axios.adapter.d.ts +4 -3
  37. package/src/infra/mercado-pago/types/mercado-pago-response.type.d.ts +23 -0
  38. package/src/infra/pagarme/adapters/v5/index.d.ts +1 -0
  39. package/src/infra/pagarme/adapters/v5/pagarmev5-base-axios.d.ts +11 -0
  40. package/src/infra/pagarme/adapters/v5/pagarmev5-card-payment-axios.adapter.d.ts +5 -4
  41. package/src/infra/pagarme/adapters/v5/pagarmev5-pix-payment-axios.adapter.d.ts +4 -3
  42. package/src/infra/pagarme/types/v5/pagarmev5-order-response.type.d.ts +115 -0
package/index.esm.js CHANGED
@@ -691,6 +691,8 @@ var Shops;
691
691
  Shops["MENSMARKET"] = "mensmarket";
692
692
  Shops["GLAMSHOP"] = "Glamshop";
693
693
  Shops["GLAMPOINTS"] = "Glampoints";
694
+ Shops["GLAMBEAUTY"] = "Glambeauty";
695
+ Shops["ELLA"] = "ella";
694
696
  Shops["ALL"] = "ALL";
695
697
  })(Shops || (Shops = {}));
696
698
 
@@ -1667,8 +1669,38 @@ var OrderStatus;
1667
1669
  OrderStatus["ENTREGUE"] = "Entregue";
1668
1670
  OrderStatus["CANCELADO"] = "Cancelado";
1669
1671
  OrderStatus["PENDENTE_REENVIO"] = "Pendente reenvio";
1672
+ OrderStatus["AGUARDANDO_STOCK_REENVIO"] = "Aguardando stock para reenvio";
1670
1673
  })(OrderStatus || (OrderStatus = {}));
1671
1674
 
1675
+ var ShoppingRecurrenceCycle;
1676
+ (function (ShoppingRecurrenceCycle) {
1677
+ ShoppingRecurrenceCycle[ShoppingRecurrenceCycle["MONTHLY"] = 1] = "MONTHLY";
1678
+ ShoppingRecurrenceCycle[ShoppingRecurrenceCycle["BIMONTHLY"] = 2] = "BIMONTHLY";
1679
+ ShoppingRecurrenceCycle[ShoppingRecurrenceCycle["QUARTERLY"] = 3] = "QUARTERLY";
1680
+ })(ShoppingRecurrenceCycle || (ShoppingRecurrenceCycle = {}));
1681
+
1682
+ var ShoppingRecurrenceEditionStatus;
1683
+ (function (ShoppingRecurrenceEditionStatus) {
1684
+ ShoppingRecurrenceEditionStatus["SCHEDULED"] = "scheduled";
1685
+ ShoppingRecurrenceEditionStatus["PAUSED"] = "paused";
1686
+ ShoppingRecurrenceEditionStatus["SKIPPED"] = "skipped";
1687
+ ShoppingRecurrenceEditionStatus["PROCESSING"] = "processing";
1688
+ ShoppingRecurrenceEditionStatus["FINISHED"] = "finished";
1689
+ ShoppingRecurrenceEditionStatus["PAYMENT_FAIL"] = "payment_fail";
1690
+ ShoppingRecurrenceEditionStatus["AWAITING_PAYMENT"] = "awaiting_payment";
1691
+ ShoppingRecurrenceEditionStatus["STOCK_VALIDATION"] = "stock_validation";
1692
+ ShoppingRecurrenceEditionStatus["CANCELLED"] = "cancelled";
1693
+ })(ShoppingRecurrenceEditionStatus || (ShoppingRecurrenceEditionStatus = {}));
1694
+
1695
+ var ShoppingRecurrenceStatus;
1696
+ (function (ShoppingRecurrenceStatus) {
1697
+ ShoppingRecurrenceStatus["ACTIVE"] = "active";
1698
+ ShoppingRecurrenceStatus["PAUSED"] = "paused";
1699
+ ShoppingRecurrenceStatus["CANCELLED"] = "cancelled";
1700
+ ShoppingRecurrenceStatus["PAYMENT_FAILED"] = "payment_failed";
1701
+ ShoppingRecurrenceStatus["WAITING_STOCK"] = "waiting_stock";
1702
+ })(ShoppingRecurrenceStatus || (ShoppingRecurrenceStatus = {}));
1703
+
1672
1704
  class Order extends Checkout {
1673
1705
  }
1674
1706
  __decorate([
@@ -1682,6 +1714,38 @@ class OrderBlocked extends BaseModel {
1682
1714
  }
1683
1715
  }
1684
1716
 
1717
+ class ShoppingRecurrence extends BaseModel {
1718
+ static get identifiersFields() {
1719
+ return ['id'];
1720
+ }
1721
+ }
1722
+ __decorate([
1723
+ Type(() => User),
1724
+ __metadata("design:type", User)
1725
+ ], ShoppingRecurrence.prototype, "user", void 0);
1726
+ __decorate([
1727
+ Type(() => UserAddress),
1728
+ __metadata("design:type", UserAddress)
1729
+ ], ShoppingRecurrence.prototype, "shippingAddress", void 0);
1730
+ __decorate([
1731
+ Type(() => UserAddress),
1732
+ __metadata("design:type", UserAddress)
1733
+ ], ShoppingRecurrence.prototype, "billingAddress", void 0);
1734
+ __decorate([
1735
+ Type(() => ShippingMethod),
1736
+ __metadata("design:type", ShippingMethod)
1737
+ ], ShoppingRecurrence.prototype, "shipping", void 0);
1738
+ __decorate([
1739
+ Type(() => Coupon),
1740
+ __metadata("design:type", Coupon)
1741
+ ], ShoppingRecurrence.prototype, "coupon", void 0);
1742
+
1743
+ class ShoppingRecurrenceEdition extends BaseModel {
1744
+ static get identifiersFields() {
1745
+ return ['id'];
1746
+ }
1747
+ }
1748
+
1685
1749
  class CheckoutSubscription extends BaseModel {
1686
1750
  static get identifiersFields() {
1687
1751
  return ['id'];
@@ -2316,6 +2380,7 @@ var ShopPageName;
2316
2380
  ShopPageName["LP_GLAMQUEENS"] = "LP_GLAMQUEENS";
2317
2381
  ShopPageName["LP_INVITE"] = "LP_INVITE";
2318
2382
  ShopPageName["LP_LIVELO"] = "LP_LIVELO";
2383
+ ShopPageName["GLAM_NEW_HOME"] = "GLAM_NEW_HOME";
2319
2384
  })(ShopPageName || (ShopPageName = {}));
2320
2385
 
2321
2386
  class BeautyQuestionsHelper {
@@ -2393,10 +2458,88 @@ class ShopMenu extends BaseModel {
2393
2458
  }
2394
2459
  }
2395
2460
 
2461
+ var ShopPageSectionType;
2462
+ (function (ShopPageSectionType) {
2463
+ ShopPageSectionType["LIVE"] = "LIVE";
2464
+ ShopPageSectionType["CAROUSEL"] = "CAROUSEL";
2465
+ ShopPageSectionType["BANNER"] = "BANNER";
2466
+ ShopPageSectionType["INFOBARS"] = "INFOBARS";
2467
+ ShopPageSectionType["HIGHLIGHTS"] = "HIGHLIGHTS";
2468
+ ShopPageSectionType["SUBSCRIBER_INFO"] = "SUBSCRIBER_INFO";
2469
+ ShopPageSectionType["COLLECTION"] = "COLLECTION";
2470
+ ShopPageSectionType["BEAUTY_PROFILE_COLLECTION"] = "BEAUTY_PROFILE_COLLECTION";
2471
+ ShopPageSectionType["PLANS"] = "PLANS";
2472
+ ShopPageSectionType["SINGLE_PLAN"] = "SINGLE_PLAN";
2473
+ ShopPageSectionType["BRANDS"] = "BRANDS";
2474
+ ShopPageSectionType["NEWSLETTER"] = "NEWSLETTER";
2475
+ })(ShopPageSectionType || (ShopPageSectionType = {}));
2476
+
2477
+ /* eslint-disable max-lines-per-function */
2396
2478
  class ShopSettings extends BaseModel {
2397
2479
  static get identifiersFields() {
2398
2480
  return ['id'];
2399
2481
  }
2482
+ getPageSections(displayRules) {
2483
+ const now = new Date();
2484
+ return (Array.isArray(this.sections) ? this.sections : [])
2485
+ .map((section) => {
2486
+ // Filtra banners dentro de carrousel
2487
+ if (section.type === ShopPageSectionType.CAROUSEL && Array.isArray(section.banners)) {
2488
+ const filteredBanners = section.banners.filter((banner) => {
2489
+ // Filtra por displayRules
2490
+ const rulesMatch = banner.displayRules.length
2491
+ ? banner.displayRules.some((rule) => Object.keys(rule).every((key) => rule[key] === displayRules[key]))
2492
+ : true;
2493
+ // Filtra por publishDate e expirationDate
2494
+ const publishOk = !banner.publishDate || now >= new Date(banner.publishDate);
2495
+ const expireOk = !banner.expirationDate || now <= new Date(banner.expirationDate);
2496
+ return rulesMatch && publishOk && expireOk;
2497
+ });
2498
+ return { ...section, banners: filteredBanners };
2499
+ }
2500
+ // Filtra highlights
2501
+ if (section.type === ShopPageSectionType.HIGHLIGHTS && Array.isArray(section.highlights)) {
2502
+ const filteredHighlights = section.highlights.filter((highlight) => {
2503
+ // Filtra por displayRules
2504
+ const rulesMatch = highlight.displayRules.length
2505
+ ? highlight.displayRules.some((rule) => Object.keys(rule).every((key) => rule[key] === displayRules[key]))
2506
+ : true;
2507
+ return rulesMatch;
2508
+ });
2509
+ const sortedHighlights = !displayRules.beautyProfile
2510
+ ? filteredHighlights.sort((a, b) => (a.starred === b.starred ? 0 : a.starred ? -1 : 1))
2511
+ : filteredHighlights;
2512
+ return { ...section, highlights: sortedHighlights };
2513
+ }
2514
+ // Filtra collections
2515
+ if (section.type === ShopPageSectionType.COLLECTION) {
2516
+ const rulesMatch = section.displayRules.length
2517
+ ? section.displayRules.some((rule) => Object.keys(rule).every((key) => rule[key] === displayRules[key]))
2518
+ : true;
2519
+ const publishOk = !section.publishDate || now >= new Date(section.publishDate);
2520
+ const expireOk = !section.expirationDate || now <= new Date(section.expirationDate);
2521
+ return rulesMatch && publishOk && expireOk ? section : null;
2522
+ }
2523
+ // Filtra banners
2524
+ if (section.type === ShopPageSectionType.BANNER) {
2525
+ const rulesMatch = section.displayRules.length
2526
+ ? section.displayRules.some((rule) => Object.keys(rule).every((key) => rule[key] === displayRules[key]))
2527
+ : true;
2528
+ const publishOk = !section.publishDate || now >= new Date(section.publishDate);
2529
+ const expireOk = !section.expirationDate || now <= new Date(section.expirationDate);
2530
+ return rulesMatch && publishOk && expireOk ? section : null;
2531
+ }
2532
+ if (section.type === ShopPageSectionType.LIVE) {
2533
+ return section.active ? section : null;
2534
+ }
2535
+ if (section.type === ShopPageSectionType.PLANS || section.type === ShopPageSectionType.SINGLE_PLAN) {
2536
+ return displayRules.notSubscriber ? section : null;
2537
+ }
2538
+ // Demais seções retornam normalmente
2539
+ return section;
2540
+ })
2541
+ .filter(Boolean);
2542
+ }
2400
2543
  }
2401
2544
 
2402
2545
  class AdyenBlockedOrderHelper {
@@ -5403,6 +5546,62 @@ class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFires
5403
5546
  }
5404
5547
  }
5405
5548
 
5549
+ class ShoppingRecurrenceEditionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
5550
+ constructor({ firestore, interceptors, cache, }) {
5551
+ super({
5552
+ firestore,
5553
+ collectionName: 'shoppingRecurrenceEditions',
5554
+ model: ShoppingRecurrenceEdition,
5555
+ interceptors,
5556
+ cache,
5557
+ });
5558
+ }
5559
+ }
5560
+
5561
+ class ShoppingRecurrenceFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
5562
+ constructor({ firestore, interceptors, cache, }) {
5563
+ super({
5564
+ firestore,
5565
+ collectionName: 'shoppingRecurrences',
5566
+ model: ShoppingRecurrence,
5567
+ interceptors,
5568
+ cache,
5569
+ });
5570
+ }
5571
+ async findByUserId(userId) {
5572
+ const result = await this.find({
5573
+ filters: {
5574
+ user: {
5575
+ id: userId,
5576
+ },
5577
+ },
5578
+ });
5579
+ return result.data;
5580
+ }
5581
+ async findByUserIdAndStatus(userId, status) {
5582
+ const result = await this.find({
5583
+ filters: {
5584
+ user: {
5585
+ id: userId,
5586
+ },
5587
+ status,
5588
+ },
5589
+ });
5590
+ return result.data;
5591
+ }
5592
+ async findByUserAndShop(userId, shop) {
5593
+ const result = await this.find({
5594
+ filters: {
5595
+ user: {
5596
+ id: userId,
5597
+ },
5598
+ shop,
5599
+ },
5600
+ });
5601
+ return result.data;
5602
+ }
5603
+ }
5604
+
5406
5605
  class SubscriptionPlanFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
5407
5606
  constructor({ firestore, interceptors, cache, }) {
5408
5607
  super({
@@ -7207,6 +7406,26 @@ class CategoryProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withH
7207
7406
  },
7208
7407
  });
7209
7408
  }
7409
+ async removeProductFromAllCategories(productId) {
7410
+ this.logger = DebugHelper.from(this, 'removeProductFromAllCategories');
7411
+ await this.mutation('delete_category_product', ['affected_rows'], {
7412
+ where: {
7413
+ type: 'category_product_bool_exp',
7414
+ required: true,
7415
+ value: { product_id: { _eq: productId } },
7416
+ },
7417
+ });
7418
+ }
7419
+ async removeCategoryFromAllProducts(categoryId) {
7420
+ this.logger = DebugHelper.from(this, 'removeCategoryFromAllProducts');
7421
+ await this.mutation('delete_category_product', ['affected_rows'], {
7422
+ where: {
7423
+ type: 'category_product_bool_exp',
7424
+ required: true,
7425
+ value: { category_id: { _eq: categoryId } },
7426
+ },
7427
+ });
7428
+ }
7210
7429
  }
7211
7430
 
7212
7431
  const fieldsConfiguration$3 = [
@@ -9537,7 +9756,7 @@ class MercadoPagoRequestHelper {
9537
9756
  checkoutId: checkout.id,
9538
9757
  },
9539
9758
  payer: this.buildPayer(checkout, card),
9540
- statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'Glam' : 'Mens Market',
9759
+ statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'loja glam' : 'mens market',
9541
9760
  additional_info: {
9542
9761
  items: this.buildItems(checkout),
9543
9762
  },
@@ -9753,8 +9972,113 @@ class MercadoPagoBankSlipAxiosAdapter {
9753
9972
  }
9754
9973
  }
9755
9974
 
9756
- class MercadoPagoCardAxiosAdapter {
9975
+ var MercadoPagoStatusDetailEnum;
9976
+ (function (MercadoPagoStatusDetailEnum) {
9977
+ MercadoPagoStatusDetailEnum["accredited"] = "accredited";
9978
+ MercadoPagoStatusDetailEnum["partially_refunded"] = "partially_refunded";
9979
+ MercadoPagoStatusDetailEnum["pending_capture"] = "pending_capture";
9980
+ MercadoPagoStatusDetailEnum["offline_process"] = "offline_process";
9981
+ MercadoPagoStatusDetailEnum["pending_contingency"] = "pending_contingency";
9982
+ MercadoPagoStatusDetailEnum["pending_review_manual"] = "pending_review_manual";
9983
+ MercadoPagoStatusDetailEnum["pending_waiting_transfer"] = "pending_waiting_transfer";
9984
+ MercadoPagoStatusDetailEnum["pending_waiting_payment"] = "pending_waiting_payment";
9985
+ MercadoPagoStatusDetailEnum["pending_challenge"] = "pending_challenge";
9986
+ MercadoPagoStatusDetailEnum["bank_error"] = "bank_error";
9987
+ MercadoPagoStatusDetailEnum["cc_rejected_3ds_mandatory"] = "cc_rejected_3ds_mandatory";
9988
+ MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_card_number"] = "cc_rejected_bad_filled_card_number";
9989
+ MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_date"] = "cc_rejected_bad_filled_date";
9990
+ MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_other"] = "cc_rejected_bad_filled_other";
9991
+ MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_security_code"] = "cc_rejected_bad_filled_security_code";
9992
+ MercadoPagoStatusDetailEnum["cc_rejected_blacklist"] = "cc_rejected_blacklist";
9993
+ MercadoPagoStatusDetailEnum["cc_rejected_call_for_authorize"] = "cc_rejected_call_for_authorize";
9994
+ MercadoPagoStatusDetailEnum["cc_rejected_card_disabled"] = "cc_rejected_card_disabled";
9995
+ MercadoPagoStatusDetailEnum["cc_rejected_card_error"] = "cc_rejected_card_error";
9996
+ MercadoPagoStatusDetailEnum["cc_rejected_duplicated_payment"] = "cc_rejected_duplicated_payment";
9997
+ MercadoPagoStatusDetailEnum["cc_rejected_high_risk"] = "cc_rejected_high_risk";
9998
+ MercadoPagoStatusDetailEnum["cc_rejected_insufficient_amount"] = "cc_rejected_insufficient_amount";
9999
+ MercadoPagoStatusDetailEnum["cc_rejected_invalid_installments"] = "cc_rejected_invalid_installments";
10000
+ MercadoPagoStatusDetailEnum["cc_rejected_max_attempts"] = "cc_rejected_max_attempts";
10001
+ MercadoPagoStatusDetailEnum["cc_rejected_other_reason"] = "cc_rejected_other_reason";
10002
+ MercadoPagoStatusDetailEnum["cc_amount_rate_limit_exceeded"] = "cc_amount_rate_limit_exceeded";
10003
+ MercadoPagoStatusDetailEnum["rejected_insufficient_data"] = "rejected_insufficient_data";
10004
+ MercadoPagoStatusDetailEnum["rejected_by_bank"] = "rejected_by_bank";
10005
+ MercadoPagoStatusDetailEnum["rejected_by_regulations"] = "rejected_by_regulations";
10006
+ MercadoPagoStatusDetailEnum["insufficient_amount"] = "insufficient_amount";
10007
+ MercadoPagoStatusDetailEnum["cc_rejected_card_type_not_allowed"] = "cc_rejected_card_type_not_allowed";
10008
+ })(MercadoPagoStatusDetailEnum || (MercadoPagoStatusDetailEnum = {}));
10009
+
10010
+ var MercadoPagoStatusEnum;
10011
+ (function (MercadoPagoStatusEnum) {
10012
+ MercadoPagoStatusEnum["approved"] = "approved";
10013
+ MercadoPagoStatusEnum["authorized"] = "authorized";
10014
+ MercadoPagoStatusEnum["pending"] = "pending";
10015
+ MercadoPagoStatusEnum["in_process"] = "in_process";
10016
+ MercadoPagoStatusEnum["rejected"] = "rejected";
10017
+ MercadoPagoStatusEnum["cancelled"] = "cancelled";
10018
+ MercadoPagoStatusEnum["refunded"] = "refunded";
10019
+ MercadoPagoStatusEnum["charged_back"] = "charged_back";
10020
+ })(MercadoPagoStatusEnum || (MercadoPagoStatusEnum = {}));
10021
+
10022
+ class MercadoPagoBaseAxiosAdapter {
10023
+ constructor(credentials, paymentRepository) {
10024
+ this.credentials = credentials;
10025
+ this.paymentRepository = paymentRepository;
10026
+ }
10027
+ async refund(order, amount) {
10028
+ const { data } = await axios({
10029
+ method: 'POST',
10030
+ url: `${this.credentials.url}/v1/payments/${order.payment.id}/refunds`,
10031
+ headers: {
10032
+ 'X-Idempotency-Key': `${order.payment.charger_id}-${new Date().getTime()}`,
10033
+ Authorization: `Bearer ${this.credentials.api_key}`,
10034
+ 'Content-Type': 'application/json',
10035
+ },
10036
+ data: {
10037
+ amount: +amount.toFixed(2),
10038
+ },
10039
+ });
10040
+ await this.paymentRepository.create({
10041
+ createdAt: new Date(),
10042
+ updatedAt: new Date(),
10043
+ userId: order.user.id,
10044
+ orderId: order.id,
10045
+ totalPrice: amount,
10046
+ paymentProvider: PaymentProviders.MERCADOPAGO,
10047
+ mercadoPagoId: data.id,
10048
+ transaction: data,
10049
+ });
10050
+ console.warn('[RESPONSE MERCADO PAGO REFUND]', JSON.stringify(data));
10051
+ return {
10052
+ status: this.getRefundStatus(data.status),
10053
+ success: [
10054
+ MercadoPagoStatusEnum.approved,
10055
+ MercadoPagoStatusEnum.refunded,
10056
+ MercadoPagoStatusEnum.cancelled,
10057
+ MercadoPagoStatusEnum.authorized,
10058
+ ].includes(data.status)
10059
+ ? true
10060
+ : false,
10061
+ };
10062
+ }
10063
+ getRefundStatus(status) {
10064
+ if ([MercadoPagoStatusEnum.in_process, MercadoPagoStatusEnum.pending].includes(status)) {
10065
+ return 'processing';
10066
+ }
10067
+ if ([
10068
+ MercadoPagoStatusEnum.approved,
10069
+ MercadoPagoStatusEnum.refunded,
10070
+ MercadoPagoStatusEnum.cancelled,
10071
+ MercadoPagoStatusEnum.authorized,
10072
+ ].includes(status)) {
10073
+ return 'success';
10074
+ }
10075
+ return 'unknown';
10076
+ }
10077
+ }
10078
+
10079
+ class MercadoPagoCardAxiosAdapter extends MercadoPagoBaseAxiosAdapter {
9757
10080
  constructor(credentials, paymentRepository, orderBlockedRepository) {
10081
+ super(credentials, paymentRepository);
9758
10082
  this.credentials = credentials;
9759
10083
  this.paymentRepository = paymentRepository;
9760
10084
  this.orderBlockedRepository = orderBlockedRepository;
@@ -9883,8 +10207,9 @@ class MercadoPagoCardAxiosAdapter {
9883
10207
  }
9884
10208
  }
9885
10209
 
9886
- class MercadoPagoPixAxiosAdapter {
10210
+ class MercadoPagoPixAxiosAdapter extends MercadoPagoBaseAxiosAdapter {
9887
10211
  constructor(credentials, paymentRepository) {
10212
+ super(credentials, paymentRepository);
9888
10213
  this.credentials = credentials;
9889
10214
  this.paymentRepository = paymentRepository;
9890
10215
  }
@@ -9923,53 +10248,6 @@ class MercadoPagoPixAxiosAdapter {
9923
10248
  }
9924
10249
  }
9925
10250
 
9926
- var MercadoPagoStatusDetailEnum;
9927
- (function (MercadoPagoStatusDetailEnum) {
9928
- MercadoPagoStatusDetailEnum["accredited"] = "accredited";
9929
- MercadoPagoStatusDetailEnum["partially_refunded"] = "partially_refunded";
9930
- MercadoPagoStatusDetailEnum["pending_capture"] = "pending_capture";
9931
- MercadoPagoStatusDetailEnum["offline_process"] = "offline_process";
9932
- MercadoPagoStatusDetailEnum["pending_contingency"] = "pending_contingency";
9933
- MercadoPagoStatusDetailEnum["pending_review_manual"] = "pending_review_manual";
9934
- MercadoPagoStatusDetailEnum["pending_waiting_transfer"] = "pending_waiting_transfer";
9935
- MercadoPagoStatusDetailEnum["pending_waiting_payment"] = "pending_waiting_payment";
9936
- MercadoPagoStatusDetailEnum["pending_challenge"] = "pending_challenge";
9937
- MercadoPagoStatusDetailEnum["bank_error"] = "bank_error";
9938
- MercadoPagoStatusDetailEnum["cc_rejected_3ds_mandatory"] = "cc_rejected_3ds_mandatory";
9939
- MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_card_number"] = "cc_rejected_bad_filled_card_number";
9940
- MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_date"] = "cc_rejected_bad_filled_date";
9941
- MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_other"] = "cc_rejected_bad_filled_other";
9942
- MercadoPagoStatusDetailEnum["cc_rejected_bad_filled_security_code"] = "cc_rejected_bad_filled_security_code";
9943
- MercadoPagoStatusDetailEnum["cc_rejected_blacklist"] = "cc_rejected_blacklist";
9944
- MercadoPagoStatusDetailEnum["cc_rejected_call_for_authorize"] = "cc_rejected_call_for_authorize";
9945
- MercadoPagoStatusDetailEnum["cc_rejected_card_disabled"] = "cc_rejected_card_disabled";
9946
- MercadoPagoStatusDetailEnum["cc_rejected_card_error"] = "cc_rejected_card_error";
9947
- MercadoPagoStatusDetailEnum["cc_rejected_duplicated_payment"] = "cc_rejected_duplicated_payment";
9948
- MercadoPagoStatusDetailEnum["cc_rejected_high_risk"] = "cc_rejected_high_risk";
9949
- MercadoPagoStatusDetailEnum["cc_rejected_insufficient_amount"] = "cc_rejected_insufficient_amount";
9950
- MercadoPagoStatusDetailEnum["cc_rejected_invalid_installments"] = "cc_rejected_invalid_installments";
9951
- MercadoPagoStatusDetailEnum["cc_rejected_max_attempts"] = "cc_rejected_max_attempts";
9952
- MercadoPagoStatusDetailEnum["cc_rejected_other_reason"] = "cc_rejected_other_reason";
9953
- MercadoPagoStatusDetailEnum["cc_amount_rate_limit_exceeded"] = "cc_amount_rate_limit_exceeded";
9954
- MercadoPagoStatusDetailEnum["rejected_insufficient_data"] = "rejected_insufficient_data";
9955
- MercadoPagoStatusDetailEnum["rejected_by_bank"] = "rejected_by_bank";
9956
- MercadoPagoStatusDetailEnum["rejected_by_regulations"] = "rejected_by_regulations";
9957
- MercadoPagoStatusDetailEnum["insufficient_amount"] = "insufficient_amount";
9958
- MercadoPagoStatusDetailEnum["cc_rejected_card_type_not_allowed"] = "cc_rejected_card_type_not_allowed";
9959
- })(MercadoPagoStatusDetailEnum || (MercadoPagoStatusDetailEnum = {}));
9960
-
9961
- var MercadoPagoStatusEnum;
9962
- (function (MercadoPagoStatusEnum) {
9963
- MercadoPagoStatusEnum["approved"] = "approved";
9964
- MercadoPagoStatusEnum["authorized"] = "authorized";
9965
- MercadoPagoStatusEnum["pending"] = "pending";
9966
- MercadoPagoStatusEnum["in_process"] = "in_process";
9967
- MercadoPagoStatusEnum["rejected"] = "rejected";
9968
- MercadoPagoStatusEnum["cancelled"] = "cancelled";
9969
- MercadoPagoStatusEnum["refunded"] = "refunded";
9970
- MercadoPagoStatusEnum["charged_back"] = "charged_back";
9971
- })(MercadoPagoStatusEnum || (MercadoPagoStatusEnum = {}));
9972
-
9973
10251
  class PagarmeBankSlipAxiosAdapter {
9974
10252
  constructor(credentials, paymentRepository) {
9975
10253
  this.credentials = credentials;
@@ -10097,6 +10375,14 @@ class PagarMeErrorHelper {
10097
10375
  case '1070':
10098
10376
  case '2001':
10099
10377
  case '2004':
10378
+ case '5025':
10379
+ case '9124':
10380
+ return ErrorsCode.invalidCardError;
10381
+ // Dados obrigatórios ausentes
10382
+ case '1044':
10383
+ case '5034':
10384
+ case '5047':
10385
+ case '5061':
10100
10386
  return ErrorsCode.invalidCardError;
10101
10387
  // Suspeita de fraude, prevenção do banco
10102
10388
  case '1002':
@@ -10108,6 +10394,7 @@ class PagarMeErrorHelper {
10108
10394
  case '2008':
10109
10395
  case '2009':
10110
10396
  case '2010':
10397
+ case '9201':
10111
10398
  return ErrorsCode.fraudPreventionExternal;
10112
10399
  // Recusado pelo banco/emissor
10113
10400
  case '1007':
@@ -10125,19 +10412,10 @@ class PagarMeErrorHelper {
10125
10412
  case '5087':
10126
10413
  return ErrorsCode.insufficientFundsError;
10127
10414
  // Valor solicitado inválido
10415
+ case '5094':
10128
10416
  case '5016':
10129
10417
  case '5092':
10130
10418
  return ErrorsCode.paymentError;
10131
- // Código de segurança inválido ou não enviado
10132
- case '5025':
10133
- case '9124':
10134
- return ErrorsCode.paymentError;
10135
- // Dados obrigatórios ausentes
10136
- case '1044':
10137
- case '5034':
10138
- case '5047':
10139
- case '5061':
10140
- return ErrorsCode.paymentError;
10141
10419
  // Erros internos ou genéricos
10142
10420
  case '5000':
10143
10421
  case '5001':
@@ -10227,10 +10505,9 @@ class PagarMeErrorHelper {
10227
10505
  // Transação não suportada para o banco/emissor
10228
10506
  case '1061':
10229
10507
  return ErrorsCode.paymentError;
10230
- case '5094':
10231
10508
  case '1010':
10232
10509
  case '1046':
10233
- return ErrorsCode.businessError;
10510
+ return ErrorsCode.invalidCheckoutError;
10234
10511
  default:
10235
10512
  return ErrorsCode.paymentError;
10236
10513
  }
@@ -10367,7 +10644,7 @@ class PagarMeV5RequestHelper {
10367
10644
  static getCardOrder(checkout, card) {
10368
10645
  return {
10369
10646
  installments: card.installments,
10370
- statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'Glam' : 'Mens Market',
10647
+ statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'loja glam' : 'mens market',
10371
10648
  card_id: card.cardId,
10372
10649
  card: {
10373
10650
  cvv: card.cardCvv,
@@ -10408,7 +10685,7 @@ class PagarMeV5ResponseHelper {
10408
10685
  const charger = response.charges.at(0);
10409
10686
  const transaction = charger.last_transaction;
10410
10687
  return PaymentTransaction.toInstance({
10411
- acquirer_name: 'pagar_me',
10688
+ acquirer_name: PaymentProviders.PAGARME,
10412
10689
  amount: charger.amount,
10413
10690
  currency: charger.currency,
10414
10691
  gateway_id: charger.gateway_id,
@@ -10760,8 +11037,62 @@ class PagarmeV5BankSlipAxiosAdapter {
10760
11037
  }
10761
11038
  }
10762
11039
 
10763
- class PagarmeV5CardAxiosAdapter {
11040
+ class PagarmeV5BaseAxiosAdapter {
11041
+ constructor(credentials, paymentRepository) {
11042
+ this.credentials = credentials;
11043
+ this.paymentRepository = paymentRepository;
11044
+ }
11045
+ async refund(order, amount) {
11046
+ try {
11047
+ console.warn('[PAGARME REFUND] Starting refund process for order', order.id, order.payment, 'with amount', amount);
11048
+ const amountToSend = +amount.toFixed(2) * 100;
11049
+ console.warn('[PAGARME REFUND] Amount to send in cents', amountToSend);
11050
+ const { data } = await axios({
11051
+ method: 'DELETE',
11052
+ url: `${this.credentials.URL}/charges/${order.payment.charger_id}`,
11053
+ headers: {
11054
+ Authorization: 'Basic ' + Buffer.from(`${this.credentials.API_KEY}:`).toString('base64'),
11055
+ 'Content-Type': 'application/json',
11056
+ },
11057
+ data: {
11058
+ amount: amountToSend,
11059
+ },
11060
+ });
11061
+ console.warn('[RESPONSE PAGARME REFUND]', JSON.stringify(data));
11062
+ await this.paymentRepository.create({
11063
+ createdAt: new Date(),
11064
+ updatedAt: new Date(),
11065
+ userId: order.user.id,
11066
+ orderId: order.id,
11067
+ totalPrice: amount,
11068
+ paymentProvider: PaymentProviders.PAGARME,
11069
+ pagarMeOrderId: data.id,
11070
+ transaction: data,
11071
+ });
11072
+ return {
11073
+ status: this.getRefundStatus(data.status),
11074
+ success: [PagarMeV5OrderStatus.Pago, PagarMeV5OrderStatus.Cancelado].includes(data.status) ? true : false,
11075
+ };
11076
+ }
11077
+ catch (error) {
11078
+ console.error('Error during refund process for order', order.id, 'with error', error);
11079
+ throw error;
11080
+ }
11081
+ }
11082
+ getRefundStatus(status) {
11083
+ if ([PagarMeV5PaymentStatus['Em processamento']].includes(status)) {
11084
+ return 'processing';
11085
+ }
11086
+ if ([PagarMeV5OrderStatus.Pago, PagarMeV5OrderStatus.Cancelado].includes(status)) {
11087
+ return 'success';
11088
+ }
11089
+ return 'unknown';
11090
+ }
11091
+ }
11092
+
11093
+ class PagarmeV5CardAxiosAdapter extends PagarmeV5BaseAxiosAdapter {
10764
11094
  constructor(credentials, paymentRepository, orderBlockedRepository) {
11095
+ super(credentials, paymentRepository);
10765
11096
  this.credentials = credentials;
10766
11097
  this.paymentRepository = paymentRepository;
10767
11098
  this.orderBlockedRepository = orderBlockedRepository;
@@ -10931,8 +11262,9 @@ class PagarmeV5CardAxiosAdapter {
10931
11262
  }
10932
11263
  }
10933
11264
 
10934
- class PagarmeV5PixAxiosAdapter {
11265
+ class PagarmeV5PixAxiosAdapter extends PagarmeV5BaseAxiosAdapter {
10935
11266
  constructor(credentials, paymentRepository) {
11267
+ super(credentials, paymentRepository);
10936
11268
  this.credentials = credentials;
10937
11269
  this.paymentRepository = paymentRepository;
10938
11270
  }
@@ -11126,4 +11458,4 @@ class ProductsVertexSearch {
11126
11458
  }
11127
11459
  }
11128
11460
 
11129
- export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandCategory, BrandCategoryFirestoreRepository, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, ErrorsCode, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, InvalidCheckoutError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, MercadoPagoBankSlipAxiosAdapter, MercadoPagoCardAxiosAdapter, MercadoPagoErrorHelper, MercadoPagoPaymentMethodFactory, MercadoPagoPixAxiosAdapter, MercadoPagoRequestHelper, MercadoPagoResponseHelper, MercadoPagoStatusDetailEnum, MercadoPagoStatusEnum, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderPaymentStatus, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductCatalogHasuraGraphQL, ProductCatalogHasuraGraphQLRepository, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductGroup, ProductGroupHasuraGraphQLRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductPriceLog, ProductPriceLogHasuraGraphQLRepository, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockEntry, ProductStockEntryHasuraGraphQL, ProductStockEntryHasuraGraphQLRepository, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopConfigs, ShopConfigsFirestoreRepository, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, TransactionPaymentMethods, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
11461
+ export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandCategory, BrandCategoryFirestoreRepository, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, ErrorsCode, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, InvalidCheckoutError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, MercadoPagoBankSlipAxiosAdapter, MercadoPagoCardAxiosAdapter, MercadoPagoErrorHelper, MercadoPagoPaymentMethodFactory, MercadoPagoPixAxiosAdapter, MercadoPagoRequestHelper, MercadoPagoResponseHelper, MercadoPagoStatusDetailEnum, MercadoPagoStatusEnum, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderPaymentStatus, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5BaseAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductCatalogHasuraGraphQL, ProductCatalogHasuraGraphQLRepository, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductGroup, ProductGroupHasuraGraphQLRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductPriceLog, ProductPriceLogHasuraGraphQLRepository, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockEntry, ProductStockEntryHasuraGraphQL, ProductStockEntryHasuraGraphQLRepository, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopConfigs, ShopConfigsFirestoreRepository, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, ShoppingRecurrence, ShoppingRecurrenceCycle, ShoppingRecurrenceEdition, ShoppingRecurrenceEditionFirestoreRepository, ShoppingRecurrenceEditionStatus, ShoppingRecurrenceFirestoreRepository, ShoppingRecurrenceStatus, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, TransactionPaymentMethods, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "5.3.0-beta.26",
3
+ "version": "5.3.0-beta.27",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -2,5 +2,7 @@ export declare enum Shops {
2
2
  MENSMARKET = "mensmarket",
3
3
  GLAMSHOP = "Glamshop",
4
4
  GLAMPOINTS = "Glampoints",
5
+ GLAMBEAUTY = "Glambeauty",
6
+ ELLA = "ella",
5
7
  ALL = "ALL"
6
8
  }
@@ -1,5 +1,6 @@
1
1
  export type ProductCompetitorsPrice = {
2
2
  competitorId: string;
3
- price: number;
4
- offerPrice: number;
3
+ competitorUrl?: string;
4
+ price?: number;
5
+ offerPrice?: number;
5
6
  };
@@ -8,4 +8,6 @@ export interface CategoryProductRepository extends CrudRepository<CategoryProduc
8
8
  order: number;
9
9
  }[]): Promise<void>;
10
10
  addProductToCategories(productId: string, categoryIds: string[]): Promise<void>;
11
+ removeProductFromAllCategories(productId: string): Promise<void>;
12
+ removeCategoryFromAllProducts(categoryId: string): Promise<void>;
11
13
  }