resurgence-data 1.0.22 → 1.0.23

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,1276 @@
1
+ import { ApiProperty } from "@nestjs/swagger";
2
+ import {
3
+ IsNotEmpty,
4
+ IsOptional,
5
+ IsString,
6
+ IsEnum,
7
+ Length,
8
+ IsNumber,
9
+ IsBoolean,
10
+ IsUUID,
11
+ Max,
12
+ IsInt,
13
+ Min,
14
+ IsDecimal,
15
+ IsDateString,
16
+ } from "class-validator";
17
+
18
+ /**
19
+ * DTO for `BillerCategory`
20
+ */
21
+ export class CreateBillerCategoryDto {
22
+ @ApiProperty({ description: "The name of the biller category.", example: "Utilities" })
23
+ @IsNotEmpty({ message: "Name is required." })
24
+ @IsString({ message: "Name must be a string." })
25
+ @Length(1, 100, { message: "Name must be between 1 and 100 characters long." })
26
+ name: string;
27
+
28
+ @ApiProperty({
29
+ description: "A description of the biller category.",
30
+ example: "Category for utility services like electricity and water.",
31
+ required: false,
32
+ })
33
+ @IsOptional()
34
+ @IsString({ message: "Description must be a string." })
35
+ description?: string;
36
+ }
37
+ /**
38
+ * DTO for `BillerCategory`
39
+ */
40
+ export class UpdateBillerCategoryDto {
41
+ @ApiProperty({
42
+ description: "Unique identifier for the BillerProfile",
43
+ example: "e8be631d-cf95-4c9d-9d2f-91fca1da8cdb",
44
+ })
45
+ @IsUUID()
46
+ id: string;
47
+
48
+ @ApiProperty({ description: "The name of the biller category.", example: "Utilities" })
49
+ @IsNotEmpty({ message: "Name is required." })
50
+ @IsString({ message: "Name must be a string." })
51
+ @Length(1, 100, { message: "Name must be between 1 and 100 characters long." })
52
+ name: string;
53
+
54
+ @ApiProperty({
55
+ description: "A description of the biller category.",
56
+ example: "Category for utility services like electricity and water.",
57
+ required: false,
58
+ })
59
+ @IsOptional()
60
+ @IsString({ message: "Description must be a string." })
61
+ description?: string;
62
+ }
63
+
64
+ /**
65
+ * DTO for `Bank`
66
+ */
67
+ export class CreateBankDto {
68
+ @ApiProperty({ description: "The name of the bank.", example: "First Bank" })
69
+ @IsNotEmpty({ message: "Name is required." })
70
+ @IsString({ message: "Name must be a string." })
71
+ @Length(1, 100, { message: "Name must be between 1 and 100 characters long." })
72
+ name: string;
73
+
74
+ @ApiProperty({ description: "The unique slug for the bank.", example: "first-bank" })
75
+ @IsNotEmpty({ message: "Slug is required." })
76
+ @IsString({ message: "Slug must be a string." })
77
+ @Length(1, 100, { message: "Slug must be between 1 and 100 characters long." })
78
+ slug: string;
79
+
80
+ @ApiProperty({ description: "The bank code.", example: "123" })
81
+ @IsNotEmpty({ message: "Code is required." })
82
+ @IsString({ message: "Code must be a string." })
83
+ @Length(1, 10, { message: "Code must be between 1 and 10 characters long." })
84
+ code: string;
85
+
86
+ @ApiProperty({ description: "The long code for the bank.", example: "123456789", required: false })
87
+ @IsNotEmpty({ message: "Long code is required." })
88
+ @IsString({ message: "Long code must be a string." })
89
+ @Length(1, 50, { message: "Long code must be between 1 and 50 characters long." })
90
+ @IsOptional()
91
+ longCode?: string;
92
+ }
93
+
94
+ /**
95
+ * DTO for `Charge`
96
+ */
97
+ export class CreateChargeDto {
98
+ @ApiProperty({ description: "The name of the charge.", example: "Service Fee" })
99
+ @IsNotEmpty({ message: "Name is required." })
100
+ @IsString({ message: "Name must be a string." })
101
+ @Length(1, 100, { message: "Name must be between 1 and 100 characters long." })
102
+ name: string;
103
+
104
+ @ApiProperty({ description: "The type of charge.", enum: ["FIXED", "PERCENTAGE"], example: "FIXED" })
105
+ @IsNotEmpty({ message: "Charge type is required." })
106
+ @IsEnum(["FIXED", "PERCENTAGE"], { message: "Charge type must be FIXED or PERCENTAGE." })
107
+ type: "FIXED" | "PERCENTAGE";
108
+
109
+ @ApiProperty({ description: "The value of the charge.", example: 100 })
110
+ @IsNotEmpty({ message: "Value is required." })
111
+ @IsNumber({}, { message: "Value must be a number." })
112
+ value: number;
113
+
114
+ @ApiProperty({ description: "A description of the charge.", example: "Service fee for processing.", required: false })
115
+ @IsOptional()
116
+ @IsString({ message: "Description must be a string." })
117
+ description?: string;
118
+ }
119
+
120
+ /**
121
+ * DTO for `Transaction`
122
+ */
123
+ export class CreateTransactionDto {
124
+ @ApiProperty({ description: "The amount involved in the transaction.", example: 1000 })
125
+ @IsNotEmpty({ message: "Amount is required." })
126
+ @IsNumber({}, { message: "Amount must be a number." })
127
+ amount: number;
128
+
129
+ @ApiProperty({ description: "The ID of the associated bank.", example: "uuid-value" })
130
+ @IsNotEmpty({ message: "Bank ID is required." })
131
+ @IsString({ message: "Bank ID must be a string." })
132
+ bankId: string;
133
+
134
+ @ApiProperty({ description: "The type of transaction.", enum: ["CREDIT", "DEBIT"], example: "CREDIT" })
135
+ @IsNotEmpty({ message: "Transaction type is required." })
136
+ @IsEnum(["CREDIT", "DEBIT"], { message: "Transaction type must be CREDIT or DEBIT." })
137
+ type: "CREDIT" | "DEBIT";
138
+
139
+ @ApiProperty({
140
+ description: "Remarks or notes for the transaction.",
141
+ example: "Payment for invoice #1234",
142
+ required: false,
143
+ })
144
+ @IsOptional()
145
+ @IsString({ message: "Remarks must be a string." })
146
+ remarks?: string;
147
+ }
148
+
149
+ /**
150
+ * DTO for `Biller`
151
+ */
152
+ export class CreateBillerDto {
153
+ @ApiProperty({ description: "The unique ID of the biller.", example: "uuid-value" })
154
+ @IsOptional()
155
+ @IsString({ message: "ID must be a string." })
156
+ id?: string;
157
+
158
+ @ApiProperty({ description: "The ID of the category associated with the biller.", example: "uuid-value" })
159
+ @IsNotEmpty({ message: "Category ID is required." })
160
+ @IsString({ message: "Category ID must be a string." })
161
+ categoryId: string;
162
+
163
+ @ApiProperty({ description: "The ID of the profile associated with the biller.", example: "uuid-value" })
164
+ @IsOptional()
165
+ @IsString({ message: "Profile ID must be a string." })
166
+ billerProfileId?: string;
167
+
168
+ @ApiProperty({ description: "The name of the biller.", example: "Electricity Provider" })
169
+ @IsNotEmpty({ message: "Name is required." })
170
+ @IsString({ message: "Name must be a string." })
171
+ @Length(1, 50, { message: "Name must be between 1 and 50 characters long." })
172
+ name: string;
173
+
174
+ @ApiProperty({ description: "Whether the biller is live.", example: false })
175
+ @IsNotEmpty({ message: "Live status is required." })
176
+ @IsBoolean({ message: "Live must be a boolean." })
177
+ live: boolean;
178
+
179
+ @ApiProperty({ description: "Whether the biller is active.", example: false })
180
+ @IsNotEmpty({ message: "Active status is required." })
181
+ @IsBoolean({ message: "Active must be a boolean." })
182
+ active: boolean;
183
+
184
+ @ApiProperty({ description: "The slug for the biller.", example: "electricity-provider", required: false })
185
+ @IsOptional()
186
+ @IsString({ message: "Slug must be a string." })
187
+ slug?: string;
188
+
189
+ @ApiProperty({ description: "The biller code.", example: "ELEC123", required: false })
190
+ @IsOptional()
191
+ @IsString({ message: "Biller code must be a string." })
192
+ @Length(1, 15, { message: "Biller code must be between 1 and 15 characters long." })
193
+ billerCode?: string;
194
+
195
+ @ApiProperty({ description: "The creation timestamp of the biller.", example: "2025-01-01T00:00:00Z" })
196
+ @IsOptional()
197
+ @IsString({ message: "CreatedAt must be a string." })
198
+ createdAt?: string;
199
+
200
+ @ApiProperty({ description: "The last update timestamp of the biller.", example: "2025-01-01T00:00:00Z" })
201
+ @IsOptional()
202
+ @IsString({ message: "UpdatedAt must be a string." })
203
+ updatedAt?: string;
204
+ }
205
+
206
+ export class UpdateBillerDto {
207
+ @ApiProperty({ description: "The unique ID of the biller.", example: "uuid-value" })
208
+ @IsOptional()
209
+ @IsString({ message: "ID must be a string." })
210
+ id?: string;
211
+
212
+ @ApiProperty({ description: "The ID of the category associated with the biller.", example: "uuid-value" })
213
+ @IsString({ message: "Category ID must be a string." })
214
+ @IsOptional()
215
+ categoryId?: string;
216
+
217
+ @ApiProperty({ description: "The ID of the profile associated with the biller.", example: "uuid-value" })
218
+ @IsOptional()
219
+ @IsString({ message: "Profile ID must be a string." })
220
+ billerProfileId?: string;
221
+
222
+ @ApiProperty({ description: "The name of the biller.", example: "Electricity Provider", required: false })
223
+ @IsString({ message: "Name must be a string." })
224
+ @Length(1, 50, { message: "Name must be between 1 and 50 characters long." })
225
+ @IsOptional()
226
+ name?: string;
227
+
228
+ @ApiProperty({ description: "Whether the biller is live.", example: false, required: false })
229
+ @IsBoolean({ message: "Live must be a boolean." })
230
+ @IsOptional()
231
+ live?: boolean;
232
+
233
+ @ApiProperty({ description: "Whether the biller is active.", example: false, required: false })
234
+ @IsBoolean({ message: "Active must be a boolean." })
235
+ @IsOptional()
236
+ active: boolean;
237
+
238
+ @ApiProperty({ description: "The slug for the biller.", example: "electricity-provider", required: false })
239
+ @IsOptional()
240
+ @IsString({ message: "Slug must be a string." })
241
+ slug?: string;
242
+
243
+ @ApiProperty({ description: "The biller code.", example: "ELEC123", required: false })
244
+ @IsOptional()
245
+ @IsString({ message: "Biller code must be a string." })
246
+ @Length(1, 15, { message: "Biller code must be between 1 and 15 characters long." })
247
+ billerCode?: string;
248
+ }
249
+
250
+ export enum TIME_DELIMITER {
251
+ DAY = "DAY",
252
+ WEEK = "WEEK",
253
+ MONTH = "MONTH",
254
+ }
255
+
256
+ export class BillerProfileDTO {
257
+ @ApiProperty({
258
+ description: "Unique identifier for the BillerProfile",
259
+ example: "e8be631d-cf95-4c9d-9d2f-91fca1da8cdb",
260
+ })
261
+ @IsUUID()
262
+ id: string;
263
+
264
+ @ApiProperty({
265
+ description: "Name of the BillerProfile, max length of 50 characters",
266
+ example: "Test Biller",
267
+ required: false,
268
+ })
269
+ @IsOptional()
270
+ @IsString()
271
+ @Max(50)
272
+ name?: string;
273
+
274
+ @ApiProperty({
275
+ description: "Indicates if the BillerProfile has a transaction limit",
276
+ example: true,
277
+ required: false,
278
+ })
279
+ @IsBoolean()
280
+ @IsOptional()
281
+ hasTransactionLimit?: boolean;
282
+
283
+ @ApiProperty({
284
+ description: "Transaction limit value, defaults to 0",
285
+ example: 5000,
286
+ required: false,
287
+ })
288
+ @IsInt()
289
+ @Min(0)
290
+ @IsOptional()
291
+ transactionLimit?: number;
292
+
293
+ @ApiProperty({
294
+ description: "Delimiter for time intervals, such as DAY, WEEK, or MONTH",
295
+ enum: TIME_DELIMITER,
296
+ example: TIME_DELIMITER.DAY,
297
+ required: false,
298
+ })
299
+ @IsEnum(TIME_DELIMITER)
300
+ @IsOptional()
301
+ delimiter?: TIME_DELIMITER;
302
+ }
303
+
304
+ export class UpdateBillerProfileDTO {
305
+ @ApiProperty({
306
+ description: "Unique identifier for the BillerProfile",
307
+ example: "e8be631d-cf95-4c9d-9d2f-91fca1da8cdb",
308
+ })
309
+ @IsUUID()
310
+ id: string;
311
+
312
+ @ApiProperty({
313
+ description: "Name of the BillerProfile, max length of 50 characters",
314
+ example: "Test Biller",
315
+ required: false,
316
+ })
317
+ @IsOptional()
318
+ @IsString()
319
+ @Max(50)
320
+ name?: string;
321
+
322
+ @ApiProperty({
323
+ description: "Indicates if the BillerProfile has a transaction limit",
324
+ example: true,
325
+ required: false,
326
+ })
327
+ @IsBoolean()
328
+ @IsOptional()
329
+ hasTransactionLimit?: boolean;
330
+
331
+ @ApiProperty({
332
+ description: "Transaction limit value, defaults to 0",
333
+ example: 5000,
334
+ required: false,
335
+ })
336
+ @IsInt()
337
+ @Min(0)
338
+ @IsOptional()
339
+ transactionLimit?: number;
340
+
341
+ @ApiProperty({
342
+ description: "Delimiter for time intervals, such as DAY, WEEK, or MONTH",
343
+ enum: TIME_DELIMITER,
344
+ example: TIME_DELIMITER.DAY,
345
+ required: false,
346
+ })
347
+ @IsEnum(TIME_DELIMITER)
348
+ @IsOptional()
349
+ delimiter?: TIME_DELIMITER;
350
+ }
351
+
352
+ export class CreateSettlementAccountDto {
353
+ @ApiProperty({
354
+ description: "The ID of the biller",
355
+ example: "550e8400-e29b-41d4-a716-446655440000",
356
+ })
357
+ @IsNotEmpty({ message: "Biller ID must not be empty" })
358
+ @IsString({ message: "Biller ID must be a valid string" })
359
+ billerId: string;
360
+
361
+ @ApiProperty({
362
+ description: "The ID of the bank",
363
+ example: "550e8400-e29b-41d4-a716-446655440001",
364
+ })
365
+ @IsNotEmpty({ message: "Bank ID must not be empty" })
366
+ @IsString({ message: "Bank ID must be a valid string" })
367
+ bankId: string;
368
+
369
+ @ApiProperty({
370
+ description: "Whether the account is the default account",
371
+ example: false,
372
+ })
373
+ @IsBoolean({ message: "Default must be a boolean value" })
374
+ @IsOptional()
375
+ default?: boolean;
376
+
377
+ @ApiProperty({
378
+ description: "The name of the account",
379
+ example: "John Doe",
380
+ })
381
+ @IsNotEmpty({ message: "Account name must not be empty" })
382
+ @IsString({ message: "Account name must be a valid string" })
383
+ @Length(1, 50, { message: "Account name must be between 1 and 50 characters" })
384
+ accountName: string;
385
+
386
+ @ApiProperty({
387
+ description: "The account number",
388
+ example: "123456789012345",
389
+ })
390
+ @IsNotEmpty({ message: "Account number must not be empty" })
391
+ @IsString({ message: "Account number must be a valid string" })
392
+ @Length(10, 15, { message: "Account number must be between 10 and 15 characters" })
393
+ accountNumber: string;
394
+
395
+ @ApiProperty({
396
+ description: "The currency of the account",
397
+ example: "NGN",
398
+ })
399
+ @IsNotEmpty({ message: "Currency must not be empty" })
400
+ @IsString({ message: "Currency must be a valid string" })
401
+ @Length(3, 5, { message: "Currency must be between 3 and 5 characters" })
402
+ currency: string;
403
+ }
404
+
405
+ export class UpdateSettlementAccountDto {
406
+ @IsNotEmpty({ message: "ID must be provided" })
407
+ @IsString({ message: "ID must be a valid string" })
408
+ @IsUUID()
409
+ id: string;
410
+
411
+ @ApiProperty({
412
+ description: "The ID of the biller",
413
+ example: "550e8400-e29b-41d4-a716-446655440000",
414
+ required: false,
415
+ })
416
+ @IsString({ message: "Biller ID must be a valid string" })
417
+ @IsOptional()
418
+ billerId?: string;
419
+
420
+ @ApiProperty({
421
+ description: "The ID of the bank",
422
+ example: "550e8400-e29b-41d4-a716-446655440001",
423
+ required: false,
424
+ })
425
+ @IsString({ message: "Bank ID must be a valid string" })
426
+ @IsOptional()
427
+ bankId?: string;
428
+
429
+ @ApiProperty({
430
+ description: "Whether the account is the default account",
431
+ example: false,
432
+ required: false,
433
+ })
434
+ @IsBoolean({ message: "Default must be a boolean value" })
435
+ @IsOptional()
436
+ default?: boolean;
437
+
438
+ @ApiProperty({
439
+ description: "The name of the account",
440
+ example: "John Doe",
441
+ required: false,
442
+ })
443
+ @IsString({ message: "Account name must be a valid string" })
444
+ @Length(1, 50, { message: "Account name must be between 1 and 50 characters" })
445
+ @IsOptional()
446
+ accountName?: string;
447
+
448
+ @ApiProperty({
449
+ description: "The account number",
450
+ example: "123456789012345",
451
+ required: false,
452
+ })
453
+ @IsString({ message: "Account number must be a valid string" })
454
+ @Length(10, 15, { message: "Account number must be between 10 and 15 characters" })
455
+ @IsOptional()
456
+ accountNumber?: string;
457
+
458
+ @ApiProperty({
459
+ description: "The currency of the account",
460
+ example: "NGN",
461
+ required: false,
462
+ })
463
+ @IsString({ message: "Currency must be a valid string" })
464
+ @Length(3, 5, { message: "Currency must be between 3 and 5 characters" })
465
+ @IsOptional()
466
+ currency?: string;
467
+ }
468
+
469
+ export class CreateBillerChargeConfigurationDto {
470
+ @ApiProperty({
471
+ description: "The ID of the service",
472
+ example: "550e8400-e29b-41d4-a716-446655440001",
473
+ })
474
+ @IsNotEmpty({ message: "Service ID must not be empty" })
475
+ @IsString({ message: "Service ID must be a valid string" })
476
+ serviceId: string;
477
+
478
+ @ApiProperty({
479
+ description: "Whether the configuration is active",
480
+ example: false,
481
+ })
482
+ @IsBoolean({ message: "Active must be a boolean value" })
483
+ @IsOptional()
484
+ active?: boolean;
485
+
486
+ @ApiProperty({
487
+ description: "Whether the charge is capped",
488
+ example: false,
489
+ })
490
+ @IsBoolean({ message: "Capped must be a boolean value" })
491
+ @IsOptional()
492
+ capped?: boolean;
493
+
494
+ @ApiProperty({
495
+ description: "Whether the charge is floored",
496
+ example: false,
497
+ })
498
+ @IsBoolean({ message: "Floored must be a boolean value" })
499
+ @IsOptional()
500
+ floored?: boolean;
501
+
502
+ @ApiProperty({
503
+ description: "The cap for the charge",
504
+ example: 1000,
505
+ })
506
+ @IsInt({ message: "Charge cap must be an integer value" })
507
+ @Min(0, { message: "Charge cap must not be negative" })
508
+ @IsOptional()
509
+ chargeCap?: number;
510
+
511
+ @ApiProperty({
512
+ description: "The floor for the charge",
513
+ example: 100,
514
+ })
515
+ @IsInt({ message: "Charge floor must be an integer value" })
516
+ @Min(0, { message: "Charge floor must not be negative" })
517
+ @IsOptional()
518
+ chargeFloor?: number;
519
+
520
+ @ApiProperty({
521
+ description: "The currency of the charge",
522
+ example: "NGN",
523
+ })
524
+ @IsNotEmpty({ message: "Currency must not be empty" })
525
+ @IsString({ message: "Currency must be a valid string" })
526
+ @Length(3, 4, { message: "Currency must be between 3 and 4 characters" })
527
+ currency: string;
528
+
529
+ @ApiProperty({
530
+ description: "The type of the charge",
531
+ example: "FIXED",
532
+ })
533
+ @IsNotEmpty({ message: "Charge type must not be empty" })
534
+ @IsString({ message: "Charge type must be a valid string" })
535
+ chargeType: string;
536
+
537
+ @ApiProperty({
538
+ description: "The fixed amount of the charge",
539
+ example: 500,
540
+ })
541
+ @IsInt({ message: "Fixed amount must be an integer value" })
542
+ @Min(0, { message: "Fixed amount must not be negative" })
543
+ @IsOptional()
544
+ fixedAmount?: number;
545
+
546
+ @ApiProperty({
547
+ description: "The percentage amount of the charge",
548
+ example: 5.5,
549
+ })
550
+ @IsDecimal(
551
+ { decimal_digits: "1,2", force_decimal: false },
552
+ { message: "Percent amount must be a valid decimal with up to 2 decimal places" }
553
+ )
554
+ @Min(0, { message: "Percent amount must not be negative" })
555
+ @IsOptional()
556
+ percentAmount?: number;
557
+ }
558
+
559
+ export class UpdateBillerChargeConfigurationDto {
560
+ @IsNotEmpty({ message: "ID must be provided" })
561
+ @IsString({ message: "ID must be a valid string" })
562
+ @IsUUID()
563
+ id: string;
564
+
565
+ @ApiProperty({
566
+ description: "The ID of the service",
567
+ example: "550e8400-e29b-41d4-a716-446655440001",
568
+ required: false,
569
+ })
570
+ @IsString({ message: "Service ID must be a valid string" })
571
+ @IsOptional()
572
+ serviceId?: string;
573
+
574
+ @ApiProperty({
575
+ description: "Whether the configuration is active",
576
+ example: false,
577
+ required: false,
578
+ })
579
+ @IsBoolean({ message: "Active must be a boolean value" })
580
+ @IsOptional()
581
+ active?: boolean;
582
+
583
+ @ApiProperty({
584
+ description: "Whether the charge is capped",
585
+ example: false,
586
+ required: false,
587
+ })
588
+ @IsBoolean({ message: "Capped must be a boolean value" })
589
+ @IsOptional()
590
+ capped?: boolean;
591
+
592
+ @ApiProperty({
593
+ description: "Whether the charge is floored",
594
+ example: false,
595
+ required: false,
596
+ })
597
+ @IsBoolean({ message: "Floored must be a boolean value" })
598
+ @IsOptional()
599
+ floored?: boolean;
600
+
601
+ @ApiProperty({
602
+ description: "The cap for the charge",
603
+ example: 1000,
604
+ required: false,
605
+ })
606
+ @IsInt({ message: "Charge cap must be an integer value" })
607
+ @Min(0, { message: "Charge cap must not be negative" })
608
+ @IsOptional()
609
+ chargeCap?: number;
610
+
611
+ @ApiProperty({
612
+ description: "The floor for the charge",
613
+ example: 100,
614
+ required: false,
615
+ })
616
+ @IsInt({ message: "Charge floor must be an integer value" })
617
+ @Min(0, { message: "Charge floor must not be negative" })
618
+ @IsOptional()
619
+ chargeFloor?: number;
620
+
621
+ @ApiProperty({
622
+ description: "The currency of the charge",
623
+ example: "NGN",
624
+ required: false,
625
+ })
626
+ @IsString({ message: "Currency must be a valid string" })
627
+ @Length(3, 4, { message: "Currency must be between 3 and 4 characters" })
628
+ @IsOptional()
629
+ currency?: string;
630
+
631
+ @ApiProperty({
632
+ description: "The type of the charge",
633
+ example: "FIXED",
634
+ required: false,
635
+ })
636
+ @IsString({ message: "Charge type must be a valid string" })
637
+ @IsOptional()
638
+ chargeType?: string;
639
+
640
+ @ApiProperty({
641
+ description: "The fixed amount of the charge",
642
+ example: 500,
643
+ required: false,
644
+ })
645
+ @IsInt({ message: "Fixed amount must be an integer value" })
646
+ @Min(0, { message: "Fixed amount must not be negative" })
647
+ @IsOptional()
648
+ fixedAmount?: number;
649
+
650
+ @ApiProperty({
651
+ description: "The percentage amount of the charge",
652
+ example: 5.5,
653
+ required: false,
654
+ })
655
+ @IsDecimal(
656
+ { decimal_digits: "1,2", force_decimal: false },
657
+ { message: "Percent amount must be a valid decimal with up to 2 decimal places" }
658
+ )
659
+ @Min(0, { message: "Percent amount must not be negative" })
660
+ @IsOptional()
661
+ percentAmount?: number;
662
+ }
663
+
664
+ export class CreateBillerDocumentDto {
665
+ @ApiProperty({
666
+ description: "The ID of the biller",
667
+ example: "550e8400-e29b-41d4-a716-446655440002",
668
+ })
669
+ @IsNotEmpty({ message: "Biller ID must not be empty" })
670
+ @IsString({ message: "Biller ID must be a valid string" })
671
+ billerId: string;
672
+
673
+ @ApiProperty({
674
+ description: "The URL of the document",
675
+ example: "https://example.com/document.pdf",
676
+ })
677
+ @IsNotEmpty({ message: "URL must not be empty" })
678
+ @IsString({ message: "URL must be a valid string" })
679
+ url: string;
680
+
681
+ @ApiProperty({
682
+ description: "The type of the document",
683
+ example: "CONTRACT",
684
+ })
685
+ @IsNotEmpty({ message: "Document type must not be empty" })
686
+ @IsString({ message: "Document type must be a valid string" })
687
+ type: string;
688
+ }
689
+
690
+ export class UpdateBillerDocumentDto {
691
+ @ApiProperty({
692
+ description: "The ID of the biller",
693
+ example: "550e8400-e29b-41d4-a716-446655440002",
694
+ required: false,
695
+ })
696
+ @IsString({ message: "Biller ID must be a valid string" })
697
+ @IsOptional()
698
+ billerId?: string;
699
+
700
+ @ApiProperty({
701
+ description: "The URL of the document",
702
+ example: "https://example.com/document.pdf",
703
+ required: false,
704
+ })
705
+ @IsString({ message: "URL must be a valid string" })
706
+ @IsOptional()
707
+ url?: string;
708
+
709
+ @ApiProperty({
710
+ description: "The type of the document",
711
+ example: "CONTRACT",
712
+ required: false,
713
+ })
714
+ @IsString({ message: "Document type must be a valid string" })
715
+ @IsOptional()
716
+ type?: string;
717
+ }
718
+
719
+ export class CreateGoLiveRequestDto {
720
+ @ApiProperty({
721
+ description: "The ID of the biller",
722
+ example: "550e8400-e29b-41d4-a716-446655440003",
723
+ })
724
+ @IsNotEmpty({ message: "Biller ID must not be empty" })
725
+ @IsString({ message: "Biller ID must be a valid string" })
726
+ billerId: string;
727
+
728
+ @ApiProperty({
729
+ description: "The status of the go-live request",
730
+ example: "PENDING",
731
+ })
732
+ @IsNotEmpty({ message: "Status must not be empty" })
733
+ @IsString({ message: "Status must be a valid string" })
734
+ status: string;
735
+ }
736
+
737
+ export class UpdateGoLiveRequestDto {
738
+ @ApiProperty({
739
+ description: "The ID of the biller",
740
+ example: "550e8400-e29b-41d4-a716-446655440003",
741
+ required: false,
742
+ })
743
+ @IsString({ message: "Biller ID must be a valid string" })
744
+ @IsOptional()
745
+ billerId?: string;
746
+
747
+ @ApiProperty({
748
+ description: "The status of the go-live request",
749
+ example: "PENDING",
750
+ required: false,
751
+ })
752
+ @IsString({ message: "Status must be a valid string" })
753
+ @IsOptional()
754
+ status?: string;
755
+ }
756
+
757
+ export class CreateBillerContactDto {
758
+ @ApiProperty({
759
+ description: "The ID of the biller",
760
+ example: "550e8400-e29b-41d4-a716-446655440000",
761
+ })
762
+ @IsNotEmpty({ message: "Biller ID must not be empty" })
763
+ @IsString({ message: "Biller ID must be a valid string" })
764
+ billerId: string;
765
+
766
+ @ApiProperty({
767
+ description: "The name of the contact",
768
+ example: "John Doe",
769
+ })
770
+ @IsNotEmpty({ message: "Contact name must not be empty" })
771
+ @IsString({ message: "Contact name must be a valid string" })
772
+ @Length(1, 50, { message: "Contact name must be between 1 and 50 characters" })
773
+ contactName: string;
774
+
775
+ @ApiProperty({
776
+ description: "The email address of the contact",
777
+ example: "johndoe@example.com",
778
+ })
779
+ @IsNotEmpty({ message: "Email address must not be empty" })
780
+ @IsString({ message: "Email address must be a valid string" })
781
+ @Length(1, 50, { message: "Email address must be between 1 and 50 characters" })
782
+ emailAddress: string;
783
+
784
+ @ApiProperty({
785
+ description: "The phone number of the contact",
786
+ example: "+1234567890",
787
+ required: false,
788
+ })
789
+ @IsString({ message: "Phone number must be a valid string" })
790
+ @IsOptional()
791
+ phoneNumber?: string;
792
+
793
+ @ApiProperty({
794
+ description: "The date of birth of the contact",
795
+ example: "1990-01-01T00:00:00.000Z",
796
+ })
797
+ @IsNotEmpty({ message: "Date of birth must not be empty" })
798
+ @IsDateString({}, { message: "Date of birth must be a valid ISO 8601 date string" })
799
+ dob: string;
800
+
801
+ @ApiProperty({
802
+ description: "The address of the contact",
803
+ example: "123 Main St, Anytown",
804
+ })
805
+ @IsNotEmpty({ message: "Address must not be empty" })
806
+ @IsString({ message: "Address must be a valid string" })
807
+ address: string;
808
+
809
+ @ApiProperty({
810
+ description: "The country of the contact",
811
+ example: "USA",
812
+ })
813
+ @IsNotEmpty({ message: "Country must not be empty" })
814
+ @IsString({ message: "Country must be a valid string" })
815
+ @Length(1, 50, { message: "Country must be between 1 and 50 characters" })
816
+ country: string;
817
+
818
+ @ApiProperty({
819
+ description: "The city of the contact",
820
+ example: "New York",
821
+ })
822
+ @IsNotEmpty({ message: "City must not be empty" })
823
+ @IsString({ message: "City must be a valid string" })
824
+ @Length(1, 50, { message: "City must be between 1 and 50 characters" })
825
+ city: string;
826
+
827
+ @ApiProperty({
828
+ description: "The state of the contact",
829
+ example: "NY",
830
+ })
831
+ @IsNotEmpty({ message: "State must not be empty" })
832
+ @IsString({ message: "State must be a valid string" })
833
+ @Length(1, 50, { message: "State must be between 1 and 50 characters" })
834
+ state: string;
835
+ }
836
+
837
+ export class UpdateBillerContactDto {
838
+ @ApiProperty({
839
+ description: "The ID of the contact",
840
+ example: "550e8400-e29b-41d4-a716-446655440000",
841
+ })
842
+ @IsNotEmpty({ message: "ID must not be empty" })
843
+ @IsString({ message: "ID must be a valid string" })
844
+ id: string;
845
+
846
+ @ApiProperty({
847
+ description: "The ID of the biller",
848
+ example: "550e8400-e29b-41d4-a716-446655440000",
849
+ required: false,
850
+ })
851
+ @IsNotEmpty({ message: "Biller ID must not be empty" })
852
+ @IsString({ message: "Biller ID must be a valid string" })
853
+ @IsOptional()
854
+ billerId?: string;
855
+
856
+ @ApiProperty({
857
+ description: "The name of the contact",
858
+ example: "John Doe",
859
+ required: false,
860
+ })
861
+ @IsString({ message: "Contact name must be a valid string" })
862
+ @Length(1, 50, { message: "Contact name must be between 1 and 50 characters" })
863
+ @IsOptional()
864
+ contactName?: string;
865
+
866
+ @ApiProperty({
867
+ description: "The email address of the contact",
868
+ example: "johndoe@example.com",
869
+ required: false,
870
+ })
871
+ @IsString({ message: "Email address must be a valid string" })
872
+ @Length(1, 50, { message: "Email address must be between 1 and 50 characters" })
873
+ @IsOptional()
874
+ emailAddress?: string;
875
+
876
+ @ApiProperty({
877
+ description: "The phone number of the contact",
878
+ example: "+1234567890",
879
+ required: false,
880
+ })
881
+ @IsString({ message: "Phone number must be a valid string" })
882
+ @IsOptional()
883
+ phoneNumber?: string;
884
+
885
+ @ApiProperty({
886
+ description: "The date of birth of the contact",
887
+ example: "1990-01-01T00:00:00.000Z",
888
+ required: false,
889
+ })
890
+ @IsDateString({}, { message: "Date of birth must be a valid ISO 8601 date string" })
891
+ @IsOptional()
892
+ dob?: string;
893
+
894
+ @ApiProperty({
895
+ description: "The address of the contact",
896
+ example: "123 Main St, Anytown",
897
+ required: false,
898
+ })
899
+ @IsString({ message: "Address must be a valid string" })
900
+ @IsOptional()
901
+ address?: string;
902
+
903
+ @ApiProperty({
904
+ description: "The country of the contact",
905
+ example: "USA",
906
+ required: false,
907
+ })
908
+ @IsString({ message: "Country must be a valid string" })
909
+ @Length(1, 50, { message: "Country must be between 1 and 50 characters" })
910
+ @IsOptional()
911
+ country?: string;
912
+
913
+ @ApiProperty({
914
+ description: "The city of the contact",
915
+ example: "New York",
916
+ required: false,
917
+ })
918
+ @IsString({ message: "City must be a valid string" })
919
+ @Length(1, 50, { message: "City must be between 1 and 50 characters" })
920
+ @IsOptional()
921
+ city?: string;
922
+
923
+ @ApiProperty({
924
+ description: "The state of the contact",
925
+ example: "NY",
926
+ required: false,
927
+ })
928
+ @IsString({ message: "State must be a valid string" })
929
+ @Length(1, 50, { message: "State must be between 1 and 50 characters" })
930
+ @IsOptional()
931
+ state?: string;
932
+ }
933
+
934
+ export class CreateCustomerDto {
935
+ @ApiProperty({
936
+ description: "The ID of the biller",
937
+ example: "550e8400-e29b-41d4-a716-446655440000",
938
+ })
939
+ @IsNotEmpty({ message: "Biller ID must not be empty" })
940
+ @IsString({ message: "Biller ID must be a valid string" })
941
+ billerId: string;
942
+
943
+ @ApiProperty({
944
+ description: "The name of the customer",
945
+ example: "Jane Smith",
946
+ })
947
+ @IsNotEmpty({ message: "Name must not be empty" })
948
+ @IsString({ message: "Name must be a valid string" })
949
+ @Length(1, 50, { message: "Name must be between 1 and 50 characters" })
950
+ name: string;
951
+
952
+ @ApiProperty({
953
+ description: "The email address of the customer",
954
+ example: "janesmith@example.com",
955
+ required: false,
956
+ })
957
+ @IsString({ message: "Email address must be a valid string" })
958
+ @Length(1, 50, { message: "Email address must be between 1 and 50 characters" })
959
+ @IsOptional()
960
+ emailAddress?: string;
961
+
962
+ @ApiProperty({
963
+ description: "The phone number of the customer",
964
+ example: "+9876543210",
965
+ required: false,
966
+ })
967
+ @IsString({ message: "Phone number must be a valid string" })
968
+ @IsOptional()
969
+ phoneNumber?: string;
970
+ }
971
+
972
+ export class UpdateCustomerDto {
973
+ @ApiProperty({
974
+ description: "The ID of the customer",
975
+ example: "550e8400-e29b-41d4-a716-446655440000",
976
+ })
977
+ @IsNotEmpty({ message: "ID must not be empty" })
978
+ @IsString({ message: "ID must be a valid string" })
979
+ id: string;
980
+
981
+ @ApiProperty({
982
+ description: "The name of the customer",
983
+ example: "Jane Smith",
984
+ required: false,
985
+ })
986
+ @IsString({ message: "Name must be a valid string" })
987
+ @Length(1, 50, { message: "Name must be between 1 and 50 characters" })
988
+ @IsOptional()
989
+ name?: string;
990
+
991
+ @ApiProperty({
992
+ description: "The email address of the customer",
993
+ example: "janesmith@example.com",
994
+ required: false,
995
+ })
996
+ @IsString({ message: "Email address must be a valid string" })
997
+ @Length(1, 50, { message: "Email address must be between 1 and 50 characters" })
998
+ @IsOptional()
999
+ emailAddress?: string;
1000
+
1001
+ @ApiProperty({
1002
+ description: "The phone number of the customer",
1003
+ example: "+9876543210",
1004
+ required: false,
1005
+ })
1006
+ @IsString({ message: "Phone number must be a valid string" })
1007
+ @IsOptional()
1008
+ phoneNumber?: string;
1009
+ }
1010
+
1011
+ export class CreateBillerItemDto {
1012
+ @ApiProperty({
1013
+ description: "The ID of the biller",
1014
+ example: "550e8400-e29b-41d4-a716-446655440000",
1015
+ })
1016
+ @IsNotEmpty({ message: "Biller ID must not be empty" })
1017
+ @IsString({ message: "Biller ID must be a valid string" })
1018
+ billerId: string;
1019
+
1020
+ @ApiProperty({
1021
+ description: "The amount associated with the biller item",
1022
+ example: 100,
1023
+ })
1024
+ @IsInt({ message: "Amount must be a valid integer" })
1025
+ @IsNotEmpty({ message: "Amount must not be empty" })
1026
+ amount: number;
1027
+
1028
+ @ApiProperty({
1029
+ description: "The source of the biller item",
1030
+ example: "Utility Bill",
1031
+ required: false,
1032
+ })
1033
+ @IsString({ message: "Source must be a valid string" })
1034
+ @IsOptional()
1035
+ source?: string;
1036
+
1037
+ @ApiProperty({
1038
+ description: "The customer identifier name for the biller item",
1039
+ example: "Customer ID",
1040
+ required: false,
1041
+ })
1042
+ @IsString({ message: "Customer identifier name must be a valid string" })
1043
+ @IsOptional()
1044
+ customerIdentifierName?: string;
1045
+
1046
+ @ApiProperty({
1047
+ description: "The service fee associated with the biller item",
1048
+ example: 10,
1049
+ })
1050
+ @IsInt({ message: "Service fee must be a valid integer" })
1051
+ @IsNotEmpty({ message: "Service fee must not be empty" })
1052
+ serviceFee: number;
1053
+
1054
+ @ApiProperty({
1055
+ description: "The currency of the biller item",
1056
+ example: "NGN",
1057
+ })
1058
+ @IsString({ message: "Currency must be a valid string" })
1059
+ @Length(1, 4, { message: "Currency must be between 1 and 4 characters" })
1060
+ @IsNotEmpty({ message: "Currency must not be empty" })
1061
+ currency: string;
1062
+
1063
+ @ApiProperty({
1064
+ description: "The description of the biller item",
1065
+ example: "Electricity Bill Payment",
1066
+ required: false,
1067
+ })
1068
+ @IsString({ message: "Description must be a valid string" })
1069
+ @IsOptional()
1070
+ description?: string;
1071
+
1072
+ @ApiProperty({
1073
+ description: "Indicates if the biller item is external",
1074
+ example: false,
1075
+ })
1076
+ @IsBoolean({ message: "External must be a valid boolean" })
1077
+ @IsNotEmpty({ message: "External must not be empty" })
1078
+ external: boolean;
1079
+ }
1080
+
1081
+ export class UpdateBillerItemDto {
1082
+ @ApiProperty({
1083
+ description: "The ID of the biller item",
1084
+ example: "550e8400-e29b-41d4-a716-446655440000",
1085
+ })
1086
+ @IsNotEmpty({ message: "ID must not be empty" })
1087
+ @IsString({ message: "ID must be a valid string" })
1088
+ id: string;
1089
+
1090
+ @ApiProperty({
1091
+ description: "The ID of the biller",
1092
+ example: "550e8400-e29b-41d4-a716-446655440000",
1093
+ required: false,
1094
+ })
1095
+ @IsNotEmpty({ message: "Biller ID must not be empty" })
1096
+ @IsString({ message: "Biller ID must be a valid string" })
1097
+ billerId?: string;
1098
+
1099
+ @ApiProperty({
1100
+ description: "The amount associated with the biller item",
1101
+ example: 100,
1102
+ required: false,
1103
+ })
1104
+ @IsInt({ message: "Amount must be a valid integer" })
1105
+ @IsOptional()
1106
+ amount?: number;
1107
+
1108
+ @ApiProperty({
1109
+ description: "The source of the biller item",
1110
+ example: "Utility Bill",
1111
+ required: false,
1112
+ })
1113
+ @IsString({ message: "Source must be a valid string" })
1114
+ @IsOptional()
1115
+ source?: string;
1116
+
1117
+ @ApiProperty({
1118
+ description: "The customer identifier name for the biller item",
1119
+ example: "Customer ID",
1120
+ required: false,
1121
+ })
1122
+ @IsString({ message: "Customer identifier name must be a valid string" })
1123
+ @IsOptional()
1124
+ customerIdentifierName?: string;
1125
+
1126
+ @ApiProperty({
1127
+ description: "The service fee associated with the biller item",
1128
+ example: 10,
1129
+ required: false,
1130
+ })
1131
+ @IsInt({ message: "Service fee must be a valid integer" })
1132
+ @IsOptional()
1133
+ serviceFee?: number;
1134
+
1135
+ @ApiProperty({
1136
+ description: "The currency of the biller item",
1137
+ example: "NGN",
1138
+ required: false,
1139
+ })
1140
+ @IsString({ message: "Currency must be a valid string" })
1141
+ @Length(1, 4, { message: "Currency must be between 1 and 4 characters" })
1142
+ @IsOptional()
1143
+ currency?: string;
1144
+
1145
+ @ApiProperty({
1146
+ description: "The description of the biller item",
1147
+ example: "Electricity Bill Payment",
1148
+ required: false,
1149
+ })
1150
+ @IsString({ message: "Description must be a valid string" })
1151
+ @IsOptional()
1152
+ description?: string;
1153
+
1154
+ @ApiProperty({
1155
+ description: "Indicates if the biller item is external",
1156
+ example: false,
1157
+ required: false,
1158
+ })
1159
+ @IsBoolean({ message: "External must be a valid boolean" })
1160
+ @IsOptional()
1161
+ external?: boolean;
1162
+ }
1163
+
1164
+ export class CreateInvoiceDto {
1165
+ @ApiProperty({
1166
+ description: "The ID of the biller",
1167
+ example: "550e8400-e29b-41d4-a716-446655440000",
1168
+ })
1169
+ @IsNotEmpty({ message: "Biller ID must not be empty" })
1170
+ @IsString({ message: "Biller ID must be a valid string" })
1171
+ billerId: string;
1172
+
1173
+ @ApiProperty({
1174
+ description: "The ID of the customer",
1175
+ example: "550e8400-e29b-41d4-a716-446655440001",
1176
+ })
1177
+ @IsNotEmpty({ message: "Customer ID must not be empty" })
1178
+ @IsString({ message: "Customer ID must be a valid string" })
1179
+ customerId: string;
1180
+
1181
+ @ApiProperty({
1182
+ description: "The discount value applied to the invoice",
1183
+ example: 10.5,
1184
+ })
1185
+ @IsNotEmpty({ message: "Discount value must not be empty" })
1186
+ @IsInt({ message: "Discount value must be a valid number" })
1187
+ discountValue: number;
1188
+
1189
+ @ApiProperty({
1190
+ description: "The type of discount applied to the invoice",
1191
+ example: "FIXED",
1192
+ })
1193
+ @IsNotEmpty({ message: "Discount type must not be empty" })
1194
+ @IsEnum(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" })
1195
+ discountType: string;
1196
+
1197
+ @ApiProperty({
1198
+ description: "The due date for the invoice",
1199
+ example: "2025-01-31T23:59:59Z",
1200
+ })
1201
+ @IsNotEmpty({ message: "Due date must not be empty" })
1202
+ @IsDateString({}, { message: "Due date must be a valid ISO 8601 date string" })
1203
+ dueDate: string;
1204
+
1205
+ @ApiProperty({
1206
+ description: "The status of the invoice",
1207
+ example: "PENDING",
1208
+ })
1209
+ @IsNotEmpty({ message: "Status must not be empty" })
1210
+ @IsEnum(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" })
1211
+ status: string;
1212
+ }
1213
+
1214
+ export class UpdateInvoiceDto {
1215
+ @ApiProperty({
1216
+ description: "The ID of the invoice",
1217
+ example: "550e8400-e29b-41d4-a716-446655440000",
1218
+ })
1219
+ @IsNotEmpty({ message: "ID must not be empty" })
1220
+ @IsString({ message: "ID must be a valid string" })
1221
+ id: string;
1222
+
1223
+ @ApiProperty({
1224
+ description: "The ID of the biller",
1225
+ example: "550e8400-e29b-41d4-a716-446655440000",
1226
+ required: false,
1227
+ })
1228
+ @IsString({ message: "Biller ID must be a valid string" })
1229
+ @IsOptional()
1230
+ billerId?: string;
1231
+
1232
+ @ApiProperty({
1233
+ description: "The ID of the customer",
1234
+ example: "550e8400-e29b-41d4-a716-446655440001",
1235
+ required: false,
1236
+ })
1237
+ @IsString({ message: "Customer ID must be a valid string" })
1238
+ @IsOptional()
1239
+ customerId?: string;
1240
+
1241
+ @ApiProperty({
1242
+ description: "The discount value applied to the invoice",
1243
+ example: 10.5,
1244
+ required: false,
1245
+ })
1246
+ @IsInt({ message: "Discount value must be a valid number" })
1247
+ @IsOptional()
1248
+ discountValue?: number;
1249
+
1250
+ @ApiProperty({
1251
+ description: "The type of discount applied to the invoice",
1252
+ example: "FIXED",
1253
+ required: false,
1254
+ })
1255
+ @IsEnum(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" })
1256
+ @IsOptional()
1257
+ discountType?: string;
1258
+
1259
+ @ApiProperty({
1260
+ description: "The due date for the invoice",
1261
+ example: "2025-01-31T23:59:59Z",
1262
+ required: false,
1263
+ })
1264
+ @IsDateString({}, { message: "Due date must be a valid ISO 8601 date string" })
1265
+ @IsOptional()
1266
+ dueDate?: string;
1267
+
1268
+ @ApiProperty({
1269
+ description: "The status of the invoice",
1270
+ example: "PENDING",
1271
+ required: false,
1272
+ })
1273
+ @IsEnum(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" })
1274
+ @IsOptional()
1275
+ status?: string;
1276
+ }