tychat-contracts 1.0.50 → 1.0.52
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/README.md +1 -0
- package/dist/professionals/professional-profile.dto.d.ts +7 -0
- package/dist/professionals/professional-profile.dto.d.ts.map +1 -1
- package/dist/professionals/professional-profile.dto.js +66 -1
- package/dist/users/update-self-user.dto.d.ts +0 -1
- package/dist/users/update-self-user.dto.d.ts.map +1 -1
- package/dist/users/update-self-user.dto.js +1 -14
- package/dist/users/update-user-by-admin.dto.d.ts +0 -1
- package/dist/users/update-user-by-admin.dto.d.ts.map +1 -1
- package/dist/users/update-user-by-admin.dto.js +1 -14
- package/dist/users/user-update-kafka-payloads.d.ts +0 -2
- package/dist/users/user-update-kafka-payloads.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/professionals/professional-profile.dto.ts +60 -0
- package/src/users/update-self-user.dto.ts +1 -11
- package/src/users/update-user-by-admin.dto.ts +1 -12
- package/src/users/user-update-kafka-payloads.ts +0 -2
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@ DTOs compartilhados com **class-validator** usados pela **tychat-api** e pelos m
|
|
|
6
6
|
|
|
7
7
|
- **auth**: `LoginDto`, `RefreshTokenDto`, `RequestPasswordResetDto`, `ConfirmPasswordResetDto`, `AuthLoginResponseDto`, payloads Kafka (`LoginPayload`, `RequestPasswordResetPayload`, etc.)
|
|
8
8
|
- **users**: `CreateUserDto` (sem password para criação por admin), `UserListItemDto`, `UpdateSelfUserDto`, `UpdateUserByAdminDto`, `UpdatedUserDto`, `ChangeForcePasswordDto`
|
|
9
|
+
- **professionals**: `ProfessionalProfileDto`, `UpdateProfessionalProfileDto`, `CreateProfessionalWithProfileDto`
|
|
9
10
|
|
|
10
11
|
## Uso
|
|
11
12
|
|
|
@@ -10,4 +10,11 @@ export declare class UpdateProfessionalProfileDto {
|
|
|
10
10
|
procedureIds?: string[];
|
|
11
11
|
workingHours?: OpeningHoursSlotDto[];
|
|
12
12
|
}
|
|
13
|
+
export declare class CreateProfessionalWithProfileDto {
|
|
14
|
+
name: string;
|
|
15
|
+
email: string;
|
|
16
|
+
specialtyId?: string;
|
|
17
|
+
procedureIds?: string[];
|
|
18
|
+
workingHours?: OpeningHoursSlotDto[];
|
|
19
|
+
}
|
|
13
20
|
//# sourceMappingURL=professional-profile.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"professional-profile.dto.d.ts","sourceRoot":"","sources":["../../src/professionals/professional-profile.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"professional-profile.dto.d.ts","sourceRoot":"","sources":["../../src/professionals/professional-profile.dto.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,qBAAa,sBAAsB;IAMjC,MAAM,EAAE,MAAM,CAAC;IAOf,WAAW,EAAE,MAAM,CAAC;IAapB,YAAY,EAAE,MAAM,EAAE,CAAC;IAYvB,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACtC;AAED,qBAAa,4BAA4B;IAOvC,WAAW,CAAC,EAAE,MAAM,CAAC;IAarB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAYxB,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACtC;AAED,qBAAa,gCAAgC;IAS3C,IAAI,EAAE,MAAM,CAAC;IAWb,KAAK,EAAE,MAAM,CAAC;IAQd,WAAW,CAAC,EAAE,MAAM,CAAC;IAarB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAYxB,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACtC"}
|
|
@@ -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.UpdateProfessionalProfileDto = exports.ProfessionalProfileDto = void 0;
|
|
12
|
+
exports.CreateProfessionalWithProfileDto = exports.UpdateProfessionalProfileDto = exports.ProfessionalProfileDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const class_validator_1 = require("class-validator");
|
|
@@ -102,3 +102,68 @@ __decorate([
|
|
|
102
102
|
(0, class_transformer_1.Type)(() => configurations_1.OpeningHoursSlotDto),
|
|
103
103
|
__metadata("design:type", Array)
|
|
104
104
|
], UpdateProfessionalProfileDto.prototype, "workingHours", void 0);
|
|
105
|
+
class CreateProfessionalWithProfileDto {
|
|
106
|
+
name;
|
|
107
|
+
email;
|
|
108
|
+
specialtyId;
|
|
109
|
+
procedureIds;
|
|
110
|
+
workingHours;
|
|
111
|
+
}
|
|
112
|
+
exports.CreateProfessionalWithProfileDto = CreateProfessionalWithProfileDto;
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, swagger_1.ApiProperty)({
|
|
115
|
+
description: 'Nome completo do profissional',
|
|
116
|
+
example: 'Dra. Maria da Silva',
|
|
117
|
+
maxLength: 255,
|
|
118
|
+
}),
|
|
119
|
+
(0, class_validator_1.IsString)(),
|
|
120
|
+
(0, class_validator_1.MinLength)(1, { message: 'name não pode ser vazio' }),
|
|
121
|
+
(0, class_validator_1.MaxLength)(255),
|
|
122
|
+
__metadata("design:type", String)
|
|
123
|
+
], CreateProfessionalWithProfileDto.prototype, "name", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, swagger_1.ApiProperty)({
|
|
126
|
+
description: 'E-mail de login do profissional',
|
|
127
|
+
example: 'maria.silva@clinica.com',
|
|
128
|
+
maxLength: 255,
|
|
129
|
+
}),
|
|
130
|
+
(0, class_validator_1.IsEmail)({}, { message: 'email deve ser um e-mail válido' }),
|
|
131
|
+
(0, class_validator_1.IsString)(),
|
|
132
|
+
(0, class_validator_1.MinLength)(1, { message: 'email não pode ser vazio' }),
|
|
133
|
+
(0, class_validator_1.MaxLength)(255),
|
|
134
|
+
__metadata("design:type", String)
|
|
135
|
+
], CreateProfessionalWithProfileDto.prototype, "email", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
138
|
+
description: 'ID da especialidade do profissional (UUID v4)',
|
|
139
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
140
|
+
}),
|
|
141
|
+
(0, class_validator_1.IsOptional)(),
|
|
142
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
143
|
+
__metadata("design:type", String)
|
|
144
|
+
], CreateProfessionalWithProfileDto.prototype, "specialtyId", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
147
|
+
description: 'IDs dos procedimentos (UUID v4) da especialidade que o profissional realiza',
|
|
148
|
+
example: [
|
|
149
|
+
'550e8400-e29b-41d4-a716-446655440010',
|
|
150
|
+
'550e8400-e29b-41d4-a716-446655440011',
|
|
151
|
+
],
|
|
152
|
+
}),
|
|
153
|
+
(0, class_validator_1.IsOptional)(),
|
|
154
|
+
(0, class_validator_1.IsArray)(),
|
|
155
|
+
(0, class_validator_1.IsUUID)('4', { each: true }),
|
|
156
|
+
__metadata("design:type", Array)
|
|
157
|
+
], CreateProfessionalWithProfileDto.prototype, "procedureIds", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
160
|
+
description: 'Horário de trabalho do profissional por dia da semana (0=domingo..6=sábado)',
|
|
161
|
+
type: [configurations_1.OpeningHoursSlotDto],
|
|
162
|
+
example: [{ dayOfWeek: 1, open: '08:00', close: '18:00' }],
|
|
163
|
+
}),
|
|
164
|
+
(0, class_validator_1.IsOptional)(),
|
|
165
|
+
(0, class_validator_1.IsArray)(),
|
|
166
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
167
|
+
(0, class_transformer_1.Type)(() => configurations_1.OpeningHoursSlotDto),
|
|
168
|
+
__metadata("design:type", Array)
|
|
169
|
+
], CreateProfessionalWithProfileDto.prototype, "workingHours", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-self-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/update-self-user.dto.ts"],"names":[],"mappings":"AAIA,sFAAsF;AACtF,qBAAa,iBAAiB;IAG5B,WAAW,CAAC,EAAE,MAAM,CAAC;IAWrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAUd,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"update-self-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/update-self-user.dto.ts"],"names":[],"mappings":"AAIA,sFAAsF;AACtF,qBAAa,iBAAiB;IAG5B,WAAW,CAAC,EAAE,MAAM,CAAC;IAWrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAUd,KAAK,CAAC,EAAE,MAAM,CAAC;CAEhB"}
|
|
@@ -18,12 +18,11 @@ class UpdateSelfUserDto {
|
|
|
18
18
|
_atLeastOne;
|
|
19
19
|
name;
|
|
20
20
|
email;
|
|
21
|
-
password;
|
|
22
21
|
}
|
|
23
22
|
exports.UpdateSelfUserDto = UpdateSelfUserDto;
|
|
24
23
|
__decorate([
|
|
25
24
|
(0, swagger_1.ApiHideProperty)(),
|
|
26
|
-
(0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email'
|
|
25
|
+
(0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email']),
|
|
27
26
|
__metadata("design:type", String)
|
|
28
27
|
], UpdateSelfUserDto.prototype, "_atLeastOne", void 0);
|
|
29
28
|
__decorate([
|
|
@@ -49,15 +48,3 @@ __decorate([
|
|
|
49
48
|
(0, class_validator_1.MaxLength)(255),
|
|
50
49
|
__metadata("design:type", String)
|
|
51
50
|
], UpdateSelfUserDto.prototype, "email", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
54
|
-
description: 'New password (bcrypt-hashed on the auth service)',
|
|
55
|
-
example: 'senha123',
|
|
56
|
-
minLength: 6,
|
|
57
|
-
}),
|
|
58
|
-
(0, class_validator_1.IsOptional)(),
|
|
59
|
-
(0, class_validator_1.IsString)(),
|
|
60
|
-
(0, class_validator_1.MinLength)(6, { message: 'password must be at least 6 characters' }),
|
|
61
|
-
(0, class_validator_1.MaxLength)(255),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], UpdateSelfUserDto.prototype, "password", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-user-by-admin.dto.d.ts","sourceRoot":"","sources":["../../src/users/update-user-by-admin.dto.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,gEAIjB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,wEAAwE;AACxE,qBAAa,oBAAoB;IAG/B,WAAW,CAAC,EAAE,MAAM,CAAC;IAWrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAUd,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"update-user-by-admin.dto.d.ts","sourceRoot":"","sources":["../../src/users/update-user-by-admin.dto.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,gEAIjB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,wEAAwE;AACxE,qBAAa,oBAAoB;IAG/B,WAAW,CAAC,EAAE,MAAM,CAAC;IAWrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAUd,KAAK,CAAC,EAAE,MAAM,CAAC;IAYf,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
|
|
@@ -23,13 +23,12 @@ class UpdateUserByAdminDto {
|
|
|
23
23
|
_atLeastOne;
|
|
24
24
|
name;
|
|
25
25
|
email;
|
|
26
|
-
password;
|
|
27
26
|
role;
|
|
28
27
|
}
|
|
29
28
|
exports.UpdateUserByAdminDto = UpdateUserByAdminDto;
|
|
30
29
|
__decorate([
|
|
31
30
|
(0, swagger_1.ApiHideProperty)(),
|
|
32
|
-
(0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email', '
|
|
31
|
+
(0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email', 'role']),
|
|
33
32
|
__metadata("design:type", String)
|
|
34
33
|
], UpdateUserByAdminDto.prototype, "_atLeastOne", void 0);
|
|
35
34
|
__decorate([
|
|
@@ -55,18 +54,6 @@ __decorate([
|
|
|
55
54
|
(0, class_validator_1.MaxLength)(255),
|
|
56
55
|
__metadata("design:type", String)
|
|
57
56
|
], UpdateUserByAdminDto.prototype, "email", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
60
|
-
description: 'New password (bcrypt-hashed on the auth service)',
|
|
61
|
-
example: 'senha123',
|
|
62
|
-
minLength: 6,
|
|
63
|
-
}),
|
|
64
|
-
(0, class_validator_1.IsOptional)(),
|
|
65
|
-
(0, class_validator_1.IsString)(),
|
|
66
|
-
(0, class_validator_1.MinLength)(6, { message: 'password must be at least 6 characters' }),
|
|
67
|
-
(0, class_validator_1.MaxLength)(255),
|
|
68
|
-
__metadata("design:type", String)
|
|
69
|
-
], UpdateUserByAdminDto.prototype, "password", void 0);
|
|
70
57
|
__decorate([
|
|
71
58
|
(0, swagger_1.ApiPropertyOptional)({
|
|
72
59
|
description: 'User role',
|
|
@@ -6,7 +6,6 @@ export interface AuthUpdateSelfPayload {
|
|
|
6
6
|
userId: string;
|
|
7
7
|
name?: string;
|
|
8
8
|
email?: string;
|
|
9
|
-
password?: string;
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
11
|
* Kafka payload for auth.update_user_admin (tychat-api → tychat-auth-service).
|
|
@@ -18,7 +17,6 @@ export interface AuthUpdateUserAdminPayload {
|
|
|
18
17
|
targetUserId: string;
|
|
19
18
|
name?: string;
|
|
20
19
|
email?: string;
|
|
21
|
-
password?: string;
|
|
22
20
|
role?: 'administrator' | 'attendant' | 'health_professional';
|
|
23
21
|
}
|
|
24
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-update-kafka-payloads.d.ts","sourceRoot":"","sources":["../../src/users/user-update-kafka-payloads.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"user-update-kafka-payloads.d.ts","sourceRoot":"","sources":["../../src/users/user-update-kafka-payloads.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,eAAe,GAAG,WAAW,GAAG,qBAAqB,CAAC;CAC9D;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -2,9 +2,13 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
2
2
|
import { Type } from 'class-transformer';
|
|
3
3
|
import {
|
|
4
4
|
ArrayNotEmpty,
|
|
5
|
+
IsEmail,
|
|
5
6
|
IsArray,
|
|
6
7
|
IsOptional,
|
|
8
|
+
IsString,
|
|
7
9
|
IsUUID,
|
|
10
|
+
MaxLength,
|
|
11
|
+
MinLength,
|
|
8
12
|
ValidateNested,
|
|
9
13
|
} from 'class-validator';
|
|
10
14
|
import { OpeningHoursSlotDto } from '../configurations';
|
|
@@ -85,3 +89,59 @@ export class UpdateProfessionalProfileDto {
|
|
|
85
89
|
workingHours?: OpeningHoursSlotDto[];
|
|
86
90
|
}
|
|
87
91
|
|
|
92
|
+
export class CreateProfessionalWithProfileDto {
|
|
93
|
+
@ApiProperty({
|
|
94
|
+
description: 'Nome completo do profissional',
|
|
95
|
+
example: 'Dra. Maria da Silva',
|
|
96
|
+
maxLength: 255,
|
|
97
|
+
})
|
|
98
|
+
@IsString()
|
|
99
|
+
@MinLength(1, { message: 'name não pode ser vazio' })
|
|
100
|
+
@MaxLength(255)
|
|
101
|
+
name: string;
|
|
102
|
+
|
|
103
|
+
@ApiProperty({
|
|
104
|
+
description: 'E-mail de login do profissional',
|
|
105
|
+
example: 'maria.silva@clinica.com',
|
|
106
|
+
maxLength: 255,
|
|
107
|
+
})
|
|
108
|
+
@IsEmail({}, { message: 'email deve ser um e-mail válido' })
|
|
109
|
+
@IsString()
|
|
110
|
+
@MinLength(1, { message: 'email não pode ser vazio' })
|
|
111
|
+
@MaxLength(255)
|
|
112
|
+
email: string;
|
|
113
|
+
|
|
114
|
+
@ApiPropertyOptional({
|
|
115
|
+
description: 'ID da especialidade do profissional (UUID v4)',
|
|
116
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
117
|
+
})
|
|
118
|
+
@IsOptional()
|
|
119
|
+
@IsUUID('4')
|
|
120
|
+
specialtyId?: string;
|
|
121
|
+
|
|
122
|
+
@ApiPropertyOptional({
|
|
123
|
+
description:
|
|
124
|
+
'IDs dos procedimentos (UUID v4) da especialidade que o profissional realiza',
|
|
125
|
+
example: [
|
|
126
|
+
'550e8400-e29b-41d4-a716-446655440010',
|
|
127
|
+
'550e8400-e29b-41d4-a716-446655440011',
|
|
128
|
+
],
|
|
129
|
+
})
|
|
130
|
+
@IsOptional()
|
|
131
|
+
@IsArray()
|
|
132
|
+
@IsUUID('4', { each: true })
|
|
133
|
+
procedureIds?: string[];
|
|
134
|
+
|
|
135
|
+
@ApiPropertyOptional({
|
|
136
|
+
description:
|
|
137
|
+
'Horário de trabalho do profissional por dia da semana (0=domingo..6=sábado)',
|
|
138
|
+
type: [OpeningHoursSlotDto],
|
|
139
|
+
example: [{ dayOfWeek: 1, open: '08:00', close: '18:00' }],
|
|
140
|
+
})
|
|
141
|
+
@IsOptional()
|
|
142
|
+
@IsArray()
|
|
143
|
+
@ValidateNested({ each: true })
|
|
144
|
+
@Type(() => OpeningHoursSlotDto)
|
|
145
|
+
workingHours?: OpeningHoursSlotDto[];
|
|
146
|
+
}
|
|
147
|
+
|
|
@@ -5,7 +5,7 @@ import { AtLeastOneOf } from './at-least-one-of.decorator';
|
|
|
5
5
|
/** Fields the authenticated user may change on their own profile (no role change). */
|
|
6
6
|
export class UpdateSelfUserDto {
|
|
7
7
|
@ApiHideProperty()
|
|
8
|
-
@AtLeastOneOf(['name', 'email'
|
|
8
|
+
@AtLeastOneOf(['name', 'email'])
|
|
9
9
|
_atLeastOne?: string;
|
|
10
10
|
|
|
11
11
|
@ApiPropertyOptional({
|
|
@@ -29,14 +29,4 @@ export class UpdateSelfUserDto {
|
|
|
29
29
|
@MaxLength(255)
|
|
30
30
|
email?: string;
|
|
31
31
|
|
|
32
|
-
@ApiPropertyOptional({
|
|
33
|
-
description: 'New password (bcrypt-hashed on the auth service)',
|
|
34
|
-
example: 'senha123',
|
|
35
|
-
minLength: 6,
|
|
36
|
-
})
|
|
37
|
-
@IsOptional()
|
|
38
|
-
@IsString()
|
|
39
|
-
@MinLength(6, { message: 'password must be at least 6 characters' })
|
|
40
|
-
@MaxLength(255)
|
|
41
|
-
password?: string;
|
|
42
32
|
}
|
|
@@ -12,7 +12,7 @@ export type AllUserRole = (typeof ALL_USER_ROLES)[number];
|
|
|
12
12
|
/** Fields an administrator may change for any user (including role). */
|
|
13
13
|
export class UpdateUserByAdminDto {
|
|
14
14
|
@ApiHideProperty()
|
|
15
|
-
@AtLeastOneOf(['name', 'email', '
|
|
15
|
+
@AtLeastOneOf(['name', 'email', 'role'])
|
|
16
16
|
_atLeastOne?: string;
|
|
17
17
|
|
|
18
18
|
@ApiPropertyOptional({
|
|
@@ -36,17 +36,6 @@ export class UpdateUserByAdminDto {
|
|
|
36
36
|
@MaxLength(255)
|
|
37
37
|
email?: string;
|
|
38
38
|
|
|
39
|
-
@ApiPropertyOptional({
|
|
40
|
-
description: 'New password (bcrypt-hashed on the auth service)',
|
|
41
|
-
example: 'senha123',
|
|
42
|
-
minLength: 6,
|
|
43
|
-
})
|
|
44
|
-
@IsOptional()
|
|
45
|
-
@IsString()
|
|
46
|
-
@MinLength(6, { message: 'password must be at least 6 characters' })
|
|
47
|
-
@MaxLength(255)
|
|
48
|
-
password?: string;
|
|
49
|
-
|
|
50
39
|
@ApiPropertyOptional({
|
|
51
40
|
description: 'User role',
|
|
52
41
|
enum: ALL_USER_ROLES,
|
|
@@ -6,7 +6,6 @@ export interface AuthUpdateSelfPayload {
|
|
|
6
6
|
userId: string;
|
|
7
7
|
name?: string;
|
|
8
8
|
email?: string;
|
|
9
|
-
password?: string;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
/**
|
|
@@ -19,7 +18,6 @@ export interface AuthUpdateUserAdminPayload {
|
|
|
19
18
|
targetUserId: string;
|
|
20
19
|
name?: string;
|
|
21
20
|
email?: string;
|
|
22
|
-
password?: string;
|
|
23
21
|
role?: 'administrator' | 'attendant' | 'health_professional';
|
|
24
22
|
}
|
|
25
23
|
|