resurgence-data 1.1.34 → 1.1.36

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.
@@ -0,0 +1,75 @@
1
+ export interface FlutterWaveChargeCompleted {
2
+ event: "charge.completed";
3
+ data: {
4
+ id: number;
5
+ tx_ref: string;
6
+ flw_ref: string;
7
+ device_fingerprint: string | null;
8
+ amount: number;
9
+ currency: string;
10
+ charged_amount: number;
11
+ app_fee: number;
12
+ merchant_fee: number;
13
+ processor_response: string;
14
+ auth_model: string;
15
+ ip: string | null;
16
+ narration: string;
17
+ status: string;
18
+ payment_type: string;
19
+ created_at: string;
20
+ account_id: number;
21
+ customer: {
22
+ id: number;
23
+ name: string;
24
+ phone_number: string;
25
+ email: string;
26
+ created_at: string;
27
+ };
28
+ card: {
29
+ first_6digits: string;
30
+ last_4digits: string;
31
+ issuer: string;
32
+ country: string;
33
+ type: string;
34
+ expiry: string;
35
+ };
36
+ };
37
+ }
38
+ export interface FlutterwaveChargeFailed {
39
+ event: "charge.failed";
40
+ data: {
41
+ id: number;
42
+ tx_ref: string;
43
+ flw_ref: string;
44
+ device_fingerprint: string | null;
45
+ amount: number;
46
+ currency: string;
47
+ charged_amount: number;
48
+ app_fee: number;
49
+ merchant_fee: number;
50
+ processor_response: string;
51
+ auth_model: string;
52
+ ip: string | null;
53
+ narration: string;
54
+ status: string;
55
+ payment_type: string;
56
+ created_at: string;
57
+ account_id: number;
58
+ customer: {
59
+ id: number;
60
+ name: string;
61
+ phone_number: string | null;
62
+ email: string;
63
+ created_at: string;
64
+ };
65
+ card: {
66
+ first_6digits: string;
67
+ last_4digits: string;
68
+ issuer: string;
69
+ country: string;
70
+ type: string;
71
+ expiry: string;
72
+ };
73
+ };
74
+ "event.type": string;
75
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -12,6 +12,8 @@ export declare class InvoiceItemDto extends BaseDTO {
12
12
  export declare class CreateInvoiceDto extends BaseDTO {
13
13
  billerId: string;
14
14
  customerId?: string;
15
+ title?: string;
16
+ description?: string;
15
17
  items: InvoiceItemDto[];
16
18
  discountValue: number;
17
19
  total?: number;
@@ -24,6 +26,8 @@ export declare class CreateInvoiceDto extends BaseDTO {
24
26
  export declare class UpdateInvoiceDto extends BaseDTO {
25
27
  id: string;
26
28
  billerId?: string;
29
+ title?: string;
30
+ description?: string;
27
31
  items?: InvoiceItemDto[];
28
32
  customerId?: string;
29
33
  discountValue?: number;
@@ -106,6 +106,26 @@ __decorate([
106
106
  (0, class_validator_1.IsOptional)(),
107
107
  __metadata("design:type", String)
108
108
  ], CreateInvoiceDto.prototype, "customerId", void 0);
109
+ __decorate([
110
+ (0, swagger_1.ApiProperty)({
111
+ description: "Title of the invoice",
112
+ example: " Invoice to blah blah",
113
+ required: false,
114
+ }),
115
+ (0, class_validator_1.IsString)({ message: "Please enter a valid title" }),
116
+ (0, class_validator_1.IsOptional)(),
117
+ __metadata("design:type", String)
118
+ ], CreateInvoiceDto.prototype, "title", void 0);
119
+ __decorate([
120
+ (0, swagger_1.ApiProperty)({
121
+ description: "Description of the invoice",
122
+ example: "Invoice to blah blah",
123
+ required: false,
124
+ }),
125
+ (0, class_validator_1.IsString)({ message: "Please enter a valid description" }),
126
+ (0, class_validator_1.IsOptional)(),
127
+ __metadata("design:type", String)
128
+ ], CreateInvoiceDto.prototype, "description", void 0);
109
129
  __decorate([
110
130
  (0, swagger_1.ApiProperty)({
111
131
  description: "List of items",
@@ -202,6 +222,26 @@ __decorate([
202
222
  (0, class_validator_1.IsOptional)(),
203
223
  __metadata("design:type", String)
204
224
  ], UpdateInvoiceDto.prototype, "billerId", void 0);
225
+ __decorate([
226
+ (0, swagger_1.ApiProperty)({
227
+ description: "Title of the invoice",
228
+ example: " Invoice to blah blah",
229
+ required: false,
230
+ }),
231
+ (0, class_validator_1.IsString)({ message: "Please enter a valid title" }),
232
+ (0, class_validator_1.IsOptional)(),
233
+ __metadata("design:type", String)
234
+ ], UpdateInvoiceDto.prototype, "title", void 0);
235
+ __decorate([
236
+ (0, swagger_1.ApiProperty)({
237
+ description: "Description of the invoice",
238
+ example: "Invoice to blah blah",
239
+ required: false,
240
+ }),
241
+ (0, class_validator_1.IsString)({ message: "Please enter a valid description" }),
242
+ (0, class_validator_1.IsOptional)(),
243
+ __metadata("design:type", String)
244
+ ], UpdateInvoiceDto.prototype, "description", void 0);
205
245
  __decorate([
206
246
  (0, swagger_1.ApiProperty)({
207
247
  description: "List of items",
@@ -3,7 +3,6 @@ export declare class TransactionSplitDto {
3
3
  splitType: string;
4
4
  splitValue: string;
5
5
  transactionTotal: number;
6
- splitAmount?: number;
7
6
  }
8
7
  export declare class PaymentRequestDto {
9
8
  uniqueTransactionRef?: string;
@@ -73,3 +72,10 @@ export declare class USSDChargeDto {
73
72
  emailAddress?: string;
74
73
  fullName?: string;
75
74
  }
75
+ export declare class BankTransferChargeDto {
76
+ transactionReference: string;
77
+ currency: string;
78
+ amount: number;
79
+ emailAddress?: string;
80
+ fullName?: string;
81
+ }
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.USSDChargeDto = exports.CardValidationPayload = exports.CardChargeAuthorizationDto = exports.CardChargeDTO = exports.APIPaymentRequestDto = exports.PaymentRequestDto = exports.TransactionSplitDto = void 0;
12
+ exports.BankTransferChargeDto = exports.USSDChargeDto = exports.CardValidationPayload = exports.CardChargeAuthorizationDto = exports.CardChargeDTO = exports.APIPaymentRequestDto = exports.PaymentRequestDto = exports.TransactionSplitDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
15
  class TransactionSplitDto {
@@ -39,11 +39,6 @@ __decorate([
39
39
  (0, class_validator_1.IsInt)({ message: "Transaction Total must be the lowest currency denomination" }),
40
40
  __metadata("design:type", Number)
41
41
  ], TransactionSplitDto.prototype, "transactionTotal", void 0);
42
- __decorate([
43
- (0, swagger_1.ApiProperty)({ description: "Amount of the transaction split" }),
44
- (0, class_validator_1.IsOptional)(),
45
- __metadata("design:type", Number)
46
- ], TransactionSplitDto.prototype, "splitAmount", void 0);
47
42
  class PaymentRequestDto {
48
43
  }
49
44
  exports.PaymentRequestDto = PaymentRequestDto;
@@ -386,3 +381,35 @@ __decorate([
386
381
  (0, class_validator_1.IsOptional)(),
387
382
  __metadata("design:type", String)
388
383
  ], USSDChargeDto.prototype, "fullName", void 0);
384
+ class BankTransferChargeDto {
385
+ }
386
+ exports.BankTransferChargeDto = BankTransferChargeDto;
387
+ __decorate([
388
+ (0, swagger_1.ApiProperty)({ description: "Transaction reference" }),
389
+ (0, class_validator_1.IsNotEmpty)({ message: "Please provide your transaction reference" }),
390
+ (0, class_validator_1.IsString)({ message: "Transaction reference must be a string" }),
391
+ __metadata("design:type", String)
392
+ ], BankTransferChargeDto.prototype, "transactionReference", void 0);
393
+ __decorate([
394
+ (0, swagger_1.ApiProperty)({ description: "Charge currency" }),
395
+ (0, class_validator_1.IsNotEmpty)({ message: "Please check your currency" }),
396
+ __metadata("design:type", String)
397
+ ], BankTransferChargeDto.prototype, "currency", void 0);
398
+ __decorate([
399
+ (0, swagger_1.ApiProperty)({ description: "amount to be paid" }),
400
+ (0, class_validator_1.IsNumber)({ allowNaN: false, allowInfinity: false }, { message: "Amount must be a number" }),
401
+ (0, class_validator_1.IsNotEmpty)({ message: "Please specify the amount to be paid" }),
402
+ __metadata("design:type", Number)
403
+ ], BankTransferChargeDto.prototype, "amount", void 0);
404
+ __decorate([
405
+ (0, swagger_1.ApiProperty)({ description: "Email address for the customer", required: false }),
406
+ (0, class_validator_1.IsString)({ message: "Email address must be a string" }),
407
+ (0, class_validator_1.IsOptional)(),
408
+ __metadata("design:type", String)
409
+ ], BankTransferChargeDto.prototype, "emailAddress", void 0);
410
+ __decorate([
411
+ (0, swagger_1.ApiProperty)({ description: "Full name of the customer", required: false }),
412
+ (0, class_validator_1.IsString)({ message: "Full Name must be a string" }),
413
+ (0, class_validator_1.IsOptional)(),
414
+ __metadata("design:type", String)
415
+ ], BankTransferChargeDto.prototype, "fullName", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.34",
3
+ "version": "1.1.36",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,76 @@
1
+ export interface FlutterWaveChargeCompleted {
2
+ event: "charge.completed";
3
+ data: {
4
+ id: number;
5
+ tx_ref: string;
6
+ flw_ref: string;
7
+ device_fingerprint: string | null;
8
+ amount: number;
9
+ currency: string;
10
+ charged_amount: number;
11
+ app_fee: number;
12
+ merchant_fee: number;
13
+ processor_response: string;
14
+ auth_model: string;
15
+ ip: string | null;
16
+ narration: string;
17
+ status: string;
18
+ payment_type: string;
19
+ created_at: string;
20
+ account_id: number;
21
+ customer: {
22
+ id: number;
23
+ name: string;
24
+ phone_number: string;
25
+ email: string;
26
+ created_at: string;
27
+ };
28
+ card: {
29
+ first_6digits: string;
30
+ last_4digits: string;
31
+ issuer: string;
32
+ country: string;
33
+ type: string;
34
+ expiry: string;
35
+ };
36
+ };
37
+ }
38
+
39
+ export interface FlutterwaveChargeFailed {
40
+ event: "charge.failed";
41
+ data: {
42
+ id: number;
43
+ tx_ref: string;
44
+ flw_ref: string;
45
+ device_fingerprint: string | null;
46
+ amount: number;
47
+ currency: string;
48
+ charged_amount: number;
49
+ app_fee: number;
50
+ merchant_fee: number;
51
+ processor_response: string;
52
+ auth_model: string;
53
+ ip: string | null;
54
+ narration: string;
55
+ status: string;
56
+ payment_type: string;
57
+ created_at: string;
58
+ account_id: number;
59
+ customer: {
60
+ id: number;
61
+ name: string;
62
+ phone_number: string | null;
63
+ email: string;
64
+ created_at: string;
65
+ };
66
+ card: {
67
+ first_6digits: string;
68
+ last_4digits: string;
69
+ issuer: string;
70
+ country: string;
71
+ type: string;
72
+ expiry: string;
73
+ };
74
+ };
75
+ "event.type": string;
76
+ }
@@ -86,6 +86,22 @@ export class CreateInvoiceDto extends BaseDTO {
86
86
  @IsString({ message: "Customer ID must be a valid string" })
87
87
  @IsOptional()
88
88
  customerId?: string;
89
+ @ApiProperty({
90
+ description: "Title of the invoice",
91
+ example: " Invoice to blah blah",
92
+ required: false,
93
+ })
94
+ @IsString({ message: "Please enter a valid title" })
95
+ @IsOptional()
96
+ title?: string;
97
+ @ApiProperty({
98
+ description: "Description of the invoice",
99
+ example: "Invoice to blah blah",
100
+ required: false,
101
+ })
102
+ @IsString({ message: "Please enter a valid description" })
103
+ @IsOptional()
104
+ description?: string;
89
105
 
90
106
  @ApiProperty({
91
107
  description: "List of items",
@@ -171,6 +187,23 @@ export class UpdateInvoiceDto extends BaseDTO {
171
187
  @IsOptional()
172
188
  billerId?: string;
173
189
 
190
+ @ApiProperty({
191
+ description: "Title of the invoice",
192
+ example: " Invoice to blah blah",
193
+ required: false,
194
+ })
195
+ @IsString({ message: "Please enter a valid title" })
196
+ @IsOptional()
197
+ title?: string;
198
+ @ApiProperty({
199
+ description: "Description of the invoice",
200
+ example: "Invoice to blah blah",
201
+ required: false,
202
+ })
203
+ @IsString({ message: "Please enter a valid description" })
204
+ @IsOptional()
205
+ description?: string;
206
+
174
207
  @ApiProperty({
175
208
  description: "List of items",
176
209
  example:
@@ -36,11 +36,8 @@ export class TransactionSplitDto {
36
36
  @IsNotEmpty({ message: "Transaction Total is required" })
37
37
  @IsInt({ message: "Transaction Total must be the lowest currency denomination" })
38
38
  transactionTotal: number;
39
-
40
- @ApiProperty({ description: "Amount of the transaction split" })
41
- @IsOptional()
42
- splitAmount?: number;
43
39
  }
40
+
44
41
  export class PaymentRequestDto {
45
42
  @ApiProperty({ description: "Unique identifier for the transaction from the biller" })
46
43
  @IsNotEmpty({ message: "Your unique transaction reference is required" })
@@ -311,3 +308,29 @@ export class USSDChargeDto {
311
308
  @IsOptional()
312
309
  fullName?: string;
313
310
  }
311
+
312
+ export class BankTransferChargeDto {
313
+ @ApiProperty({ description: "Transaction reference" })
314
+ @IsNotEmpty({ message: "Please provide your transaction reference" })
315
+ @IsString({ message: "Transaction reference must be a string" })
316
+ transactionReference: string;
317
+
318
+ @ApiProperty({ description: "Charge currency" })
319
+ @IsNotEmpty({ message: "Please check your currency" })
320
+ currency: string;
321
+
322
+ @ApiProperty({ description: "amount to be paid" })
323
+ @IsNumber({ allowNaN: false, allowInfinity: false }, { message: "Amount must be a number" })
324
+ @IsNotEmpty({ message: "Please specify the amount to be paid" })
325
+ amount: number;
326
+
327
+ @ApiProperty({ description: "Email address for the customer", required: false })
328
+ @IsString({ message: "Email address must be a string" })
329
+ @IsOptional()
330
+ emailAddress?: string;
331
+
332
+ @ApiProperty({ description: "Full name of the customer", required: false })
333
+ @IsString({ message: "Full Name must be a string" })
334
+ @IsOptional()
335
+ fullName?: string;
336
+ }