resurgence-data 1.1.16 → 1.1.17

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.
@@ -178,6 +178,7 @@ export declare class CreateCustomerDto extends BaseDTO {
178
178
  name: string;
179
179
  emailAddress?: string;
180
180
  phoneNumber?: string;
181
+ address?: string;
181
182
  }
182
183
  export declare class UpdateCustomerDto extends BaseDTO {
183
184
  id: string;
@@ -185,6 +186,7 @@ export declare class UpdateCustomerDto extends BaseDTO {
185
186
  name?: string;
186
187
  emailAddress?: string;
187
188
  phoneNumber?: string;
189
+ address?: string;
188
190
  }
189
191
  export declare class BillerItemCategoryDto extends BaseDTO {
190
192
  name: string;
@@ -1124,6 +1124,16 @@ __decorate([
1124
1124
  (0, class_validator_1.IsOptional)(),
1125
1125
  __metadata("design:type", String)
1126
1126
  ], CreateCustomerDto.prototype, "phoneNumber", void 0);
1127
+ __decorate([
1128
+ (0, swagger_1.ApiProperty)({
1129
+ description: "Address of the customer",
1130
+ example: "12 Fremont lane, New York",
1131
+ required: false,
1132
+ }),
1133
+ (0, class_validator_1.IsString)({ message: "Address must be a valid string" }),
1134
+ (0, class_validator_1.IsOptional)(),
1135
+ __metadata("design:type", String)
1136
+ ], CreateCustomerDto.prototype, "address", void 0);
1127
1137
  class UpdateCustomerDto extends dto_type_1.BaseDTO {
1128
1138
  }
1129
1139
  exports.UpdateCustomerDto = UpdateCustomerDto;
@@ -1177,6 +1187,16 @@ __decorate([
1177
1187
  (0, class_validator_1.IsOptional)(),
1178
1188
  __metadata("design:type", String)
1179
1189
  ], UpdateCustomerDto.prototype, "phoneNumber", void 0);
1190
+ __decorate([
1191
+ (0, swagger_1.ApiProperty)({
1192
+ description: "Address of the customer",
1193
+ example: "12 Fremont lane, New York",
1194
+ required: false,
1195
+ }),
1196
+ (0, class_validator_1.IsString)({ message: "Address must be a valid string" }),
1197
+ (0, class_validator_1.IsOptional)(),
1198
+ __metadata("design:type", String)
1199
+ ], UpdateCustomerDto.prototype, "address", void 0);
1180
1200
  class BillerItemCategoryDto extends dto_type_1.BaseDTO {
1181
1201
  }
1182
1202
  exports.BillerItemCategoryDto = BillerItemCategoryDto;
@@ -14,7 +14,7 @@ export declare class CreateInvoiceDto extends BaseDTO {
14
14
  totalService?: number;
15
15
  discountType: string;
16
16
  dueDate: string;
17
- status: string;
17
+ status?: string | "PENDING";
18
18
  customer?: InvoiceCustomerDto;
19
19
  }
20
20
  export declare class UpdateInvoiceDto extends BaseDTO {
@@ -102,7 +102,8 @@ __decorate([
102
102
  description: "Total for invoice",
103
103
  example: 20030,
104
104
  }),
105
- (0, class_validator_1.IsInt)({ message: "Discount value must be a valid number" }),
105
+ (0, class_validator_1.IsInt)({ message: "Total invoice value must be a valid number" }),
106
+ (0, class_validator_1.IsOptional)(),
106
107
  __metadata("design:type", Number)
107
108
  ], CreateInvoiceDto.prototype, "total", void 0);
108
109
  __decorate([
@@ -110,7 +111,7 @@ __decorate([
110
111
  description: "Total for invoice service charges",
111
112
  example: 1000,
112
113
  }),
113
- (0, class_validator_1.IsNumber)(undefined, { message: "Discount value must be a valid number" }),
114
+ (0, class_validator_1.IsNumber)(undefined, { message: "Service fee total value must be a valid number" }),
114
115
  __metadata("design:type", Number)
115
116
  ], CreateInvoiceDto.prototype, "totalService", void 0);
116
117
  __decorate([
@@ -127,8 +128,8 @@ __decorate([
127
128
  description: "The due date for the invoice",
128
129
  example: "2025-01-31T23:59:59Z",
129
130
  }),
130
- (0, class_validator_1.IsNotEmpty)({ message: "Due date must not be empty" }),
131
- (0, class_validator_1.IsDateString)({}, { message: "Due date must be a valid ISO 8601 date string" }),
131
+ (0, class_validator_1.IsISO8601)({}, { message: "Due date must be a valid ISO 8601 date string" }),
132
+ (0, class_validator_1.IsOptional)(),
132
133
  __metadata("design:type", String)
133
134
  ], CreateInvoiceDto.prototype, "dueDate", void 0);
134
135
  __decorate([
@@ -136,7 +137,7 @@ __decorate([
136
137
  description: "The status of the invoice",
137
138
  example: "PENDING",
138
139
  }),
139
- (0, class_validator_1.IsNotEmpty)({ message: "Status must not be empty" }),
140
+ (0, class_validator_1.IsOptional)(),
140
141
  (0, class_validator_1.IsEnum)(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" }),
141
142
  __metadata("design:type", String)
142
143
  ], CreateInvoiceDto.prototype, "status", void 0);
@@ -213,9 +214,8 @@ __decorate([
213
214
  (0, swagger_1.ApiProperty)({
214
215
  description: "The due date for the invoice",
215
216
  example: "2025-01-31T23:59:59Z",
216
- required: false,
217
217
  }),
218
- (0, class_validator_1.IsDateString)({}, { message: "Due date must be a valid ISO 8601 date string" }),
218
+ (0, class_validator_1.IsISO8601)({}, { message: "Due date must be a valid ISO 8601 date string" }),
219
219
  (0, class_validator_1.IsOptional)(),
220
220
  __metadata("design:type", String)
221
221
  ], UpdateInvoiceDto.prototype, "dueDate", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -999,6 +999,15 @@ export class CreateCustomerDto extends BaseDTO {
999
999
  @IsString({ message: "Phone number must be a valid string" })
1000
1000
  @IsOptional()
1001
1001
  phoneNumber?: string;
1002
+
1003
+ @ApiProperty({
1004
+ description: "Address of the customer",
1005
+ example: "12 Fremont lane, New York",
1006
+ required: false,
1007
+ })
1008
+ @IsString({ message: "Address must be a valid string" })
1009
+ @IsOptional()
1010
+ address?: string;
1002
1011
  }
1003
1012
 
1004
1013
  export class UpdateCustomerDto extends BaseDTO {
@@ -1046,6 +1055,15 @@ export class UpdateCustomerDto extends BaseDTO {
1046
1055
  @IsString({ message: "Phone number must be a valid string" })
1047
1056
  @IsOptional()
1048
1057
  phoneNumber?: string;
1058
+
1059
+ @ApiProperty({
1060
+ description: "Address of the customer",
1061
+ example: "12 Fremont lane, New York",
1062
+ required: false,
1063
+ })
1064
+ @IsString({ message: "Address must be a valid string" })
1065
+ @IsOptional()
1066
+ address?: string;
1049
1067
  }
1050
1068
 
1051
1069
  export class BillerItemCategoryDto extends BaseDTO {
@@ -9,6 +9,7 @@ import {
9
9
  IsDateString,
10
10
  IsOptional,
11
11
  Length,
12
+ IsISO8601,
12
13
  } from "class-validator";
13
14
  import { BaseDTO } from "../types/dto.type";
14
15
 
@@ -88,13 +89,14 @@ export class CreateInvoiceDto extends BaseDTO {
88
89
  description: "Total for invoice",
89
90
  example: 20030,
90
91
  })
91
- @IsInt({ message: "Discount value must be a valid number" })
92
+ @IsInt({ message: "Total invoice value must be a valid number" })
93
+ @IsOptional()
92
94
  total?: number;
93
95
  @ApiProperty({
94
96
  description: "Total for invoice service charges",
95
97
  example: 1000,
96
98
  })
97
- @IsNumber(undefined, { message: "Discount value must be a valid number" })
99
+ @IsNumber(undefined, { message: "Service fee total value must be a valid number" })
98
100
  totalService?: number;
99
101
 
100
102
  @ApiProperty({
@@ -109,17 +111,17 @@ export class CreateInvoiceDto extends BaseDTO {
109
111
  description: "The due date for the invoice",
110
112
  example: "2025-01-31T23:59:59Z",
111
113
  })
112
- @IsNotEmpty({ message: "Due date must not be empty" })
113
- @IsDateString({}, { message: "Due date must be a valid ISO 8601 date string" })
114
+ @IsISO8601({}, { message: "Due date must be a valid ISO 8601 date string" })
115
+ @IsOptional()
114
116
  dueDate: string;
115
117
 
116
118
  @ApiProperty({
117
119
  description: "The status of the invoice",
118
120
  example: "PENDING",
119
121
  })
120
- @IsNotEmpty({ message: "Status must not be empty" })
122
+ @IsOptional()
121
123
  @IsEnum(["PENDING", "PAID", "CANCELLED"], { message: "Status must be PENDING, PAID, or CANCELLED" })
122
- status: string;
124
+ status?: string | "PENDING";
123
125
 
124
126
  @ApiProperty({
125
127
  description: "The customer details",
@@ -185,9 +187,8 @@ export class UpdateInvoiceDto extends BaseDTO {
185
187
  @ApiProperty({
186
188
  description: "The due date for the invoice",
187
189
  example: "2025-01-31T23:59:59Z",
188
- required: false,
189
190
  })
190
- @IsDateString({}, { message: "Due date must be a valid ISO 8601 date string" })
191
+ @IsISO8601({}, { message: "Due date must be a valid ISO 8601 date string" })
191
192
  @IsOptional()
192
193
  dueDate?: string;
193
194