@natrave/shared-entities 7.6.0 → 7.7.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/dist/billing/billing-payments/billing-payment.entity.d.ts +25 -0
- package/dist/billing/billing-payments/billing-payment.entity.d.ts.map +1 -0
- package/dist/billing/billing-payments/billing-payment.entity.js +162 -0
- package/dist/billing/billing-payments/enums/billing-payment-method.enum.d.ts +8 -0
- package/dist/billing/billing-payments/enums/billing-payment-method.enum.d.ts.map +1 -0
- package/dist/billing/billing-payments/enums/billing-payment-method.enum.js +11 -0
- package/dist/billing/billing-payments/enums/billing-payment-provider-name.enum.d.ts +5 -0
- package/dist/billing/billing-payments/enums/billing-payment-provider-name.enum.d.ts.map +1 -0
- package/dist/billing/billing-payments/enums/billing-payment-provider-name.enum.js +8 -0
- package/dist/billing/billing-payments/enums/billing-payment-status.enum.d.ts +9 -0
- package/dist/billing/billing-payments/enums/billing-payment-status.enum.d.ts.map +1 -0
- package/dist/billing/billing-payments/enums/billing-payment-status.enum.js +12 -0
- package/dist/billing/billing-payments/index.d.ts +5 -0
- package/dist/billing/billing-payments/index.d.ts.map +1 -0
- package/dist/billing/billing-payments/index.js +4 -0
- package/dist/billing/billing-provider-webhook-events/billing-provider-webhook-event.entity.d.ts +16 -0
- package/dist/billing/billing-provider-webhook-events/billing-provider-webhook-event.entity.d.ts.map +1 -0
- package/dist/billing/billing-provider-webhook-events/billing-provider-webhook-event.entity.js +108 -0
- package/dist/billing/billing-provider-webhook-events/enums/billing-provider-webhook-status.enum.d.ts +6 -0
- package/dist/billing/billing-provider-webhook-events/enums/billing-provider-webhook-status.enum.d.ts.map +1 -0
- package/dist/billing/billing-provider-webhook-events/enums/billing-provider-webhook-status.enum.js +9 -0
- package/dist/billing/billing-provider-webhook-events/index.d.ts +3 -0
- package/dist/billing/billing-provider-webhook-events/index.d.ts.map +1 -0
- package/dist/billing/billing-provider-webhook-events/index.js +2 -0
- package/dist/billing/index.d.ts +2 -0
- package/dist/billing/index.d.ts.map +1 -1
- package/dist/billing/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BillingAccount } from '../billing-accounts';
|
|
2
|
+
import { BillingInvoice } from '../billing-invoices';
|
|
3
|
+
import { BillingPaymentMethod } from './enums/billing-payment-method.enum';
|
|
4
|
+
import { BillingPaymentProviderName } from './enums/billing-payment-provider-name.enum';
|
|
5
|
+
import { BillingPaymentStatus } from './enums/billing-payment-status.enum';
|
|
6
|
+
export declare class BillingPayment {
|
|
7
|
+
id: string;
|
|
8
|
+
billingAccountId: string;
|
|
9
|
+
invoiceId: string;
|
|
10
|
+
amount: number;
|
|
11
|
+
method: BillingPaymentMethod;
|
|
12
|
+
status: BillingPaymentStatus;
|
|
13
|
+
provider: BillingPaymentProviderName;
|
|
14
|
+
externalId: string | null;
|
|
15
|
+
providerResponse: Record<string, unknown> | null;
|
|
16
|
+
qrCode: string | null;
|
|
17
|
+
checkoutUrl: string | null;
|
|
18
|
+
expiresAt: Date | null;
|
|
19
|
+
paidAt: Date | null;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
billingAccount: BillingAccount;
|
|
23
|
+
invoice: BillingInvoice;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=billing-payment.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-payment.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-payments/billing-payment.entity.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAgB3E,qBAKa,cAAc;IAIzB,EAAE,EAAE,MAAM,CAAC;IAOX,gBAAgB,EAAE,MAAM,CAAC;IAOzB,SAAS,EAAE,MAAM,CAAC;IAMlB,MAAM,EAAE,MAAM,CAAC;IAUf,MAAM,EAAE,oBAAoB,CAAC;IAS7B,MAAM,EAAE,oBAAoB,CAAC;IAS7B,QAAQ,EAAE,0BAA0B,CAAC;IASrC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ1B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAQjD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAQtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAQvB,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IAOpB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAShB,cAAc,EAAE,cAAc,CAAC;IAO/B,OAAO,EAAE,cAAc,CAAC;CACzB"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
import {
|
|
12
|
+
Check,
|
|
13
|
+
Column,
|
|
14
|
+
CreateDateColumn,
|
|
15
|
+
Entity,
|
|
16
|
+
Index,
|
|
17
|
+
JoinColumn,
|
|
18
|
+
ManyToOne,
|
|
19
|
+
PrimaryGeneratedColumn,
|
|
20
|
+
UpdateDateColumn
|
|
21
|
+
} from "typeorm";
|
|
22
|
+
import { BillingAccount } from "../billing-accounts/index.js";
|
|
23
|
+
import { BillingInvoice } from "../billing-invoices/index.js";
|
|
24
|
+
import { BillingPaymentMethod } from "./enums/billing-payment-method.enum.js";
|
|
25
|
+
import { BillingPaymentProviderName } from "./enums/billing-payment-provider-name.enum.js";
|
|
26
|
+
import { BillingPaymentStatus } from "./enums/billing-payment-status.enum.js";
|
|
27
|
+
let BillingPayment = class {
|
|
28
|
+
};
|
|
29
|
+
__decorateClass([
|
|
30
|
+
PrimaryGeneratedColumn("uuid", {
|
|
31
|
+
comment: "Identificador \xFAnico do pagamento."
|
|
32
|
+
})
|
|
33
|
+
], BillingPayment.prototype, "id", 2);
|
|
34
|
+
__decorateClass([
|
|
35
|
+
Column({
|
|
36
|
+
name: "billing_account_id",
|
|
37
|
+
type: "uuid",
|
|
38
|
+
comment: "Identificador da conta de billing que paga."
|
|
39
|
+
})
|
|
40
|
+
], BillingPayment.prototype, "billingAccountId", 2);
|
|
41
|
+
__decorateClass([
|
|
42
|
+
Column({
|
|
43
|
+
name: "invoice_id",
|
|
44
|
+
type: "uuid",
|
|
45
|
+
comment: "Identificador da fatura sendo paga."
|
|
46
|
+
})
|
|
47
|
+
], BillingPayment.prototype, "invoiceId", 2);
|
|
48
|
+
__decorateClass([
|
|
49
|
+
Column({
|
|
50
|
+
type: "int",
|
|
51
|
+
comment: "Valor do pagamento em centavos."
|
|
52
|
+
})
|
|
53
|
+
], BillingPayment.prototype, "amount", 2);
|
|
54
|
+
__decorateClass([
|
|
55
|
+
Column({
|
|
56
|
+
name: "method",
|
|
57
|
+
type: "enum",
|
|
58
|
+
enum: BillingPaymentMethod,
|
|
59
|
+
enumName: "billing_payments_method_enum",
|
|
60
|
+
default: BillingPaymentMethod.UNSPECIFIED,
|
|
61
|
+
comment: "M\xE9todo do pagamento (definido no checkout do provider)."
|
|
62
|
+
})
|
|
63
|
+
], BillingPayment.prototype, "method", 2);
|
|
64
|
+
__decorateClass([
|
|
65
|
+
Column({
|
|
66
|
+
type: "enum",
|
|
67
|
+
enum: BillingPaymentStatus,
|
|
68
|
+
enumName: "billing_payments_status_enum",
|
|
69
|
+
default: BillingPaymentStatus.PENDING,
|
|
70
|
+
comment: "Estado atual do pagamento."
|
|
71
|
+
})
|
|
72
|
+
], BillingPayment.prototype, "status", 2);
|
|
73
|
+
__decorateClass([
|
|
74
|
+
Column({
|
|
75
|
+
name: "provider",
|
|
76
|
+
type: "enum",
|
|
77
|
+
enum: BillingPaymentProviderName,
|
|
78
|
+
enumName: "billing_payment_provider_name_enum",
|
|
79
|
+
comment: "Provider (gateway) usado neste pagamento."
|
|
80
|
+
})
|
|
81
|
+
], BillingPayment.prototype, "provider", 2);
|
|
82
|
+
__decorateClass([
|
|
83
|
+
Column({
|
|
84
|
+
name: "external_id",
|
|
85
|
+
type: "varchar",
|
|
86
|
+
length: 255,
|
|
87
|
+
nullable: true,
|
|
88
|
+
comment: "Identificador do pagamento no provider."
|
|
89
|
+
})
|
|
90
|
+
], BillingPayment.prototype, "externalId", 2);
|
|
91
|
+
__decorateClass([
|
|
92
|
+
Column({
|
|
93
|
+
name: "provider_response",
|
|
94
|
+
type: "jsonb",
|
|
95
|
+
nullable: true,
|
|
96
|
+
comment: "Resposta crua do provider."
|
|
97
|
+
})
|
|
98
|
+
], BillingPayment.prototype, "providerResponse", 2);
|
|
99
|
+
__decorateClass([
|
|
100
|
+
Column({
|
|
101
|
+
name: "qr_code",
|
|
102
|
+
type: "text",
|
|
103
|
+
nullable: true,
|
|
104
|
+
comment: "C\xF3digo PIX copia-e-cola (quando aplic\xE1vel)."
|
|
105
|
+
})
|
|
106
|
+
], BillingPayment.prototype, "qrCode", 2);
|
|
107
|
+
__decorateClass([
|
|
108
|
+
Column({
|
|
109
|
+
name: "checkout_url",
|
|
110
|
+
type: "text",
|
|
111
|
+
nullable: true,
|
|
112
|
+
comment: "URL de checkout do provider (quando aplic\xE1vel)."
|
|
113
|
+
})
|
|
114
|
+
], BillingPayment.prototype, "checkoutUrl", 2);
|
|
115
|
+
__decorateClass([
|
|
116
|
+
Column({
|
|
117
|
+
name: "expires_at",
|
|
118
|
+
type: "timestamptz",
|
|
119
|
+
nullable: true,
|
|
120
|
+
comment: "Expira\xE7\xE3o da cobran\xE7a (quando aplic\xE1vel)."
|
|
121
|
+
})
|
|
122
|
+
], BillingPayment.prototype, "expiresAt", 2);
|
|
123
|
+
__decorateClass([
|
|
124
|
+
Column({
|
|
125
|
+
name: "paid_at",
|
|
126
|
+
type: "timestamptz",
|
|
127
|
+
nullable: true,
|
|
128
|
+
comment: "Momento da confirma\xE7\xE3o do pagamento. Nulo enquanto n\xE3o pago."
|
|
129
|
+
})
|
|
130
|
+
], BillingPayment.prototype, "paidAt", 2);
|
|
131
|
+
__decorateClass([
|
|
132
|
+
CreateDateColumn({
|
|
133
|
+
name: "created_at",
|
|
134
|
+
type: "timestamptz",
|
|
135
|
+
comment: "Data de cria\xE7\xE3o do registro."
|
|
136
|
+
})
|
|
137
|
+
], BillingPayment.prototype, "createdAt", 2);
|
|
138
|
+
__decorateClass([
|
|
139
|
+
UpdateDateColumn({
|
|
140
|
+
name: "updated_at",
|
|
141
|
+
type: "timestamptz",
|
|
142
|
+
comment: "Data da \xFAltima atualiza\xE7\xE3o do registro."
|
|
143
|
+
})
|
|
144
|
+
], BillingPayment.prototype, "updatedAt", 2);
|
|
145
|
+
__decorateClass([
|
|
146
|
+
ManyToOne(() => BillingAccount, { onDelete: "RESTRICT" }),
|
|
147
|
+
JoinColumn({ name: "billing_account_id" })
|
|
148
|
+
], BillingPayment.prototype, "billingAccount", 2);
|
|
149
|
+
__decorateClass([
|
|
150
|
+
ManyToOne(() => BillingInvoice, { onDelete: "RESTRICT" }),
|
|
151
|
+
JoinColumn({ name: "invoice_id" })
|
|
152
|
+
], BillingPayment.prototype, "invoice", 2);
|
|
153
|
+
BillingPayment = __decorateClass([
|
|
154
|
+
Entity("billing_payments"),
|
|
155
|
+
Check("CHK_billing_payments_amount_positive", '"amount" >= 1'),
|
|
156
|
+
Index("idx_billing_payments_account", ["billingAccountId"]),
|
|
157
|
+
Index("idx_billing_payments_invoice", ["invoiceId"]),
|
|
158
|
+
Index("idx_billing_payments_status", ["status"])
|
|
159
|
+
], BillingPayment);
|
|
160
|
+
export {
|
|
161
|
+
BillingPayment
|
|
162
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-payment-method.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-payments/enums/billing-payment-method.enum.ts"],"names":[],"mappings":"AASA,oBAAY,oBAAoB;IAC9B,WAAW,gBAAgB;IAC3B,GAAG,QAAQ;IACX,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var BillingPaymentMethod = /* @__PURE__ */ ((BillingPaymentMethod2) => {
|
|
2
|
+
BillingPaymentMethod2["UNSPECIFIED"] = "unspecified";
|
|
3
|
+
BillingPaymentMethod2["PIX"] = "pix";
|
|
4
|
+
BillingPaymentMethod2["CREDIT_CARD"] = "credit_card";
|
|
5
|
+
BillingPaymentMethod2["DEBIT_CARD"] = "debit_card";
|
|
6
|
+
BillingPaymentMethod2["BOLETO"] = "boleto";
|
|
7
|
+
return BillingPaymentMethod2;
|
|
8
|
+
})(BillingPaymentMethod || {});
|
|
9
|
+
export {
|
|
10
|
+
BillingPaymentMethod
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-payment-provider-name.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-payments/enums/billing-payment-provider-name.enum.ts"],"names":[],"mappings":"AAUA,oBAAY,0BAA0B;IACpC,OAAO,YAAY;IACnB,YAAY,iBAAiB;CAC9B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var BillingPaymentProviderName = /* @__PURE__ */ ((BillingPaymentProviderName2) => {
|
|
2
|
+
BillingPaymentProviderName2["PAGARME"] = "pagarme";
|
|
3
|
+
BillingPaymentProviderName2["MERCADO_PAGO"] = "mercado_pago";
|
|
4
|
+
return BillingPaymentProviderName2;
|
|
5
|
+
})(BillingPaymentProviderName || {});
|
|
6
|
+
export {
|
|
7
|
+
BillingPaymentProviderName
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-payment-status.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-payments/enums/billing-payment-status.enum.ts"],"names":[],"mappings":"AAUA,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var BillingPaymentStatus = /* @__PURE__ */ ((BillingPaymentStatus2) => {
|
|
2
|
+
BillingPaymentStatus2["PENDING"] = "pending";
|
|
3
|
+
BillingPaymentStatus2["PAID"] = "paid";
|
|
4
|
+
BillingPaymentStatus2["FAILED"] = "failed";
|
|
5
|
+
BillingPaymentStatus2["EXPIRED"] = "expired";
|
|
6
|
+
BillingPaymentStatus2["CANCELED"] = "canceled";
|
|
7
|
+
BillingPaymentStatus2["REFUNDED"] = "refunded";
|
|
8
|
+
return BillingPaymentStatus2;
|
|
9
|
+
})(BillingPaymentStatus || {});
|
|
10
|
+
export {
|
|
11
|
+
BillingPaymentStatus
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-payments/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,qCAAqC,CAAC;AACpD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC"}
|
package/dist/billing/billing-provider-webhook-events/billing-provider-webhook-event.entity.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BillingPaymentProviderName } from '../billing-payments';
|
|
2
|
+
import { BillingProviderWebhookStatus } from './enums/billing-provider-webhook-status.enum';
|
|
3
|
+
export declare class BillingProviderWebhookEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
provider: BillingPaymentProviderName;
|
|
6
|
+
externalEventId: string;
|
|
7
|
+
eventType: string;
|
|
8
|
+
payload: Record<string, unknown>;
|
|
9
|
+
status: BillingProviderWebhookStatus;
|
|
10
|
+
attempts: number;
|
|
11
|
+
availableAt: Date;
|
|
12
|
+
lastError: string | null;
|
|
13
|
+
processedAt: Date | null;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=billing-provider-webhook-event.entity.d.ts.map
|
package/dist/billing/billing-provider-webhook-events/billing-provider-webhook-event.entity.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-provider-webhook-event.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-provider-webhook-events/billing-provider-webhook-event.entity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAe5F,qBAMa,2BAA2B;IAItC,EAAE,EAAE,MAAM,CAAC;IASX,QAAQ,EAAE,0BAA0B,CAAC;IAQrC,eAAe,EAAE,MAAM,CAAC;IAQxB,SAAS,EAAE,MAAM,CAAC;IAMlB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IASjC,MAAM,EAAE,4BAA4B,CAAC;IAOrC,QAAQ,EAAE,MAAM,CAAC;IAQjB,WAAW,EAAE,IAAI,CAAC;IAQlB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAQzB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAOzB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, Unique } from "typeorm";
|
|
12
|
+
import { BillingPaymentProviderName } from "../billing-payments/index.js";
|
|
13
|
+
import { BillingProviderWebhookStatus } from "./enums/billing-provider-webhook-status.enum.js";
|
|
14
|
+
let BillingProviderWebhookEvent = class {
|
|
15
|
+
};
|
|
16
|
+
__decorateClass([
|
|
17
|
+
PrimaryGeneratedColumn("uuid", {
|
|
18
|
+
comment: "Identificador \xFAnico do evento."
|
|
19
|
+
})
|
|
20
|
+
], BillingProviderWebhookEvent.prototype, "id", 2);
|
|
21
|
+
__decorateClass([
|
|
22
|
+
Column({
|
|
23
|
+
name: "provider",
|
|
24
|
+
type: "enum",
|
|
25
|
+
enum: BillingPaymentProviderName,
|
|
26
|
+
enumName: "billing_payment_provider_name_enum",
|
|
27
|
+
comment: "Provider que emitiu o webhook."
|
|
28
|
+
})
|
|
29
|
+
], BillingProviderWebhookEvent.prototype, "provider", 2);
|
|
30
|
+
__decorateClass([
|
|
31
|
+
Column({
|
|
32
|
+
name: "external_event_id",
|
|
33
|
+
type: "varchar",
|
|
34
|
+
length: 255,
|
|
35
|
+
comment: "Identificador do evento no provider (idempot\xEAncia)."
|
|
36
|
+
})
|
|
37
|
+
], BillingProviderWebhookEvent.prototype, "externalEventId", 2);
|
|
38
|
+
__decorateClass([
|
|
39
|
+
Column({
|
|
40
|
+
name: "event_type",
|
|
41
|
+
type: "varchar",
|
|
42
|
+
length: 80,
|
|
43
|
+
comment: "Tipo do evento no provider (ex.: payment.paid)."
|
|
44
|
+
})
|
|
45
|
+
], BillingProviderWebhookEvent.prototype, "eventType", 2);
|
|
46
|
+
__decorateClass([
|
|
47
|
+
Column({
|
|
48
|
+
type: "jsonb",
|
|
49
|
+
comment: "Payload cru do evento."
|
|
50
|
+
})
|
|
51
|
+
], BillingProviderWebhookEvent.prototype, "payload", 2);
|
|
52
|
+
__decorateClass([
|
|
53
|
+
Column({
|
|
54
|
+
type: "enum",
|
|
55
|
+
enum: BillingProviderWebhookStatus,
|
|
56
|
+
enumName: "billing_provider_webhook_events_status_enum",
|
|
57
|
+
default: BillingProviderWebhookStatus.PENDING,
|
|
58
|
+
comment: "Estado de processamento do evento."
|
|
59
|
+
})
|
|
60
|
+
], BillingProviderWebhookEvent.prototype, "status", 2);
|
|
61
|
+
__decorateClass([
|
|
62
|
+
Column({
|
|
63
|
+
type: "int",
|
|
64
|
+
default: 0,
|
|
65
|
+
comment: "N\xFAmero de tentativas de processamento."
|
|
66
|
+
})
|
|
67
|
+
], BillingProviderWebhookEvent.prototype, "attempts", 2);
|
|
68
|
+
__decorateClass([
|
|
69
|
+
Column({
|
|
70
|
+
name: "available_at",
|
|
71
|
+
type: "timestamptz",
|
|
72
|
+
default: () => "now()",
|
|
73
|
+
comment: "Momento a partir do qual o evento pode ser processado (backoff)."
|
|
74
|
+
})
|
|
75
|
+
], BillingProviderWebhookEvent.prototype, "availableAt", 2);
|
|
76
|
+
__decorateClass([
|
|
77
|
+
Column({
|
|
78
|
+
name: "last_error",
|
|
79
|
+
type: "text",
|
|
80
|
+
nullable: true,
|
|
81
|
+
comment: "\xDAltima mensagem de erro no processamento."
|
|
82
|
+
})
|
|
83
|
+
], BillingProviderWebhookEvent.prototype, "lastError", 2);
|
|
84
|
+
__decorateClass([
|
|
85
|
+
Column({
|
|
86
|
+
name: "processed_at",
|
|
87
|
+
type: "timestamptz",
|
|
88
|
+
nullable: true,
|
|
89
|
+
comment: "Momento em que o evento foi processado com sucesso."
|
|
90
|
+
})
|
|
91
|
+
], BillingProviderWebhookEvent.prototype, "processedAt", 2);
|
|
92
|
+
__decorateClass([
|
|
93
|
+
CreateDateColumn({
|
|
94
|
+
name: "created_at",
|
|
95
|
+
type: "timestamptz",
|
|
96
|
+
comment: "Data de recebimento do evento."
|
|
97
|
+
})
|
|
98
|
+
], BillingProviderWebhookEvent.prototype, "createdAt", 2);
|
|
99
|
+
BillingProviderWebhookEvent = __decorateClass([
|
|
100
|
+
Entity("billing_provider_webhook_events"),
|
|
101
|
+
Unique("UQ_billing_provider_webhook_events_external", ["provider", "externalEventId"]),
|
|
102
|
+
Index("idx_billing_provider_webhook_events_pending", ["availableAt"], {
|
|
103
|
+
where: `"status" = 'pending'`
|
|
104
|
+
})
|
|
105
|
+
], BillingProviderWebhookEvent);
|
|
106
|
+
export {
|
|
107
|
+
BillingProviderWebhookEvent
|
|
108
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-provider-webhook-status.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-provider-webhook-events/enums/billing-provider-webhook-status.enum.ts"],"names":[],"mappings":"AAUA,oBAAY,4BAA4B;IACtC,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB"}
|
package/dist/billing/billing-provider-webhook-events/enums/billing-provider-webhook-status.enum.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var BillingProviderWebhookStatus = /* @__PURE__ */ ((BillingProviderWebhookStatus2) => {
|
|
2
|
+
BillingProviderWebhookStatus2["PENDING"] = "pending";
|
|
3
|
+
BillingProviderWebhookStatus2["PROCESSED"] = "processed";
|
|
4
|
+
BillingProviderWebhookStatus2["FAILED"] = "failed";
|
|
5
|
+
return BillingProviderWebhookStatus2;
|
|
6
|
+
})(BillingProviderWebhookStatus || {});
|
|
7
|
+
export {
|
|
8
|
+
BillingProviderWebhookStatus
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-provider-webhook-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC"}
|
package/dist/billing/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from './billing-accounts';
|
|
2
2
|
export * from './billing-invoice-line-items';
|
|
3
3
|
export * from './billing-invoices';
|
|
4
|
+
export * from './billing-payments';
|
|
4
5
|
export * from './billing-plans';
|
|
5
6
|
export * from './billing-products';
|
|
7
|
+
export * from './billing-provider-webhook-events';
|
|
6
8
|
export * from './billing-subscription-items';
|
|
7
9
|
export * from './billing-subscriptions';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC"}
|
package/dist/billing/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from "./billing-accounts/index.js";
|
|
2
2
|
export * from "./billing-invoice-line-items/index.js";
|
|
3
3
|
export * from "./billing-invoices/index.js";
|
|
4
|
+
export * from "./billing-payments/index.js";
|
|
4
5
|
export * from "./billing-plans/index.js";
|
|
5
6
|
export * from "./billing-products/index.js";
|
|
7
|
+
export * from "./billing-provider-webhook-events/index.js";
|
|
6
8
|
export * from "./billing-subscription-items/index.js";
|
|
7
9
|
export * from "./billing-subscriptions/index.js";
|