tychat-contracts 1.0.49 → 1.0.51
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 +2 -2
- 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/change-force-password.dto.d.ts +6 -0
- package/dist/users/change-force-password.dto.d.ts.map +1 -0
- package/dist/users/change-force-password.dto.js +59 -0
- package/dist/users/create-user.dto.d.ts +0 -1
- package/dist/users/create-user.dto.d.ts.map +1 -1
- package/dist/users/create-user.dto.js +0 -12
- package/dist/users/index.d.ts +2 -1
- package/dist/users/index.d.ts.map +1 -1
- package/dist/users/index.js +3 -1
- package/dist/users/user-update-kafka-payloads.d.ts +9 -0
- 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/change-force-password.dto.ts +40 -0
- package/src/users/create-user.dto.ts +0 -10
- package/src/users/index.ts +2 -0
- package/src/users/user-update-kafka-payloads.ts +10 -0
- package/tychat-contracts-1.0.48.tgz +0 -0
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ DTOs compartilhados com **class-validator** usados pela **tychat-api** e pelos m
|
|
|
4
4
|
|
|
5
5
|
## Estrutura
|
|
6
6
|
|
|
7
|
-
- **auth**: `LoginDto`, `RefreshTokenDto`, payloads Kafka (`LoginPayload`, etc.)
|
|
8
|
-
- **users**: `CreateUserDto
|
|
7
|
+
- **auth**: `LoginDto`, `RefreshTokenDto`, `RequestPasswordResetDto`, `ConfirmPasswordResetDto`, `AuthLoginResponseDto`, payloads Kafka (`LoginPayload`, `RequestPasswordResetPayload`, etc.)
|
|
8
|
+
- **users**: `CreateUserDto` (sem password para criação por admin), `UserListItemDto`, `UpdateSelfUserDto`, `UpdateUserByAdminDto`, `UpdatedUserDto`, `ChangeForcePasswordDto`
|
|
9
9
|
|
|
10
10
|
## Uso
|
|
11
11
|
|
|
@@ -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);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-force-password.dto.d.ts","sourceRoot":"","sources":["../../src/users/change-force-password.dto.ts"],"names":[],"mappings":"AAIA,qBAAa,sBAAsB;IASjC,gBAAgB,EAAE,MAAM,CAAC;IAUzB,YAAY,EAAE,MAAM,CAAC;IAerB,yBAAyB,EAAE,MAAM,CAAC;CACnC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.ChangeForcePasswordDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const match_field_decorator_1 = require("../auth/match-field.decorator");
|
|
16
|
+
class ChangeForcePasswordDto {
|
|
17
|
+
current_password;
|
|
18
|
+
new_password;
|
|
19
|
+
new_password_confirmation;
|
|
20
|
+
}
|
|
21
|
+
exports.ChangeForcePasswordDto = ChangeForcePasswordDto;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, swagger_1.ApiProperty)({
|
|
24
|
+
description: 'Senha atual recebida por e-mail no primeiro acesso',
|
|
25
|
+
example: 'Tmp#4A8x!pQ',
|
|
26
|
+
minLength: 1,
|
|
27
|
+
}),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.MinLength)(1, { message: 'current_password não pode ser vazio' }),
|
|
30
|
+
(0, class_validator_1.MaxLength)(255),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], ChangeForcePasswordDto.prototype, "current_password", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiProperty)({
|
|
35
|
+
description: 'Nova senha a ser definida pelo usuário',
|
|
36
|
+
example: 'MinhaSenha@2026',
|
|
37
|
+
minLength: 6,
|
|
38
|
+
}),
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
(0, class_validator_1.MinLength)(6, { message: 'new_password deve ter no mínimo 6 caracteres' }),
|
|
41
|
+
(0, class_validator_1.MaxLength)(255),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ChangeForcePasswordDto.prototype, "new_password", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiProperty)({
|
|
46
|
+
description: 'Confirmação da nova senha',
|
|
47
|
+
example: 'MinhaSenha@2026',
|
|
48
|
+
minLength: 6,
|
|
49
|
+
}),
|
|
50
|
+
(0, class_validator_1.IsString)(),
|
|
51
|
+
(0, class_validator_1.MinLength)(6, {
|
|
52
|
+
message: 'new_password_confirmation deve ter no mínimo 6 caracteres',
|
|
53
|
+
}),
|
|
54
|
+
(0, class_validator_1.MaxLength)(255),
|
|
55
|
+
(0, match_field_decorator_1.MatchField)('new_password', {
|
|
56
|
+
message: 'new_password_confirmation deve ser igual a new_password',
|
|
57
|
+
}),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], ChangeForcePasswordDto.prototype, "new_password_confirmation", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/create-user.dto.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+CAAgD,CAAC;AAClF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,qBAAa,aAAa;IASxB,IAAI,EAAE,MAAM,CAAC;IAWb,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"create-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/create-user.dto.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+CAAgD,CAAC;AAClF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,qBAAa,aAAa;IASxB,IAAI,EAAE,MAAM,CAAC;IAWb,KAAK,EAAE,MAAM,CAAC;IAWd,IAAI,EAAE,iBAAiB,CAAC;CACzB"}
|
|
@@ -20,7 +20,6 @@ exports.CREATABLE_USER_ROLES = ['attendant', 'health_professional'];
|
|
|
20
20
|
class CreateUserDto {
|
|
21
21
|
name;
|
|
22
22
|
email;
|
|
23
|
-
password;
|
|
24
23
|
role;
|
|
25
24
|
}
|
|
26
25
|
exports.CreateUserDto = CreateUserDto;
|
|
@@ -47,17 +46,6 @@ __decorate([
|
|
|
47
46
|
(0, class_validator_1.MaxLength)(255),
|
|
48
47
|
__metadata("design:type", String)
|
|
49
48
|
], CreateUserDto.prototype, "email", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, swagger_1.ApiProperty)({
|
|
52
|
-
description: 'Senha (será hasheada com bcrypt)',
|
|
53
|
-
example: 'senha123',
|
|
54
|
-
minLength: 6,
|
|
55
|
-
}),
|
|
56
|
-
(0, class_validator_1.IsString)(),
|
|
57
|
-
(0, class_validator_1.MinLength)(6, { message: 'password deve ter no mínimo 6 caracteres' }),
|
|
58
|
-
(0, class_validator_1.MaxLength)(255),
|
|
59
|
-
__metadata("design:type", String)
|
|
60
|
-
], CreateUserDto.prototype, "password", void 0);
|
|
61
49
|
__decorate([
|
|
62
50
|
(0, swagger_1.ApiProperty)({
|
|
63
51
|
description: 'Papel do usuário. Apenas atendente ou profissional de saúde; administrador não pode criar outros administradores.',
|
package/dist/users/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export { UserListItemDto } from './user-list-item.dto';
|
|
|
3
3
|
export { UpdateSelfUserDto } from './update-self-user.dto';
|
|
4
4
|
export { UpdateUserByAdminDto, ALL_USER_ROLES, type AllUserRole, } from './update-user-by-admin.dto';
|
|
5
5
|
export { UpdatedUserDto } from './updated-user.dto';
|
|
6
|
-
export
|
|
6
|
+
export { ChangeForcePasswordDto } from './change-force-password.dto';
|
|
7
|
+
export type { AuthUpdateSelfPayload, AuthUpdateUserAdminPayload, AuthChangeForcePasswordPayload, } from './user-update-kafka-payloads';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,KAAK,WAAW,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EACV,qBAAqB,EACrB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,KAAK,WAAW,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,8BAA8B,CAAC"}
|
package/dist/users/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdatedUserDto = exports.ALL_USER_ROLES = exports.UpdateUserByAdminDto = exports.UpdateSelfUserDto = exports.UserListItemDto = exports.CREATABLE_USER_ROLES = exports.CreateUserDto = void 0;
|
|
3
|
+
exports.ChangeForcePasswordDto = exports.UpdatedUserDto = exports.ALL_USER_ROLES = exports.UpdateUserByAdminDto = exports.UpdateSelfUserDto = exports.UserListItemDto = exports.CREATABLE_USER_ROLES = exports.CreateUserDto = void 0;
|
|
4
4
|
var create_user_dto_1 = require("./create-user.dto");
|
|
5
5
|
Object.defineProperty(exports, "CreateUserDto", { enumerable: true, get: function () { return create_user_dto_1.CreateUserDto; } });
|
|
6
6
|
Object.defineProperty(exports, "CREATABLE_USER_ROLES", { enumerable: true, get: function () { return create_user_dto_1.CREATABLE_USER_ROLES; } });
|
|
@@ -13,3 +13,5 @@ Object.defineProperty(exports, "UpdateUserByAdminDto", { enumerable: true, get:
|
|
|
13
13
|
Object.defineProperty(exports, "ALL_USER_ROLES", { enumerable: true, get: function () { return update_user_by_admin_dto_1.ALL_USER_ROLES; } });
|
|
14
14
|
var updated_user_dto_1 = require("./updated-user.dto");
|
|
15
15
|
Object.defineProperty(exports, "UpdatedUserDto", { enumerable: true, get: function () { return updated_user_dto_1.UpdatedUserDto; } });
|
|
16
|
+
var change_force_password_dto_1 = require("./change-force-password.dto");
|
|
17
|
+
Object.defineProperty(exports, "ChangeForcePasswordDto", { enumerable: true, get: function () { return change_force_password_dto_1.ChangeForcePasswordDto; } });
|
|
@@ -21,4 +21,13 @@ export interface AuthUpdateUserAdminPayload {
|
|
|
21
21
|
password?: string;
|
|
22
22
|
role?: 'administrator' | 'attendant' | 'health_professional';
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Kafka payload for auth.change_force_password (tychat-api → tychat-auth-service).
|
|
26
|
+
*/
|
|
27
|
+
export interface AuthChangeForcePasswordPayload {
|
|
28
|
+
tenant?: string;
|
|
29
|
+
userId: string;
|
|
30
|
+
current_password: string;
|
|
31
|
+
new_password: string;
|
|
32
|
+
}
|
|
24
33
|
//# sourceMappingURL=user-update-kafka-payloads.d.ts.map
|
|
@@ -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;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;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,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,eAAe,GAAG,WAAW,GAAG,qBAAqB,CAAC;CAC9D"}
|
|
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;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;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,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,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
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { IsString, MaxLength, MinLength } from 'class-validator';
|
|
3
|
+
import { MatchField } from '../auth/match-field.decorator';
|
|
4
|
+
|
|
5
|
+
export class ChangeForcePasswordDto {
|
|
6
|
+
@ApiProperty({
|
|
7
|
+
description: 'Senha atual recebida por e-mail no primeiro acesso',
|
|
8
|
+
example: 'Tmp#4A8x!pQ',
|
|
9
|
+
minLength: 1,
|
|
10
|
+
})
|
|
11
|
+
@IsString()
|
|
12
|
+
@MinLength(1, { message: 'current_password não pode ser vazio' })
|
|
13
|
+
@MaxLength(255)
|
|
14
|
+
current_password: string;
|
|
15
|
+
|
|
16
|
+
@ApiProperty({
|
|
17
|
+
description: 'Nova senha a ser definida pelo usuário',
|
|
18
|
+
example: 'MinhaSenha@2026',
|
|
19
|
+
minLength: 6,
|
|
20
|
+
})
|
|
21
|
+
@IsString()
|
|
22
|
+
@MinLength(6, { message: 'new_password deve ter no mínimo 6 caracteres' })
|
|
23
|
+
@MaxLength(255)
|
|
24
|
+
new_password: string;
|
|
25
|
+
|
|
26
|
+
@ApiProperty({
|
|
27
|
+
description: 'Confirmação da nova senha',
|
|
28
|
+
example: 'MinhaSenha@2026',
|
|
29
|
+
minLength: 6,
|
|
30
|
+
})
|
|
31
|
+
@IsString()
|
|
32
|
+
@MinLength(6, {
|
|
33
|
+
message: 'new_password_confirmation deve ter no mínimo 6 caracteres',
|
|
34
|
+
})
|
|
35
|
+
@MaxLength(255)
|
|
36
|
+
@MatchField('new_password', {
|
|
37
|
+
message: 'new_password_confirmation deve ser igual a new_password',
|
|
38
|
+
})
|
|
39
|
+
new_password_confirmation: string;
|
|
40
|
+
}
|
|
@@ -36,16 +36,6 @@ export class CreateUserDto {
|
|
|
36
36
|
@MaxLength(255)
|
|
37
37
|
email: string;
|
|
38
38
|
|
|
39
|
-
@ApiProperty({
|
|
40
|
-
description: 'Senha (será hasheada com bcrypt)',
|
|
41
|
-
example: 'senha123',
|
|
42
|
-
minLength: 6,
|
|
43
|
-
})
|
|
44
|
-
@IsString()
|
|
45
|
-
@MinLength(6, { message: 'password deve ter no mínimo 6 caracteres' })
|
|
46
|
-
@MaxLength(255)
|
|
47
|
-
password: string;
|
|
48
|
-
|
|
49
39
|
@ApiProperty({
|
|
50
40
|
description: 'Papel do usuário. Apenas atendente ou profissional de saúde; administrador não pode criar outros administradores.',
|
|
51
41
|
enum: CREATABLE_USER_ROLES,
|
package/src/users/index.ts
CHANGED
|
@@ -11,7 +11,9 @@ export {
|
|
|
11
11
|
type AllUserRole,
|
|
12
12
|
} from './update-user-by-admin.dto';
|
|
13
13
|
export { UpdatedUserDto } from './updated-user.dto';
|
|
14
|
+
export { ChangeForcePasswordDto } from './change-force-password.dto';
|
|
14
15
|
export type {
|
|
15
16
|
AuthUpdateSelfPayload,
|
|
16
17
|
AuthUpdateUserAdminPayload,
|
|
18
|
+
AuthChangeForcePasswordPayload,
|
|
17
19
|
} from './user-update-kafka-payloads';
|
|
@@ -22,3 +22,13 @@ export interface AuthUpdateUserAdminPayload {
|
|
|
22
22
|
password?: string;
|
|
23
23
|
role?: 'administrator' | 'attendant' | 'health_professional';
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Kafka payload for auth.change_force_password (tychat-api → tychat-auth-service).
|
|
28
|
+
*/
|
|
29
|
+
export interface AuthChangeForcePasswordPayload {
|
|
30
|
+
tenant?: string;
|
|
31
|
+
userId: string;
|
|
32
|
+
current_password: string;
|
|
33
|
+
new_password: string;
|
|
34
|
+
}
|
|
Binary file
|