@hed-hog/billing 0.0.2 → 0.0.285
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/README.md +420 -0
- package/dist/billing-contracts.controller.d.ts +85 -4
- package/dist/billing-contracts.controller.d.ts.map +1 -1
- package/dist/billing-coupons.controller.d.ts +60 -4
- package/dist/billing-coupons.controller.d.ts.map +1 -1
- package/dist/billing-dashboard.controller.d.ts +20 -5
- package/dist/billing-dashboard.controller.d.ts.map +1 -1
- package/dist/billing-entitlements.controller.d.ts +28 -2
- package/dist/billing-entitlements.controller.d.ts.map +1 -1
- package/dist/billing-gateways.controller.d.ts +18 -2
- package/dist/billing-gateways.controller.d.ts.map +1 -1
- package/dist/billing-invoices.controller.d.ts +56 -2
- package/dist/billing-invoices.controller.d.ts.map +1 -1
- package/dist/billing-offers.controller.d.ts +61 -4
- package/dist/billing-offers.controller.d.ts.map +1 -1
- package/dist/billing-orders.controller.d.ts +39 -2
- package/dist/billing-orders.controller.d.ts.map +1 -1
- package/dist/billing-payments.controller.d.ts +16 -1
- package/dist/billing-payments.controller.d.ts.map +1 -1
- package/dist/billing-prices.controller.d.ts +80 -4
- package/dist/billing-prices.controller.d.ts.map +1 -1
- package/dist/billing-products.controller.d.ts +62 -4
- package/dist/billing-products.controller.d.ts.map +1 -1
- package/dist/billing-subscriptions.controller.d.ts +138 -5
- package/dist/billing-subscriptions.controller.d.ts.map +1 -1
- package/dist/billing.service.d.ts +663 -39
- package/dist/billing.service.d.ts.map +1 -1
- package/dist/billing.service.js +135 -16
- package/dist/billing.service.js.map +1 -1
- package/hedhog/data/menu.yaml +1 -1
- package/hedhog/frontend/app/contracts/page.tsx.ejs +68 -64
- package/hedhog/frontend/app/coupons/page.tsx.ejs +81 -77
- package/hedhog/frontend/app/entitlements/page.tsx.ejs +59 -58
- package/hedhog/frontend/app/gateways/page.tsx.ejs +125 -57
- package/hedhog/frontend/app/invoices/page.tsx.ejs +49 -43
- package/hedhog/frontend/app/offers/page.tsx.ejs +68 -64
- package/hedhog/frontend/app/orders/page.tsx.ejs +47 -46
- package/hedhog/frontend/app/page.tsx.ejs +186 -186
- package/hedhog/frontend/app/payments/page.tsx.ejs +51 -45
- package/hedhog/frontend/app/prices/page.tsx.ejs +81 -75
- package/hedhog/frontend/app/products/page.tsx.ejs +79 -73
- package/hedhog/frontend/app/refunds/page.tsx.ejs +50 -44
- package/hedhog/frontend/app/reports/page.tsx.ejs +1 -1
- package/hedhog/frontend/app/seats/page.tsx.ejs +826 -0
- package/hedhog/frontend/app/subscriptions/page.tsx.ejs +95 -90
- package/hedhog/frontend/app/webhooks/page.tsx.ejs +47 -39
- package/hedhog/frontend/messages/en.json +640 -551
- package/hedhog/frontend/messages/pt.json +652 -563
- package/hedhog/table/billing_payment_method.yaml +1 -1
- package/package.json +4 -3
- package/src/billing.service.ts +299 -17
|
@@ -25,10 +25,68 @@ export declare class BillingService {
|
|
|
25
25
|
next: number;
|
|
26
26
|
data: any[];
|
|
27
27
|
}>;
|
|
28
|
-
getProduct(id: number): Promise<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
getProduct(id: number): Promise<{
|
|
29
|
+
billing_price: {
|
|
30
|
+
currency: string;
|
|
31
|
+
name: string;
|
|
32
|
+
id: number;
|
|
33
|
+
created_at: Date;
|
|
34
|
+
updated_at: Date;
|
|
35
|
+
amount_cents: number;
|
|
36
|
+
starts_at: Date | null;
|
|
37
|
+
ends_at: Date | null;
|
|
38
|
+
product_id: number;
|
|
39
|
+
is_active: boolean;
|
|
40
|
+
billing_type: import("@prisma/client").$Enums.billing_price_billing_type_enum;
|
|
41
|
+
interval_unit: import("@prisma/client").$Enums.billing_price_interval_unit_enum | null;
|
|
42
|
+
interval_count: number;
|
|
43
|
+
trial_days: number;
|
|
44
|
+
setup_fee_cents: number;
|
|
45
|
+
}[];
|
|
46
|
+
} & {
|
|
47
|
+
code: string | null;
|
|
48
|
+
name: string;
|
|
49
|
+
id: number;
|
|
50
|
+
description: string | null;
|
|
51
|
+
created_at: Date;
|
|
52
|
+
updated_at: Date;
|
|
53
|
+
is_active: boolean;
|
|
54
|
+
product_type: import("@prisma/client").$Enums.billing_product_product_type_enum;
|
|
55
|
+
category: string | null;
|
|
56
|
+
}>;
|
|
57
|
+
createProduct(data: CreateProductDto): Promise<{
|
|
58
|
+
code: string | null;
|
|
59
|
+
name: string;
|
|
60
|
+
id: number;
|
|
61
|
+
description: string | null;
|
|
62
|
+
created_at: Date;
|
|
63
|
+
updated_at: Date;
|
|
64
|
+
is_active: boolean;
|
|
65
|
+
product_type: import("@prisma/client").$Enums.billing_product_product_type_enum;
|
|
66
|
+
category: string | null;
|
|
67
|
+
}>;
|
|
68
|
+
updateProduct(id: number, data: UpdateProductDto): Promise<{
|
|
69
|
+
code: string | null;
|
|
70
|
+
name: string;
|
|
71
|
+
id: number;
|
|
72
|
+
description: string | null;
|
|
73
|
+
created_at: Date;
|
|
74
|
+
updated_at: Date;
|
|
75
|
+
is_active: boolean;
|
|
76
|
+
product_type: import("@prisma/client").$Enums.billing_product_product_type_enum;
|
|
77
|
+
category: string | null;
|
|
78
|
+
}>;
|
|
79
|
+
deleteProduct(id: number): Promise<{
|
|
80
|
+
code: string | null;
|
|
81
|
+
name: string;
|
|
82
|
+
id: number;
|
|
83
|
+
description: string | null;
|
|
84
|
+
created_at: Date;
|
|
85
|
+
updated_at: Date;
|
|
86
|
+
is_active: boolean;
|
|
87
|
+
product_type: import("@prisma/client").$Enums.billing_product_product_type_enum;
|
|
88
|
+
category: string | null;
|
|
89
|
+
}>;
|
|
32
90
|
listPrices(paginationParams: PaginationDTO): Promise<{
|
|
33
91
|
total: any;
|
|
34
92
|
lastPage: number;
|
|
@@ -38,10 +96,86 @@ export declare class BillingService {
|
|
|
38
96
|
next: number;
|
|
39
97
|
data: any[];
|
|
40
98
|
}>;
|
|
41
|
-
getPrice(id: number): Promise<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
99
|
+
getPrice(id: number): Promise<{
|
|
100
|
+
billing_product: {
|
|
101
|
+
code: string | null;
|
|
102
|
+
name: string;
|
|
103
|
+
id: number;
|
|
104
|
+
description: string | null;
|
|
105
|
+
created_at: Date;
|
|
106
|
+
updated_at: Date;
|
|
107
|
+
is_active: boolean;
|
|
108
|
+
product_type: import("@prisma/client").$Enums.billing_product_product_type_enum;
|
|
109
|
+
category: string | null;
|
|
110
|
+
};
|
|
111
|
+
} & {
|
|
112
|
+
currency: string;
|
|
113
|
+
name: string;
|
|
114
|
+
id: number;
|
|
115
|
+
created_at: Date;
|
|
116
|
+
updated_at: Date;
|
|
117
|
+
amount_cents: number;
|
|
118
|
+
starts_at: Date | null;
|
|
119
|
+
ends_at: Date | null;
|
|
120
|
+
product_id: number;
|
|
121
|
+
is_active: boolean;
|
|
122
|
+
billing_type: import("@prisma/client").$Enums.billing_price_billing_type_enum;
|
|
123
|
+
interval_unit: import("@prisma/client").$Enums.billing_price_interval_unit_enum | null;
|
|
124
|
+
interval_count: number;
|
|
125
|
+
trial_days: number;
|
|
126
|
+
setup_fee_cents: number;
|
|
127
|
+
}>;
|
|
128
|
+
createPrice(data: CreatePriceDto): Promise<{
|
|
129
|
+
currency: string;
|
|
130
|
+
name: string;
|
|
131
|
+
id: number;
|
|
132
|
+
created_at: Date;
|
|
133
|
+
updated_at: Date;
|
|
134
|
+
amount_cents: number;
|
|
135
|
+
starts_at: Date | null;
|
|
136
|
+
ends_at: Date | null;
|
|
137
|
+
product_id: number;
|
|
138
|
+
is_active: boolean;
|
|
139
|
+
billing_type: import("@prisma/client").$Enums.billing_price_billing_type_enum;
|
|
140
|
+
interval_unit: import("@prisma/client").$Enums.billing_price_interval_unit_enum | null;
|
|
141
|
+
interval_count: number;
|
|
142
|
+
trial_days: number;
|
|
143
|
+
setup_fee_cents: number;
|
|
144
|
+
}>;
|
|
145
|
+
updatePrice(id: number, data: UpdatePriceDto): Promise<{
|
|
146
|
+
currency: string;
|
|
147
|
+
name: string;
|
|
148
|
+
id: number;
|
|
149
|
+
created_at: Date;
|
|
150
|
+
updated_at: Date;
|
|
151
|
+
amount_cents: number;
|
|
152
|
+
starts_at: Date | null;
|
|
153
|
+
ends_at: Date | null;
|
|
154
|
+
product_id: number;
|
|
155
|
+
is_active: boolean;
|
|
156
|
+
billing_type: import("@prisma/client").$Enums.billing_price_billing_type_enum;
|
|
157
|
+
interval_unit: import("@prisma/client").$Enums.billing_price_interval_unit_enum | null;
|
|
158
|
+
interval_count: number;
|
|
159
|
+
trial_days: number;
|
|
160
|
+
setup_fee_cents: number;
|
|
161
|
+
}>;
|
|
162
|
+
deletePrice(id: number): Promise<{
|
|
163
|
+
currency: string;
|
|
164
|
+
name: string;
|
|
165
|
+
id: number;
|
|
166
|
+
created_at: Date;
|
|
167
|
+
updated_at: Date;
|
|
168
|
+
amount_cents: number;
|
|
169
|
+
starts_at: Date | null;
|
|
170
|
+
ends_at: Date | null;
|
|
171
|
+
product_id: number;
|
|
172
|
+
is_active: boolean;
|
|
173
|
+
billing_type: import("@prisma/client").$Enums.billing_price_billing_type_enum;
|
|
174
|
+
interval_unit: import("@prisma/client").$Enums.billing_price_interval_unit_enum | null;
|
|
175
|
+
interval_count: number;
|
|
176
|
+
trial_days: number;
|
|
177
|
+
setup_fee_cents: number;
|
|
178
|
+
}>;
|
|
45
179
|
listOffers(paginationParams: PaginationDTO): Promise<{
|
|
46
180
|
total: any;
|
|
47
181
|
lastPage: number;
|
|
@@ -51,10 +185,67 @@ export declare class BillingService {
|
|
|
51
185
|
next: number;
|
|
52
186
|
data: any[];
|
|
53
187
|
}>;
|
|
54
|
-
getOffer(id: number): Promise<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
188
|
+
getOffer(id: number): Promise<{
|
|
189
|
+
billing_offer_price: ({
|
|
190
|
+
billing_price: {
|
|
191
|
+
currency: string;
|
|
192
|
+
name: string;
|
|
193
|
+
id: number;
|
|
194
|
+
created_at: Date;
|
|
195
|
+
updated_at: Date;
|
|
196
|
+
amount_cents: number;
|
|
197
|
+
starts_at: Date | null;
|
|
198
|
+
ends_at: Date | null;
|
|
199
|
+
product_id: number;
|
|
200
|
+
is_active: boolean;
|
|
201
|
+
billing_type: import("@prisma/client").$Enums.billing_price_billing_type_enum;
|
|
202
|
+
interval_unit: import("@prisma/client").$Enums.billing_price_interval_unit_enum | null;
|
|
203
|
+
interval_count: number;
|
|
204
|
+
trial_days: number;
|
|
205
|
+
setup_fee_cents: number;
|
|
206
|
+
};
|
|
207
|
+
} & {
|
|
208
|
+
id: number;
|
|
209
|
+
created_at: Date;
|
|
210
|
+
offer_id: number;
|
|
211
|
+
price_id: number;
|
|
212
|
+
})[];
|
|
213
|
+
} & {
|
|
214
|
+
code: string;
|
|
215
|
+
name: string;
|
|
216
|
+
id: number;
|
|
217
|
+
description: string | null;
|
|
218
|
+
created_at: Date;
|
|
219
|
+
updated_at: Date;
|
|
220
|
+
status: import("@prisma/client").$Enums.billing_offer_status_enum;
|
|
221
|
+
}>;
|
|
222
|
+
createOffer(data: CreateOfferDto): Promise<{
|
|
223
|
+
code: string;
|
|
224
|
+
name: string;
|
|
225
|
+
id: number;
|
|
226
|
+
description: string | null;
|
|
227
|
+
created_at: Date;
|
|
228
|
+
updated_at: Date;
|
|
229
|
+
status: import("@prisma/client").$Enums.billing_offer_status_enum;
|
|
230
|
+
}>;
|
|
231
|
+
updateOffer(id: number, data: UpdateOfferDto): Promise<{
|
|
232
|
+
code: string;
|
|
233
|
+
name: string;
|
|
234
|
+
id: number;
|
|
235
|
+
description: string | null;
|
|
236
|
+
created_at: Date;
|
|
237
|
+
updated_at: Date;
|
|
238
|
+
status: import("@prisma/client").$Enums.billing_offer_status_enum;
|
|
239
|
+
}>;
|
|
240
|
+
deleteOffer(id: number): Promise<{
|
|
241
|
+
code: string;
|
|
242
|
+
name: string;
|
|
243
|
+
id: number;
|
|
244
|
+
description: string | null;
|
|
245
|
+
created_at: Date;
|
|
246
|
+
updated_at: Date;
|
|
247
|
+
status: import("@prisma/client").$Enums.billing_offer_status_enum;
|
|
248
|
+
}>;
|
|
58
249
|
listCoupons(paginationParams: PaginationDTO): Promise<{
|
|
59
250
|
total: any;
|
|
60
251
|
lastPage: number;
|
|
@@ -64,10 +255,66 @@ export declare class BillingService {
|
|
|
64
255
|
next: number;
|
|
65
256
|
data: any[];
|
|
66
257
|
}>;
|
|
67
|
-
getCoupon(id: number): Promise<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
258
|
+
getCoupon(id: number): Promise<{
|
|
259
|
+
currency: string | null;
|
|
260
|
+
code: string;
|
|
261
|
+
name: string;
|
|
262
|
+
id: number;
|
|
263
|
+
created_at: Date;
|
|
264
|
+
updated_at: Date;
|
|
265
|
+
status: import("@prisma/client").$Enums.billing_coupon_status_enum;
|
|
266
|
+
starts_at: Date | null;
|
|
267
|
+
ends_at: Date | null;
|
|
268
|
+
discount_type: import("@prisma/client").$Enums.billing_coupon_discount_type_enum;
|
|
269
|
+
discount_value: number;
|
|
270
|
+
max_uses: number | null;
|
|
271
|
+
uses_count: number;
|
|
272
|
+
}>;
|
|
273
|
+
createCoupon(data: CreateCouponDto): Promise<{
|
|
274
|
+
currency: string | null;
|
|
275
|
+
code: string;
|
|
276
|
+
name: string;
|
|
277
|
+
id: number;
|
|
278
|
+
created_at: Date;
|
|
279
|
+
updated_at: Date;
|
|
280
|
+
status: import("@prisma/client").$Enums.billing_coupon_status_enum;
|
|
281
|
+
starts_at: Date | null;
|
|
282
|
+
ends_at: Date | null;
|
|
283
|
+
discount_type: import("@prisma/client").$Enums.billing_coupon_discount_type_enum;
|
|
284
|
+
discount_value: number;
|
|
285
|
+
max_uses: number | null;
|
|
286
|
+
uses_count: number;
|
|
287
|
+
}>;
|
|
288
|
+
updateCoupon(id: number, data: Partial<CreateCouponDto>): Promise<{
|
|
289
|
+
currency: string | null;
|
|
290
|
+
code: string;
|
|
291
|
+
name: string;
|
|
292
|
+
id: number;
|
|
293
|
+
created_at: Date;
|
|
294
|
+
updated_at: Date;
|
|
295
|
+
status: import("@prisma/client").$Enums.billing_coupon_status_enum;
|
|
296
|
+
starts_at: Date | null;
|
|
297
|
+
ends_at: Date | null;
|
|
298
|
+
discount_type: import("@prisma/client").$Enums.billing_coupon_discount_type_enum;
|
|
299
|
+
discount_value: number;
|
|
300
|
+
max_uses: number | null;
|
|
301
|
+
uses_count: number;
|
|
302
|
+
}>;
|
|
303
|
+
deleteCoupon(id: number): Promise<{
|
|
304
|
+
currency: string | null;
|
|
305
|
+
code: string;
|
|
306
|
+
name: string;
|
|
307
|
+
id: number;
|
|
308
|
+
created_at: Date;
|
|
309
|
+
updated_at: Date;
|
|
310
|
+
status: import("@prisma/client").$Enums.billing_coupon_status_enum;
|
|
311
|
+
starts_at: Date | null;
|
|
312
|
+
ends_at: Date | null;
|
|
313
|
+
discount_type: import("@prisma/client").$Enums.billing_coupon_discount_type_enum;
|
|
314
|
+
discount_value: number;
|
|
315
|
+
max_uses: number | null;
|
|
316
|
+
uses_count: number;
|
|
317
|
+
}>;
|
|
71
318
|
listOrders(paginationParams: PaginationDTO): Promise<{
|
|
72
319
|
total: any;
|
|
73
320
|
lastPage: number;
|
|
@@ -77,8 +324,45 @@ export declare class BillingService {
|
|
|
77
324
|
next: number;
|
|
78
325
|
data: any[];
|
|
79
326
|
}>;
|
|
80
|
-
getOrder(id: number): Promise<
|
|
81
|
-
|
|
327
|
+
getOrder(id: number): Promise<{
|
|
328
|
+
billing_order_item: {
|
|
329
|
+
id: number;
|
|
330
|
+
description: string | null;
|
|
331
|
+
created_at: Date;
|
|
332
|
+
quantity: number;
|
|
333
|
+
order_id: number;
|
|
334
|
+
unit_amount_cents: number;
|
|
335
|
+
total_amount_cents: number;
|
|
336
|
+
price_id: number | null;
|
|
337
|
+
}[];
|
|
338
|
+
} & {
|
|
339
|
+
currency: string;
|
|
340
|
+
id: number;
|
|
341
|
+
created_at: Date;
|
|
342
|
+
updated_at: Date;
|
|
343
|
+
status: import("@prisma/client").$Enums.billing_order_status_enum;
|
|
344
|
+
contact_id: number | null;
|
|
345
|
+
subtotal_cents: number;
|
|
346
|
+
total_cents: number;
|
|
347
|
+
company_contact_id: number | null;
|
|
348
|
+
discount_cents: number;
|
|
349
|
+
source: string | null;
|
|
350
|
+
notes: string | null;
|
|
351
|
+
}>;
|
|
352
|
+
createOrder(data: CreateOrderDto): Promise<{
|
|
353
|
+
currency: string;
|
|
354
|
+
id: number;
|
|
355
|
+
created_at: Date;
|
|
356
|
+
updated_at: Date;
|
|
357
|
+
status: import("@prisma/client").$Enums.billing_order_status_enum;
|
|
358
|
+
contact_id: number | null;
|
|
359
|
+
subtotal_cents: number;
|
|
360
|
+
total_cents: number;
|
|
361
|
+
company_contact_id: number | null;
|
|
362
|
+
discount_cents: number;
|
|
363
|
+
source: string | null;
|
|
364
|
+
notes: string | null;
|
|
365
|
+
}>;
|
|
82
366
|
listSubscriptions(paginationParams: PaginationDTO): Promise<{
|
|
83
367
|
total: any;
|
|
84
368
|
lastPage: number;
|
|
@@ -88,11 +372,144 @@ export declare class BillingService {
|
|
|
88
372
|
next: number;
|
|
89
373
|
data: any[];
|
|
90
374
|
}>;
|
|
91
|
-
getSubscription(id: number): Promise<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
375
|
+
getSubscription(id: number): Promise<{
|
|
376
|
+
billing_product: {
|
|
377
|
+
code: string | null;
|
|
378
|
+
name: string;
|
|
379
|
+
id: number;
|
|
380
|
+
description: string | null;
|
|
381
|
+
created_at: Date;
|
|
382
|
+
updated_at: Date;
|
|
383
|
+
is_active: boolean;
|
|
384
|
+
product_type: import("@prisma/client").$Enums.billing_product_product_type_enum;
|
|
385
|
+
category: string | null;
|
|
386
|
+
};
|
|
387
|
+
billing_invoice: {
|
|
388
|
+
currency: string;
|
|
389
|
+
id: number;
|
|
390
|
+
created_at: Date;
|
|
391
|
+
updated_at: Date;
|
|
392
|
+
status: import("@prisma/client").$Enums.billing_invoice_status_enum;
|
|
393
|
+
contact_id: number | null;
|
|
394
|
+
subscription_id: number | null;
|
|
395
|
+
order_id: number | null;
|
|
396
|
+
invoice_number: string | null;
|
|
397
|
+
subtotal_cents: number;
|
|
398
|
+
total_cents: number;
|
|
399
|
+
due_date: Date | null;
|
|
400
|
+
paid_at: Date | null;
|
|
401
|
+
}[];
|
|
402
|
+
billing_price: {
|
|
403
|
+
currency: string;
|
|
404
|
+
name: string;
|
|
405
|
+
id: number;
|
|
406
|
+
created_at: Date;
|
|
407
|
+
updated_at: Date;
|
|
408
|
+
amount_cents: number;
|
|
409
|
+
starts_at: Date | null;
|
|
410
|
+
ends_at: Date | null;
|
|
411
|
+
product_id: number;
|
|
412
|
+
is_active: boolean;
|
|
413
|
+
billing_type: import("@prisma/client").$Enums.billing_price_billing_type_enum;
|
|
414
|
+
interval_unit: import("@prisma/client").$Enums.billing_price_interval_unit_enum | null;
|
|
415
|
+
interval_count: number;
|
|
416
|
+
trial_days: number;
|
|
417
|
+
setup_fee_cents: number;
|
|
418
|
+
};
|
|
419
|
+
billing_subscription_item: {
|
|
420
|
+
id: number;
|
|
421
|
+
created_at: Date;
|
|
422
|
+
updated_at: Date;
|
|
423
|
+
quantity: number;
|
|
424
|
+
subscription_id: number;
|
|
425
|
+
price_id: number;
|
|
426
|
+
is_active: boolean;
|
|
427
|
+
}[];
|
|
428
|
+
} & {
|
|
429
|
+
id: number;
|
|
430
|
+
created_at: Date;
|
|
431
|
+
updated_at: Date;
|
|
432
|
+
status: import("@prisma/client").$Enums.billing_subscription_status_enum;
|
|
433
|
+
contact_id: number | null;
|
|
434
|
+
product_id: number | null;
|
|
435
|
+
price_id: number | null;
|
|
436
|
+
gateway: string | null;
|
|
437
|
+
gateway_subscription_id: string | null;
|
|
438
|
+
started_at: Date | null;
|
|
439
|
+
trial_ends_at: Date | null;
|
|
440
|
+
current_period_start: Date | null;
|
|
441
|
+
current_period_end: Date | null;
|
|
442
|
+
cancel_at_period_end: boolean;
|
|
443
|
+
canceled_at: Date | null;
|
|
444
|
+
}>;
|
|
445
|
+
createSubscription(data: CreateSubscriptionDto): Promise<{
|
|
446
|
+
id: number;
|
|
447
|
+
created_at: Date;
|
|
448
|
+
updated_at: Date;
|
|
449
|
+
status: import("@prisma/client").$Enums.billing_subscription_status_enum;
|
|
450
|
+
contact_id: number | null;
|
|
451
|
+
product_id: number | null;
|
|
452
|
+
price_id: number | null;
|
|
453
|
+
gateway: string | null;
|
|
454
|
+
gateway_subscription_id: string | null;
|
|
455
|
+
started_at: Date | null;
|
|
456
|
+
trial_ends_at: Date | null;
|
|
457
|
+
current_period_start: Date | null;
|
|
458
|
+
current_period_end: Date | null;
|
|
459
|
+
cancel_at_period_end: boolean;
|
|
460
|
+
canceled_at: Date | null;
|
|
461
|
+
}>;
|
|
462
|
+
cancelSubscription(id: number): Promise<{
|
|
463
|
+
id: number;
|
|
464
|
+
created_at: Date;
|
|
465
|
+
updated_at: Date;
|
|
466
|
+
status: import("@prisma/client").$Enums.billing_subscription_status_enum;
|
|
467
|
+
contact_id: number | null;
|
|
468
|
+
product_id: number | null;
|
|
469
|
+
price_id: number | null;
|
|
470
|
+
gateway: string | null;
|
|
471
|
+
gateway_subscription_id: string | null;
|
|
472
|
+
started_at: Date | null;
|
|
473
|
+
trial_ends_at: Date | null;
|
|
474
|
+
current_period_start: Date | null;
|
|
475
|
+
current_period_end: Date | null;
|
|
476
|
+
cancel_at_period_end: boolean;
|
|
477
|
+
canceled_at: Date | null;
|
|
478
|
+
}>;
|
|
479
|
+
pauseSubscription(id: number): Promise<{
|
|
480
|
+
id: number;
|
|
481
|
+
created_at: Date;
|
|
482
|
+
updated_at: Date;
|
|
483
|
+
status: import("@prisma/client").$Enums.billing_subscription_status_enum;
|
|
484
|
+
contact_id: number | null;
|
|
485
|
+
product_id: number | null;
|
|
486
|
+
price_id: number | null;
|
|
487
|
+
gateway: string | null;
|
|
488
|
+
gateway_subscription_id: string | null;
|
|
489
|
+
started_at: Date | null;
|
|
490
|
+
trial_ends_at: Date | null;
|
|
491
|
+
current_period_start: Date | null;
|
|
492
|
+
current_period_end: Date | null;
|
|
493
|
+
cancel_at_period_end: boolean;
|
|
494
|
+
canceled_at: Date | null;
|
|
495
|
+
}>;
|
|
496
|
+
resumeSubscription(id: number): Promise<{
|
|
497
|
+
id: number;
|
|
498
|
+
created_at: Date;
|
|
499
|
+
updated_at: Date;
|
|
500
|
+
status: import("@prisma/client").$Enums.billing_subscription_status_enum;
|
|
501
|
+
contact_id: number | null;
|
|
502
|
+
product_id: number | null;
|
|
503
|
+
price_id: number | null;
|
|
504
|
+
gateway: string | null;
|
|
505
|
+
gateway_subscription_id: string | null;
|
|
506
|
+
started_at: Date | null;
|
|
507
|
+
trial_ends_at: Date | null;
|
|
508
|
+
current_period_start: Date | null;
|
|
509
|
+
current_period_end: Date | null;
|
|
510
|
+
cancel_at_period_end: boolean;
|
|
511
|
+
canceled_at: Date | null;
|
|
512
|
+
}>;
|
|
96
513
|
listInvoices(paginationParams: PaginationDTO): Promise<{
|
|
97
514
|
total: any;
|
|
98
515
|
lastPage: number;
|
|
@@ -102,8 +519,62 @@ export declare class BillingService {
|
|
|
102
519
|
next: number;
|
|
103
520
|
data: any[];
|
|
104
521
|
}>;
|
|
105
|
-
getInvoice(id: number): Promise<
|
|
106
|
-
|
|
522
|
+
getInvoice(id: number): Promise<{
|
|
523
|
+
billing_invoice_item: {
|
|
524
|
+
id: number;
|
|
525
|
+
description: string;
|
|
526
|
+
created_at: Date;
|
|
527
|
+
quantity: number;
|
|
528
|
+
invoice_id: number;
|
|
529
|
+
unit_amount_cents: number;
|
|
530
|
+
total_amount_cents: number;
|
|
531
|
+
}[];
|
|
532
|
+
billing_payment: {
|
|
533
|
+
currency: string;
|
|
534
|
+
id: number;
|
|
535
|
+
provider: string | null;
|
|
536
|
+
created_at: Date;
|
|
537
|
+
updated_at: Date;
|
|
538
|
+
status: import("@prisma/client").$Enums.billing_payment_status_enum;
|
|
539
|
+
amount_cents: number;
|
|
540
|
+
contact_id: number | null;
|
|
541
|
+
order_id: number | null;
|
|
542
|
+
paid_at: Date | null;
|
|
543
|
+
invoice_id: number | null;
|
|
544
|
+
method_type: import("@prisma/client").$Enums.billing_payment_method_type_enum;
|
|
545
|
+
external_transaction_id: string | null;
|
|
546
|
+
raw_response: string | null;
|
|
547
|
+
}[];
|
|
548
|
+
} & {
|
|
549
|
+
currency: string;
|
|
550
|
+
id: number;
|
|
551
|
+
created_at: Date;
|
|
552
|
+
updated_at: Date;
|
|
553
|
+
status: import("@prisma/client").$Enums.billing_invoice_status_enum;
|
|
554
|
+
contact_id: number | null;
|
|
555
|
+
subscription_id: number | null;
|
|
556
|
+
order_id: number | null;
|
|
557
|
+
invoice_number: string | null;
|
|
558
|
+
subtotal_cents: number;
|
|
559
|
+
total_cents: number;
|
|
560
|
+
due_date: Date | null;
|
|
561
|
+
paid_at: Date | null;
|
|
562
|
+
}>;
|
|
563
|
+
createInvoice(data: Record<string, unknown>): Promise<{
|
|
564
|
+
currency: string;
|
|
565
|
+
id: number;
|
|
566
|
+
created_at: Date;
|
|
567
|
+
updated_at: Date;
|
|
568
|
+
status: import("@prisma/client").$Enums.billing_invoice_status_enum;
|
|
569
|
+
contact_id: number | null;
|
|
570
|
+
subscription_id: number | null;
|
|
571
|
+
order_id: number | null;
|
|
572
|
+
invoice_number: string | null;
|
|
573
|
+
subtotal_cents: number;
|
|
574
|
+
total_cents: number;
|
|
575
|
+
due_date: Date | null;
|
|
576
|
+
paid_at: Date | null;
|
|
577
|
+
}>;
|
|
107
578
|
listPayments(paginationParams: PaginationDTO): Promise<{
|
|
108
579
|
total: any;
|
|
109
580
|
lastPage: number;
|
|
@@ -113,7 +584,22 @@ export declare class BillingService {
|
|
|
113
584
|
next: number;
|
|
114
585
|
data: any[];
|
|
115
586
|
}>;
|
|
116
|
-
getPayment(id: number): Promise<
|
|
587
|
+
getPayment(id: number): Promise<{
|
|
588
|
+
currency: string;
|
|
589
|
+
id: number;
|
|
590
|
+
provider: string | null;
|
|
591
|
+
created_at: Date;
|
|
592
|
+
updated_at: Date;
|
|
593
|
+
status: import("@prisma/client").$Enums.billing_payment_status_enum;
|
|
594
|
+
amount_cents: number;
|
|
595
|
+
contact_id: number | null;
|
|
596
|
+
order_id: number | null;
|
|
597
|
+
paid_at: Date | null;
|
|
598
|
+
invoice_id: number | null;
|
|
599
|
+
method_type: import("@prisma/client").$Enums.billing_payment_method_type_enum;
|
|
600
|
+
external_transaction_id: string | null;
|
|
601
|
+
raw_response: string | null;
|
|
602
|
+
}>;
|
|
117
603
|
listRefunds(paginationParams: PaginationDTO): Promise<{
|
|
118
604
|
total: any;
|
|
119
605
|
lastPage: number;
|
|
@@ -132,8 +618,34 @@ export declare class BillingService {
|
|
|
132
618
|
next: number;
|
|
133
619
|
data: any[];
|
|
134
620
|
}>;
|
|
135
|
-
createEntitlement(data: CreateEntitlementDto): Promise<
|
|
136
|
-
|
|
621
|
+
createEntitlement(data: CreateEntitlementDto): Promise<{
|
|
622
|
+
id: number;
|
|
623
|
+
created_at: Date;
|
|
624
|
+
updated_at: Date;
|
|
625
|
+
status: import("@prisma/client").$Enums.billing_entitlement_status_enum;
|
|
626
|
+
source_type: string;
|
|
627
|
+
contact_id: number;
|
|
628
|
+
starts_at: Date | null;
|
|
629
|
+
ends_at: Date | null;
|
|
630
|
+
source_id: number;
|
|
631
|
+
target_type: string;
|
|
632
|
+
target_id: number;
|
|
633
|
+
access_type: string;
|
|
634
|
+
}>;
|
|
635
|
+
deleteEntitlement(id: number): Promise<{
|
|
636
|
+
id: number;
|
|
637
|
+
created_at: Date;
|
|
638
|
+
updated_at: Date;
|
|
639
|
+
status: import("@prisma/client").$Enums.billing_entitlement_status_enum;
|
|
640
|
+
source_type: string;
|
|
641
|
+
contact_id: number;
|
|
642
|
+
starts_at: Date | null;
|
|
643
|
+
ends_at: Date | null;
|
|
644
|
+
source_id: number;
|
|
645
|
+
target_type: string;
|
|
646
|
+
target_id: number;
|
|
647
|
+
access_type: string;
|
|
648
|
+
}>;
|
|
137
649
|
listContracts(paginationParams: PaginationDTO): Promise<{
|
|
138
650
|
total: any;
|
|
139
651
|
lastPage: number;
|
|
@@ -143,12 +655,109 @@ export declare class BillingService {
|
|
|
143
655
|
next: number;
|
|
144
656
|
data: any[];
|
|
145
657
|
}>;
|
|
146
|
-
getContract(id: number): Promise<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
658
|
+
getContract(id: number): Promise<{
|
|
659
|
+
billing_contract_seat: ({
|
|
660
|
+
billing_product: {
|
|
661
|
+
code: string | null;
|
|
662
|
+
name: string;
|
|
663
|
+
id: number;
|
|
664
|
+
description: string | null;
|
|
665
|
+
created_at: Date;
|
|
666
|
+
updated_at: Date;
|
|
667
|
+
is_active: boolean;
|
|
668
|
+
product_type: import("@prisma/client").$Enums.billing_product_product_type_enum;
|
|
669
|
+
category: string | null;
|
|
670
|
+
};
|
|
671
|
+
} & {
|
|
672
|
+
id: number;
|
|
673
|
+
created_at: Date;
|
|
674
|
+
updated_at: Date;
|
|
675
|
+
contract_id: number;
|
|
676
|
+
product_id: number;
|
|
677
|
+
quantity: number;
|
|
678
|
+
price_per_seat_cents: number | null;
|
|
679
|
+
})[];
|
|
680
|
+
billing_seat_allocation: {
|
|
681
|
+
id: number;
|
|
682
|
+
created_at: Date;
|
|
683
|
+
updated_at: Date;
|
|
684
|
+
status: import("@prisma/client").$Enums.billing_seat_allocation_status_enum;
|
|
685
|
+
contract_id: number;
|
|
686
|
+
seat_id: number;
|
|
687
|
+
person_id: number;
|
|
688
|
+
allocated_at: Date;
|
|
689
|
+
released_at: Date | null;
|
|
690
|
+
}[];
|
|
691
|
+
} & {
|
|
692
|
+
name: string;
|
|
693
|
+
id: number;
|
|
694
|
+
description: string | null;
|
|
695
|
+
created_at: Date;
|
|
696
|
+
updated_at: Date;
|
|
697
|
+
status: import("@prisma/client").$Enums.billing_contract_status_enum;
|
|
698
|
+
contact_id: number;
|
|
699
|
+
starts_at: Date;
|
|
700
|
+
ends_at: Date | null;
|
|
701
|
+
total_seats: number | null;
|
|
702
|
+
signed_at: Date | null;
|
|
703
|
+
}>;
|
|
704
|
+
createContract(data: CreateContractDto): Promise<{
|
|
705
|
+
name: string;
|
|
706
|
+
id: number;
|
|
707
|
+
description: string | null;
|
|
708
|
+
created_at: Date;
|
|
709
|
+
updated_at: Date;
|
|
710
|
+
status: import("@prisma/client").$Enums.billing_contract_status_enum;
|
|
711
|
+
contact_id: number;
|
|
712
|
+
starts_at: Date;
|
|
713
|
+
ends_at: Date | null;
|
|
714
|
+
total_seats: number | null;
|
|
715
|
+
signed_at: Date | null;
|
|
716
|
+
}>;
|
|
717
|
+
updateContract(id: number, data: UpdateContractDto): Promise<{
|
|
718
|
+
name: string;
|
|
719
|
+
id: number;
|
|
720
|
+
description: string | null;
|
|
721
|
+
created_at: Date;
|
|
722
|
+
updated_at: Date;
|
|
723
|
+
status: import("@prisma/client").$Enums.billing_contract_status_enum;
|
|
724
|
+
contact_id: number;
|
|
725
|
+
starts_at: Date;
|
|
726
|
+
ends_at: Date | null;
|
|
727
|
+
total_seats: number | null;
|
|
728
|
+
signed_at: Date | null;
|
|
729
|
+
}>;
|
|
730
|
+
deleteContract(id: number): Promise<{
|
|
731
|
+
name: string;
|
|
732
|
+
id: number;
|
|
733
|
+
description: string | null;
|
|
734
|
+
created_at: Date;
|
|
735
|
+
updated_at: Date;
|
|
736
|
+
status: import("@prisma/client").$Enums.billing_contract_status_enum;
|
|
737
|
+
contact_id: number;
|
|
738
|
+
starts_at: Date;
|
|
739
|
+
ends_at: Date | null;
|
|
740
|
+
total_seats: number | null;
|
|
741
|
+
signed_at: Date | null;
|
|
742
|
+
}>;
|
|
743
|
+
listGateways(): Promise<{
|
|
744
|
+
name: string;
|
|
745
|
+
id: number;
|
|
746
|
+
created_at: Date;
|
|
747
|
+
updated_at: Date;
|
|
748
|
+
slug: string;
|
|
749
|
+
is_active: boolean;
|
|
750
|
+
config_json: string | null;
|
|
751
|
+
}[]>;
|
|
752
|
+
updateGateway(slug: string, data: Record<string, unknown>): Promise<{
|
|
753
|
+
name: string;
|
|
754
|
+
id: number;
|
|
755
|
+
created_at: Date;
|
|
756
|
+
updated_at: Date;
|
|
757
|
+
slug: string;
|
|
758
|
+
is_active: boolean;
|
|
759
|
+
config_json: string | null;
|
|
760
|
+
}>;
|
|
152
761
|
listWebhooks(paginationParams: PaginationDTO): Promise<{
|
|
153
762
|
total: any;
|
|
154
763
|
lastPage: number;
|
|
@@ -159,11 +768,26 @@ export declare class BillingService {
|
|
|
159
768
|
data: any[];
|
|
160
769
|
}>;
|
|
161
770
|
getDashboardData(): Promise<{
|
|
162
|
-
activeSubscriptions:
|
|
163
|
-
failedPayments:
|
|
164
|
-
overdueInvoices:
|
|
165
|
-
revenueThisMonthCents:
|
|
166
|
-
recentPayments:
|
|
771
|
+
activeSubscriptions: number;
|
|
772
|
+
failedPayments: number;
|
|
773
|
+
overdueInvoices: number;
|
|
774
|
+
revenueThisMonthCents: number;
|
|
775
|
+
recentPayments: {
|
|
776
|
+
currency: string;
|
|
777
|
+
id: number;
|
|
778
|
+
provider: string | null;
|
|
779
|
+
created_at: Date;
|
|
780
|
+
updated_at: Date;
|
|
781
|
+
status: import("@prisma/client").$Enums.billing_payment_status_enum;
|
|
782
|
+
amount_cents: number;
|
|
783
|
+
contact_id: number | null;
|
|
784
|
+
order_id: number | null;
|
|
785
|
+
paid_at: Date | null;
|
|
786
|
+
invoice_id: number | null;
|
|
787
|
+
method_type: import("@prisma/client").$Enums.billing_payment_method_type_enum;
|
|
788
|
+
external_transaction_id: string | null;
|
|
789
|
+
raw_response: string | null;
|
|
790
|
+
}[];
|
|
167
791
|
}>;
|
|
168
792
|
}
|
|
169
793
|
//# sourceMappingURL=billing.service.d.ts.map
|