@infrab4a/connect 4.20.0-beta.9 → 4.21.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.
Files changed (86) hide show
  1. package/index.cjs.js +120 -865
  2. package/index.esm.js +121 -842
  3. package/package.json +1 -1
  4. package/src/domain/catalog/models/category-product.d.ts +8 -0
  5. package/src/domain/catalog/models/index.d.ts +1 -0
  6. package/src/domain/catalog/models/product-base.d.ts +2 -0
  7. package/src/domain/catalog/models/types/index.d.ts +0 -1
  8. package/src/domain/catalog/models/variant.d.ts +2 -0
  9. package/src/domain/catalog/repositories/category-product.repository.d.ts +6 -0
  10. package/src/domain/catalog/repositories/index.d.ts +1 -0
  11. package/src/domain/general/models/index.d.ts +0 -1
  12. package/src/domain/general/repositories/index.d.ts +0 -1
  13. package/src/domain/shopping/index.d.ts +0 -4
  14. package/src/domain/shopping/models/index.d.ts +0 -1
  15. package/src/domain/shopping/models/order-blocked.d.ts +6 -4
  16. package/src/domain/shopping/models/order.d.ts +2 -2
  17. package/src/domain/shopping/models/payment.d.ts +63 -10
  18. package/src/domain/shopping/models/types/index.d.ts +4 -4
  19. package/src/domain/shopping/types/index.d.ts +0 -8
  20. package/src/errors/index.d.ts +2 -8
  21. package/src/infra/elasticsearch/indexes/products-index.d.ts +2 -0
  22. package/src/infra/firebase/firestore/repositories/general/index.d.ts +0 -1
  23. package/src/infra/firebase/firestore/repositories/shopping/index.d.ts +1 -1
  24. package/src/infra/firebase/firestore/repositories/shopping/{order-blocked-firestore.repository.d.ts → order-blocked-firestore.repository.ts.d.ts} +2 -2
  25. package/src/infra/hasura-graphql/repositories/catalog/category-product-hasura-graphql.repository.d.ts +11 -0
  26. package/src/infra/hasura-graphql/repositories/catalog/index.d.ts +1 -0
  27. package/src/infra/index.d.ts +0 -2
  28. package/src/utils/index.d.ts +2 -2
  29. package/src/domain/general/models/sequences.d.ts +0 -9
  30. package/src/domain/general/repositories/sequences.repository.d.ts +0 -4
  31. package/src/domain/shopping/enums/antifraud-providers.enum.d.ts +0 -6
  32. package/src/domain/shopping/enums/business-unit.enum.d.ts +0 -4
  33. package/src/domain/shopping/enums/index.d.ts +0 -6
  34. package/src/domain/shopping/enums/order-blocked.enum.d.ts +0 -5
  35. package/src/domain/shopping/enums/pagarme-payment-status.enum.d.ts +0 -10
  36. package/src/domain/shopping/enums/payment-methods.enum.d.ts +0 -6
  37. package/src/domain/shopping/enums/payment-providers.enum.d.ts +0 -5
  38. package/src/domain/shopping/factories/adyen-payment-method.factory.d.ts +0 -9
  39. package/src/domain/shopping/factories/antifraud-provider.factory.d.ts +0 -15
  40. package/src/domain/shopping/factories/base-payment-method.factory.d.ts +0 -7
  41. package/src/domain/shopping/factories/glampoints-payment-method.factory.d.ts +0 -8
  42. package/src/domain/shopping/factories/index.d.ts +0 -5
  43. package/src/domain/shopping/factories/pagarme-payment-method.factory.d.ts +0 -11
  44. package/src/domain/shopping/factories/payment-provider.factory.d.ts +0 -15
  45. package/src/domain/shopping/interfaces/antifraud-method-factory.interface.d.ts +0 -11
  46. package/src/domain/shopping/interfaces/antifraud-provider.interface.d.ts +0 -5
  47. package/src/domain/shopping/interfaces/index.d.ts +0 -7
  48. package/src/domain/shopping/interfaces/payment-method-factory.interface.d.ts +0 -14
  49. package/src/domain/shopping/interfaces/payment-provider-bank-slip.interface.d.ts +0 -7
  50. package/src/domain/shopping/interfaces/payment-provider-card.interface.d.ts +0 -13
  51. package/src/domain/shopping/interfaces/payment-provider-glampoints.interface.d.ts +0 -5
  52. package/src/domain/shopping/interfaces/payment-provider-pix.interface.d.ts +0 -5
  53. package/src/domain/shopping/models/payment-transaction.d.ts +0 -67
  54. package/src/domain/shopping/services/antifraud-bankslip.service.d.ts +0 -9
  55. package/src/domain/shopping/services/antifraud-card.service.d.ts +0 -18
  56. package/src/domain/shopping/services/antifraud-glampoints.service.d.ts +0 -6
  57. package/src/domain/shopping/services/antifraud-pix.service.d.ts +0 -6
  58. package/src/domain/shopping/services/glampoints-payment.service.d.ts +0 -8
  59. package/src/domain/shopping/services/index.d.ts +0 -5
  60. package/src/domain/shopping/types/adyen-card.type.d.ts +0 -3
  61. package/src/domain/shopping/types/adyen-credentials.type.d.ts +0 -6
  62. package/src/domain/shopping/types/antifraud-provider.type.d.ts +0 -2
  63. package/src/domain/shopping/types/base-card.type.d.ts +0 -2
  64. package/src/domain/shopping/types/card-info.type.d.ts +0 -8
  65. package/src/domain/shopping/types/pagarme-card-manual-hash.type.d.ts +0 -6
  66. package/src/domain/shopping/types/pagarme-card.type.d.ts +0 -16
  67. package/src/domain/shopping/types/pagarme-credentials.type.d.ts +0 -7
  68. package/src/domain/shopping/types/payment-method.type.d.ts +0 -2
  69. package/src/domain/shopping/types/payment-provider.type.d.ts +0 -2
  70. package/src/errors/business.error.d.ts +0 -7
  71. package/src/errors/fraud-validation.error.d.ts +0 -7
  72. package/src/errors/payment.error.d.ts +0 -7
  73. package/src/errors/stock-limit.error.d.ts +0 -5
  74. package/src/errors/stock-out.error.d.ts +0 -5
  75. package/src/errors/types/checkout-additional-data-erro.type.d.ts +0 -6
  76. package/src/errors/types/index.d.ts +0 -2
  77. package/src/errors/types/pagarme-erros.type.d.ts +0 -9
  78. package/src/infra/adyen/adapters/adyen-card-payment-axios.adapter.d.ts +0 -17
  79. package/src/infra/adyen/adapters/index.d.ts +0 -1
  80. package/src/infra/adyen/index.d.ts +0 -1
  81. package/src/infra/firebase/firestore/repositories/general/sequences-firestore.repository.d.ts +0 -7
  82. package/src/infra/pagarme/adapters/index.d.ts +0 -3
  83. package/src/infra/pagarme/adapters/pagarme-bank-slip-payment-axios.adapter.d.ts +0 -12
  84. package/src/infra/pagarme/adapters/pagarme-card-payment-axios.adapter.d.ts +0 -17
  85. package/src/infra/pagarme/adapters/pagarme-pix-payment-axios.adapter.d.ts +0 -11
  86. package/src/infra/pagarme/index.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.20.0-beta.9",
3
+ "version": "4.21.0-beta.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -0,0 +1,8 @@
1
+ import { BaseModel } from '../../generic/model';
2
+ export type CategoryProductIdentifiers = 'productId' | 'categoryId';
3
+ export declare class CategoryProduct extends BaseModel<CategoryProduct, CategoryProductIdentifiers> {
4
+ categoryId: number;
5
+ productId: number;
6
+ order: number;
7
+ static get identifiersFields(): CategoryProductIdentifiers[];
8
+ }
@@ -1,6 +1,7 @@
1
1
  export * from './category';
2
2
  export * from './category-collection-children';
3
3
  export * from './category-filter';
4
+ export * from './category-product';
4
5
  export * from './enums';
5
6
  export * from './filter';
6
7
  export * from './filter-option';
@@ -35,6 +35,8 @@ export declare class ProductBase<ChildProduct extends ModelBaseStructure<ChildPr
35
35
  metadata: ProductMetadata;
36
36
  outlet?: boolean;
37
37
  label?: ProductLabel;
38
+ group?: number;
39
+ validity: boolean;
38
40
  private reviewsTotal?;
39
41
  get evaluation(): ProductEvaluation;
40
42
  set evaluation(evaluation: ProductEvaluation);
@@ -2,7 +2,6 @@ export * from './category-condition.type';
2
2
  export * from './category-images.type';
3
3
  export * from './category-metadata.type';
4
4
  export * from './category-most-relevant.type';
5
- export * from './category-product';
6
5
  export * from './product-evaluation.type';
7
6
  export * from './product-gender.type';
8
7
  export * from './product-label.type';
@@ -13,5 +13,7 @@ export declare class Variant extends BaseModel<Variant, ProductVariantIdentifier
13
13
  weight: number;
14
14
  createdAt?: Date;
15
15
  updatedAt?: Date;
16
+ group?: number;
17
+ validity: boolean;
16
18
  static get identifiersFields(): ProductVariantIdentifiers[];
17
19
  }
@@ -0,0 +1,6 @@
1
+ import { CrudRepository } from '../../generic/repository/crud.repository';
2
+ import { CategoryProduct } from '../models';
3
+ export interface CategoryProductRepository extends CrudRepository<CategoryProduct> {
4
+ removeProductFromCategory(categoryId: string, productId: string): Promise<void>;
5
+ addProductToCategory(categoryId: string, productId: string): Promise<void>;
6
+ }
@@ -1,5 +1,6 @@
1
1
  export * from './category-collection-children.repository';
2
2
  export * from './category-filter.repository';
3
+ export * from './category-product.repository';
3
4
  export * from './category.repository';
4
5
  export * from './filter-option.repository';
5
6
  export * from './filter.repository';
@@ -1,2 +1 @@
1
1
  export * from './log-document';
2
- export * from './sequences';
@@ -1,2 +1 @@
1
1
  export * from './log.repository';
2
- export * from './sequences.repository';
@@ -1,7 +1,3 @@
1
- export * from './enums';
2
- export * from './factories';
3
- export * from './interfaces';
4
1
  export * from './models';
5
2
  export * from './repositories';
6
- export * from './services';
7
3
  export * from './types';
@@ -8,7 +8,6 @@ export * from './line-item';
8
8
  export * from './order';
9
9
  export * from './order-blocked';
10
10
  export * from './payment';
11
- export * from './payment-transaction';
12
11
  export * from './shipping-method';
13
12
  export * from './subscription';
14
13
  export * from './types';
@@ -1,7 +1,5 @@
1
1
  import { BaseModel, GenericIdentifier } from '../../generic';
2
2
  import { UserAddress } from '../../users';
3
- import { OrderBlockedType } from '../enums';
4
- import { Checkout } from './checkout';
5
3
  export declare class OrderBlocked extends BaseModel<OrderBlocked> {
6
4
  id?: string;
7
5
  customer: {
@@ -16,9 +14,13 @@ export declare class OrderBlocked extends BaseModel<OrderBlocked> {
16
14
  };
17
15
  blockType: string;
18
16
  limiteRange: string;
19
- type: OrderBlockedType;
17
+ type: string;
20
18
  card?: any;
21
- checkout: Checkout;
19
+ checkout: {
20
+ id: string;
21
+ shop: string;
22
+ total: number;
23
+ };
22
24
  date: Date;
23
25
  static get identifiersFields(): GenericIdentifier[];
24
26
  }
@@ -1,7 +1,7 @@
1
1
  import { OrderTrackingEvent } from '../types';
2
2
  import { Checkout } from './checkout';
3
3
  import { OrderStatus } from './enums/order-status.enum';
4
- import { PaymentTransaction } from './payment-transaction';
4
+ import { Payment } from './payment';
5
5
  export declare class Order extends Checkout {
6
6
  status: OrderStatus;
7
7
  orderNumber?: string;
@@ -10,5 +10,5 @@ export declare class Order extends Checkout {
10
10
  sentAt?: string;
11
11
  deliveredAt?: string;
12
12
  trackingEvents?: OrderTrackingEvent[];
13
- payment: PaymentTransaction;
13
+ payment: Payment;
14
14
  }
@@ -1,15 +1,68 @@
1
1
  import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
2
- import { PaymentProvider } from '../types';
3
- import { PaymentTransaction } from './payment-transaction';
2
+ import { PaymentBilling, PaymentCard, PaymentCustomer, PaymentItem, PaymentShipping } from './types';
4
3
  export declare class Payment extends BaseModel<Payment> {
5
4
  id: number;
6
- checkoutId: string;
7
- orderId?: string;
8
- totalPrice: number;
9
- userId: string;
10
- paymentProvider: PaymentProvider;
11
- createdAt: Date;
12
- updatedAt?: Date;
13
- transaction: PaymentTransaction;
5
+ object: string;
6
+ status: string;
7
+ tid: number;
8
+ nsu: number;
9
+ amount: number;
10
+ cost: number;
11
+ installments: number;
12
+ referer: string;
13
+ ip: string;
14
+ phone: string;
15
+ address: string;
16
+ metadata: any;
17
+ device: string;
18
+ payment: string;
19
+ addition: string;
20
+ discount: string;
21
+ customer: PaymentCustomer;
22
+ billing: PaymentBilling;
23
+ shipping: PaymentShipping;
24
+ items: PaymentItem[];
25
+ card: PaymentCard;
26
+ refuseReason: string;
27
+ statusReason: string;
28
+ acquirerResponseCode: string;
29
+ acquirerName: string;
30
+ acquirerId: string;
31
+ authorizationCode: string;
32
+ softDescriptor: string;
33
+ dateCreated: string;
34
+ dateUpdated: string;
35
+ authorizedAmount: number;
36
+ paidAmount: number;
37
+ paidAt: string;
38
+ refundedAmount: number;
39
+ cardHolderName: string;
40
+ cardLastDigits: string;
41
+ cardFirstDigits: string;
42
+ cardBrand: string;
43
+ cardPinMode: string;
44
+ cardMagstripeFallback: boolean;
45
+ cvmPin: boolean;
46
+ postbackUrl: string;
47
+ paymentMethod: string;
48
+ captureMethod: string;
49
+ antifraudScore: string;
50
+ boletoUrl: string;
51
+ boletoBarcode: string;
52
+ boletoExpirationDate: string;
53
+ subscriptionId: string;
54
+ splitRules: string;
55
+ antifraudMetadata: any;
56
+ referenceKey: string;
57
+ localTransactionId: string;
58
+ localTime: string;
59
+ fraudCovered: boolean;
60
+ fraudReimbursed: string;
61
+ orderId: string;
62
+ riskLevel: string;
63
+ receiptUrl: string;
64
+ privateLabel: string;
65
+ pixQrCode: string;
66
+ pixExpirationDate: string;
14
67
  static get identifiersFields(): GenericIdentifier[];
15
68
  }
@@ -1,7 +1,7 @@
1
- export * from './payment-address.type';
2
- export * from './payment-billing.type';
3
- export * from './payment-card.type';
4
1
  export * from './payment-customer.type';
5
2
  export * from './payment-document.type';
6
- export * from './payment-item.type';
3
+ export * from './payment-address.type';
4
+ export * from './payment-billing.type';
7
5
  export * from './payment-shipping.type';
6
+ export * from './payment-item.type';
7
+ export * from './payment-card.type';
@@ -1,10 +1,2 @@
1
- export * from './adyen-card.type';
2
- export * from './adyen-credentials.type';
3
- export * from './antifraud-provider.type';
4
- export * from './card-info.type';
5
1
  export * from './order-tracking-events.type';
6
- export * from './pagarme-card.type';
7
- export * from './pagarme-credentials.type';
8
2
  export * from './payment-card-info.type';
9
- export * from './payment-method.type';
10
- export * from './payment-provider.type';
@@ -1,10 +1,4 @@
1
- export * from './business.error';
2
- export * from './duplicated-results.error';
3
- export * from './fraud-validation.error';
4
1
  export * from './invalid-argument.error';
5
- export * from './not-found.error';
6
- export * from './payment.error';
7
2
  export * from './required-argument.error';
8
- export * from './stock-limit.error';
9
- export * from './stock-out.error';
10
- export * from './types';
3
+ export * from './not-found.error';
4
+ export * from './duplicated-results.error';
@@ -42,6 +42,8 @@ export declare class ProductsIndex {
42
42
  metadata: import("../../../domain").ProductMetadata;
43
43
  outlet?: boolean;
44
44
  label?: import("../../../domain").ProductLabel;
45
+ group?: number;
46
+ validity: boolean;
45
47
  }[]>;
46
48
  save(product: ProductHasuraGraphQL): Promise<void>;
47
49
  update(product: ProductHasuraGraphQL): Promise<void>;
@@ -1,2 +1 @@
1
1
  export * from './log-firestore.repository';
2
- export * from './sequences-firestore.repository';
@@ -5,7 +5,7 @@ export * from './checkout-firestore.repository';
5
5
  export * from './checkout-subscription-firestore.repository';
6
6
  export * from './coupon-firestore.repository';
7
7
  export * from './legacy-order-firestore.repository';
8
- export * from './order-blocked-firestore.repository';
8
+ export * from './order-blocked-firestore.repository.ts';
9
9
  export * from './order-firestore.repository';
10
10
  export * from './payment-firestore.repository';
11
11
  export * from './subscription-plan-firestore.repository';
@@ -1,9 +1,9 @@
1
- import { Checkout, OrderBlocked, OrderBlockedRepository, OrderBlockedType, PaymentCardInfo } from '../../../../../domain';
1
+ import { Checkout, OrderBlocked, OrderBlockedRepository, PaymentCardInfo } from '../../../../../domain';
2
2
  import { FirestoreConstructorParams } from '../../mixins';
3
3
  declare const OrderBlockedFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<OrderBlocked> & import("../../../../../domain").CrudRepository<OrderBlocked, import("../../../../../domain").CrudParams<OrderBlocked>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<OrderBlocked>, ...any[]]>;
4
4
  export declare class OrderBlockedFirestoreRepository extends OrderBlockedFirestoreRepository_base implements OrderBlockedRepository {
5
5
  constructor({ firestore, interceptors, }: Pick<FirestoreConstructorParams<OrderBlocked>, 'firestore' | 'interceptors'>);
6
- createBlockedOrderOrPayment(checkout: Checkout, blockType: string, type: OrderBlockedType, limiteRange: string, card?: PaymentCardInfo): Promise<OrderBlocked>;
6
+ createBlockedOrderOrPayment(checkout: Checkout, blockType: string, type: string, limiteRange: string, card?: PaymentCardInfo): Promise<OrderBlocked>;
7
7
  private formatZip;
8
8
  }
9
9
  export {};
@@ -0,0 +1,11 @@
1
+ import { CategoryProduct, CategoryProductRepository } from '../../../../domain';
2
+ import { HasuraConstructorParams } from '../../mixins';
3
+ declare const CategoryProductHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../..").GraphQLRepository<CategoryProduct> & import("../../../../domain").CrudRepository<CategoryProduct, import("../../../../domain").CrudParams<CategoryProduct>> & import("../../../../domain").UpdateRepository<CategoryProduct, import("../../../../domain").RepositoryUpdateParams<CategoryProduct>> & {
4
+ paramsToPlain(params: import("../../../../domain").RepositoryUpdateParams<CategoryProduct>): Partial<CategoryProduct>;
5
+ }, [HasuraConstructorParams<CategoryProduct> & import("../../mixins").CreateConstructorParams & import("../../mixins").DeleteConstructorParams & import("../../mixins").GetConstructorParams & import("../../mixins").UpdateConstructorParams, ...any[]]>;
6
+ export declare class CategoryProductHasuraGraphQLRepository extends CategoryProductHasuraGraphQLRepository_base implements CategoryProductRepository {
7
+ constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<CategoryProduct>, 'endpoint' | 'authOptions' | 'interceptors'>);
8
+ removeProductFromCategory(categoryId: string, productId: string): Promise<void>;
9
+ addProductToCategory(categoryId: string, productId: string): Promise<void>;
10
+ }
11
+ export {};
@@ -1,6 +1,7 @@
1
1
  export * from './category-collection-children-hasura-graphql.repository';
2
2
  export * from './category-filter-hasura-graphql.repository';
3
3
  export * from './category-hasura-graphql.repository';
4
+ export * from './category-product-hasura-graphql.repository';
4
5
  export * from './filter-hasura-graphql.repository';
5
6
  export * from './filter-option-hasura-graphql.repository';
6
7
  export * from './product-hasura-graphql.repository';
@@ -1,6 +1,4 @@
1
- export * from './adyen';
2
1
  export * from './elasticsearch';
3
2
  export * from './firebase';
4
3
  export * from './hasura-graphql';
5
- export * from './pagarme';
6
4
  export * from './vertex-ai';
@@ -1,4 +1,4 @@
1
- import { add, addBusinessDays, addDays, addMonths, addYears, Duration, endOfDay, format, formatISO9075, parseISO, startOfDay, sub, subDays } from 'date-fns';
1
+ import { add, addBusinessDays, addDays, addMonths, addYears, Duration, endOfDay, format, formatISO9075, parseISO, startOfDay, sub } from 'date-fns';
2
2
  import { chunk, each, get, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, pick, set, sortBy, unset } from 'lodash';
3
3
  export type DateDuration = Duration;
4
4
  export * from './decorators';
@@ -10,4 +10,4 @@ export * from './log.utils';
10
10
  export * from './mixins';
11
11
  export * from './parse-datetime';
12
12
  export * from './types';
13
- export { add, addBusinessDays, addDays, addMonths, addYears, chunk, each, endOfDay, format, formatISO9075, get, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, parseISO, pick, set, sortBy, startOfDay, sub, subDays, unset, };
13
+ export { add, addBusinessDays, addDays, addMonths, addYears, chunk, each, endOfDay, format, formatISO9075, get, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, parseISO, pick, set, sortBy, startOfDay, sub, unset, };
@@ -1,9 +0,0 @@
1
- import { BaseModel, GenericIdentifier } from '../../generic';
2
- export declare class Sequence extends BaseModel<Sequence> {
3
- id?: string;
4
- type: string;
5
- counter: number;
6
- month: number;
7
- year: number;
8
- static get identifiersFields(): GenericIdentifier[];
9
- }
@@ -1,4 +0,0 @@
1
- import { CrudRepository } from '../../generic/repository/crud.repository';
2
- import { Sequence } from '../models';
3
- export interface SequenceRepository extends CrudRepository<Sequence> {
4
- }
@@ -1,6 +0,0 @@
1
- export declare enum AntifraudProviders {
2
- BANKSLIP = "bankSlip",
3
- CARD = "card",
4
- PIX = "pix",
5
- POINTS = "glampoints"
6
- }
@@ -1,4 +0,0 @@
1
- export declare enum BusinessUnitEnum {
2
- 'SUBSCRIPTION' = 1,
3
- 'SHOP' = 2
4
- }
@@ -1,6 +0,0 @@
1
- export * from './antifraud-providers.enum';
2
- export * from './business-unit.enum';
3
- export * from './order-blocked.enum';
4
- export * from './pagarme-payment-status.enum';
5
- export * from './payment-methods.enum';
6
- export * from './payment-providers.enum';
@@ -1,5 +0,0 @@
1
- export declare enum OrderBlockedType {
2
- Checkout = "Checkout",
3
- Card = "Card",
4
- Boleto = "Boleto"
5
- }
@@ -1,10 +0,0 @@
1
- export declare enum PagarmePaymentStatus {
2
- 'Em processamento' = "processing",
3
- 'Autorizada' = "authorized",
4
- 'Pago' = "paid",
5
- 'Estornada' = "refunded",
6
- 'Aguardando pagamento' = "waiting_payment",
7
- 'Aguardando estorno' = "pending_refund",
8
- 'Recusada/Não autorizada' = "refused",
9
- 'Chargedback' = "chargedback"
10
- }
@@ -1,6 +0,0 @@
1
- export declare enum PaymentMethods {
2
- CARD = "card",
3
- BANKSLIP = "bankSlip",
4
- PIX = "pix",
5
- POINTS = "glampoints"
6
- }
@@ -1,5 +0,0 @@
1
- export declare enum PaymentProviders {
2
- PAGARME = "pagarMe",
3
- ADYEN = "adyen",
4
- GLAMPOINTS = "glampoints"
5
- }
@@ -1,9 +0,0 @@
1
- import { PaymentProviderCard } from '../interfaces';
2
- import { AdyenCard } from '../types';
3
- import { BasePaymentMethodFactory } from './base-payment-method.factory';
4
- type AdyenPaymentFactoryMethods = {
5
- card?: PaymentProviderCard<AdyenCard>;
6
- };
7
- export declare class AdyenPaymentMethodFactory extends BasePaymentMethodFactory<AdyenPaymentFactoryMethods> {
8
- }
9
- export {};
@@ -1,15 +0,0 @@
1
- import { AntifraudMethodFactory } from '../interfaces';
2
- import { AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService } from '../services';
3
- import { AntifraudeProvider } from '../types';
4
- type AntifraudMethods = {
5
- bankSlip?: AntifraudBankSlipService;
6
- card?: AntifraudCardService;
7
- pix?: AntifraudPixService;
8
- glampoints?: AntifraudGlampointsService;
9
- };
10
- export declare class AntifraudProviderFactory implements AntifraudMethodFactory {
11
- private readonly antifraudProviders;
12
- constructor(antifraudProviders: AntifraudMethods);
13
- build<T extends AntifraudeProvider>(provider: T): AntifraudProviderFactory['antifraudProviders'][T];
14
- }
15
- export {};
@@ -1,7 +0,0 @@
1
- import { PaymentMethodFactory, PaymentMethodFactoryMethods } from '../interfaces';
2
- import { PaymentMethod } from '../types';
3
- export declare abstract class BasePaymentMethodFactory<T extends PaymentMethodFactoryMethods = PaymentMethodFactoryMethods> implements PaymentMethodFactory {
4
- private readonly methods;
5
- constructor(methods: T);
6
- build<T extends PaymentMethod>(method: T): BasePaymentMethodFactory['methods'][T];
7
- }
@@ -1,8 +0,0 @@
1
- import { GlampointsPaymentService } from '../services';
2
- import { BasePaymentMethodFactory } from './base-payment-method.factory';
3
- type GlampointsPaymentFactoryMethods = {
4
- glampoints: GlampointsPaymentService;
5
- };
6
- export declare class GlampointsPaymentMethodFactory extends BasePaymentMethodFactory<GlampointsPaymentFactoryMethods> {
7
- }
8
- export {};
@@ -1,5 +0,0 @@
1
- export * from './adyen-payment-method.factory';
2
- export * from './antifraud-provider.factory';
3
- export * from './glampoints-payment-method.factory';
4
- export * from './pagarme-payment-method.factory';
5
- export * from './payment-provider.factory';
@@ -1,11 +0,0 @@
1
- import { PaymentProviderBankSlip, PaymentProviderCard, PaymentProviderPix } from '../interfaces';
2
- import { PagarMeCard } from '../types';
3
- import { BasePaymentMethodFactory } from './base-payment-method.factory';
4
- type PagarmePaymentFactoryMethods = {
5
- card?: PaymentProviderCard<PagarMeCard>;
6
- bankSlip?: PaymentProviderBankSlip;
7
- pix?: PaymentProviderPix;
8
- };
9
- export declare class PagarmePaymentMethodFactory extends BasePaymentMethodFactory<PagarmePaymentFactoryMethods> {
10
- }
11
- export {};
@@ -1,15 +0,0 @@
1
- import { PaymentProvider } from '../types';
2
- import { AdyenPaymentMethodFactory } from './adyen-payment-method.factory';
3
- import { GlampointsPaymentMethodFactory } from './glampoints-payment-method.factory';
4
- import { PagarmePaymentMethodFactory } from './pagarme-payment-method.factory';
5
- type PaymentProviderFactoryFactories = {
6
- pagarMe?: PagarmePaymentMethodFactory;
7
- adyen?: AdyenPaymentMethodFactory;
8
- glampoints?: GlampointsPaymentMethodFactory;
9
- };
10
- export declare class PaymentProviderFactory {
11
- private readonly paymentProviders;
12
- constructor(paymentProviders: PaymentProviderFactoryFactories);
13
- build<T extends PaymentProvider>(provider: T): PaymentProviderFactory['paymentProviders'][T];
14
- }
15
- export {};
@@ -1,11 +0,0 @@
1
- import { AntifraudeProvider } from '../types';
2
- import { AntifraudProvider } from './antifraud-provider.interface';
3
- export type AntifraudMethods = {
4
- bankSlip?: AntifraudProvider;
5
- card?: AntifraudProvider;
6
- pix?: AntifraudProvider;
7
- glampoints?: AntifraudProvider;
8
- };
9
- export interface AntifraudMethodFactory {
10
- build<T extends AntifraudeProvider>(method: T): AntifraudMethods[T];
11
- }
@@ -1,5 +0,0 @@
1
- import { Checkout } from '../models';
2
- import { PaymentCardInfo } from '../types';
3
- export interface AntifraudProvider {
4
- validate(checkout: Checkout, card?: PaymentCardInfo): Promise<Boolean>;
5
- }
@@ -1,7 +0,0 @@
1
- export * from './antifraud-method-factory.interface';
2
- export * from './antifraud-provider.interface';
3
- export * from './payment-method-factory.interface';
4
- export * from './payment-provider-bank-slip.interface';
5
- export * from './payment-provider-card.interface';
6
- export * from './payment-provider-glampoints.interface';
7
- export * from './payment-provider-pix.interface';
@@ -1,14 +0,0 @@
1
- import { PaymentMethod } from '../types';
2
- import { PaymentProviderBankSlip } from './payment-provider-bank-slip.interface';
3
- import { PaymentProviderCard } from './payment-provider-card.interface';
4
- import { PaymentProviderGlampoints } from './payment-provider-glampoints.interface';
5
- import { PaymentProviderPix } from './payment-provider-pix.interface';
6
- export type PaymentMethodFactoryMethods = {
7
- card?: PaymentProviderCard;
8
- bankSlip?: PaymentProviderBankSlip;
9
- pix?: PaymentProviderPix;
10
- glampoints?: PaymentProviderGlampoints;
11
- };
12
- export interface PaymentMethodFactory {
13
- build<T extends PaymentMethod>(method: T): PaymentMethodFactoryMethods[T];
14
- }
@@ -1,7 +0,0 @@
1
- import { PaymentTransaction } from '../models';
2
- import { Checkout } from '../models/checkout';
3
- import { Payment } from '../models/payment';
4
- export interface PaymentProviderBankSlip {
5
- pay(checkout: Checkout): Promise<Payment>;
6
- getBoletoTransaction(paymentId: number): Promise<PaymentTransaction>;
7
- }
@@ -1,13 +0,0 @@
1
- import { BusinessUnitEnum } from '../enums';
2
- import { PaymentTransaction } from '../models';
3
- import { Checkout } from '../models/checkout';
4
- import { Payment } from '../models/payment';
5
- import { CardInfo, PaymentCardInfo } from '../types';
6
- import { BaseCard } from '../types/base-card.type';
7
- export interface PaymentProviderCard<Card extends BaseCard = BaseCard> {
8
- pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
9
- addCard(card: CardInfo): Promise<Card>;
10
- getCardByToken(token: string): Promise<Card>;
11
- createCardHash<T>(bu: BusinessUnitEnum, card?: CardInfo): Promise<string | T>;
12
- createTransaction(info: any): Promise<PaymentTransaction>;
13
- }
@@ -1,5 +0,0 @@
1
- import { Checkout } from '../models/checkout';
2
- import { Payment } from '../models/payment';
3
- export interface PaymentProviderGlampoints {
4
- pay(checkout: Checkout): Promise<Payment>;
5
- }
@@ -1,5 +0,0 @@
1
- import { Checkout } from '../models/checkout';
2
- import { Payment } from '../models/payment';
3
- export interface PaymentProviderPix {
4
- pay(checkout: Checkout): Promise<Payment>;
5
- }