tychat-contracts 1.6.80 → 1.6.82
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/.husky/commit-msg +11 -0
- package/dist/appointments/appointment-calendar.dto.d.ts +1 -0
- package/dist/appointments/appointment-calendar.dto.d.ts.map +1 -1
- package/dist/appointments/appointment-calendar.dto.js +8 -0
- package/dist/conversations/followup-confirmation-response.dto.d.ts +24 -0
- package/dist/conversations/followup-confirmation-response.dto.d.ts.map +1 -0
- package/dist/conversations/followup-confirmation-response.dto.js +125 -0
- package/dist/conversations/index.d.ts +1 -0
- package/dist/conversations/index.d.ts.map +1 -1
- package/dist/conversations/index.js +1 -0
- package/dist/users/create-user.dto.d.ts +2 -1
- package/dist/users/create-user.dto.d.ts.map +1 -1
- package/dist/users/create-user.dto.js +19 -1
- package/dist/users/update-user-by-admin.dto.d.ts +2 -1
- package/dist/users/update-user-by-admin.dto.d.ts.map +1 -1
- package/dist/users/update-user-by-admin.dto.js +20 -3
- package/dist/users/updated-user.dto.d.ts +3 -1
- package/dist/users/updated-user.dto.d.ts.map +1 -1
- package/dist/users/updated-user.dto.js +14 -3
- package/dist/users/user-list-item.dto.d.ts +3 -1
- package/dist/users/user-list-item.dto.d.ts.map +1 -1
- package/dist/users/user-list-item.dto.js +14 -3
- package/dist/users/user-update-kafka-payloads.d.ts +3 -0
- package/dist/users/user-update-kafka-payloads.d.ts.map +1 -1
- package/package.json +32 -30
- package/src/appointments/appointment-calendar.dto.ts +8 -1
- package/src/conversations/followup-confirmation-response.dto.ts +93 -0
- package/src/conversations/index.ts +1 -0
- package/src/users/create-user.dto.ts +25 -3
- package/src/users/update-user-by-admin.dto.ts +28 -4
- package/src/users/updated-user.dto.ts +13 -4
- package/src/users/user-list-item.dto.ts +13 -4
- package/src/users/user-update-kafka-payloads.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appointment-calendar.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-calendar.dto.ts"],"names":[],"mappings":"AAEA,oCAAoC;AACpC,qBAAa,0BAA0B;IAErC,EAAE,EAAE,MAAM,CAAC;IAMX,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"appointment-calendar.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-calendar.dto.ts"],"names":[],"mappings":"AAEA,oCAAoC;AACpC,qBAAa,0BAA0B;IAErC,EAAE,EAAE,MAAM,CAAC;IAMX,IAAI,EAAE,MAAM,CAAC;IAOb,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,iDAAiD;AACjD,qBAAa,0BAA0B;IAKrC,IAAI,EAAE,MAAM,CAAC;IAKb,gBAAgB,EAAE,MAAM,CAAC;IAGzB,YAAY,EAAE,0BAA0B,EAAE,CAAC;CAC5C;AAED,uFAAuF;AACvF,qBAAa,yBAAyB;IAKpC,IAAI,EAAE,MAAM,CAAC;IAMb,gBAAgB,EAAE,MAAM,CAAC;IAGzB,YAAY,EAAE,0BAA0B,EAAE,CAAC;IAQ3C,KAAK,CAAC,EAAE,0BAA0B,EAAE,CAAC;CACtC;AAED,qBAAa,8BAA8B;IAEzC,SAAS,EAAE,MAAM,CAAC;IAGlB,OAAO,EAAE,MAAM,CAAC;IAOhB,IAAI,EAAE,yBAAyB,EAAE,CAAC;CACnC"}
|
|
@@ -15,6 +15,7 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
15
15
|
class AppointmentCalendarItemDto {
|
|
16
16
|
id;
|
|
17
17
|
date;
|
|
18
|
+
patientConfirmedAt;
|
|
18
19
|
}
|
|
19
20
|
exports.AppointmentCalendarItemDto = AppointmentCalendarItemDto;
|
|
20
21
|
__decorate([
|
|
@@ -28,6 +29,13 @@ __decorate([
|
|
|
28
29
|
}),
|
|
29
30
|
__metadata("design:type", String)
|
|
30
31
|
], AppointmentCalendarItemDto.prototype, "date", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
34
|
+
description: 'Data/hora em que o paciente confirmou presença via WhatsApp (ISO 8601)',
|
|
35
|
+
example: '2026-04-09T10:30:00.000Z',
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], AppointmentCalendarItemDto.prototype, "patientConfirmedAt", void 0);
|
|
31
39
|
/** Agendamentos agrupados por hora civil UTC. */
|
|
32
40
|
class AppointmentCalendarHourDto {
|
|
33
41
|
hour;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const APPOINTMENT_CONFIRMATION_ACTIONS: readonly ["confirm", "reschedule"];
|
|
2
|
+
export type AppointmentConfirmationActionDto = (typeof APPOINTMENT_CONFIRMATION_ACTIONS)[number];
|
|
3
|
+
/** Query parameters for listing appointment confirmation button responses. */
|
|
4
|
+
export declare class FollowupConfirmationResponseListQueryDto {
|
|
5
|
+
page?: number;
|
|
6
|
+
limit?: number;
|
|
7
|
+
patientId?: string;
|
|
8
|
+
appointmentId?: string;
|
|
9
|
+
action?: AppointmentConfirmationActionDto;
|
|
10
|
+
dateFrom?: string;
|
|
11
|
+
dateTo?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Single row from appointment_confirmation_responses. */
|
|
14
|
+
export declare class FollowupConfirmationResponseItemDto {
|
|
15
|
+
id: string;
|
|
16
|
+
patientId: string;
|
|
17
|
+
appointmentId: string;
|
|
18
|
+
action: AppointmentConfirmationActionDto;
|
|
19
|
+
buttonId: string;
|
|
20
|
+
buttonTitle: string;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
patientName?: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=followup-confirmation-response.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followup-confirmation-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-confirmation-response.dto.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,gCAAgC,oCAAqC,CAAC;AACnF,MAAM,MAAM,gCAAgC,GAC1C,CAAC,OAAO,gCAAgC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,8EAA8E;AAC9E,qBAAa,wCAAwC;IAMnD,IAAI,CAAC,EAAE,MAAM,CAAC;IAQd,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,MAAM,CAAC,EAAE,gCAAgC,CAAC;IAQ1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,0DAA0D;AAC1D,qBAAa,mCAAmC;IAE9C,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,aAAa,EAAE,MAAM,CAAC;IAGtB,MAAM,EAAE,gCAAgC,CAAC;IAGzC,QAAQ,EAAE,MAAM,CAAC;IAGjB,WAAW,EAAE,MAAM,CAAC;IAGpB,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,125 @@
|
|
|
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.FollowupConfirmationResponseItemDto = exports.FollowupConfirmationResponseListQueryDto = exports.APPOINTMENT_CONFIRMATION_ACTIONS = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
exports.APPOINTMENT_CONFIRMATION_ACTIONS = ['confirm', 'reschedule'];
|
|
17
|
+
/** Query parameters for listing appointment confirmation button responses. */
|
|
18
|
+
class FollowupConfirmationResponseListQueryDto {
|
|
19
|
+
page;
|
|
20
|
+
limit;
|
|
21
|
+
patientId;
|
|
22
|
+
appointmentId;
|
|
23
|
+
action;
|
|
24
|
+
dateFrom;
|
|
25
|
+
dateTo;
|
|
26
|
+
}
|
|
27
|
+
exports.FollowupConfirmationResponseListQueryDto = FollowupConfirmationResponseListQueryDto;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, swagger_1.ApiPropertyOptional)({ minimum: 1, default: 1 }),
|
|
30
|
+
(0, class_validator_1.IsOptional)(),
|
|
31
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
32
|
+
(0, class_validator_1.IsInt)(),
|
|
33
|
+
(0, class_validator_1.Min)(1),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], FollowupConfirmationResponseListQueryDto.prototype, "page", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiPropertyOptional)({ minimum: 1, maximum: 100, default: 20 }),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
40
|
+
(0, class_validator_1.IsInt)(),
|
|
41
|
+
(0, class_validator_1.Min)(1),
|
|
42
|
+
(0, class_validator_1.Max)(100),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], FollowupConfirmationResponseListQueryDto.prototype, "limit", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, swagger_1.ApiPropertyOptional)({ format: 'uuid' }),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], FollowupConfirmationResponseListQueryDto.prototype, "patientId", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, swagger_1.ApiPropertyOptional)({ format: 'uuid' }),
|
|
53
|
+
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], FollowupConfirmationResponseListQueryDto.prototype, "appointmentId", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, swagger_1.ApiPropertyOptional)({ enum: exports.APPOINTMENT_CONFIRMATION_ACTIONS }),
|
|
59
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
(0, class_validator_1.IsIn)([...exports.APPOINTMENT_CONFIRMATION_ACTIONS]),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], FollowupConfirmationResponseListQueryDto.prototype, "action", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
66
|
+
description: 'Início do período (ISO 8601). Filtra por `created_at` (inclusivo).',
|
|
67
|
+
example: '2026-04-01T00:00:00.000Z',
|
|
68
|
+
}),
|
|
69
|
+
(0, class_validator_1.IsOptional)(),
|
|
70
|
+
(0, class_validator_1.IsDateString)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], FollowupConfirmationResponseListQueryDto.prototype, "dateFrom", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
75
|
+
description: 'Fim do período (ISO 8601). Filtra por `created_at` (inclusivo).',
|
|
76
|
+
example: '2026-04-30T23:59:59.999Z',
|
|
77
|
+
}),
|
|
78
|
+
(0, class_validator_1.IsOptional)(),
|
|
79
|
+
(0, class_validator_1.IsDateString)(),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], FollowupConfirmationResponseListQueryDto.prototype, "dateTo", void 0);
|
|
82
|
+
/** Single row from appointment_confirmation_responses. */
|
|
83
|
+
class FollowupConfirmationResponseItemDto {
|
|
84
|
+
id;
|
|
85
|
+
patientId;
|
|
86
|
+
appointmentId;
|
|
87
|
+
action;
|
|
88
|
+
buttonId;
|
|
89
|
+
buttonTitle;
|
|
90
|
+
createdAt;
|
|
91
|
+
patientName;
|
|
92
|
+
}
|
|
93
|
+
exports.FollowupConfirmationResponseItemDto = FollowupConfirmationResponseItemDto;
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], FollowupConfirmationResponseItemDto.prototype, "id", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], FollowupConfirmationResponseItemDto.prototype, "patientId", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], FollowupConfirmationResponseItemDto.prototype, "appointmentId", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, swagger_1.ApiProperty)({ enum: exports.APPOINTMENT_CONFIRMATION_ACTIONS }),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], FollowupConfirmationResponseItemDto.prototype, "action", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, swagger_1.ApiProperty)(),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], FollowupConfirmationResponseItemDto.prototype, "buttonId", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, swagger_1.ApiProperty)(),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], FollowupConfirmationResponseItemDto.prototype, "buttonTitle", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, swagger_1.ApiProperty)({ example: '2026-04-03T13:11:00.000Z' }),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], FollowupConfirmationResponseItemDto.prototype, "createdAt", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Nome do paciente (enriquecido pelo gateway)' }),
|
|
124
|
+
__metadata("design:type", String)
|
|
125
|
+
], FollowupConfirmationResponseItemDto.prototype, "patientName", void 0);
|
|
@@ -15,6 +15,7 @@ export * from './followup-log-response.dto';
|
|
|
15
15
|
export * from './followup-log-list-query.dto';
|
|
16
16
|
export * from './followup-log-list-response.dto';
|
|
17
17
|
export * from './followup-appointment-reprocess.dto';
|
|
18
|
+
export * from './followup-confirmation-response.dto';
|
|
18
19
|
export * from './satisfaction-response.dto';
|
|
19
20
|
export * from './followup-events.dto';
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversations/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversations/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
|
|
@@ -31,5 +31,6 @@ __exportStar(require("./followup-log-response.dto"), exports);
|
|
|
31
31
|
__exportStar(require("./followup-log-list-query.dto"), exports);
|
|
32
32
|
__exportStar(require("./followup-log-list-response.dto"), exports);
|
|
33
33
|
__exportStar(require("./followup-appointment-reprocess.dto"), exports);
|
|
34
|
+
__exportStar(require("./followup-confirmation-response.dto"), exports);
|
|
34
35
|
__exportStar(require("./satisfaction-response.dto"), exports);
|
|
35
36
|
__exportStar(require("./followup-events.dto"), exports);
|
|
@@ -7,6 +7,7 @@ export type CreatableUserRole = (typeof CREATABLE_USER_ROLES)[number];
|
|
|
7
7
|
export declare class CreateUserDto {
|
|
8
8
|
name: string;
|
|
9
9
|
email: string;
|
|
10
|
-
|
|
10
|
+
roles?: CreatableUserRole[];
|
|
11
|
+
role?: CreatableUserRole;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=create-user.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/create-user.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/create-user.dto.ts"],"names":[],"mappings":"AAaA;;;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;IAgBd,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAa5B,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B"}
|
|
@@ -20,6 +20,7 @@ exports.CREATABLE_USER_ROLES = ['attendant', 'health_professional'];
|
|
|
20
20
|
class CreateUserDto {
|
|
21
21
|
name;
|
|
22
22
|
email;
|
|
23
|
+
roles;
|
|
23
24
|
role;
|
|
24
25
|
}
|
|
25
26
|
exports.CreateUserDto = CreateUserDto;
|
|
@@ -48,10 +49,27 @@ __decorate([
|
|
|
48
49
|
], CreateUserDto.prototype, "email", void 0);
|
|
49
50
|
__decorate([
|
|
50
51
|
(0, swagger_1.ApiProperty)({
|
|
51
|
-
description: '
|
|
52
|
+
description: 'Papéis do usuário. Pelo menos um: atendente e/ou profissional de saúde.',
|
|
53
|
+
enum: exports.CREATABLE_USER_ROLES,
|
|
54
|
+
isArray: true,
|
|
55
|
+
example: ['attendant'],
|
|
56
|
+
}),
|
|
57
|
+
(0, class_validator_1.ValidateIf)((o) => o.role == null),
|
|
58
|
+
(0, class_validator_1.IsArray)({ message: 'roles deve ser um array' }),
|
|
59
|
+
(0, class_validator_1.ArrayMinSize)(1, { message: 'roles deve conter ao menos um papel' }),
|
|
60
|
+
(0, class_validator_1.IsIn)(exports.CREATABLE_USER_ROLES, {
|
|
61
|
+
each: true,
|
|
62
|
+
message: 'cada role deve ser attendant ou health_professional',
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Array)
|
|
65
|
+
], CreateUserDto.prototype, "roles", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
68
|
+
description: 'Deprecated: use roles[]. Papel único; convertido internamente para roles com um elemento.',
|
|
52
69
|
enum: exports.CREATABLE_USER_ROLES,
|
|
53
70
|
default: 'attendant',
|
|
54
71
|
}),
|
|
72
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
73
|
(0, class_validator_1.IsString)(),
|
|
56
74
|
(0, class_validator_1.IsIn)(exports.CREATABLE_USER_ROLES, {
|
|
57
75
|
message: 'role deve ser attendant ou health_professional',
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export declare const ALL_USER_ROLES: readonly ["administrator", "attendant", "health_professional"];
|
|
2
2
|
export type AllUserRole = (typeof ALL_USER_ROLES)[number];
|
|
3
|
-
/** Fields an administrator may change for any user (including
|
|
3
|
+
/** Fields an administrator may change for any user (including roles). */
|
|
4
4
|
export declare class UpdateUserByAdminDto {
|
|
5
5
|
_atLeastOne?: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
email?: string;
|
|
8
|
+
roles?: AllUserRole[];
|
|
8
9
|
role?: AllUserRole;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=update-user-by-admin.dto.d.ts.map
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"update-user-by-admin.dto.d.ts","sourceRoot":"","sources":["../../src/users/update-user-by-admin.dto.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,cAAc,gEAIjB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,yEAAyE;AACzE,qBAAa,oBAAoB;IAG/B,WAAW,CAAC,EAAE,MAAM,CAAC;IAWrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAWd,KAAK,CAAC,EAAE,MAAM,CAAC;IAef,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IAYtB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
|
|
@@ -18,17 +18,18 @@ exports.ALL_USER_ROLES = [
|
|
|
18
18
|
'attendant',
|
|
19
19
|
'health_professional',
|
|
20
20
|
];
|
|
21
|
-
/** Fields an administrator may change for any user (including
|
|
21
|
+
/** Fields an administrator may change for any user (including roles). */
|
|
22
22
|
class UpdateUserByAdminDto {
|
|
23
23
|
_atLeastOne;
|
|
24
24
|
name;
|
|
25
25
|
email;
|
|
26
|
+
roles;
|
|
26
27
|
role;
|
|
27
28
|
}
|
|
28
29
|
exports.UpdateUserByAdminDto = UpdateUserByAdminDto;
|
|
29
30
|
__decorate([
|
|
30
31
|
(0, swagger_1.ApiHideProperty)(),
|
|
31
|
-
(0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email', 'role']),
|
|
32
|
+
(0, at_least_one_of_decorator_1.AtLeastOneOf)(['name', 'email', 'role', 'roles']),
|
|
32
33
|
__metadata("design:type", String)
|
|
33
34
|
], UpdateUserByAdminDto.prototype, "_atLeastOne", void 0);
|
|
34
35
|
__decorate([
|
|
@@ -56,7 +57,23 @@ __decorate([
|
|
|
56
57
|
], UpdateUserByAdminDto.prototype, "email", void 0);
|
|
57
58
|
__decorate([
|
|
58
59
|
(0, swagger_1.ApiPropertyOptional)({
|
|
59
|
-
description: 'User role',
|
|
60
|
+
description: 'User roles (replaces the full role set when provided)',
|
|
61
|
+
enum: exports.ALL_USER_ROLES,
|
|
62
|
+
isArray: true,
|
|
63
|
+
example: ['attendant', 'health_professional'],
|
|
64
|
+
}),
|
|
65
|
+
(0, class_validator_1.IsOptional)(),
|
|
66
|
+
(0, class_validator_1.IsArray)(),
|
|
67
|
+
(0, class_validator_1.ArrayMinSize)(1, { message: 'roles must contain at least one role when provided' }),
|
|
68
|
+
(0, class_validator_1.IsIn)(exports.ALL_USER_ROLES, {
|
|
69
|
+
each: true,
|
|
70
|
+
message: 'each role must be administrator, attendant, or health_professional',
|
|
71
|
+
}),
|
|
72
|
+
__metadata("design:type", Array)
|
|
73
|
+
], UpdateUserByAdminDto.prototype, "roles", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
76
|
+
description: 'Deprecated: use roles[]. Single role replacement.',
|
|
60
77
|
enum: exports.ALL_USER_ROLES,
|
|
61
78
|
example: 'attendant',
|
|
62
79
|
}),
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { ALL_USER_ROLES } from './update-user-by-admin.dto';
|
|
1
2
|
/** User payload returned after create or update (no password). */
|
|
2
3
|
export declare class UpdatedUserDto {
|
|
3
4
|
userId: string;
|
|
4
5
|
name: string;
|
|
5
6
|
email: string;
|
|
6
|
-
|
|
7
|
+
roles: (typeof ALL_USER_ROLES)[number][];
|
|
8
|
+
role?: (typeof ALL_USER_ROLES)[number];
|
|
7
9
|
createdAt: Date;
|
|
8
10
|
updatedAt: Date;
|
|
9
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updated-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/updated-user.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updated-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/updated-user.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,kEAAkE;AAClE,qBAAa,cAAc;IAMzB,MAAM,EAAE,MAAM,CAAC;IAGf,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAQd,KAAK,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IAOzC,IAAI,CAAC,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;IAGvC,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -11,11 +11,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UpdatedUserDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const update_user_by_admin_dto_1 = require("./update-user-by-admin.dto");
|
|
14
15
|
/** User payload returned after create or update (no password). */
|
|
15
16
|
class UpdatedUserDto {
|
|
16
17
|
userId;
|
|
17
18
|
name;
|
|
18
19
|
email;
|
|
20
|
+
roles;
|
|
19
21
|
role;
|
|
20
22
|
createdAt;
|
|
21
23
|
updatedAt;
|
|
@@ -39,11 +41,20 @@ __decorate([
|
|
|
39
41
|
], UpdatedUserDto.prototype, "email", void 0);
|
|
40
42
|
__decorate([
|
|
41
43
|
(0, swagger_1.ApiProperty)({
|
|
42
|
-
description: '
|
|
43
|
-
enum:
|
|
44
|
+
description: 'All roles assigned to the user',
|
|
45
|
+
enum: update_user_by_admin_dto_1.ALL_USER_ROLES,
|
|
46
|
+
isArray: true,
|
|
47
|
+
example: ['attendant'],
|
|
48
|
+
}),
|
|
49
|
+
__metadata("design:type", Array)
|
|
50
|
+
], UpdatedUserDto.prototype, "roles", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
53
|
+
description: 'Deprecated primary role alias (first role in roles[])',
|
|
54
|
+
enum: update_user_by_admin_dto_1.ALL_USER_ROLES,
|
|
44
55
|
example: 'attendant',
|
|
45
56
|
}),
|
|
46
|
-
__metadata("design:type",
|
|
57
|
+
__metadata("design:type", Object)
|
|
47
58
|
], UpdatedUserDto.prototype, "role", void 0);
|
|
48
59
|
__decorate([
|
|
49
60
|
(0, swagger_1.ApiProperty)({ description: 'Creation timestamp' }),
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { ALL_USER_ROLES } from './update-user-by-admin.dto';
|
|
1
2
|
/** Public user summary returned when an administrator lists users (no password). */
|
|
2
3
|
export declare class UserListItemDto {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
5
6
|
email: string;
|
|
6
|
-
|
|
7
|
+
roles: (typeof ALL_USER_ROLES)[number][];
|
|
8
|
+
role?: (typeof ALL_USER_ROLES)[number];
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=user-list-item.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-list-item.dto.d.ts","sourceRoot":"","sources":["../../src/users/user-list-item.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user-list-item.dto.d.ts","sourceRoot":"","sources":["../../src/users/user-list-item.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,oFAAoF;AACpF,qBAAa,eAAe;IAM1B,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAQd,KAAK,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IAOzC,IAAI,CAAC,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;CACxC"}
|
|
@@ -11,11 +11,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UserListItemDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const update_user_by_admin_dto_1 = require("./update-user-by-admin.dto");
|
|
14
15
|
/** Public user summary returned when an administrator lists users (no password). */
|
|
15
16
|
class UserListItemDto {
|
|
16
17
|
id;
|
|
17
18
|
name;
|
|
18
19
|
email;
|
|
20
|
+
roles;
|
|
19
21
|
role;
|
|
20
22
|
}
|
|
21
23
|
exports.UserListItemDto = UserListItemDto;
|
|
@@ -37,9 +39,18 @@ __decorate([
|
|
|
37
39
|
], UserListItemDto.prototype, "email", void 0);
|
|
38
40
|
__decorate([
|
|
39
41
|
(0, swagger_1.ApiProperty)({
|
|
40
|
-
description: '
|
|
41
|
-
enum:
|
|
42
|
+
description: 'All roles assigned to the user',
|
|
43
|
+
enum: update_user_by_admin_dto_1.ALL_USER_ROLES,
|
|
44
|
+
isArray: true,
|
|
45
|
+
example: ['attendant'],
|
|
46
|
+
}),
|
|
47
|
+
__metadata("design:type", Array)
|
|
48
|
+
], UserListItemDto.prototype, "roles", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
51
|
+
description: 'Deprecated primary role alias (first role in roles[])',
|
|
52
|
+
enum: update_user_by_admin_dto_1.ALL_USER_ROLES,
|
|
42
53
|
example: 'attendant',
|
|
43
54
|
}),
|
|
44
|
-
__metadata("design:type",
|
|
55
|
+
__metadata("design:type", Object)
|
|
45
56
|
], UserListItemDto.prototype, "role", void 0);
|
|
@@ -19,6 +19,9 @@ export interface AuthUpdateUserAdminPayload {
|
|
|
19
19
|
targetUserId: string;
|
|
20
20
|
name?: string;
|
|
21
21
|
email?: string;
|
|
22
|
+
/** Replaces the full role set when provided. */
|
|
23
|
+
roles?: ('administrator' | 'attendant' | 'health_professional')[];
|
|
24
|
+
/** @deprecated Use roles[] */
|
|
22
25
|
role?: 'administrator' | 'attendant' | 'health_professional';
|
|
23
26
|
}
|
|
24
27
|
/**
|
|
@@ -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;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,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"}
|
|
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;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,KAAK,CAAC,EAAE,CAAC,eAAe,GAAG,WAAW,GAAG,qBAAqB,CAAC,EAAE,CAAC;IAClE,8BAA8B;IAC9B,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
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tychat-contracts",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "DTOs compartilhados com class-validator (API e microserviços)",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"private": false,
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build": "tsc",
|
|
10
|
-
"release": "npm version patch && npm publish",
|
|
11
|
-
"prepublishOnly": "npm run build"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"class-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"@
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "tychat-contracts",
|
|
3
|
+
"version": "1.6.82",
|
|
4
|
+
"description": "DTOs compartilhados com class-validator (API e microserviços)",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"private": false,
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"release": "npm version patch && npm publish",
|
|
11
|
+
"prepublishOnly": "npm run build",
|
|
12
|
+
"prepare": "husky"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"class-transformer": "^0.5.1",
|
|
16
|
+
"class-validator": "^0.14.1",
|
|
17
|
+
"ioredis": "^5.10.0",
|
|
18
|
+
"jest": "^30.3.0",
|
|
19
|
+
"reflect-metadata": "*"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@nestjs/swagger": "^11.2.6",
|
|
23
|
+
"@types/jest": "^30.0.0",
|
|
24
|
+
"husky": "^9.1.7",
|
|
25
|
+
"ts-jest": "^29.4.9",
|
|
26
|
+
"typescript": "^5.7.3"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@nestjs/swagger": "^11.2.6",
|
|
30
|
+
"reflect-metadata": "*"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
2
|
|
|
3
3
|
/** Um agendamento no calendário. */
|
|
4
4
|
export class AppointmentCalendarItemDto {
|
|
@@ -10,6 +10,13 @@ export class AppointmentCalendarItemDto {
|
|
|
10
10
|
example: '2026-04-10T14:30:00.000Z',
|
|
11
11
|
})
|
|
12
12
|
date: string;
|
|
13
|
+
|
|
14
|
+
@ApiPropertyOptional({
|
|
15
|
+
description:
|
|
16
|
+
'Data/hora em que o paciente confirmou presença via WhatsApp (ISO 8601)',
|
|
17
|
+
example: '2026-04-09T10:30:00.000Z',
|
|
18
|
+
})
|
|
19
|
+
patientConfirmedAt?: string;
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
/** Agendamentos agrupados por hora civil UTC. */
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { Type } from 'class-transformer';
|
|
3
|
+
import {
|
|
4
|
+
IsDateString,
|
|
5
|
+
IsIn,
|
|
6
|
+
IsInt,
|
|
7
|
+
IsOptional,
|
|
8
|
+
IsString,
|
|
9
|
+
IsUUID,
|
|
10
|
+
Max,
|
|
11
|
+
Min,
|
|
12
|
+
} from 'class-validator';
|
|
13
|
+
|
|
14
|
+
export const APPOINTMENT_CONFIRMATION_ACTIONS = ['confirm', 'reschedule'] as const;
|
|
15
|
+
export type AppointmentConfirmationActionDto =
|
|
16
|
+
(typeof APPOINTMENT_CONFIRMATION_ACTIONS)[number];
|
|
17
|
+
|
|
18
|
+
/** Query parameters for listing appointment confirmation button responses. */
|
|
19
|
+
export class FollowupConfirmationResponseListQueryDto {
|
|
20
|
+
@ApiPropertyOptional({ minimum: 1, default: 1 })
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@Type(() => Number)
|
|
23
|
+
@IsInt()
|
|
24
|
+
@Min(1)
|
|
25
|
+
page?: number;
|
|
26
|
+
|
|
27
|
+
@ApiPropertyOptional({ minimum: 1, maximum: 100, default: 20 })
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@Type(() => Number)
|
|
30
|
+
@IsInt()
|
|
31
|
+
@Min(1)
|
|
32
|
+
@Max(100)
|
|
33
|
+
limit?: number;
|
|
34
|
+
|
|
35
|
+
@ApiPropertyOptional({ format: 'uuid' })
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsUUID('4')
|
|
38
|
+
patientId?: string;
|
|
39
|
+
|
|
40
|
+
@ApiPropertyOptional({ format: 'uuid' })
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@IsUUID('4')
|
|
43
|
+
appointmentId?: string;
|
|
44
|
+
|
|
45
|
+
@ApiPropertyOptional({ enum: APPOINTMENT_CONFIRMATION_ACTIONS })
|
|
46
|
+
@IsOptional()
|
|
47
|
+
@IsString()
|
|
48
|
+
@IsIn([...APPOINTMENT_CONFIRMATION_ACTIONS])
|
|
49
|
+
action?: AppointmentConfirmationActionDto;
|
|
50
|
+
|
|
51
|
+
@ApiPropertyOptional({
|
|
52
|
+
description: 'Início do período (ISO 8601). Filtra por `created_at` (inclusivo).',
|
|
53
|
+
example: '2026-04-01T00:00:00.000Z',
|
|
54
|
+
})
|
|
55
|
+
@IsOptional()
|
|
56
|
+
@IsDateString()
|
|
57
|
+
dateFrom?: string;
|
|
58
|
+
|
|
59
|
+
@ApiPropertyOptional({
|
|
60
|
+
description: 'Fim do período (ISO 8601). Filtra por `created_at` (inclusivo).',
|
|
61
|
+
example: '2026-04-30T23:59:59.999Z',
|
|
62
|
+
})
|
|
63
|
+
@IsOptional()
|
|
64
|
+
@IsDateString()
|
|
65
|
+
dateTo?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Single row from appointment_confirmation_responses. */
|
|
69
|
+
export class FollowupConfirmationResponseItemDto {
|
|
70
|
+
@ApiProperty({ format: 'uuid' })
|
|
71
|
+
id: string;
|
|
72
|
+
|
|
73
|
+
@ApiProperty({ format: 'uuid' })
|
|
74
|
+
patientId: string;
|
|
75
|
+
|
|
76
|
+
@ApiProperty({ format: 'uuid' })
|
|
77
|
+
appointmentId: string;
|
|
78
|
+
|
|
79
|
+
@ApiProperty({ enum: APPOINTMENT_CONFIRMATION_ACTIONS })
|
|
80
|
+
action: AppointmentConfirmationActionDto;
|
|
81
|
+
|
|
82
|
+
@ApiProperty()
|
|
83
|
+
buttonId: string;
|
|
84
|
+
|
|
85
|
+
@ApiProperty()
|
|
86
|
+
buttonTitle: string;
|
|
87
|
+
|
|
88
|
+
@ApiProperty({ example: '2026-04-03T13:11:00.000Z' })
|
|
89
|
+
createdAt: string;
|
|
90
|
+
|
|
91
|
+
@ApiPropertyOptional({ description: 'Nome do paciente (enriquecido pelo gateway)' })
|
|
92
|
+
patientName?: string;
|
|
93
|
+
}
|
|
@@ -15,5 +15,6 @@ export * from './followup-log-response.dto';
|
|
|
15
15
|
export * from './followup-log-list-query.dto';
|
|
16
16
|
export * from './followup-log-list-response.dto';
|
|
17
17
|
export * from './followup-appointment-reprocess.dto';
|
|
18
|
+
export * from './followup-confirmation-response.dto';
|
|
18
19
|
export * from './satisfaction-response.dto';
|
|
19
20
|
export * from './followup-events.dto';
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
2
|
import {
|
|
3
3
|
IsEmail,
|
|
4
4
|
IsString,
|
|
5
5
|
IsIn,
|
|
6
6
|
MinLength,
|
|
7
7
|
MaxLength,
|
|
8
|
+
IsArray,
|
|
9
|
+
ArrayMinSize,
|
|
10
|
+
IsOptional,
|
|
11
|
+
ValidateIf,
|
|
8
12
|
} from 'class-validator';
|
|
9
13
|
|
|
10
14
|
/**
|
|
@@ -37,13 +41,31 @@ export class CreateUserDto {
|
|
|
37
41
|
email: string;
|
|
38
42
|
|
|
39
43
|
@ApiProperty({
|
|
40
|
-
description:
|
|
44
|
+
description:
|
|
45
|
+
'Papéis do usuário. Pelo menos um: atendente e/ou profissional de saúde.',
|
|
46
|
+
enum: CREATABLE_USER_ROLES,
|
|
47
|
+
isArray: true,
|
|
48
|
+
example: ['attendant'],
|
|
49
|
+
})
|
|
50
|
+
@ValidateIf((o: CreateUserDto) => o.role == null)
|
|
51
|
+
@IsArray({ message: 'roles deve ser um array' })
|
|
52
|
+
@ArrayMinSize(1, { message: 'roles deve conter ao menos um papel' })
|
|
53
|
+
@IsIn(CREATABLE_USER_ROLES, {
|
|
54
|
+
each: true,
|
|
55
|
+
message: 'cada role deve ser attendant ou health_professional',
|
|
56
|
+
})
|
|
57
|
+
roles?: CreatableUserRole[];
|
|
58
|
+
|
|
59
|
+
@ApiPropertyOptional({
|
|
60
|
+
description:
|
|
61
|
+
'Deprecated: use roles[]. Papel único; convertido internamente para roles com um elemento.',
|
|
41
62
|
enum: CREATABLE_USER_ROLES,
|
|
42
63
|
default: 'attendant',
|
|
43
64
|
})
|
|
65
|
+
@IsOptional()
|
|
44
66
|
@IsString()
|
|
45
67
|
@IsIn(CREATABLE_USER_ROLES, {
|
|
46
68
|
message: 'role deve ser attendant ou health_professional',
|
|
47
69
|
})
|
|
48
|
-
role
|
|
70
|
+
role?: CreatableUserRole;
|
|
49
71
|
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { ApiHideProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IsEmail,
|
|
4
|
+
IsIn,
|
|
5
|
+
IsOptional,
|
|
6
|
+
IsString,
|
|
7
|
+
MaxLength,
|
|
8
|
+
MinLength,
|
|
9
|
+
IsArray,
|
|
10
|
+
ArrayMinSize,
|
|
11
|
+
} from 'class-validator';
|
|
3
12
|
import { AtLeastOneOf } from './at-least-one-of.decorator';
|
|
4
13
|
|
|
5
14
|
export const ALL_USER_ROLES = [
|
|
@@ -9,10 +18,10 @@ export const ALL_USER_ROLES = [
|
|
|
9
18
|
] as const;
|
|
10
19
|
export type AllUserRole = (typeof ALL_USER_ROLES)[number];
|
|
11
20
|
|
|
12
|
-
/** Fields an administrator may change for any user (including
|
|
21
|
+
/** Fields an administrator may change for any user (including roles). */
|
|
13
22
|
export class UpdateUserByAdminDto {
|
|
14
23
|
@ApiHideProperty()
|
|
15
|
-
@AtLeastOneOf(['name', 'email', 'role'])
|
|
24
|
+
@AtLeastOneOf(['name', 'email', 'role', 'roles'])
|
|
16
25
|
_atLeastOne?: string;
|
|
17
26
|
|
|
18
27
|
@ApiPropertyOptional({
|
|
@@ -38,7 +47,22 @@ export class UpdateUserByAdminDto {
|
|
|
38
47
|
email?: string;
|
|
39
48
|
|
|
40
49
|
@ApiPropertyOptional({
|
|
41
|
-
description: 'User role',
|
|
50
|
+
description: 'User roles (replaces the full role set when provided)',
|
|
51
|
+
enum: ALL_USER_ROLES,
|
|
52
|
+
isArray: true,
|
|
53
|
+
example: ['attendant', 'health_professional'],
|
|
54
|
+
})
|
|
55
|
+
@IsOptional()
|
|
56
|
+
@IsArray()
|
|
57
|
+
@ArrayMinSize(1, { message: 'roles must contain at least one role when provided' })
|
|
58
|
+
@IsIn(ALL_USER_ROLES, {
|
|
59
|
+
each: true,
|
|
60
|
+
message: 'each role must be administrator, attendant, or health_professional',
|
|
61
|
+
})
|
|
62
|
+
roles?: AllUserRole[];
|
|
63
|
+
|
|
64
|
+
@ApiPropertyOptional({
|
|
65
|
+
description: 'Deprecated: use roles[]. Single role replacement.',
|
|
42
66
|
enum: ALL_USER_ROLES,
|
|
43
67
|
example: 'attendant',
|
|
44
68
|
})
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { ALL_USER_ROLES } from './update-user-by-admin.dto';
|
|
2
3
|
|
|
3
4
|
/** User payload returned after create or update (no password). */
|
|
4
5
|
export class UpdatedUserDto {
|
|
@@ -16,11 +17,19 @@ export class UpdatedUserDto {
|
|
|
16
17
|
email: string;
|
|
17
18
|
|
|
18
19
|
@ApiProperty({
|
|
19
|
-
description: '
|
|
20
|
-
enum:
|
|
20
|
+
description: 'All roles assigned to the user',
|
|
21
|
+
enum: ALL_USER_ROLES,
|
|
22
|
+
isArray: true,
|
|
23
|
+
example: ['attendant'],
|
|
24
|
+
})
|
|
25
|
+
roles: (typeof ALL_USER_ROLES)[number][];
|
|
26
|
+
|
|
27
|
+
@ApiPropertyOptional({
|
|
28
|
+
description: 'Deprecated primary role alias (first role in roles[])',
|
|
29
|
+
enum: ALL_USER_ROLES,
|
|
21
30
|
example: 'attendant',
|
|
22
31
|
})
|
|
23
|
-
role
|
|
32
|
+
role?: (typeof ALL_USER_ROLES)[number];
|
|
24
33
|
|
|
25
34
|
@ApiProperty({ description: 'Creation timestamp' })
|
|
26
35
|
createdAt: Date;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { ALL_USER_ROLES } from './update-user-by-admin.dto';
|
|
2
3
|
|
|
3
4
|
/** Public user summary returned when an administrator lists users (no password). */
|
|
4
5
|
export class UserListItemDto {
|
|
@@ -16,9 +17,17 @@ export class UserListItemDto {
|
|
|
16
17
|
email: string;
|
|
17
18
|
|
|
18
19
|
@ApiProperty({
|
|
19
|
-
description: '
|
|
20
|
-
enum:
|
|
20
|
+
description: 'All roles assigned to the user',
|
|
21
|
+
enum: ALL_USER_ROLES,
|
|
22
|
+
isArray: true,
|
|
23
|
+
example: ['attendant'],
|
|
24
|
+
})
|
|
25
|
+
roles: (typeof ALL_USER_ROLES)[number][];
|
|
26
|
+
|
|
27
|
+
@ApiPropertyOptional({
|
|
28
|
+
description: 'Deprecated primary role alias (first role in roles[])',
|
|
29
|
+
enum: ALL_USER_ROLES,
|
|
21
30
|
example: 'attendant',
|
|
22
31
|
})
|
|
23
|
-
role
|
|
32
|
+
role?: (typeof ALL_USER_ROLES)[number];
|
|
24
33
|
}
|
|
@@ -20,6 +20,9 @@ export interface AuthUpdateUserAdminPayload {
|
|
|
20
20
|
targetUserId: string;
|
|
21
21
|
name?: string;
|
|
22
22
|
email?: string;
|
|
23
|
+
/** Replaces the full role set when provided. */
|
|
24
|
+
roles?: ('administrator' | 'attendant' | 'health_professional')[];
|
|
25
|
+
/** @deprecated Use roles[] */
|
|
23
26
|
role?: 'administrator' | 'attendant' | 'health_professional';
|
|
24
27
|
}
|
|
25
28
|
|