resurgence-data 1.1.35 → 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;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.35",
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" })