resurgence-data 1.1.8 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/biller/biller.dto.d.ts +0 -21
- package/dist/biller/biller.dto.js +1 -165
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/invoice/index.d.ts +2 -0
- package/dist/invoice/index.js +18 -0
- package/dist/invoice/invoice.dto.d.ts +29 -0
- package/dist/invoice/invoice.dto.js +231 -0
- package/dist/invoice/payment-page.dto.d.ts +33 -0
- package/dist/invoice/payment-page.dto.js +174 -0
- package/package.json +1 -1
- package/src/biller/biller.dto.ts +0 -143
- package/src/index.ts +1 -0
- package/src/invoice/index.ts +2 -0
- package/src/invoice/invoice.dto.ts +202 -0
- package/src/invoice/payment-page.dto.ts +126 -0
@@ -226,27 +226,6 @@ export declare class UpdateBillerItemDto extends BaseDTO {
|
|
226
226
|
description?: string;
|
227
227
|
external?: boolean;
|
228
228
|
}
|
229
|
-
export declare class CreateInvoiceDto extends BaseDTO {
|
230
|
-
billerId: string;
|
231
|
-
customerId: string;
|
232
|
-
items: string[];
|
233
|
-
discountValue: number;
|
234
|
-
total?: number;
|
235
|
-
totalService?: number;
|
236
|
-
discountType: string;
|
237
|
-
dueDate: string;
|
238
|
-
status: string;
|
239
|
-
}
|
240
|
-
export declare class UpdateInvoiceDto extends BaseDTO {
|
241
|
-
id: string;
|
242
|
-
billerId?: string;
|
243
|
-
items?: string[];
|
244
|
-
customerId?: string;
|
245
|
-
discountValue?: number;
|
246
|
-
discountType?: string;
|
247
|
-
dueDate?: string;
|
248
|
-
status?: string;
|
249
|
-
}
|
250
229
|
export declare class EnrollBillerDto extends CreateBillerDto {
|
251
230
|
id: string;
|
252
231
|
chargeConfigurations?: CreateBillerChargeConfigurationDto[];
|
@@ -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.EnrollBillerSettlementAccount = exports.EnrollBillerDto = exports.
|
12
|
+
exports.EnrollBillerSettlementAccount = exports.EnrollBillerDto = exports.UpdateBillerItemDto = exports.CreateBillerItemDto = exports.UpdateBillerItemCategoryDto = exports.BillerItemCategoryDto = exports.UpdateCustomerDto = exports.CreateCustomerDto = exports.UpdateBillerContactDto = exports.CreateBillerContactDto = exports.UpdateGoLiveRequestDto = exports.CreateGoLiveRequestDto = exports.UpdateBillerDocumentDto = exports.CreateBillerDocumentDto = exports.UpdateBillerChargeConfigurationDto = exports.CreateBillerChargeConfigurationDto = exports.UpdateSettlementAccountDto = exports.CreateSettlementAccountDto = exports.UpdateBillerProfileDTO = exports.BillerProfileDTO = exports.TIME_DELIMITER = exports.UpdateBillerDto = exports.CreateBillerDto = exports.CreateTransactionDto = exports.CreateChargeDto = exports.CreateBankDto = exports.UpdateBillerCategoryDto = exports.CreateBillerCategoryDto = void 0;
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
14
14
|
const class_validator_1 = require("class-validator");
|
15
15
|
const dto_type_1 = require("../types/dto.type");
|
@@ -1498,170 +1498,6 @@ __decorate([
|
|
1498
1498
|
(0, class_validator_1.IsOptional)(),
|
1499
1499
|
__metadata("design:type", Boolean)
|
1500
1500
|
], UpdateBillerItemDto.prototype, "external", void 0);
|
1501
|
-
class CreateInvoiceDto extends dto_type_1.BaseDTO {
|
1502
|
-
}
|
1503
|
-
exports.CreateInvoiceDto = CreateInvoiceDto;
|
1504
|
-
__decorate([
|
1505
|
-
(0, swagger_1.ApiProperty)({
|
1506
|
-
description: "The ID of the biller",
|
1507
|
-
example: "550e8400-e29b-41d4-a716-446655440000",
|
1508
|
-
}),
|
1509
|
-
(0, class_validator_1.IsNotEmpty)({ message: "Biller ID must not be empty" }),
|
1510
|
-
(0, class_validator_1.IsString)({ message: "Biller ID must be a valid string" }),
|
1511
|
-
__metadata("design:type", String)
|
1512
|
-
], CreateInvoiceDto.prototype, "billerId", void 0);
|
1513
|
-
__decorate([
|
1514
|
-
(0, swagger_1.ApiProperty)({
|
1515
|
-
description: "The ID of the customer",
|
1516
|
-
example: "550e8400-e29b-41d4-a716-446655440001",
|
1517
|
-
}),
|
1518
|
-
(0, class_validator_1.IsNotEmpty)({ message: "Customer ID must not be empty" }),
|
1519
|
-
(0, class_validator_1.IsString)({ message: "Customer ID must be a valid string" }),
|
1520
|
-
__metadata("design:type", String)
|
1521
|
-
], CreateInvoiceDto.prototype, "customerId", void 0);
|
1522
|
-
__decorate([
|
1523
|
-
(0, swagger_1.ApiProperty)({
|
1524
|
-
description: "List of items",
|
1525
|
-
example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
|
1526
|
-
}),
|
1527
|
-
(0, class_validator_1.IsNotEmpty)({ message: "Please provide items for this invoice" }),
|
1528
|
-
(0, class_validator_1.IsArray)({ message: "Please provide a list of items for this invoice" }),
|
1529
|
-
__metadata("design:type", Array)
|
1530
|
-
], CreateInvoiceDto.prototype, "items", void 0);
|
1531
|
-
__decorate([
|
1532
|
-
(0, swagger_1.ApiProperty)({
|
1533
|
-
description: "The discount value applied to the invoice",
|
1534
|
-
example: 10.5,
|
1535
|
-
}),
|
1536
|
-
(0, class_validator_1.IsNotEmpty)({ message: "Discount value must not be empty" }),
|
1537
|
-
(0, class_validator_1.IsNumber)(undefined, { message: "Discount value must be a valid number" }),
|
1538
|
-
__metadata("design:type", Number)
|
1539
|
-
], CreateInvoiceDto.prototype, "discountValue", void 0);
|
1540
|
-
__decorate([
|
1541
|
-
(0, swagger_1.ApiProperty)({
|
1542
|
-
description: "Total for invoice",
|
1543
|
-
example: 20030,
|
1544
|
-
}),
|
1545
|
-
(0, class_validator_1.IsInt)({ message: "Discount value must be a valid number" }),
|
1546
|
-
__metadata("design:type", Number)
|
1547
|
-
], CreateInvoiceDto.prototype, "total", void 0);
|
1548
|
-
__decorate([
|
1549
|
-
(0, swagger_1.ApiProperty)({
|
1550
|
-
description: "Total for invoice service charges",
|
1551
|
-
example: 1000,
|
1552
|
-
}),
|
1553
|
-
(0, class_validator_1.IsNumber)(undefined, { message: "Discount value must be a valid number" }),
|
1554
|
-
__metadata("design:type", Number)
|
1555
|
-
], CreateInvoiceDto.prototype, "totalService", void 0);
|
1556
|
-
__decorate([
|
1557
|
-
(0, swagger_1.ApiProperty)({
|
1558
|
-
description: "The type of discount applied to the invoice",
|
1559
|
-
example: "FIXED",
|
1560
|
-
}),
|
1561
|
-
(0, class_validator_1.IsNotEmpty)({ message: "Discount type must not be empty" }),
|
1562
|
-
(0, class_validator_1.IsEnum)(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" }),
|
1563
|
-
__metadata("design:type", String)
|
1564
|
-
], CreateInvoiceDto.prototype, "discountType", void 0);
|
1565
|
-
__decorate([
|
1566
|
-
(0, swagger_1.ApiProperty)({
|
1567
|
-
description: "The due date for the invoice",
|
1568
|
-
example: "2025-01-31T23:59:59Z",
|
1569
|
-
}),
|
1570
|
-
(0, class_validator_1.IsNotEmpty)({ message: "Due date must not be empty" }),
|
1571
|
-
(0, class_validator_1.IsDateString)({}, { message: "Due date must be a valid ISO 8601 date string" }),
|
1572
|
-
__metadata("design:type", String)
|
1573
|
-
], CreateInvoiceDto.prototype, "dueDate", void 0);
|
1574
|
-
__decorate([
|
1575
|
-
(0, swagger_1.ApiProperty)({
|
1576
|
-
description: "The status of the invoice",
|
1577
|
-
example: "PENDING",
|
1578
|
-
}),
|
1579
|
-
(0, class_validator_1.IsNotEmpty)({ message: "Status must not be empty" }),
|
1580
|
-
(0, class_validator_1.IsEnum)(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" }),
|
1581
|
-
__metadata("design:type", String)
|
1582
|
-
], CreateInvoiceDto.prototype, "status", void 0);
|
1583
|
-
class UpdateInvoiceDto extends dto_type_1.BaseDTO {
|
1584
|
-
}
|
1585
|
-
exports.UpdateInvoiceDto = UpdateInvoiceDto;
|
1586
|
-
__decorate([
|
1587
|
-
(0, swagger_1.ApiProperty)({
|
1588
|
-
description: "The ID of the invoice",
|
1589
|
-
example: "550e8400-e29b-41d4-a716-446655440000",
|
1590
|
-
}),
|
1591
|
-
(0, class_validator_1.IsNotEmpty)({ message: "ID must not be empty" }),
|
1592
|
-
(0, class_validator_1.IsString)({ message: "ID must be a valid string" }),
|
1593
|
-
__metadata("design:type", String)
|
1594
|
-
], UpdateInvoiceDto.prototype, "id", void 0);
|
1595
|
-
__decorate([
|
1596
|
-
(0, swagger_1.ApiProperty)({
|
1597
|
-
description: "The ID of the biller",
|
1598
|
-
example: "550e8400-e29b-41d4-a716-446655440000",
|
1599
|
-
required: false,
|
1600
|
-
}),
|
1601
|
-
(0, class_validator_1.IsString)({ message: "Biller ID must be a valid string" }),
|
1602
|
-
(0, class_validator_1.IsOptional)(),
|
1603
|
-
__metadata("design:type", String)
|
1604
|
-
], UpdateInvoiceDto.prototype, "billerId", void 0);
|
1605
|
-
__decorate([
|
1606
|
-
(0, swagger_1.ApiProperty)({
|
1607
|
-
description: "List of items",
|
1608
|
-
example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
|
1609
|
-
required: false,
|
1610
|
-
}),
|
1611
|
-
(0, class_validator_1.IsNotEmpty)({ message: "Please provide items for this invoice" }),
|
1612
|
-
(0, class_validator_1.IsArray)({ message: "Please provide a list of items for this invoice" }),
|
1613
|
-
__metadata("design:type", Array)
|
1614
|
-
], UpdateInvoiceDto.prototype, "items", void 0);
|
1615
|
-
__decorate([
|
1616
|
-
(0, swagger_1.ApiProperty)({
|
1617
|
-
description: "The ID of the customer",
|
1618
|
-
example: "550e8400-e29b-41d4-a716-446655440001",
|
1619
|
-
required: false,
|
1620
|
-
}),
|
1621
|
-
(0, class_validator_1.IsString)({ message: "Customer ID must be a valid string" }),
|
1622
|
-
(0, class_validator_1.IsOptional)(),
|
1623
|
-
__metadata("design:type", String)
|
1624
|
-
], UpdateInvoiceDto.prototype, "customerId", void 0);
|
1625
|
-
__decorate([
|
1626
|
-
(0, swagger_1.ApiProperty)({
|
1627
|
-
description: "The discount value applied to the invoice",
|
1628
|
-
example: 10.5,
|
1629
|
-
required: false,
|
1630
|
-
}),
|
1631
|
-
(0, class_validator_1.IsInt)({ message: "Discount value must be a valid number" }),
|
1632
|
-
(0, class_validator_1.IsOptional)(),
|
1633
|
-
__metadata("design:type", Number)
|
1634
|
-
], UpdateInvoiceDto.prototype, "discountValue", void 0);
|
1635
|
-
__decorate([
|
1636
|
-
(0, swagger_1.ApiProperty)({
|
1637
|
-
description: "The type of discount applied to the invoice",
|
1638
|
-
example: "FIXED",
|
1639
|
-
required: false,
|
1640
|
-
}),
|
1641
|
-
(0, class_validator_1.IsEnum)(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" }),
|
1642
|
-
(0, class_validator_1.IsOptional)(),
|
1643
|
-
__metadata("design:type", String)
|
1644
|
-
], UpdateInvoiceDto.prototype, "discountType", void 0);
|
1645
|
-
__decorate([
|
1646
|
-
(0, swagger_1.ApiProperty)({
|
1647
|
-
description: "The due date for the invoice",
|
1648
|
-
example: "2025-01-31T23:59:59Z",
|
1649
|
-
required: false,
|
1650
|
-
}),
|
1651
|
-
(0, class_validator_1.IsDateString)({}, { message: "Due date must be a valid ISO 8601 date string" }),
|
1652
|
-
(0, class_validator_1.IsOptional)(),
|
1653
|
-
__metadata("design:type", String)
|
1654
|
-
], UpdateInvoiceDto.prototype, "dueDate", void 0);
|
1655
|
-
__decorate([
|
1656
|
-
(0, swagger_1.ApiProperty)({
|
1657
|
-
description: "The status of the invoice",
|
1658
|
-
example: "PENDING",
|
1659
|
-
required: false,
|
1660
|
-
}),
|
1661
|
-
(0, class_validator_1.IsEnum)(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" }),
|
1662
|
-
(0, class_validator_1.IsOptional)(),
|
1663
|
-
__metadata("design:type", String)
|
1664
|
-
], UpdateInvoiceDto.prototype, "status", void 0);
|
1665
1501
|
class EnrollBillerDto extends CreateBillerDto {
|
1666
1502
|
}
|
1667
1503
|
exports.EnrollBillerDto = EnrollBillerDto;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./payment-page.dto"), exports);
|
18
|
+
__exportStar(require("./invoice.dto"), exports);
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { BaseDTO } from "../types/dto.type";
|
2
|
+
export declare class CreateInvoiceDto extends BaseDTO {
|
3
|
+
billerId: string;
|
4
|
+
customerId?: string;
|
5
|
+
items: string[];
|
6
|
+
discountValue: number;
|
7
|
+
total?: number;
|
8
|
+
totalService?: number;
|
9
|
+
discountType: string;
|
10
|
+
dueDate: string;
|
11
|
+
status: string;
|
12
|
+
customer?: InvoiceCustomerDto;
|
13
|
+
}
|
14
|
+
export declare class UpdateInvoiceDto extends BaseDTO {
|
15
|
+
id: string;
|
16
|
+
billerId?: string;
|
17
|
+
items?: string[];
|
18
|
+
customerId?: string;
|
19
|
+
discountValue?: number;
|
20
|
+
discountType?: string;
|
21
|
+
dueDate?: string;
|
22
|
+
status?: string;
|
23
|
+
}
|
24
|
+
export declare class InvoiceCustomerDto extends BaseDTO {
|
25
|
+
name: string;
|
26
|
+
emailAddress?: string;
|
27
|
+
phoneNumber?: string;
|
28
|
+
address?: string;
|
29
|
+
}
|
@@ -0,0 +1,231 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.InvoiceCustomerDto = exports.UpdateInvoiceDto = exports.CreateInvoiceDto = void 0;
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
14
|
+
const class_validator_1 = require("class-validator");
|
15
|
+
const dto_type_1 = require("../types/dto.type");
|
16
|
+
class CreateInvoiceDto extends dto_type_1.BaseDTO {
|
17
|
+
}
|
18
|
+
exports.CreateInvoiceDto = CreateInvoiceDto;
|
19
|
+
__decorate([
|
20
|
+
(0, swagger_1.ApiProperty)({
|
21
|
+
description: "The ID of the biller",
|
22
|
+
example: "550e8400-e29b-41d4-a716-446655440000",
|
23
|
+
}),
|
24
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Biller ID must not be empty" }),
|
25
|
+
(0, class_validator_1.IsString)({ message: "Biller ID must be a valid string" }),
|
26
|
+
__metadata("design:type", String)
|
27
|
+
], CreateInvoiceDto.prototype, "billerId", void 0);
|
28
|
+
__decorate([
|
29
|
+
(0, swagger_1.ApiProperty)({
|
30
|
+
description: "The ID of the customer",
|
31
|
+
example: "550e8400-e29b-41d4-a716-446655440001",
|
32
|
+
required: false,
|
33
|
+
}),
|
34
|
+
(0, class_validator_1.IsString)({ message: "Customer ID must be a valid string" }),
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
36
|
+
__metadata("design:type", String)
|
37
|
+
], CreateInvoiceDto.prototype, "customerId", void 0);
|
38
|
+
__decorate([
|
39
|
+
(0, swagger_1.ApiProperty)({
|
40
|
+
description: "List of items",
|
41
|
+
example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
|
42
|
+
}),
|
43
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Please provide items for this invoice" }),
|
44
|
+
(0, class_validator_1.IsArray)({ message: "Please provide a list of items for this invoice" }),
|
45
|
+
__metadata("design:type", Array)
|
46
|
+
], CreateInvoiceDto.prototype, "items", void 0);
|
47
|
+
__decorate([
|
48
|
+
(0, swagger_1.ApiProperty)({
|
49
|
+
description: "The discount value applied to the invoice",
|
50
|
+
example: 10.5,
|
51
|
+
}),
|
52
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Discount value must not be empty" }),
|
53
|
+
(0, class_validator_1.IsNumber)(undefined, { message: "Discount value must be a valid number" }),
|
54
|
+
__metadata("design:type", Number)
|
55
|
+
], CreateInvoiceDto.prototype, "discountValue", void 0);
|
56
|
+
__decorate([
|
57
|
+
(0, swagger_1.ApiProperty)({
|
58
|
+
description: "Total for invoice",
|
59
|
+
example: 20030,
|
60
|
+
}),
|
61
|
+
(0, class_validator_1.IsInt)({ message: "Discount value must be a valid number" }),
|
62
|
+
__metadata("design:type", Number)
|
63
|
+
], CreateInvoiceDto.prototype, "total", void 0);
|
64
|
+
__decorate([
|
65
|
+
(0, swagger_1.ApiProperty)({
|
66
|
+
description: "Total for invoice service charges",
|
67
|
+
example: 1000,
|
68
|
+
}),
|
69
|
+
(0, class_validator_1.IsNumber)(undefined, { message: "Discount value must be a valid number" }),
|
70
|
+
__metadata("design:type", Number)
|
71
|
+
], CreateInvoiceDto.prototype, "totalService", void 0);
|
72
|
+
__decorate([
|
73
|
+
(0, swagger_1.ApiProperty)({
|
74
|
+
description: "The type of discount applied to the invoice",
|
75
|
+
example: "FIXED",
|
76
|
+
}),
|
77
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Discount type must not be empty" }),
|
78
|
+
(0, class_validator_1.IsEnum)(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" }),
|
79
|
+
__metadata("design:type", String)
|
80
|
+
], CreateInvoiceDto.prototype, "discountType", void 0);
|
81
|
+
__decorate([
|
82
|
+
(0, swagger_1.ApiProperty)({
|
83
|
+
description: "The due date for the invoice",
|
84
|
+
example: "2025-01-31T23:59:59Z",
|
85
|
+
}),
|
86
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Due date must not be empty" }),
|
87
|
+
(0, class_validator_1.IsDateString)({}, { message: "Due date must be a valid ISO 8601 date string" }),
|
88
|
+
__metadata("design:type", String)
|
89
|
+
], CreateInvoiceDto.prototype, "dueDate", void 0);
|
90
|
+
__decorate([
|
91
|
+
(0, swagger_1.ApiProperty)({
|
92
|
+
description: "The status of the invoice",
|
93
|
+
example: "PENDING",
|
94
|
+
}),
|
95
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Status must not be empty" }),
|
96
|
+
(0, class_validator_1.IsEnum)(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" }),
|
97
|
+
__metadata("design:type", String)
|
98
|
+
], CreateInvoiceDto.prototype, "status", void 0);
|
99
|
+
__decorate([
|
100
|
+
(0, swagger_1.ApiProperty)({
|
101
|
+
description: "The customer details",
|
102
|
+
}),
|
103
|
+
(0, class_validator_1.IsOptional)(),
|
104
|
+
__metadata("design:type", InvoiceCustomerDto)
|
105
|
+
], CreateInvoiceDto.prototype, "customer", void 0);
|
106
|
+
class UpdateInvoiceDto extends dto_type_1.BaseDTO {
|
107
|
+
}
|
108
|
+
exports.UpdateInvoiceDto = UpdateInvoiceDto;
|
109
|
+
__decorate([
|
110
|
+
(0, swagger_1.ApiProperty)({
|
111
|
+
description: "The ID of the invoice",
|
112
|
+
example: "550e8400-e29b-41d4-a716-446655440000",
|
113
|
+
}),
|
114
|
+
(0, class_validator_1.IsNotEmpty)({ message: "ID must not be empty" }),
|
115
|
+
(0, class_validator_1.IsString)({ message: "ID must be a valid string" }),
|
116
|
+
__metadata("design:type", String)
|
117
|
+
], UpdateInvoiceDto.prototype, "id", void 0);
|
118
|
+
__decorate([
|
119
|
+
(0, swagger_1.ApiProperty)({
|
120
|
+
description: "The ID of the biller",
|
121
|
+
example: "550e8400-e29b-41d4-a716-446655440000",
|
122
|
+
required: false,
|
123
|
+
}),
|
124
|
+
(0, class_validator_1.IsString)({ message: "Biller ID must be a valid string" }),
|
125
|
+
(0, class_validator_1.IsOptional)(),
|
126
|
+
__metadata("design:type", String)
|
127
|
+
], UpdateInvoiceDto.prototype, "billerId", void 0);
|
128
|
+
__decorate([
|
129
|
+
(0, swagger_1.ApiProperty)({
|
130
|
+
description: "List of items",
|
131
|
+
example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
|
132
|
+
required: false,
|
133
|
+
}),
|
134
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Please provide items for this invoice" }),
|
135
|
+
(0, class_validator_1.IsArray)({ message: "Please provide a list of items for this invoice" }),
|
136
|
+
__metadata("design:type", Array)
|
137
|
+
], UpdateInvoiceDto.prototype, "items", void 0);
|
138
|
+
__decorate([
|
139
|
+
(0, swagger_1.ApiProperty)({
|
140
|
+
description: "The ID of the customer",
|
141
|
+
example: "550e8400-e29b-41d4-a716-446655440001",
|
142
|
+
required: false,
|
143
|
+
}),
|
144
|
+
(0, class_validator_1.IsString)({ message: "Customer ID must be a valid string" }),
|
145
|
+
(0, class_validator_1.IsOptional)(),
|
146
|
+
__metadata("design:type", String)
|
147
|
+
], UpdateInvoiceDto.prototype, "customerId", void 0);
|
148
|
+
__decorate([
|
149
|
+
(0, swagger_1.ApiProperty)({
|
150
|
+
description: "The discount value applied to the invoice",
|
151
|
+
example: 10.5,
|
152
|
+
required: false,
|
153
|
+
}),
|
154
|
+
(0, class_validator_1.IsInt)({ message: "Discount value must be a valid number" }),
|
155
|
+
(0, class_validator_1.IsOptional)(),
|
156
|
+
__metadata("design:type", Number)
|
157
|
+
], UpdateInvoiceDto.prototype, "discountValue", void 0);
|
158
|
+
__decorate([
|
159
|
+
(0, swagger_1.ApiProperty)({
|
160
|
+
description: "The type of discount applied to the invoice",
|
161
|
+
example: "FIXED",
|
162
|
+
required: false,
|
163
|
+
}),
|
164
|
+
(0, class_validator_1.IsEnum)(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" }),
|
165
|
+
(0, class_validator_1.IsOptional)(),
|
166
|
+
__metadata("design:type", String)
|
167
|
+
], UpdateInvoiceDto.prototype, "discountType", void 0);
|
168
|
+
__decorate([
|
169
|
+
(0, swagger_1.ApiProperty)({
|
170
|
+
description: "The due date for the invoice",
|
171
|
+
example: "2025-01-31T23:59:59Z",
|
172
|
+
required: false,
|
173
|
+
}),
|
174
|
+
(0, class_validator_1.IsDateString)({}, { message: "Due date must be a valid ISO 8601 date string" }),
|
175
|
+
(0, class_validator_1.IsOptional)(),
|
176
|
+
__metadata("design:type", String)
|
177
|
+
], UpdateInvoiceDto.prototype, "dueDate", void 0);
|
178
|
+
__decorate([
|
179
|
+
(0, swagger_1.ApiProperty)({
|
180
|
+
description: "The status of the invoice",
|
181
|
+
example: "PENDING",
|
182
|
+
required: false,
|
183
|
+
}),
|
184
|
+
(0, class_validator_1.IsEnum)(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" }),
|
185
|
+
(0, class_validator_1.IsOptional)(),
|
186
|
+
__metadata("design:type", String)
|
187
|
+
], UpdateInvoiceDto.prototype, "status", void 0);
|
188
|
+
class InvoiceCustomerDto extends dto_type_1.BaseDTO {
|
189
|
+
}
|
190
|
+
exports.InvoiceCustomerDto = InvoiceCustomerDto;
|
191
|
+
__decorate([
|
192
|
+
(0, swagger_1.ApiProperty)({
|
193
|
+
description: "The name of the customer",
|
194
|
+
example: "Jane Smith",
|
195
|
+
}),
|
196
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Name must not be empty" }),
|
197
|
+
(0, class_validator_1.IsString)({ message: "Name must be a valid string" }),
|
198
|
+
(0, class_validator_1.Length)(1, 50, { message: "Name must be between 1 and 50 characters" }),
|
199
|
+
__metadata("design:type", String)
|
200
|
+
], InvoiceCustomerDto.prototype, "name", void 0);
|
201
|
+
__decorate([
|
202
|
+
(0, swagger_1.ApiProperty)({
|
203
|
+
description: "The email address of the customer",
|
204
|
+
example: "janesmith@example.com",
|
205
|
+
required: false,
|
206
|
+
}),
|
207
|
+
(0, class_validator_1.IsString)({ message: "Email address must be a valid string" }),
|
208
|
+
(0, class_validator_1.Length)(1, 50, { message: "Email address must be between 1 and 50 characters" }),
|
209
|
+
(0, class_validator_1.IsOptional)(),
|
210
|
+
__metadata("design:type", String)
|
211
|
+
], InvoiceCustomerDto.prototype, "emailAddress", void 0);
|
212
|
+
__decorate([
|
213
|
+
(0, swagger_1.ApiProperty)({
|
214
|
+
description: "The phone number of the customer",
|
215
|
+
example: "+9876543210",
|
216
|
+
required: false,
|
217
|
+
}),
|
218
|
+
(0, class_validator_1.IsString)({ message: "Phone number must be a valid string" }),
|
219
|
+
(0, class_validator_1.IsOptional)(),
|
220
|
+
__metadata("design:type", String)
|
221
|
+
], InvoiceCustomerDto.prototype, "phoneNumber", void 0);
|
222
|
+
__decorate([
|
223
|
+
(0, swagger_1.ApiProperty)({
|
224
|
+
description: "Address of the customer",
|
225
|
+
example: "12 Fremont lane, New York",
|
226
|
+
required: false,
|
227
|
+
}),
|
228
|
+
(0, class_validator_1.IsString)({ message: "Address must be a valid string" }),
|
229
|
+
(0, class_validator_1.IsOptional)(),
|
230
|
+
__metadata("design:type", String)
|
231
|
+
], InvoiceCustomerDto.prototype, "address", void 0);
|
@@ -0,0 +1,33 @@
|
|
1
|
+
export declare class PaymentPageDto {
|
2
|
+
billerId: string;
|
3
|
+
description?: string;
|
4
|
+
title: string;
|
5
|
+
totalAmount: number;
|
6
|
+
currencyCode: string;
|
7
|
+
active?: boolean;
|
8
|
+
url?: boolean;
|
9
|
+
acceptsUserAmount?: boolean;
|
10
|
+
}
|
11
|
+
export declare class UpdatePaymentPageDto {
|
12
|
+
id: string;
|
13
|
+
billerId?: string;
|
14
|
+
description?: string;
|
15
|
+
title?: string;
|
16
|
+
totalAmount?: number;
|
17
|
+
currencyCode?: string;
|
18
|
+
active?: boolean;
|
19
|
+
url?: boolean;
|
20
|
+
acceptsUserAmount?: boolean;
|
21
|
+
}
|
22
|
+
export declare class PaymentPageResponseDto {
|
23
|
+
billerId: string;
|
24
|
+
description?: string;
|
25
|
+
title: string;
|
26
|
+
totalAmount: number;
|
27
|
+
currencyCode: string;
|
28
|
+
active?: boolean;
|
29
|
+
url?: boolean;
|
30
|
+
acceptsUserAmount?: boolean;
|
31
|
+
createdAt: Date;
|
32
|
+
updatedAt: Date;
|
33
|
+
}
|
@@ -0,0 +1,174 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.PaymentPageResponseDto = exports.UpdatePaymentPageDto = exports.PaymentPageDto = void 0;
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
14
|
+
const class_validator_1 = require("class-validator");
|
15
|
+
class PaymentPageDto {
|
16
|
+
constructor() {
|
17
|
+
this.currencyCode = "NGN";
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.PaymentPageDto = PaymentPageDto;
|
21
|
+
__decorate([
|
22
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page biller code uuid" }),
|
23
|
+
(0, class_validator_1.IsString)({ message: "billerId must be a string" }),
|
24
|
+
(0, class_validator_1.IsUUID)("4", { message: "billerId must be a valid id format" }),
|
25
|
+
(0, class_validator_1.IsNotEmpty)({ message: "billerId should not be empty" }),
|
26
|
+
__metadata("design:type", String)
|
27
|
+
], PaymentPageDto.prototype, "billerId", void 0);
|
28
|
+
__decorate([
|
29
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page description", required: false }),
|
30
|
+
(0, class_validator_1.IsString)({ message: "description must be a string" }),
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
32
|
+
__metadata("design:type", String)
|
33
|
+
], PaymentPageDto.prototype, "description", void 0);
|
34
|
+
__decorate([
|
35
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page's title" }),
|
36
|
+
(0, class_validator_1.IsString)({ message: "title must be a string" }),
|
37
|
+
(0, class_validator_1.IsNotEmpty)({ message: "title should not be empty" }),
|
38
|
+
__metadata("design:type", String)
|
39
|
+
], PaymentPageDto.prototype, "title", void 0);
|
40
|
+
__decorate([
|
41
|
+
(0, swagger_1.ApiProperty)({ description: "Page total amount in lowest denomination" }),
|
42
|
+
(0, class_validator_1.IsInt)({ message: "totalAmount must be an integer" }),
|
43
|
+
(0, class_validator_1.IsNotEmpty)({ message: "totalAmount should not be empty" }),
|
44
|
+
__metadata("design:type", Number)
|
45
|
+
], PaymentPageDto.prototype, "totalAmount", void 0);
|
46
|
+
__decorate([
|
47
|
+
(0, swagger_1.ApiProperty)({ description: "Amount's currency code", default: "NGN" }),
|
48
|
+
(0, class_validator_1.IsString)({ message: "currencyCode must be a string" }),
|
49
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Please select a currency" }),
|
50
|
+
__metadata("design:type", String)
|
51
|
+
], PaymentPageDto.prototype, "currencyCode", void 0);
|
52
|
+
__decorate([
|
53
|
+
(0, swagger_1.ApiProperty)({ description: "Invoice's active status", required: false }),
|
54
|
+
(0, class_validator_1.IsBoolean)({ message: "active must be a boolean" }),
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
56
|
+
__metadata("design:type", Boolean)
|
57
|
+
], PaymentPageDto.prototype, "active", void 0);
|
58
|
+
__decorate([
|
59
|
+
(0, swagger_1.ApiProperty)({ description: "Url of the page", required: false }),
|
60
|
+
(0, class_validator_1.IsString)({ message: "URL should be text" }),
|
61
|
+
(0, class_validator_1.IsOptional)(),
|
62
|
+
__metadata("design:type", Boolean)
|
63
|
+
], PaymentPageDto.prototype, "url", void 0);
|
64
|
+
__decorate([
|
65
|
+
(0, swagger_1.ApiProperty)({ description: "Whether pages accept user amount", required: false }),
|
66
|
+
(0, class_validator_1.IsBoolean)({ message: "acceptsUserAmount must be a boolean" }),
|
67
|
+
(0, class_validator_1.IsOptional)(),
|
68
|
+
__metadata("design:type", Boolean)
|
69
|
+
], PaymentPageDto.prototype, "acceptsUserAmount", void 0);
|
70
|
+
class UpdatePaymentPageDto {
|
71
|
+
constructor() {
|
72
|
+
this.currencyCode = "NGN";
|
73
|
+
}
|
74
|
+
}
|
75
|
+
exports.UpdatePaymentPageDto = UpdatePaymentPageDto;
|
76
|
+
__decorate([
|
77
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page biller code uuid" }),
|
78
|
+
(0, class_validator_1.IsString)({ message: "Page id must be a string" }),
|
79
|
+
(0, class_validator_1.IsUUID)("4", { message: "Id must be a valid id format" }),
|
80
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Page id should not be empty" }),
|
81
|
+
__metadata("design:type", String)
|
82
|
+
], UpdatePaymentPageDto.prototype, "id", void 0);
|
83
|
+
__decorate([
|
84
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page biller code uuid", required: false }),
|
85
|
+
(0, class_validator_1.IsUUID)("4", { message: "billerId must be a valid id format" }),
|
86
|
+
(0, class_validator_1.IsString)({ message: "billerId must be a string" }),
|
87
|
+
(0, class_validator_1.IsOptional)(),
|
88
|
+
__metadata("design:type", String)
|
89
|
+
], UpdatePaymentPageDto.prototype, "billerId", void 0);
|
90
|
+
__decorate([
|
91
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page description", required: false }),
|
92
|
+
(0, class_validator_1.IsString)({ message: "description must be a string" }),
|
93
|
+
(0, class_validator_1.IsOptional)(),
|
94
|
+
__metadata("design:type", String)
|
95
|
+
], UpdatePaymentPageDto.prototype, "description", void 0);
|
96
|
+
__decorate([
|
97
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page's title", required: false }),
|
98
|
+
(0, class_validator_1.IsString)({ message: "title must be a string" }),
|
99
|
+
(0, class_validator_1.IsOptional)(),
|
100
|
+
__metadata("design:type", String)
|
101
|
+
], UpdatePaymentPageDto.prototype, "title", void 0);
|
102
|
+
__decorate([
|
103
|
+
(0, swagger_1.ApiProperty)({ description: "Page total amount in lowest denomination", required: false }),
|
104
|
+
(0, class_validator_1.IsInt)({ message: "totalAmount must be an integer" }),
|
105
|
+
(0, class_validator_1.IsOptional)(),
|
106
|
+
__metadata("design:type", Number)
|
107
|
+
], UpdatePaymentPageDto.prototype, "totalAmount", void 0);
|
108
|
+
__decorate([
|
109
|
+
(0, swagger_1.ApiProperty)({ description: "Amount's currency code", default: "NGN", required: false }),
|
110
|
+
(0, class_validator_1.IsString)({ message: "currencyCode must be a string" }),
|
111
|
+
(0, class_validator_1.IsNotEmpty)({ message: "Please select a currency" }),
|
112
|
+
__metadata("design:type", String)
|
113
|
+
], UpdatePaymentPageDto.prototype, "currencyCode", void 0);
|
114
|
+
__decorate([
|
115
|
+
(0, swagger_1.ApiProperty)({ description: "Invoice's active status", required: false }),
|
116
|
+
(0, class_validator_1.IsBoolean)({ message: "active must be a boolean" }),
|
117
|
+
(0, class_validator_1.IsOptional)(),
|
118
|
+
__metadata("design:type", Boolean)
|
119
|
+
], UpdatePaymentPageDto.prototype, "active", void 0);
|
120
|
+
__decorate([
|
121
|
+
(0, swagger_1.ApiProperty)({ description: "Url of the page", required: false }),
|
122
|
+
(0, class_validator_1.IsString)({ message: "URL should be text" }),
|
123
|
+
(0, class_validator_1.IsOptional)(),
|
124
|
+
__metadata("design:type", Boolean)
|
125
|
+
], UpdatePaymentPageDto.prototype, "url", void 0);
|
126
|
+
__decorate([
|
127
|
+
(0, swagger_1.ApiProperty)({ description: "Whether pages accept user amount", required: false }),
|
128
|
+
(0, class_validator_1.IsBoolean)({ message: "acceptsUserAmount must be a boolean" }),
|
129
|
+
(0, class_validator_1.IsOptional)(),
|
130
|
+
__metadata("design:type", Boolean)
|
131
|
+
], UpdatePaymentPageDto.prototype, "acceptsUserAmount", void 0);
|
132
|
+
class PaymentPageResponseDto {
|
133
|
+
}
|
134
|
+
exports.PaymentPageResponseDto = PaymentPageResponseDto;
|
135
|
+
__decorate([
|
136
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page biller code uuid" }),
|
137
|
+
__metadata("design:type", String)
|
138
|
+
], PaymentPageResponseDto.prototype, "billerId", void 0);
|
139
|
+
__decorate([
|
140
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page description", required: false }),
|
141
|
+
__metadata("design:type", String)
|
142
|
+
], PaymentPageResponseDto.prototype, "description", void 0);
|
143
|
+
__decorate([
|
144
|
+
(0, swagger_1.ApiProperty)({ description: "Payment page's title" }),
|
145
|
+
__metadata("design:type", String)
|
146
|
+
], PaymentPageResponseDto.prototype, "title", void 0);
|
147
|
+
__decorate([
|
148
|
+
(0, swagger_1.ApiProperty)({ description: "Page total amount in lowest denomination" }),
|
149
|
+
__metadata("design:type", Number)
|
150
|
+
], PaymentPageResponseDto.prototype, "totalAmount", void 0);
|
151
|
+
__decorate([
|
152
|
+
(0, swagger_1.ApiProperty)({ description: "Amount's currency code", default: "NGN" }),
|
153
|
+
__metadata("design:type", String)
|
154
|
+
], PaymentPageResponseDto.prototype, "currencyCode", void 0);
|
155
|
+
__decorate([
|
156
|
+
(0, swagger_1.ApiProperty)({ description: "Invoice's active status", required: false }),
|
157
|
+
__metadata("design:type", Boolean)
|
158
|
+
], PaymentPageResponseDto.prototype, "active", void 0);
|
159
|
+
__decorate([
|
160
|
+
(0, swagger_1.ApiProperty)({ description: "Url of the page", required: false }),
|
161
|
+
__metadata("design:type", Boolean)
|
162
|
+
], PaymentPageResponseDto.prototype, "url", void 0);
|
163
|
+
__decorate([
|
164
|
+
(0, swagger_1.ApiProperty)({ description: "Whether pages accept user amount", required: false }),
|
165
|
+
__metadata("design:type", Boolean)
|
166
|
+
], PaymentPageResponseDto.prototype, "acceptsUserAmount", void 0);
|
167
|
+
__decorate([
|
168
|
+
(0, swagger_1.ApiProperty)({ description: "Date when the page was created" }),
|
169
|
+
__metadata("design:type", Date)
|
170
|
+
], PaymentPageResponseDto.prototype, "createdAt", void 0);
|
171
|
+
__decorate([
|
172
|
+
(0, swagger_1.ApiProperty)({ description: "Date when the page was last updated" }),
|
173
|
+
__metadata("design:type", Date)
|
174
|
+
], PaymentPageResponseDto.prototype, "updatedAt", void 0);
|
package/package.json
CHANGED
package/src/biller/biller.dto.ts
CHANGED
@@ -1329,149 +1329,6 @@ export class UpdateBillerItemDto extends BaseDTO {
|
|
1329
1329
|
external?: boolean;
|
1330
1330
|
}
|
1331
1331
|
|
1332
|
-
export class CreateInvoiceDto extends BaseDTO {
|
1333
|
-
@ApiProperty({
|
1334
|
-
description: "The ID of the biller",
|
1335
|
-
example: "550e8400-e29b-41d4-a716-446655440000",
|
1336
|
-
})
|
1337
|
-
@IsNotEmpty({ message: "Biller ID must not be empty" })
|
1338
|
-
@IsString({ message: "Biller ID must be a valid string" })
|
1339
|
-
billerId: string;
|
1340
|
-
|
1341
|
-
@ApiProperty({
|
1342
|
-
description: "The ID of the customer",
|
1343
|
-
example: "550e8400-e29b-41d4-a716-446655440001",
|
1344
|
-
})
|
1345
|
-
@IsNotEmpty({ message: "Customer ID must not be empty" })
|
1346
|
-
@IsString({ message: "Customer ID must be a valid string" })
|
1347
|
-
customerId: string;
|
1348
|
-
|
1349
|
-
@ApiProperty({
|
1350
|
-
description: "List of items",
|
1351
|
-
example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
|
1352
|
-
})
|
1353
|
-
@IsNotEmpty({ message: "Please provide items for this invoice" })
|
1354
|
-
@IsArray({ message: "Please provide a list of items for this invoice" })
|
1355
|
-
items: string[];
|
1356
|
-
|
1357
|
-
@ApiProperty({
|
1358
|
-
description: "The discount value applied to the invoice",
|
1359
|
-
example: 10.5,
|
1360
|
-
})
|
1361
|
-
@IsNotEmpty({ message: "Discount value must not be empty" })
|
1362
|
-
@IsNumber(undefined, { message: "Discount value must be a valid number" })
|
1363
|
-
discountValue: number;
|
1364
|
-
@ApiProperty({
|
1365
|
-
description: "Total for invoice",
|
1366
|
-
example: 20030,
|
1367
|
-
})
|
1368
|
-
@IsInt({ message: "Discount value must be a valid number" })
|
1369
|
-
total?: number;
|
1370
|
-
@ApiProperty({
|
1371
|
-
description: "Total for invoice service charges",
|
1372
|
-
example: 1000,
|
1373
|
-
})
|
1374
|
-
@IsNumber(undefined, { message: "Discount value must be a valid number" })
|
1375
|
-
totalService?: number;
|
1376
|
-
|
1377
|
-
@ApiProperty({
|
1378
|
-
description: "The type of discount applied to the invoice",
|
1379
|
-
example: "FIXED",
|
1380
|
-
})
|
1381
|
-
@IsNotEmpty({ message: "Discount type must not be empty" })
|
1382
|
-
@IsEnum(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" })
|
1383
|
-
discountType: string;
|
1384
|
-
|
1385
|
-
@ApiProperty({
|
1386
|
-
description: "The due date for the invoice",
|
1387
|
-
example: "2025-01-31T23:59:59Z",
|
1388
|
-
})
|
1389
|
-
@IsNotEmpty({ message: "Due date must not be empty" })
|
1390
|
-
@IsDateString({}, { message: "Due date must be a valid ISO 8601 date string" })
|
1391
|
-
dueDate: string;
|
1392
|
-
|
1393
|
-
@ApiProperty({
|
1394
|
-
description: "The status of the invoice",
|
1395
|
-
example: "PENDING",
|
1396
|
-
})
|
1397
|
-
@IsNotEmpty({ message: "Status must not be empty" })
|
1398
|
-
@IsEnum(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" })
|
1399
|
-
status: string;
|
1400
|
-
}
|
1401
|
-
|
1402
|
-
export class UpdateInvoiceDto extends BaseDTO {
|
1403
|
-
@ApiProperty({
|
1404
|
-
description: "The ID of the invoice",
|
1405
|
-
example: "550e8400-e29b-41d4-a716-446655440000",
|
1406
|
-
})
|
1407
|
-
@IsNotEmpty({ message: "ID must not be empty" })
|
1408
|
-
@IsString({ message: "ID must be a valid string" })
|
1409
|
-
id: string;
|
1410
|
-
|
1411
|
-
@ApiProperty({
|
1412
|
-
description: "The ID of the biller",
|
1413
|
-
example: "550e8400-e29b-41d4-a716-446655440000",
|
1414
|
-
required: false,
|
1415
|
-
})
|
1416
|
-
@IsString({ message: "Biller ID must be a valid string" })
|
1417
|
-
@IsOptional()
|
1418
|
-
billerId?: string;
|
1419
|
-
|
1420
|
-
@ApiProperty({
|
1421
|
-
description: "List of items",
|
1422
|
-
example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
|
1423
|
-
required: false,
|
1424
|
-
})
|
1425
|
-
@IsNotEmpty({ message: "Please provide items for this invoice" })
|
1426
|
-
@IsArray({ message: "Please provide a list of items for this invoice" })
|
1427
|
-
items?: string[];
|
1428
|
-
|
1429
|
-
@ApiProperty({
|
1430
|
-
description: "The ID of the customer",
|
1431
|
-
example: "550e8400-e29b-41d4-a716-446655440001",
|
1432
|
-
required: false,
|
1433
|
-
})
|
1434
|
-
@IsString({ message: "Customer ID must be a valid string" })
|
1435
|
-
@IsOptional()
|
1436
|
-
customerId?: string;
|
1437
|
-
|
1438
|
-
@ApiProperty({
|
1439
|
-
description: "The discount value applied to the invoice",
|
1440
|
-
example: 10.5,
|
1441
|
-
required: false,
|
1442
|
-
})
|
1443
|
-
@IsInt({ message: "Discount value must be a valid number" })
|
1444
|
-
@IsOptional()
|
1445
|
-
discountValue?: number;
|
1446
|
-
|
1447
|
-
@ApiProperty({
|
1448
|
-
description: "The type of discount applied to the invoice",
|
1449
|
-
example: "FIXED",
|
1450
|
-
required: false,
|
1451
|
-
})
|
1452
|
-
@IsEnum(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" })
|
1453
|
-
@IsOptional()
|
1454
|
-
discountType?: string;
|
1455
|
-
|
1456
|
-
@ApiProperty({
|
1457
|
-
description: "The due date for the invoice",
|
1458
|
-
example: "2025-01-31T23:59:59Z",
|
1459
|
-
required: false,
|
1460
|
-
})
|
1461
|
-
@IsDateString({}, { message: "Due date must be a valid ISO 8601 date string" })
|
1462
|
-
@IsOptional()
|
1463
|
-
dueDate?: string;
|
1464
|
-
|
1465
|
-
@ApiProperty({
|
1466
|
-
description: "The status of the invoice",
|
1467
|
-
example: "PENDING",
|
1468
|
-
required: false,
|
1469
|
-
})
|
1470
|
-
@IsEnum(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" })
|
1471
|
-
@IsOptional()
|
1472
|
-
status?: string;
|
1473
|
-
}
|
1474
|
-
|
1475
1332
|
export class EnrollBillerDto extends CreateBillerDto {
|
1476
1333
|
id: string;
|
1477
1334
|
chargeConfigurations?: CreateBillerChargeConfigurationDto[];
|
package/src/index.ts
CHANGED
@@ -0,0 +1,202 @@
|
|
1
|
+
import { ApiProperty } from "@nestjs/swagger";
|
2
|
+
import {
|
3
|
+
IsString,
|
4
|
+
IsNotEmpty,
|
5
|
+
IsArray,
|
6
|
+
IsNumber,
|
7
|
+
IsInt,
|
8
|
+
IsEnum,
|
9
|
+
IsDateString,
|
10
|
+
IsOptional,
|
11
|
+
Length,
|
12
|
+
} from "class-validator";
|
13
|
+
import { BaseDTO } from "../types/dto.type";
|
14
|
+
|
15
|
+
export class CreateInvoiceDto extends BaseDTO {
|
16
|
+
@ApiProperty({
|
17
|
+
description: "The ID of the biller",
|
18
|
+
example: "550e8400-e29b-41d4-a716-446655440000",
|
19
|
+
})
|
20
|
+
@IsNotEmpty({ message: "Biller ID must not be empty" })
|
21
|
+
@IsString({ message: "Biller ID must be a valid string" })
|
22
|
+
billerId: string;
|
23
|
+
|
24
|
+
@ApiProperty({
|
25
|
+
description: "The ID of the customer",
|
26
|
+
example: "550e8400-e29b-41d4-a716-446655440001",
|
27
|
+
required: false,
|
28
|
+
})
|
29
|
+
@IsString({ message: "Customer ID must be a valid string" })
|
30
|
+
@IsOptional()
|
31
|
+
customerId?: string;
|
32
|
+
|
33
|
+
@ApiProperty({
|
34
|
+
description: "List of items",
|
35
|
+
example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
|
36
|
+
})
|
37
|
+
@IsNotEmpty({ message: "Please provide items for this invoice" })
|
38
|
+
@IsArray({ message: "Please provide a list of items for this invoice" })
|
39
|
+
items: string[];
|
40
|
+
|
41
|
+
@ApiProperty({
|
42
|
+
description: "The discount value applied to the invoice",
|
43
|
+
example: 10.5,
|
44
|
+
})
|
45
|
+
@IsNotEmpty({ message: "Discount value must not be empty" })
|
46
|
+
@IsNumber(undefined, { message: "Discount value must be a valid number" })
|
47
|
+
discountValue: number;
|
48
|
+
@ApiProperty({
|
49
|
+
description: "Total for invoice",
|
50
|
+
example: 20030,
|
51
|
+
})
|
52
|
+
@IsInt({ message: "Discount value must be a valid number" })
|
53
|
+
total?: number;
|
54
|
+
@ApiProperty({
|
55
|
+
description: "Total for invoice service charges",
|
56
|
+
example: 1000,
|
57
|
+
})
|
58
|
+
@IsNumber(undefined, { message: "Discount value must be a valid number" })
|
59
|
+
totalService?: number;
|
60
|
+
|
61
|
+
@ApiProperty({
|
62
|
+
description: "The type of discount applied to the invoice",
|
63
|
+
example: "FIXED",
|
64
|
+
})
|
65
|
+
@IsNotEmpty({ message: "Discount type must not be empty" })
|
66
|
+
@IsEnum(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" })
|
67
|
+
discountType: string;
|
68
|
+
|
69
|
+
@ApiProperty({
|
70
|
+
description: "The due date for the invoice",
|
71
|
+
example: "2025-01-31T23:59:59Z",
|
72
|
+
})
|
73
|
+
@IsNotEmpty({ message: "Due date must not be empty" })
|
74
|
+
@IsDateString({}, { message: "Due date must be a valid ISO 8601 date string" })
|
75
|
+
dueDate: string;
|
76
|
+
|
77
|
+
@ApiProperty({
|
78
|
+
description: "The status of the invoice",
|
79
|
+
example: "PENDING",
|
80
|
+
})
|
81
|
+
@IsNotEmpty({ message: "Status must not be empty" })
|
82
|
+
@IsEnum(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" })
|
83
|
+
status: string;
|
84
|
+
|
85
|
+
@ApiProperty({
|
86
|
+
description: "The customer details",
|
87
|
+
})
|
88
|
+
@IsOptional()
|
89
|
+
customer?: InvoiceCustomerDto;
|
90
|
+
}
|
91
|
+
|
92
|
+
export class UpdateInvoiceDto extends BaseDTO {
|
93
|
+
@ApiProperty({
|
94
|
+
description: "The ID of the invoice",
|
95
|
+
example: "550e8400-e29b-41d4-a716-446655440000",
|
96
|
+
})
|
97
|
+
@IsNotEmpty({ message: "ID must not be empty" })
|
98
|
+
@IsString({ message: "ID must be a valid string" })
|
99
|
+
id: string;
|
100
|
+
|
101
|
+
@ApiProperty({
|
102
|
+
description: "The ID of the biller",
|
103
|
+
example: "550e8400-e29b-41d4-a716-446655440000",
|
104
|
+
required: false,
|
105
|
+
})
|
106
|
+
@IsString({ message: "Biller ID must be a valid string" })
|
107
|
+
@IsOptional()
|
108
|
+
billerId?: string;
|
109
|
+
|
110
|
+
@ApiProperty({
|
111
|
+
description: "List of items",
|
112
|
+
example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
|
113
|
+
required: false,
|
114
|
+
})
|
115
|
+
@IsNotEmpty({ message: "Please provide items for this invoice" })
|
116
|
+
@IsArray({ message: "Please provide a list of items for this invoice" })
|
117
|
+
items?: string[];
|
118
|
+
|
119
|
+
@ApiProperty({
|
120
|
+
description: "The ID of the customer",
|
121
|
+
example: "550e8400-e29b-41d4-a716-446655440001",
|
122
|
+
required: false,
|
123
|
+
})
|
124
|
+
@IsString({ message: "Customer ID must be a valid string" })
|
125
|
+
@IsOptional()
|
126
|
+
customerId?: string;
|
127
|
+
|
128
|
+
@ApiProperty({
|
129
|
+
description: "The discount value applied to the invoice",
|
130
|
+
example: 10.5,
|
131
|
+
required: false,
|
132
|
+
})
|
133
|
+
@IsInt({ message: "Discount value must be a valid number" })
|
134
|
+
@IsOptional()
|
135
|
+
discountValue?: number;
|
136
|
+
|
137
|
+
@ApiProperty({
|
138
|
+
description: "The type of discount applied to the invoice",
|
139
|
+
example: "FIXED",
|
140
|
+
required: false,
|
141
|
+
})
|
142
|
+
@IsEnum(["FIXED", "PERCENT"], { message: "Discount type must be FIXED or PERCENT" })
|
143
|
+
@IsOptional()
|
144
|
+
discountType?: string;
|
145
|
+
|
146
|
+
@ApiProperty({
|
147
|
+
description: "The due date for the invoice",
|
148
|
+
example: "2025-01-31T23:59:59Z",
|
149
|
+
required: false,
|
150
|
+
})
|
151
|
+
@IsDateString({}, { message: "Due date must be a valid ISO 8601 date string" })
|
152
|
+
@IsOptional()
|
153
|
+
dueDate?: string;
|
154
|
+
|
155
|
+
@ApiProperty({
|
156
|
+
description: "The status of the invoice",
|
157
|
+
example: "PENDING",
|
158
|
+
required: false,
|
159
|
+
})
|
160
|
+
@IsEnum(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" })
|
161
|
+
@IsOptional()
|
162
|
+
status?: string;
|
163
|
+
}
|
164
|
+
|
165
|
+
export class InvoiceCustomerDto extends BaseDTO {
|
166
|
+
@ApiProperty({
|
167
|
+
description: "The name of the customer",
|
168
|
+
example: "Jane Smith",
|
169
|
+
})
|
170
|
+
@IsNotEmpty({ message: "Name must not be empty" })
|
171
|
+
@IsString({ message: "Name must be a valid string" })
|
172
|
+
@Length(1, 50, { message: "Name must be between 1 and 50 characters" })
|
173
|
+
name: string;
|
174
|
+
|
175
|
+
@ApiProperty({
|
176
|
+
description: "The email address of the customer",
|
177
|
+
example: "janesmith@example.com",
|
178
|
+
required: false,
|
179
|
+
})
|
180
|
+
@IsString({ message: "Email address must be a valid string" })
|
181
|
+
@Length(1, 50, { message: "Email address must be between 1 and 50 characters" })
|
182
|
+
@IsOptional()
|
183
|
+
emailAddress?: string;
|
184
|
+
|
185
|
+
@ApiProperty({
|
186
|
+
description: "The phone number of the customer",
|
187
|
+
example: "+9876543210",
|
188
|
+
required: false,
|
189
|
+
})
|
190
|
+
@IsString({ message: "Phone number must be a valid string" })
|
191
|
+
@IsOptional()
|
192
|
+
phoneNumber?: string;
|
193
|
+
|
194
|
+
@ApiProperty({
|
195
|
+
description: "Address of the customer",
|
196
|
+
example: "12 Fremont lane, New York",
|
197
|
+
required: false,
|
198
|
+
})
|
199
|
+
@IsString({ message: "Address must be a valid string" })
|
200
|
+
@IsOptional()
|
201
|
+
address?: string;
|
202
|
+
}
|
@@ -0,0 +1,126 @@
|
|
1
|
+
import { ApiProperty } from "@nestjs/swagger";
|
2
|
+
import { IsString, IsInt, IsOptional, IsBoolean, IsNotEmpty, IsUUID } from "class-validator";
|
3
|
+
|
4
|
+
export class PaymentPageDto {
|
5
|
+
@ApiProperty({ description: "Payment page biller code uuid" })
|
6
|
+
@IsString({ message: "billerId must be a string" })
|
7
|
+
@IsUUID("4", { message: "billerId must be a valid id format" })
|
8
|
+
@IsNotEmpty({ message: "billerId should not be empty" })
|
9
|
+
billerId: string;
|
10
|
+
|
11
|
+
@ApiProperty({ description: "Payment page description", required: false })
|
12
|
+
@IsString({ message: "description must be a string" })
|
13
|
+
@IsOptional()
|
14
|
+
description?: string;
|
15
|
+
|
16
|
+
@ApiProperty({ description: "Payment page's title" })
|
17
|
+
@IsString({ message: "title must be a string" })
|
18
|
+
@IsNotEmpty({ message: "title should not be empty" })
|
19
|
+
title: string;
|
20
|
+
|
21
|
+
@ApiProperty({ description: "Page total amount in lowest denomination" })
|
22
|
+
@IsInt({ message: "totalAmount must be an integer" })
|
23
|
+
@IsNotEmpty({ message: "totalAmount should not be empty" })
|
24
|
+
totalAmount: number;
|
25
|
+
|
26
|
+
@ApiProperty({ description: "Amount's currency code", default: "NGN" })
|
27
|
+
@IsString({ message: "currencyCode must be a string" })
|
28
|
+
@IsNotEmpty({ message: "Please select a currency" })
|
29
|
+
currencyCode: string = "NGN";
|
30
|
+
|
31
|
+
@ApiProperty({ description: "Invoice's active status", required: false })
|
32
|
+
@IsBoolean({ message: "active must be a boolean" })
|
33
|
+
@IsOptional()
|
34
|
+
active?: boolean;
|
35
|
+
|
36
|
+
@ApiProperty({ description: "Url of the page", required: false })
|
37
|
+
@IsString({ message: "URL should be text" })
|
38
|
+
@IsOptional()
|
39
|
+
url?: boolean;
|
40
|
+
|
41
|
+
@ApiProperty({ description: "Whether pages accept user amount", required: false })
|
42
|
+
@IsBoolean({ message: "acceptsUserAmount must be a boolean" })
|
43
|
+
@IsOptional()
|
44
|
+
acceptsUserAmount?: boolean;
|
45
|
+
}
|
46
|
+
|
47
|
+
export class UpdatePaymentPageDto {
|
48
|
+
@ApiProperty({ description: "Payment page biller code uuid" })
|
49
|
+
@IsString({ message: "Page id must be a string" })
|
50
|
+
@IsUUID("4", { message: "Id must be a valid id format" })
|
51
|
+
@IsNotEmpty({ message: "Page id should not be empty" })
|
52
|
+
id: string;
|
53
|
+
|
54
|
+
@ApiProperty({ description: "Payment page biller code uuid", required: false })
|
55
|
+
@IsUUID("4", { message: "billerId must be a valid id format" })
|
56
|
+
@IsString({ message: "billerId must be a string" })
|
57
|
+
@IsOptional()
|
58
|
+
billerId?: string;
|
59
|
+
|
60
|
+
@ApiProperty({ description: "Payment page description", required: false })
|
61
|
+
@IsString({ message: "description must be a string" })
|
62
|
+
@IsOptional()
|
63
|
+
description?: string;
|
64
|
+
|
65
|
+
@ApiProperty({ description: "Payment page's title", required: false })
|
66
|
+
@IsString({ message: "title must be a string" })
|
67
|
+
@IsOptional()
|
68
|
+
title?: string;
|
69
|
+
|
70
|
+
@ApiProperty({ description: "Page total amount in lowest denomination", required: false })
|
71
|
+
@IsInt({ message: "totalAmount must be an integer" })
|
72
|
+
@IsOptional()
|
73
|
+
totalAmount?: number;
|
74
|
+
|
75
|
+
@ApiProperty({ description: "Amount's currency code", default: "NGN", required: false })
|
76
|
+
@IsString({ message: "currencyCode must be a string" })
|
77
|
+
@IsNotEmpty({ message: "Please select a currency" })
|
78
|
+
currencyCode?: string = "NGN";
|
79
|
+
|
80
|
+
@ApiProperty({ description: "Invoice's active status", required: false })
|
81
|
+
@IsBoolean({ message: "active must be a boolean" })
|
82
|
+
@IsOptional()
|
83
|
+
active?: boolean;
|
84
|
+
|
85
|
+
@ApiProperty({ description: "Url of the page", required: false })
|
86
|
+
@IsString({ message: "URL should be text" })
|
87
|
+
@IsOptional()
|
88
|
+
url?: boolean;
|
89
|
+
|
90
|
+
@ApiProperty({ description: "Whether pages accept user amount", required: false })
|
91
|
+
@IsBoolean({ message: "acceptsUserAmount must be a boolean" })
|
92
|
+
@IsOptional()
|
93
|
+
acceptsUserAmount?: boolean;
|
94
|
+
}
|
95
|
+
|
96
|
+
export class PaymentPageResponseDto {
|
97
|
+
@ApiProperty({ description: "Payment page biller code uuid" })
|
98
|
+
billerId: string;
|
99
|
+
|
100
|
+
@ApiProperty({ description: "Payment page description", required: false })
|
101
|
+
description?: string;
|
102
|
+
|
103
|
+
@ApiProperty({ description: "Payment page's title" })
|
104
|
+
title: string;
|
105
|
+
|
106
|
+
@ApiProperty({ description: "Page total amount in lowest denomination" })
|
107
|
+
totalAmount: number;
|
108
|
+
|
109
|
+
@ApiProperty({ description: "Amount's currency code", default: "NGN" })
|
110
|
+
currencyCode: string;
|
111
|
+
|
112
|
+
@ApiProperty({ description: "Invoice's active status", required: false })
|
113
|
+
active?: boolean;
|
114
|
+
|
115
|
+
@ApiProperty({ description: "Url of the page", required: false })
|
116
|
+
url?: boolean;
|
117
|
+
|
118
|
+
@ApiProperty({ description: "Whether pages accept user amount", required: false })
|
119
|
+
acceptsUserAmount?: boolean;
|
120
|
+
|
121
|
+
@ApiProperty({ description: "Date when the page was created" })
|
122
|
+
createdAt: Date;
|
123
|
+
|
124
|
+
@ApiProperty({ description: "Date when the page was last updated" })
|
125
|
+
updatedAt: Date;
|
126
|
+
}
|