resurgence-data 1.1.17 → 1.1.19

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.
@@ -5,10 +5,14 @@ export declare class InvoiceCustomerDto extends BaseDTO {
5
5
  phoneNumber?: string;
6
6
  address?: string;
7
7
  }
8
+ export declare class InvoiceItemDto extends BaseDTO {
9
+ id: string;
10
+ quantity: number;
11
+ }
8
12
  export declare class CreateInvoiceDto extends BaseDTO {
9
13
  billerId: string;
10
14
  customerId?: string;
11
- items: string[];
15
+ items: InvoiceItemDto[];
12
16
  discountValue: number;
13
17
  total?: number;
14
18
  totalService?: number;
@@ -20,7 +24,7 @@ export declare class CreateInvoiceDto extends BaseDTO {
20
24
  export declare class UpdateInvoiceDto extends BaseDTO {
21
25
  id: string;
22
26
  billerId?: string;
23
- items?: string[];
27
+ items?: InvoiceItemDto[];
24
28
  customerId?: string;
25
29
  discountValue?: number;
26
30
  discountType?: string;
@@ -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.UpdateInvoiceDto = exports.CreateInvoiceDto = exports.InvoiceCustomerDto = void 0;
12
+ exports.UpdateInvoiceDto = exports.CreateInvoiceDto = exports.InvoiceItemDto = exports.InvoiceCustomerDto = 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");
@@ -57,6 +57,27 @@ __decorate([
57
57
  (0, class_validator_1.IsOptional)(),
58
58
  __metadata("design:type", String)
59
59
  ], InvoiceCustomerDto.prototype, "address", void 0);
60
+ class InvoiceItemDto extends dto_type_1.BaseDTO {
61
+ }
62
+ exports.InvoiceItemDto = InvoiceItemDto;
63
+ __decorate([
64
+ (0, swagger_1.ApiProperty)({
65
+ description: "The ID of the biller",
66
+ example: "550e8400-e29b-41d4-a716-446655440000",
67
+ }),
68
+ (0, class_validator_1.IsNotEmpty)({ message: "Please provide a valid invoice item id" }),
69
+ (0, class_validator_1.IsString)({ message: "Please select a valid invoice item" }),
70
+ __metadata("design:type", String)
71
+ ], InvoiceItemDto.prototype, "id", void 0);
72
+ __decorate([
73
+ (0, swagger_1.ApiProperty)({
74
+ description: "The ID of the biller",
75
+ example: "550e8400-e29b-41d4-a716-446655440000",
76
+ }),
77
+ (0, class_validator_1.IsNotEmpty)({ message: "Please provide the item quantity" }),
78
+ (0, class_validator_1.IsInt)({ message: "Please select a valid invoice item" }),
79
+ __metadata("design:type", Number)
80
+ ], InvoiceItemDto.prototype, "quantity", void 0);
60
81
  class CreateInvoiceDto extends dto_type_1.BaseDTO {
61
82
  }
62
83
  exports.CreateInvoiceDto = CreateInvoiceDto;
@@ -82,7 +103,7 @@ __decorate([
82
103
  __decorate([
83
104
  (0, swagger_1.ApiProperty)({
84
105
  description: "List of items",
85
- example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
106
+ example: "[{id:'550e8400-e29b-41d4-a716-446655440001', quantity:2},{id:'550e8400-e29b-41d4-a716-446655440001', quantity:3}]",
86
107
  }),
87
108
  (0, class_validator_1.IsNotEmpty)({ message: "Please provide items for this invoice" }),
88
109
  (0, class_validator_1.IsArray)({ message: "Please provide a list of items for this invoice" }),
@@ -173,7 +194,7 @@ __decorate([
173
194
  __decorate([
174
195
  (0, swagger_1.ApiProperty)({
175
196
  description: "List of items",
176
- example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
197
+ example: "[{id:'550e8400-e29b-41d4-a716-446655440001', quantity:2},{id:'550e8400-e29b-41d4-a716-446655440001', quantity:3}]",
177
198
  required: false,
178
199
  }),
179
200
  (0, class_validator_1.IsNotEmpty)({ message: "Please provide items for this invoice" }),
@@ -1,4 +1,5 @@
1
1
  import { UUID } from "crypto";
2
+ import { InvoiceItemDto } from "./invoice.dto";
2
3
  export declare class PaymentPageDto {
3
4
  billerId: UUID;
4
5
  description?: string;
@@ -19,6 +20,7 @@ export declare class UpdatePaymentPageDto {
19
20
  active?: boolean;
20
21
  url?: string;
21
22
  acceptsUserAmount?: boolean;
23
+ items?: InvoiceItemDto[];
22
24
  }
23
25
  export declare class PaymentPageResponseDto {
24
26
  billerId: string;
@@ -31,4 +33,5 @@ export declare class PaymentPageResponseDto {
31
33
  acceptsUserAmount?: boolean;
32
34
  createdAt: Date;
33
35
  updatedAt: Date;
36
+ items?: InvoiceItemDto[];
34
37
  }
@@ -129,6 +129,15 @@ __decorate([
129
129
  (0, class_validator_1.IsOptional)(),
130
130
  __metadata("design:type", Boolean)
131
131
  ], UpdatePaymentPageDto.prototype, "acceptsUserAmount", void 0);
132
+ __decorate([
133
+ (0, swagger_1.ApiProperty)({
134
+ description: "List of items",
135
+ example: "[{id:'550e8400-e29b-41d4-a716-446655440001', quantity:2},{id:'550e8400-e29b-41d4-a716-446655440001', quantity:3}]",
136
+ }),
137
+ (0, class_validator_1.IsOptional)(),
138
+ (0, class_validator_1.IsArray)({ message: "Please provide a list of items for this invoice" }),
139
+ __metadata("design:type", Array)
140
+ ], UpdatePaymentPageDto.prototype, "items", void 0);
132
141
  class PaymentPageResponseDto {
133
142
  }
134
143
  exports.PaymentPageResponseDto = PaymentPageResponseDto;
@@ -172,3 +181,7 @@ __decorate([
172
181
  (0, swagger_1.ApiProperty)({ description: "Date when the page was last updated" }),
173
182
  __metadata("design:type", Date)
174
183
  ], PaymentPageResponseDto.prototype, "updatedAt", void 0);
184
+ __decorate([
185
+ (0, swagger_1.ApiProperty)({ description: "List of Items" }),
186
+ __metadata("design:type", Array)
187
+ ], PaymentPageResponseDto.prototype, "items", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -52,6 +52,23 @@ export class InvoiceCustomerDto extends BaseDTO {
52
52
  address?: string;
53
53
  }
54
54
 
55
+ export class InvoiceItemDto extends BaseDTO {
56
+ @ApiProperty({
57
+ description: "The ID of the biller",
58
+ example: "550e8400-e29b-41d4-a716-446655440000",
59
+ })
60
+ @IsNotEmpty({ message: "Please provide a valid invoice item id" })
61
+ @IsString({ message: "Please select a valid invoice item" })
62
+ id: string;
63
+ @ApiProperty({
64
+ description: "The ID of the biller",
65
+ example: "550e8400-e29b-41d4-a716-446655440000",
66
+ })
67
+ @IsNotEmpty({ message: "Please provide the item quantity" })
68
+ @IsInt({ message: "Please select a valid invoice item" })
69
+ quantity: number;
70
+ }
71
+
55
72
  export class CreateInvoiceDto extends BaseDTO {
56
73
  @ApiProperty({
57
74
  description: "The ID of the biller",
@@ -72,11 +89,12 @@ export class CreateInvoiceDto extends BaseDTO {
72
89
 
73
90
  @ApiProperty({
74
91
  description: "List of items",
75
- example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
92
+ example:
93
+ "[{id:'550e8400-e29b-41d4-a716-446655440001', quantity:2},{id:'550e8400-e29b-41d4-a716-446655440001', quantity:3}]",
76
94
  })
77
95
  @IsNotEmpty({ message: "Please provide items for this invoice" })
78
96
  @IsArray({ message: "Please provide a list of items for this invoice" })
79
- items: string[];
97
+ items: InvoiceItemDto[];
80
98
 
81
99
  @ApiProperty({
82
100
  description: "The discount value applied to the invoice",
@@ -150,12 +168,13 @@ export class UpdateInvoiceDto extends BaseDTO {
150
168
 
151
169
  @ApiProperty({
152
170
  description: "List of items",
153
- example: "['550e8400-e29b-41d4-a716-446655440001','550e8400-e29b-41d4-a716-446655440001' ]",
171
+ example:
172
+ "[{id:'550e8400-e29b-41d4-a716-446655440001', quantity:2},{id:'550e8400-e29b-41d4-a716-446655440001', quantity:3}]",
154
173
  required: false,
155
174
  })
156
175
  @IsNotEmpty({ message: "Please provide items for this invoice" })
157
176
  @IsArray({ message: "Please provide a list of items for this invoice" })
158
- items?: string[];
177
+ items?: InvoiceItemDto[];
159
178
 
160
179
  @ApiProperty({
161
180
  description: "The ID of the customer",
@@ -1,6 +1,7 @@
1
1
  import { ApiProperty } from "@nestjs/swagger";
2
- import { IsString, IsInt, IsOptional, IsBoolean, IsNotEmpty, IsUUID } from "class-validator";
2
+ import { IsString, IsInt, IsOptional, IsBoolean, IsNotEmpty, IsUUID, IsArray } from "class-validator";
3
3
  import { UUID } from "crypto";
4
+ import { InvoiceItemDto } from "./invoice.dto";
4
5
 
5
6
  export class PaymentPageDto {
6
7
  @ApiProperty({ description: "Payment page biller code uuid" })
@@ -92,6 +93,15 @@ export class UpdatePaymentPageDto {
92
93
  @IsBoolean({ message: "acceptsUserAmount must be a boolean" })
93
94
  @IsOptional()
94
95
  acceptsUserAmount?: boolean;
96
+
97
+ @ApiProperty({
98
+ description: "List of items",
99
+ example:
100
+ "[{id:'550e8400-e29b-41d4-a716-446655440001', quantity:2},{id:'550e8400-e29b-41d4-a716-446655440001', quantity:3}]",
101
+ })
102
+ @IsOptional()
103
+ @IsArray({ message: "Please provide a list of items for this invoice" })
104
+ items?: InvoiceItemDto[];
95
105
  }
96
106
 
97
107
  export class PaymentPageResponseDto {
@@ -124,4 +134,7 @@ export class PaymentPageResponseDto {
124
134
 
125
135
  @ApiProperty({ description: "Date when the page was last updated" })
126
136
  updatedAt: Date;
137
+
138
+ @ApiProperty({ description: "List of Items" })
139
+ items?: InvoiceItemDto[];
127
140
  }