resurgence-data 1.0.36 → 1.0.37

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.
@@ -45,7 +45,6 @@ export declare class CreateTransactionDto extends BaseDTO {
45
45
  * DTO for `Biller`
46
46
  */
47
47
  export declare class CreateBillerDto extends BaseDTO {
48
- id?: string;
49
48
  categoryId: string;
50
49
  billerProfileId?: string;
51
50
  name: string;
@@ -173,12 +173,6 @@ __decorate([
173
173
  class CreateBillerDto extends dto_type_1.BaseDTO {
174
174
  }
175
175
  exports.CreateBillerDto = CreateBillerDto;
176
- __decorate([
177
- (0, swagger_1.ApiProperty)({ description: "The unique ID of the biller.", example: "uuid-value" }),
178
- (0, class_validator_1.IsOptional)(),
179
- (0, class_validator_1.IsString)({ message: "ID must be a string." }),
180
- __metadata("design:type", String)
181
- ], CreateBillerDto.prototype, "id", void 0);
182
176
  __decorate([
183
177
  (0, swagger_1.ApiProperty)({ description: "The ID of the category associated with the biller.", example: "uuid-value" }),
184
178
  (0, class_validator_1.IsNotEmpty)({ message: "Category ID is required." }),
@@ -6,6 +6,16 @@ export declare class CreateUserDTO {
6
6
  avatarUrl?: string;
7
7
  corporate?: boolean;
8
8
  role: string;
9
+ billerName: string;
10
+ billerCategoryId: string;
11
+ }
12
+ export declare class CreateSupportUserDTO {
13
+ firstName: string;
14
+ lastName: string;
15
+ emailAddress: string;
16
+ phoneNumber: string;
17
+ avatarUrl?: string;
18
+ role: string;
9
19
  }
10
20
  export declare class UpdateUserDTO extends CreateUserDTO {
11
21
  id: string;
package/dist/user/user.js CHANGED
@@ -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.UpdateUserDTO = exports.CreateUserDTO = void 0;
12
+ exports.UpdateUserDTO = exports.CreateSupportUserDTO = exports.CreateUserDTO = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const account_type_1 = require("../types/account.type");
15
15
  const swagger_1 = require("@nestjs/swagger");
@@ -65,6 +65,53 @@ __decorate([
65
65
  (0, swagger_1.ApiProperty)({ description: "users role", enumName: "ROLE", enum: ROLE }),
66
66
  __metadata("design:type", String)
67
67
  ], CreateUserDTO.prototype, "role", void 0);
68
+ __decorate([
69
+ (0, class_validator_1.IsString)({ message: "Please enter a name for your merchant / Business." }),
70
+ (0, swagger_1.ApiProperty)({ description: "User's biller name" }),
71
+ __metadata("design:type", String)
72
+ ], CreateUserDTO.prototype, "billerName", void 0);
73
+ __decorate([
74
+ (0, class_validator_1.IsString)({ message: "Please select biller category." }),
75
+ (0, swagger_1.ApiProperty)({ description: "User's biller category" }),
76
+ __metadata("design:type", String)
77
+ ], CreateUserDTO.prototype, "billerCategoryId", void 0);
78
+ class CreateSupportUserDTO {
79
+ }
80
+ exports.CreateSupportUserDTO = CreateSupportUserDTO;
81
+ __decorate([
82
+ (0, class_validator_1.IsString)({ message: "First name is required. Please provide it." }),
83
+ (0, swagger_1.ApiProperty)({ description: "User's first name" }),
84
+ __metadata("design:type", String)
85
+ ], CreateSupportUserDTO.prototype, "firstName", void 0);
86
+ __decorate([
87
+ (0, class_validator_1.IsString)({ message: "Last name is required. Please provide it." }),
88
+ (0, swagger_1.ApiProperty)({ description: "User's last name" }),
89
+ __metadata("design:type", String)
90
+ ], CreateSupportUserDTO.prototype, "lastName", void 0);
91
+ __decorate([
92
+ (0, class_validator_1.IsEmail)(undefined, { message: "Looks like your email isn't valid. Please double-check it." }),
93
+ (0, class_validator_1.IsString)({ message: "An email address is required. Please enter one." }),
94
+ (0, swagger_1.ApiProperty)({ description: "User's email address" }),
95
+ __metadata("design:type", String)
96
+ ], CreateSupportUserDTO.prototype, "emailAddress", void 0);
97
+ __decorate([
98
+ (0, class_validator_1.IsString)({ message: "Phone number is required. Please enter it." }),
99
+ (0, swagger_1.ApiProperty)({ description: "User's phone number" }),
100
+ __metadata("design:type", String)
101
+ ], CreateSupportUserDTO.prototype, "phoneNumber", void 0);
102
+ __decorate([
103
+ (0, class_validator_1.IsOptional)() // Allows the property to be optional
104
+ ,
105
+ (0, class_validator_1.IsString)({ message: "Please provide a valid link for the avatar (optional)." }),
106
+ (0, swagger_1.ApiProperty)({ description: "User's profile link", required: false }),
107
+ __metadata("design:type", String)
108
+ ], CreateSupportUserDTO.prototype, "avatarUrl", void 0);
109
+ __decorate([
110
+ (0, class_validator_1.IsString)({ message: "Account type is required. Please specify it." }),
111
+ (0, class_validator_1.IsIn)(account_type_1.accountTypes, { message: "Please select a valid account type" }),
112
+ (0, swagger_1.ApiProperty)({ description: "users role", enumName: "ROLE", enum: ROLE }),
113
+ __metadata("design:type", String)
114
+ ], CreateSupportUserDTO.prototype, "role", void 0);
68
115
  class UpdateUserDTO extends CreateUserDTO {
69
116
  }
70
117
  exports.UpdateUserDTO = UpdateUserDTO;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -152,11 +152,6 @@ export class CreateTransactionDto extends BaseDTO {
152
152
  * DTO for `Biller`
153
153
  */
154
154
  export class CreateBillerDto extends BaseDTO {
155
- @ApiProperty({ description: "The unique ID of the biller.", example: "uuid-value" })
156
- @IsOptional()
157
- @IsString({ message: "ID must be a string." })
158
- id?: string;
159
-
160
155
  @ApiProperty({ description: "The ID of the category associated with the biller.", example: "uuid-value" })
161
156
  @IsNotEmpty({ message: "Category ID is required." })
162
157
  @IsString({ message: "Category ID must be a string." })
package/src/user/user.ts CHANGED
@@ -42,6 +42,43 @@ export class CreateUserDTO {
42
42
  @IsIn(accountTypes, { message: "Please select a valid account type" })
43
43
  @ApiProperty({ description: "users role", enumName: "ROLE", enum: ROLE })
44
44
  role: string;
45
+
46
+ @IsString({ message: "Please enter a name for your merchant / Business." })
47
+ @ApiProperty({ description: "User's biller name" })
48
+ billerName: string;
49
+
50
+ @IsString({ message: "Please select biller category." })
51
+ @ApiProperty({ description: "User's biller category" })
52
+ billerCategoryId: string;
53
+ }
54
+
55
+ export class CreateSupportUserDTO {
56
+ @IsString({ message: "First name is required. Please provide it." })
57
+ @ApiProperty({ description: "User's first name" })
58
+ firstName: string;
59
+
60
+ @IsString({ message: "Last name is required. Please provide it." })
61
+ @ApiProperty({ description: "User's last name" })
62
+ lastName: string;
63
+
64
+ @IsEmail(undefined, { message: "Looks like your email isn't valid. Please double-check it." })
65
+ @IsString({ message: "An email address is required. Please enter one." })
66
+ @ApiProperty({ description: "User's email address" })
67
+ emailAddress: string;
68
+
69
+ @IsString({ message: "Phone number is required. Please enter it." })
70
+ @ApiProperty({ description: "User's phone number" })
71
+ phoneNumber: string;
72
+
73
+ @IsOptional() // Allows the property to be optional
74
+ @IsString({ message: "Please provide a valid link for the avatar (optional)." })
75
+ @ApiProperty({ description: "User's profile link", required: false })
76
+ avatarUrl?: string;
77
+
78
+ @IsString({ message: "Account type is required. Please specify it." })
79
+ @IsIn(accountTypes, { message: "Please select a valid account type" })
80
+ @ApiProperty({ description: "users role", enumName: "ROLE", enum: ROLE })
81
+ role: string;
45
82
  }
46
83
 
47
84
  export class UpdateUserDTO extends CreateUserDTO {