tychat-contracts 1.0.73 → 1.0.74
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/dist/appointments/appointment-procedure.dto.d.ts +2 -0
- package/dist/appointments/appointment-procedure.dto.d.ts.map +1 -1
- package/dist/appointments/appointment-procedure.dto.js +22 -0
- package/dist/appointments/appointment-status.dto.d.ts +8 -1
- package/dist/appointments/appointment-status.dto.d.ts.map +1 -1
- package/dist/appointments/appointment-status.dto.js +8 -1
- package/dist/appointments/appointment.dto.d.ts +8 -1
- package/dist/appointments/appointment.dto.d.ts.map +1 -1
- package/dist/appointments/create-appointment.dto.d.ts +4 -1
- package/dist/appointments/create-appointment.dto.d.ts.map +1 -1
- package/dist/appointments/create-appointment.dto.js +31 -0
- package/dist/conversations/conversation-intention.dto.d.ts +7 -0
- package/dist/conversations/conversation-intention.dto.d.ts.map +1 -0
- package/dist/conversations/conversation-intention.dto.js +25 -0
- package/dist/conversations/conversation-session-response.dto.d.ts +2 -0
- package/dist/conversations/conversation-session-response.dto.d.ts.map +1 -1
- package/dist/conversations/conversation-session-response.dto.js +12 -0
- package/dist/conversations/followup-config-response.dto.d.ts +31 -0
- package/dist/conversations/followup-config-response.dto.d.ts.map +1 -0
- package/dist/conversations/followup-config-response.dto.js +195 -0
- package/dist/conversations/followup-log-response.dto.d.ts +18 -0
- package/dist/conversations/followup-log-response.dto.d.ts.map +1 -0
- package/dist/conversations/followup-log-response.dto.js +96 -0
- package/dist/conversations/followup-type.dto.d.ts +14 -0
- package/dist/conversations/followup-type.dto.d.ts.map +1 -0
- package/dist/conversations/followup-type.dto.js +23 -0
- package/dist/conversations/index.d.ts +4 -0
- package/dist/conversations/index.d.ts.map +1 -1
- package/dist/conversations/index.js +4 -0
- package/dist/patients/index.d.ts +1 -0
- package/dist/patients/index.d.ts.map +1 -1
- package/dist/patients/index.js +1 -0
- package/dist/patients/patient-status.dto.d.ts +9 -0
- package/dist/patients/patient-status.dto.d.ts.map +1 -0
- package/dist/patients/patient-status.dto.js +10 -0
- package/package.json +1 -1
- package/src/appointments/appointment-procedure.dto.ts +18 -0
- package/src/appointments/appointment-status.dto.ts +10 -1
- package/src/appointments/appointment.dto.ts +20 -1
- package/src/appointments/create-appointment.dto.ts +31 -1
- package/src/conversations/conversation-intention.dto.ts +24 -0
- package/src/conversations/conversation-session-response.dto.ts +11 -1
- package/src/conversations/followup-config-response.dto.ts +145 -0
- package/src/conversations/followup-log-response.dto.ts +63 -0
- package/src/conversations/followup-type.dto.ts +22 -0
- package/src/conversations/index.ts +4 -0
- package/src/patients/index.ts +1 -0
- package/src/patients/patient-status.dto.ts +9 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appointment-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-procedure.dto.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,qBAAa,uBAAuB;IASlC,IAAI,EAAE,MAAM,CAAC;IAOb,KAAK,EAAE,MAAM,CAAC;IAOd,QAAQ,EAAE,OAAO,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAU5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
|
|
1
|
+
{"version":3,"file":"appointment-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-procedure.dto.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,qBAAa,uBAAuB;IASlC,IAAI,EAAE,MAAM,CAAC;IAOb,KAAK,EAAE,MAAM,CAAC;IAOd,QAAQ,EAAE,OAAO,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAU5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAU5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ7B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
|
|
@@ -22,6 +22,8 @@ class AppointmentProcedureDto {
|
|
|
22
22
|
finished;
|
|
23
23
|
finished_at;
|
|
24
24
|
observation;
|
|
25
|
+
side_effects;
|
|
26
|
+
return_days;
|
|
25
27
|
}
|
|
26
28
|
exports.AppointmentProcedureDto = AppointmentProcedureDto;
|
|
27
29
|
__decorate([
|
|
@@ -71,3 +73,23 @@ __decorate([
|
|
|
71
73
|
(0, class_validator_1.MaxLength)(2000),
|
|
72
74
|
__metadata("design:type", Object)
|
|
73
75
|
], AppointmentProcedureDto.prototype, "observation", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
78
|
+
description: 'Known side effects of the procedure (used for wellness follow-up after appointment)',
|
|
79
|
+
example: 'Possivel inchaço na area tratada, sensibilidade ao toque por 24-48h',
|
|
80
|
+
maxLength: 2000,
|
|
81
|
+
}),
|
|
82
|
+
(0, class_validator_1.IsString)(),
|
|
83
|
+
(0, class_validator_1.IsOptional)(),
|
|
84
|
+
(0, class_validator_1.MaxLength)(2000),
|
|
85
|
+
__metadata("design:type", Object)
|
|
86
|
+
], AppointmentProcedureDto.prototype, "side_effects", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
89
|
+
description: 'Recommended number of days until a return visit',
|
|
90
|
+
example: 30,
|
|
91
|
+
}),
|
|
92
|
+
(0, class_validator_1.IsOptional)(),
|
|
93
|
+
(0, class_validator_1.IsNumber)({ maxDecimalPlaces: 0 }),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], AppointmentProcedureDto.prototype, "return_days", void 0);
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
export declare const APPOINTMENT_STATUSES: readonly ["pending", "processing", "sended", "finished", "canceled"];
|
|
1
|
+
export declare const APPOINTMENT_STATUSES: readonly ["pending", "processing", "sended", "finished", "canceled", "no_show"];
|
|
2
2
|
export type AppointmentStatusDto = (typeof APPOINTMENT_STATUSES)[number];
|
|
3
|
+
/**
|
|
4
|
+
* Appointment types to differentiate regular appointments from return visits.
|
|
5
|
+
* - "regular" → standard appointment with procedures.
|
|
6
|
+
* - "return" → follow-up return visit linked to a previous appointment.
|
|
7
|
+
*/
|
|
8
|
+
export declare const APPOINTMENT_TYPES: readonly ["regular", "return"];
|
|
9
|
+
export type AppointmentTypeDto = (typeof APPOINTMENT_TYPES)[number];
|
|
3
10
|
//# sourceMappingURL=appointment-status.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appointment-status.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-status.dto.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"appointment-status.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-status.dto.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,iFAOvB,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gCAAiC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.APPOINTMENT_STATUSES = void 0;
|
|
3
|
+
exports.APPOINTMENT_TYPES = exports.APPOINTMENT_STATUSES = void 0;
|
|
4
4
|
exports.APPOINTMENT_STATUSES = [
|
|
5
5
|
'pending',
|
|
6
6
|
'processing',
|
|
7
7
|
'sended',
|
|
8
8
|
'finished',
|
|
9
9
|
'canceled',
|
|
10
|
+
'no_show',
|
|
10
11
|
];
|
|
12
|
+
/**
|
|
13
|
+
* Appointment types to differentiate regular appointments from return visits.
|
|
14
|
+
* - "regular" → standard appointment with procedures.
|
|
15
|
+
* - "return" → follow-up return visit linked to a previous appointment.
|
|
16
|
+
*/
|
|
17
|
+
exports.APPOINTMENT_TYPES = ['regular', 'return'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppointmentStatusDto } from "./appointment-status.dto";
|
|
1
|
+
import { AppointmentStatusDto, AppointmentTypeDto } from "./appointment-status.dto";
|
|
2
2
|
/** Procedure as returned nested inside an appointment response. */
|
|
3
3
|
export interface AppointmentProcedureResponseDto {
|
|
4
4
|
id: string;
|
|
@@ -8,6 +8,10 @@ export interface AppointmentProcedureResponseDto {
|
|
|
8
8
|
finished: boolean;
|
|
9
9
|
finishedAt: string | null;
|
|
10
10
|
observation: string | null;
|
|
11
|
+
/** Known side effects of the procedure (used for wellness follow-up). */
|
|
12
|
+
sideEffects: string | null;
|
|
13
|
+
/** Recommended number of days until a return visit (used for return follow-up). */
|
|
14
|
+
returnDays: number | null;
|
|
11
15
|
createdAt?: string;
|
|
12
16
|
updatedAt?: string;
|
|
13
17
|
}
|
|
@@ -22,6 +26,9 @@ export interface AppointmentDto {
|
|
|
22
26
|
observation?: string;
|
|
23
27
|
cancellationReason?: string;
|
|
24
28
|
status: AppointmentStatusDto;
|
|
29
|
+
appointmentType: AppointmentTypeDto;
|
|
30
|
+
rescheduledFromId?: string;
|
|
31
|
+
returnFromAppointmentId?: string;
|
|
25
32
|
procedures?: AppointmentProcedureResponseDto[];
|
|
26
33
|
}
|
|
27
34
|
//# sourceMappingURL=appointment.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEpF,mEAAmE;AACnE,MAAM,WAAW,+BAA+B;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,yEAAyE;IACzE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mFAAmF;IACnF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IAMX,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAKf,IAAI,EAAE,MAAM,CAAC;IAKb,gBAAgB,EAAE,OAAO,CAAC;IAK1B,iBAAiB,EAAE,OAAO,CAAC;IAK3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,MAAM,EAAE,oBAAoB,CAAC;IAK7B,eAAe,EAAE,kBAAkB,CAAC;IAKpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAK3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAIjC,UAAU,CAAC,EAAE,+BAA+B,EAAE,CAAC;CAChD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppointmentStatusDto } from './appointment-status.dto';
|
|
1
|
+
import { AppointmentStatusDto, AppointmentTypeDto } from './appointment-status.dto';
|
|
2
2
|
export declare class CreateAppointmentDto {
|
|
3
3
|
patientId: string;
|
|
4
4
|
date: string;
|
|
@@ -9,5 +9,8 @@ export declare class CreateAppointmentDto {
|
|
|
9
9
|
observation?: string;
|
|
10
10
|
cancellationReason?: string;
|
|
11
11
|
status?: AppointmentStatusDto;
|
|
12
|
+
appointmentType?: AppointmentTypeDto;
|
|
13
|
+
rescheduledFromId?: string;
|
|
14
|
+
returnFromAppointmentId?: string;
|
|
12
15
|
}
|
|
13
16
|
//# sourceMappingURL=create-appointment.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAIlC,qBAAa,oBAAoB;IAO/B,SAAS,EAAE,MAAM,CAAC;IAOlB,IAAI,EAAE,MAAM,CAAC;IAQb,MAAM,EAAE,MAAM,CAAC;IASf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAS3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAQ5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAS5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAS9B,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAQrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAQ3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC"}
|
|
@@ -23,6 +23,9 @@ class CreateAppointmentDto {
|
|
|
23
23
|
observation;
|
|
24
24
|
cancellationReason;
|
|
25
25
|
status;
|
|
26
|
+
appointmentType;
|
|
27
|
+
rescheduledFromId;
|
|
28
|
+
returnFromAppointmentId;
|
|
26
29
|
}
|
|
27
30
|
exports.CreateAppointmentDto = CreateAppointmentDto;
|
|
28
31
|
__decorate([
|
|
@@ -108,3 +111,31 @@ __decorate([
|
|
|
108
111
|
(0, class_validator_1.IsEnum)(appointment_status_dto_1.APPOINTMENT_STATUSES),
|
|
109
112
|
__metadata("design:type", String)
|
|
110
113
|
], CreateAppointmentDto.prototype, "status", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
116
|
+
description: 'Tipo do agendamento (regular ou retorno)',
|
|
117
|
+
enum: appointment_status_dto_1.APPOINTMENT_TYPES,
|
|
118
|
+
default: 'regular',
|
|
119
|
+
}),
|
|
120
|
+
(0, class_validator_1.IsOptional)(),
|
|
121
|
+
(0, class_validator_1.IsEnum)(appointment_status_dto_1.APPOINTMENT_TYPES),
|
|
122
|
+
__metadata("design:type", String)
|
|
123
|
+
], CreateAppointmentDto.prototype, "appointmentType", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
126
|
+
description: 'UUID do agendamento original que foi reagendado (se for reagendamento)',
|
|
127
|
+
example: '550e8400-e29b-41d4-a716-446655440003',
|
|
128
|
+
}),
|
|
129
|
+
(0, class_validator_1.IsOptional)(),
|
|
130
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], CreateAppointmentDto.prototype, "rescheduledFromId", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
135
|
+
description: 'UUID do agendamento original ao qual este retorno está vinculado',
|
|
136
|
+
example: '550e8400-e29b-41d4-a716-446655440004',
|
|
137
|
+
}),
|
|
138
|
+
(0, class_validator_1.IsOptional)(),
|
|
139
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
140
|
+
__metadata("design:type", String)
|
|
141
|
+
], CreateAppointmentDto.prototype, "returnFromAppointmentId", void 0);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All possible user intention types detected by the AI during a conversation.
|
|
3
|
+
* Used to drive follow-up logic when the user becomes inactive.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CONVERSATION_INTENTIONS: readonly ["greeting", "ask_services", "ask_prices", "ask_availability", "select_service", "provide_datetime", "confirm_appointment", "reject_appointment", "provide_data", "reschedule", "cancel_appointment", "check_appointment", "clinic_info", "human_handoff", "out_of_scope", "unclear"];
|
|
6
|
+
export type ConversationIntentionDto = (typeof CONVERSATION_INTENTIONS)[number];
|
|
7
|
+
//# sourceMappingURL=conversation-intention.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-intention.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-intention.dto.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gSAiB1B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONVERSATION_INTENTIONS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* All possible user intention types detected by the AI during a conversation.
|
|
6
|
+
* Used to drive follow-up logic when the user becomes inactive.
|
|
7
|
+
*/
|
|
8
|
+
exports.CONVERSATION_INTENTIONS = [
|
|
9
|
+
'greeting',
|
|
10
|
+
'ask_services',
|
|
11
|
+
'ask_prices',
|
|
12
|
+
'ask_availability',
|
|
13
|
+
'select_service',
|
|
14
|
+
'provide_datetime',
|
|
15
|
+
'confirm_appointment',
|
|
16
|
+
'reject_appointment',
|
|
17
|
+
'provide_data',
|
|
18
|
+
'reschedule',
|
|
19
|
+
'cancel_appointment',
|
|
20
|
+
'check_appointment',
|
|
21
|
+
'clinic_info',
|
|
22
|
+
'human_handoff',
|
|
23
|
+
'out_of_scope',
|
|
24
|
+
'unclear',
|
|
25
|
+
];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConversationIntentionDto } from './conversation-intention.dto';
|
|
1
2
|
/**
|
|
2
3
|
* Represents a conversation session record returned by the API.
|
|
3
4
|
* A session is valid for 24 hours from its start time.
|
|
@@ -8,6 +9,7 @@ export declare class ConversationSessionResponseDto {
|
|
|
8
9
|
tenant: string;
|
|
9
10
|
patientId: string;
|
|
10
11
|
unitId?: number;
|
|
12
|
+
intention?: ConversationIntentionDto;
|
|
11
13
|
startedAt: string;
|
|
12
14
|
expiresAt: string;
|
|
13
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-session-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-session-response.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation-session-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-session-response.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2B,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAEjG;;;GAGG;AACH,qBAAa,8BAA8B;IAIzC,EAAE,EAAE,MAAM,CAAC;IAQX,WAAW,EAAE,MAAM,CAAC;IAKpB,MAAM,EAAE,MAAM,CAAC;IASf,SAAS,EAAE,MAAM,CAAC;IAIlB,MAAM,CAAC,EAAE,MAAM,CAAC;IAShB,SAAS,CAAC,EAAE,wBAAwB,CAAC;IAQrC,SAAS,EAAE,MAAM,CAAC;IAQlB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ConversationSessionResponseDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const conversation_intention_dto_1 = require("./conversation-intention.dto");
|
|
15
16
|
/**
|
|
16
17
|
* Represents a conversation session record returned by the API.
|
|
17
18
|
* A session is valid for 24 hours from its start time.
|
|
@@ -22,6 +23,7 @@ class ConversationSessionResponseDto {
|
|
|
22
23
|
tenant;
|
|
23
24
|
patientId;
|
|
24
25
|
unitId;
|
|
26
|
+
intention;
|
|
25
27
|
startedAt;
|
|
26
28
|
expiresAt;
|
|
27
29
|
}
|
|
@@ -62,6 +64,16 @@ __decorate([
|
|
|
62
64
|
(0, class_validator_1.IsOptional)(),
|
|
63
65
|
__metadata("design:type", Number)
|
|
64
66
|
], ConversationSessionResponseDto.prototype, "unitId", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
69
|
+
description: 'User intention detected by the AI for this session',
|
|
70
|
+
enum: conversation_intention_dto_1.CONVERSATION_INTENTIONS,
|
|
71
|
+
example: 'ask_services',
|
|
72
|
+
}),
|
|
73
|
+
(0, class_validator_1.IsOptional)(),
|
|
74
|
+
(0, class_validator_1.IsEnum)(conversation_intention_dto_1.CONVERSATION_INTENTIONS),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], ConversationSessionResponseDto.prototype, "intention", void 0);
|
|
65
77
|
__decorate([
|
|
66
78
|
(0, swagger_1.ApiProperty)({
|
|
67
79
|
description: 'Session start timestamp (ISO 8601)',
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a follow-up timing configuration for a tenant.
|
|
3
|
+
* Defines timing and enabled flags for all follow-up types:
|
|
4
|
+
* abandonment, appointment confirmation, satisfaction surveys,
|
|
5
|
+
* no-show reschedule, wellness check, and return suggestion.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FollowupConfigResponseDto {
|
|
8
|
+
id: string;
|
|
9
|
+
tenant: string;
|
|
10
|
+
unitId?: number;
|
|
11
|
+
abandonmentThresholdMinutes: number;
|
|
12
|
+
followup1DelayMinutes: number;
|
|
13
|
+
followup2DelayMinutes: number;
|
|
14
|
+
followup3DelayMinutes: number;
|
|
15
|
+
followup4DelayMinutes: number;
|
|
16
|
+
followup5DelayMinutes: number;
|
|
17
|
+
confirmationMinutesBefore: number;
|
|
18
|
+
confirmationEnabled: boolean;
|
|
19
|
+
satisfactionBookingDelayMinutes: number;
|
|
20
|
+
satisfactionBookingEnabled: boolean;
|
|
21
|
+
satisfactionFinishedDelayMinutes: number;
|
|
22
|
+
satisfactionFinishedEnabled: boolean;
|
|
23
|
+
noShowDelayMinutes: number;
|
|
24
|
+
noShowEnabled: boolean;
|
|
25
|
+
wellnessCheckDelayMinutes: number;
|
|
26
|
+
wellnessCheckEnabled: boolean;
|
|
27
|
+
returnSuggestionDelayMinutes: number;
|
|
28
|
+
returnSuggestionEnabled: boolean;
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=followup-config-response.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followup-config-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-config-response.dto.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,qBAAa,yBAAyB;IAIpC,EAAE,EAAE,MAAM,CAAC;IAKX,MAAM,EAAE,MAAM,CAAC;IAMf,MAAM,CAAC,EAAE,MAAM,CAAC;IAYhB,2BAA2B,EAAE,MAAM,CAAC;IAKpC,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAS9B,yBAAyB,EAAE,MAAM,CAAC;IAIlC,mBAAmB,EAAE,OAAO,CAAC;IAS7B,+BAA+B,EAAE,MAAM,CAAC;IAIxC,0BAA0B,EAAE,OAAO,CAAC;IAKpC,gCAAgC,EAAE,MAAM,CAAC;IAIzC,2BAA2B,EAAE,OAAO,CAAC;IASrC,kBAAkB,EAAE,MAAM,CAAC;IAI3B,aAAa,EAAE,OAAO,CAAC;IASvB,yBAAyB,EAAE,MAAM,CAAC;IAIlC,oBAAoB,EAAE,OAAO,CAAC;IAS9B,4BAA4B,EAAE,MAAM,CAAC;IAIrC,uBAAuB,EAAE,OAAO,CAAC;IAQjC,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1,195 @@
|
|
|
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.FollowupConfigResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Represents a follow-up timing configuration for a tenant.
|
|
17
|
+
* Defines timing and enabled flags for all follow-up types:
|
|
18
|
+
* abandonment, appointment confirmation, satisfaction surveys,
|
|
19
|
+
* no-show reschedule, wellness check, and return suggestion.
|
|
20
|
+
*/
|
|
21
|
+
class FollowupConfigResponseDto {
|
|
22
|
+
id;
|
|
23
|
+
tenant;
|
|
24
|
+
unitId;
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Abandonment follow-up settings
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
abandonmentThresholdMinutes;
|
|
29
|
+
followup1DelayMinutes;
|
|
30
|
+
followup2DelayMinutes;
|
|
31
|
+
followup3DelayMinutes;
|
|
32
|
+
followup4DelayMinutes;
|
|
33
|
+
followup5DelayMinutes;
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// Appointment confirmation settings
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
confirmationMinutesBefore;
|
|
38
|
+
confirmationEnabled;
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Satisfaction survey settings
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
satisfactionBookingDelayMinutes;
|
|
43
|
+
satisfactionBookingEnabled;
|
|
44
|
+
satisfactionFinishedDelayMinutes;
|
|
45
|
+
satisfactionFinishedEnabled;
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// No-show reschedule settings
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
noShowDelayMinutes;
|
|
50
|
+
noShowEnabled;
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
// Wellness check settings
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
wellnessCheckDelayMinutes;
|
|
55
|
+
wellnessCheckEnabled;
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
// Return suggestion settings
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
returnSuggestionDelayMinutes;
|
|
60
|
+
returnSuggestionEnabled;
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Global setting
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
enabled;
|
|
65
|
+
}
|
|
66
|
+
exports.FollowupConfigResponseDto = FollowupConfigResponseDto;
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, swagger_1.ApiProperty)({ description: 'Config primary key (UUID)' }),
|
|
69
|
+
(0, class_validator_1.IsString)(),
|
|
70
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], FollowupConfigResponseDto.prototype, "id", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, swagger_1.ApiProperty)({ description: 'Tenant slug', example: 'clinic-alpha' }),
|
|
75
|
+
(0, class_validator_1.IsString)(),
|
|
76
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], FollowupConfigResponseDto.prototype, "tenant", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Tenant unit id', example: 1 }),
|
|
81
|
+
(0, class_validator_1.IsOptional)(),
|
|
82
|
+
(0, class_validator_1.IsInt)(),
|
|
83
|
+
(0, class_validator_1.Min)(1),
|
|
84
|
+
__metadata("design:type", Number)
|
|
85
|
+
], FollowupConfigResponseDto.prototype, "unitId", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, swagger_1.ApiProperty)({
|
|
88
|
+
description: 'Minutes since last AI/human message to consider the session as abandoned',
|
|
89
|
+
example: 30,
|
|
90
|
+
}),
|
|
91
|
+
(0, class_validator_1.IsInt)(),
|
|
92
|
+
(0, class_validator_1.Min)(1),
|
|
93
|
+
__metadata("design:type", Number)
|
|
94
|
+
], FollowupConfigResponseDto.prototype, "abandonmentThresholdMinutes", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes to wait before sending follow-up #1 after abandonment', example: 5 }),
|
|
97
|
+
(0, class_validator_1.IsInt)(),
|
|
98
|
+
(0, class_validator_1.Min)(1),
|
|
99
|
+
__metadata("design:type", Number)
|
|
100
|
+
], FollowupConfigResponseDto.prototype, "followup1DelayMinutes", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes to wait before sending follow-up #2 after #1', example: 15 }),
|
|
103
|
+
(0, class_validator_1.IsInt)(),
|
|
104
|
+
(0, class_validator_1.Min)(1),
|
|
105
|
+
__metadata("design:type", Number)
|
|
106
|
+
], FollowupConfigResponseDto.prototype, "followup2DelayMinutes", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes to wait before sending follow-up #3 after #2', example: 60 }),
|
|
109
|
+
(0, class_validator_1.IsInt)(),
|
|
110
|
+
(0, class_validator_1.Min)(1),
|
|
111
|
+
__metadata("design:type", Number)
|
|
112
|
+
], FollowupConfigResponseDto.prototype, "followup3DelayMinutes", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes to wait before sending follow-up #4 after #3', example: 1440 }),
|
|
115
|
+
(0, class_validator_1.IsInt)(),
|
|
116
|
+
(0, class_validator_1.Min)(1),
|
|
117
|
+
__metadata("design:type", Number)
|
|
118
|
+
], FollowupConfigResponseDto.prototype, "followup4DelayMinutes", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes to wait before sending follow-up #5 (final) after #4', example: 2880 }),
|
|
121
|
+
(0, class_validator_1.IsInt)(),
|
|
122
|
+
(0, class_validator_1.Min)(1),
|
|
123
|
+
__metadata("design:type", Number)
|
|
124
|
+
], FollowupConfigResponseDto.prototype, "followup5DelayMinutes", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes before the appointment to send the confirmation reminder', example: 60 }),
|
|
127
|
+
(0, class_validator_1.IsInt)(),
|
|
128
|
+
(0, class_validator_1.Min)(1),
|
|
129
|
+
__metadata("design:type", Number)
|
|
130
|
+
], FollowupConfigResponseDto.prototype, "confirmationMinutesBefore", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether appointment confirmation follow-up is enabled' }),
|
|
133
|
+
(0, class_validator_1.IsBoolean)(),
|
|
134
|
+
__metadata("design:type", Boolean)
|
|
135
|
+
], FollowupConfigResponseDto.prototype, "confirmationEnabled", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes after booking confirmation to send the satisfaction survey', example: 10 }),
|
|
138
|
+
(0, class_validator_1.IsInt)(),
|
|
139
|
+
(0, class_validator_1.Min)(1),
|
|
140
|
+
__metadata("design:type", Number)
|
|
141
|
+
], FollowupConfigResponseDto.prototype, "satisfactionBookingDelayMinutes", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether satisfaction survey after booking is enabled' }),
|
|
144
|
+
(0, class_validator_1.IsBoolean)(),
|
|
145
|
+
__metadata("design:type", Boolean)
|
|
146
|
+
], FollowupConfigResponseDto.prototype, "satisfactionBookingEnabled", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes after appointment finishes to send the satisfaction survey', example: 30 }),
|
|
149
|
+
(0, class_validator_1.IsInt)(),
|
|
150
|
+
(0, class_validator_1.Min)(1),
|
|
151
|
+
__metadata("design:type", Number)
|
|
152
|
+
], FollowupConfigResponseDto.prototype, "satisfactionFinishedDelayMinutes", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether satisfaction survey after finished appointment is enabled' }),
|
|
155
|
+
(0, class_validator_1.IsBoolean)(),
|
|
156
|
+
__metadata("design:type", Boolean)
|
|
157
|
+
], FollowupConfigResponseDto.prototype, "satisfactionFinishedEnabled", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes after a no-show to send the reschedule follow-up', example: 60 }),
|
|
160
|
+
(0, class_validator_1.IsInt)(),
|
|
161
|
+
(0, class_validator_1.Min)(1),
|
|
162
|
+
__metadata("design:type", Number)
|
|
163
|
+
], FollowupConfigResponseDto.prototype, "noShowDelayMinutes", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether no-show follow-up is enabled' }),
|
|
166
|
+
(0, class_validator_1.IsBoolean)(),
|
|
167
|
+
__metadata("design:type", Boolean)
|
|
168
|
+
], FollowupConfigResponseDto.prototype, "noShowEnabled", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes after appointment finishes to send the wellness check', example: 1440 }),
|
|
171
|
+
(0, class_validator_1.IsInt)(),
|
|
172
|
+
(0, class_validator_1.Min)(1),
|
|
173
|
+
__metadata("design:type", Number)
|
|
174
|
+
], FollowupConfigResponseDto.prototype, "wellnessCheckDelayMinutes", void 0);
|
|
175
|
+
__decorate([
|
|
176
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether wellness check follow-up is enabled' }),
|
|
177
|
+
(0, class_validator_1.IsBoolean)(),
|
|
178
|
+
__metadata("design:type", Boolean)
|
|
179
|
+
], FollowupConfigResponseDto.prototype, "wellnessCheckEnabled", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, swagger_1.ApiProperty)({ description: 'Minutes after appointment finishes to send the return suggestion', example: 2880 }),
|
|
182
|
+
(0, class_validator_1.IsInt)(),
|
|
183
|
+
(0, class_validator_1.Min)(1),
|
|
184
|
+
__metadata("design:type", Number)
|
|
185
|
+
], FollowupConfigResponseDto.prototype, "returnSuggestionDelayMinutes", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether return suggestion follow-up is enabled' }),
|
|
188
|
+
(0, class_validator_1.IsBoolean)(),
|
|
189
|
+
__metadata("design:type", Boolean)
|
|
190
|
+
], FollowupConfigResponseDto.prototype, "returnSuggestionEnabled", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether abandonment follow-up is enabled for this tenant' }),
|
|
193
|
+
(0, class_validator_1.IsBoolean)(),
|
|
194
|
+
__metadata("design:type", Boolean)
|
|
195
|
+
], FollowupConfigResponseDto.prototype, "enabled", void 0);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FollowupTypeDto } from './followup-type.dto';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a follow-up attempt log entry.
|
|
4
|
+
* Tracks each follow-up message sent to a patient within a session or appointment.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FollowupLogResponseDto {
|
|
7
|
+
id: string;
|
|
8
|
+
tenant: string;
|
|
9
|
+
sessionUuid?: string | null;
|
|
10
|
+
patientId: string;
|
|
11
|
+
attempt: number;
|
|
12
|
+
message: string;
|
|
13
|
+
intention?: string;
|
|
14
|
+
followupType: FollowupTypeDto;
|
|
15
|
+
appointmentId?: string | null;
|
|
16
|
+
sentAt: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=followup-log-response.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followup-log-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-log-response.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;;GAGG;AACH,qBAAa,sBAAsB;IAIjC,EAAE,EAAE,MAAM,CAAC;IAKX,MAAM,EAAE,MAAM,CAAC;IAKf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAK5B,SAAS,EAAE,MAAM,CAAC;IAMlB,OAAO,EAAE,MAAM,CAAC;IAKhB,OAAO,EAAE,MAAM,CAAC;IAKhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,YAAY,EAAE,eAAe,CAAC;IAK9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAK9B,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
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.FollowupLogResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const followup_type_dto_1 = require("./followup-type.dto");
|
|
16
|
+
/**
|
|
17
|
+
* Represents a follow-up attempt log entry.
|
|
18
|
+
* Tracks each follow-up message sent to a patient within a session or appointment.
|
|
19
|
+
*/
|
|
20
|
+
class FollowupLogResponseDto {
|
|
21
|
+
id;
|
|
22
|
+
tenant;
|
|
23
|
+
sessionUuid;
|
|
24
|
+
patientId;
|
|
25
|
+
attempt;
|
|
26
|
+
message;
|
|
27
|
+
intention;
|
|
28
|
+
followupType;
|
|
29
|
+
appointmentId;
|
|
30
|
+
sentAt;
|
|
31
|
+
}
|
|
32
|
+
exports.FollowupLogResponseDto = FollowupLogResponseDto;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiProperty)({ description: 'Log primary key (UUID)' }),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], FollowupLogResponseDto.prototype, "id", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({ description: 'Tenant slug', example: 'clinic-alpha' }),
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], FollowupLogResponseDto.prototype, "tenant", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Session UUID from conversation_sessions (null for appointment-based)' }),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
(0, class_validator_1.IsString)(),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], FollowupLogResponseDto.prototype, "sessionUuid", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, swagger_1.ApiProperty)({ description: 'Patient UUID' }),
|
|
53
|
+
(0, class_validator_1.IsString)(),
|
|
54
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], FollowupLogResponseDto.prototype, "patientId", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, swagger_1.ApiProperty)({ description: 'Follow-up attempt number (1-5 for abandonment, 1 for appointment-based)', example: 1 }),
|
|
59
|
+
(0, class_validator_1.IsInt)(),
|
|
60
|
+
(0, class_validator_1.Min)(1),
|
|
61
|
+
(0, class_validator_1.Max)(5),
|
|
62
|
+
__metadata("design:type", Number)
|
|
63
|
+
], FollowupLogResponseDto.prototype, "attempt", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, swagger_1.ApiProperty)({ description: 'The follow-up message sent to the patient' }),
|
|
66
|
+
(0, class_validator_1.IsString)(),
|
|
67
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], FollowupLogResponseDto.prototype, "message", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'The intention detected at the time of follow-up' }),
|
|
72
|
+
(0, class_validator_1.IsOptional)(),
|
|
73
|
+
(0, class_validator_1.IsString)(),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], FollowupLogResponseDto.prototype, "intention", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, swagger_1.ApiProperty)({
|
|
78
|
+
description: 'Type of follow-up',
|
|
79
|
+
enum: followup_type_dto_1.FOLLOWUP_TYPES,
|
|
80
|
+
example: 'abandonment',
|
|
81
|
+
}),
|
|
82
|
+
(0, class_validator_1.IsIn)(followup_type_dto_1.FOLLOWUP_TYPES),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], FollowupLogResponseDto.prototype, "followupType", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Appointment UUID (for appointment-based follow-ups)' }),
|
|
87
|
+
(0, class_validator_1.IsOptional)(),
|
|
88
|
+
(0, class_validator_1.IsString)(),
|
|
89
|
+
__metadata("design:type", Object)
|
|
90
|
+
], FollowupLogResponseDto.prototype, "appointmentId", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, swagger_1.ApiProperty)({ description: 'Timestamp when the follow-up was sent (ISO 8601)' }),
|
|
93
|
+
(0, class_validator_1.IsString)(),
|
|
94
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], FollowupLogResponseDto.prototype, "sentAt", void 0);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All follow-up types supported by the follow-up service.
|
|
3
|
+
*
|
|
4
|
+
* - "abandonment" → Patient stopped responding during a conversation.
|
|
5
|
+
* - "appointment_confirmation" → Reminder sent before an upcoming appointment.
|
|
6
|
+
* - "satisfaction_booking" → Satisfaction survey after the patient books an appointment.
|
|
7
|
+
* - "satisfaction_finished" → Satisfaction survey after an appointment is marked as finished.
|
|
8
|
+
* - "no_show_reschedule" → Follow-up for patients who did not show up (no_show status).
|
|
9
|
+
* - "wellness_check" → Check on patient well-being after procedures (side effects).
|
|
10
|
+
* - "return_suggestion" → Suggest a return visit based on procedure return_days.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FOLLOWUP_TYPES: readonly ["abandonment", "appointment_confirmation", "satisfaction_booking", "satisfaction_finished", "no_show_reschedule", "wellness_check", "return_suggestion"];
|
|
13
|
+
export type FollowupTypeDto = (typeof FOLLOWUP_TYPES)[number];
|
|
14
|
+
//# sourceMappingURL=followup-type.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followup-type.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-type.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,oKAQjB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FOLLOWUP_TYPES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* All follow-up types supported by the follow-up service.
|
|
6
|
+
*
|
|
7
|
+
* - "abandonment" → Patient stopped responding during a conversation.
|
|
8
|
+
* - "appointment_confirmation" → Reminder sent before an upcoming appointment.
|
|
9
|
+
* - "satisfaction_booking" → Satisfaction survey after the patient books an appointment.
|
|
10
|
+
* - "satisfaction_finished" → Satisfaction survey after an appointment is marked as finished.
|
|
11
|
+
* - "no_show_reschedule" → Follow-up for patients who did not show up (no_show status).
|
|
12
|
+
* - "wellness_check" → Check on patient well-being after procedures (side effects).
|
|
13
|
+
* - "return_suggestion" → Suggest a return visit based on procedure return_days.
|
|
14
|
+
*/
|
|
15
|
+
exports.FOLLOWUP_TYPES = [
|
|
16
|
+
'abandonment',
|
|
17
|
+
'appointment_confirmation',
|
|
18
|
+
'satisfaction_booking',
|
|
19
|
+
'satisfaction_finished',
|
|
20
|
+
'no_show_reschedule',
|
|
21
|
+
'wellness_check',
|
|
22
|
+
'return_suggestion',
|
|
23
|
+
];
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from './conversation-type.dto';
|
|
2
|
+
export * from './conversation-intention.dto';
|
|
2
3
|
export * from './create-conversation-session.dto';
|
|
3
4
|
export * from './conversation-session-response.dto';
|
|
4
5
|
export * from './create-conversation.dto';
|
|
5
6
|
export * from './conversation-response.dto';
|
|
7
|
+
export * from './followup-type.dto';
|
|
8
|
+
export * from './followup-config-response.dto';
|
|
9
|
+
export * from './followup-log-response.dto';
|
|
6
10
|
//# 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,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,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,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC"}
|
|
@@ -15,7 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./conversation-type.dto"), exports);
|
|
18
|
+
__exportStar(require("./conversation-intention.dto"), exports);
|
|
18
19
|
__exportStar(require("./create-conversation-session.dto"), exports);
|
|
19
20
|
__exportStar(require("./conversation-session-response.dto"), exports);
|
|
20
21
|
__exportStar(require("./create-conversation.dto"), exports);
|
|
21
22
|
__exportStar(require("./conversation-response.dto"), exports);
|
|
23
|
+
__exportStar(require("./followup-type.dto"), exports);
|
|
24
|
+
__exportStar(require("./followup-config-response.dto"), exports);
|
|
25
|
+
__exportStar(require("./followup-log-response.dto"), exports);
|
package/dist/patients/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patients/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patients/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC"}
|
package/dist/patients/index.js
CHANGED
|
@@ -19,3 +19,4 @@ __exportStar(require("./update-patient.dto"), exports);
|
|
|
19
19
|
__exportStar(require("./patient-history-entry.dto"), exports);
|
|
20
20
|
__exportStar(require("./list-patients-query.dto"), exports);
|
|
21
21
|
__exportStar(require("./upsert-patient-by-phone.dto"), exports);
|
|
22
|
+
__exportStar(require("./patient-status.dto"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allowed patient engagement statuses.
|
|
3
|
+
* - "active" → patient is actively engaged in conversations.
|
|
4
|
+
* - "inactive" → patient stopped responding after all follow-up attempts.
|
|
5
|
+
* Reactivated automatically when the patient sends a new message.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PATIENT_STATUSES: readonly ["active", "inactive"];
|
|
8
|
+
export type PatientStatusDto = (typeof PATIENT_STATUSES)[number];
|
|
9
|
+
//# sourceMappingURL=patient-status.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patient-status.dto.d.ts","sourceRoot":"","sources":["../../src/patients/patient-status.dto.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,iCAAkC,CAAC;AAEhE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PATIENT_STATUSES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Allowed patient engagement statuses.
|
|
6
|
+
* - "active" → patient is actively engaged in conversations.
|
|
7
|
+
* - "inactive" → patient stopped responding after all follow-up attempts.
|
|
8
|
+
* Reactivated automatically when the patient sends a new message.
|
|
9
|
+
*/
|
|
10
|
+
exports.PATIENT_STATUSES = ['active', 'inactive'];
|
package/package.json
CHANGED
|
@@ -55,4 +55,22 @@ export class AppointmentProcedureDto {
|
|
|
55
55
|
@IsOptional()
|
|
56
56
|
@MaxLength(2000)
|
|
57
57
|
observation?: string | null;
|
|
58
|
+
|
|
59
|
+
@ApiPropertyOptional({
|
|
60
|
+
description: 'Known side effects of the procedure (used for wellness follow-up after appointment)',
|
|
61
|
+
example: 'Possivel inchaço na area tratada, sensibilidade ao toque por 24-48h',
|
|
62
|
+
maxLength: 2000,
|
|
63
|
+
})
|
|
64
|
+
@IsString()
|
|
65
|
+
@IsOptional()
|
|
66
|
+
@MaxLength(2000)
|
|
67
|
+
side_effects?: string | null;
|
|
68
|
+
|
|
69
|
+
@ApiPropertyOptional({
|
|
70
|
+
description: 'Recommended number of days until a return visit',
|
|
71
|
+
example: 30,
|
|
72
|
+
})
|
|
73
|
+
@IsOptional()
|
|
74
|
+
@IsNumber({ maxDecimalPlaces: 0 })
|
|
75
|
+
return_days?: number | null;
|
|
58
76
|
}
|
|
@@ -4,5 +4,14 @@ export const APPOINTMENT_STATUSES = [
|
|
|
4
4
|
'sended',
|
|
5
5
|
'finished',
|
|
6
6
|
'canceled',
|
|
7
|
+
'no_show',
|
|
7
8
|
] as const;
|
|
8
|
-
export type AppointmentStatusDto = (typeof APPOINTMENT_STATUSES)[number];
|
|
9
|
+
export type AppointmentStatusDto = (typeof APPOINTMENT_STATUSES)[number];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Appointment types to differentiate regular appointments from return visits.
|
|
13
|
+
* - "regular" → standard appointment with procedures.
|
|
14
|
+
* - "return" → follow-up return visit linked to a previous appointment.
|
|
15
|
+
*/
|
|
16
|
+
export const APPOINTMENT_TYPES = ['regular', 'return'] as const;
|
|
17
|
+
export type AppointmentTypeDto = (typeof APPOINTMENT_TYPES)[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppointmentStatusDto } from "./appointment-status.dto";
|
|
1
|
+
import { AppointmentStatusDto, AppointmentTypeDto } from "./appointment-status.dto";
|
|
2
2
|
|
|
3
3
|
/** Procedure as returned nested inside an appointment response. */
|
|
4
4
|
export interface AppointmentProcedureResponseDto {
|
|
@@ -9,6 +9,10 @@ export interface AppointmentProcedureResponseDto {
|
|
|
9
9
|
finished: boolean;
|
|
10
10
|
finishedAt: string | null;
|
|
11
11
|
observation: string | null;
|
|
12
|
+
/** Known side effects of the procedure (used for wellness follow-up). */
|
|
13
|
+
sideEffects: string | null;
|
|
14
|
+
/** Recommended number of days until a return visit (used for return follow-up). */
|
|
15
|
+
returnDays: number | null;
|
|
12
16
|
createdAt?: string;
|
|
13
17
|
updatedAt?: string;
|
|
14
18
|
}
|
|
@@ -62,6 +66,21 @@ export interface AppointmentDto {
|
|
|
62
66
|
*/
|
|
63
67
|
status: AppointmentStatusDto;
|
|
64
68
|
/*
|
|
69
|
+
* Type of the appointment (regular or return visit)
|
|
70
|
+
* @example 'regular'
|
|
71
|
+
*/
|
|
72
|
+
appointmentType: AppointmentTypeDto;
|
|
73
|
+
/*
|
|
74
|
+
* UUID of the original appointment this was rescheduled from (null if not a reschedule)
|
|
75
|
+
* @example '550e8400-e29b-41d4-a716-446655440003'
|
|
76
|
+
*/
|
|
77
|
+
rescheduledFromId?: string;
|
|
78
|
+
/*
|
|
79
|
+
* UUID of the original appointment this return visit is linked to (null if not a return)
|
|
80
|
+
* @example '550e8400-e29b-41d4-a716-446655440004'
|
|
81
|
+
*/
|
|
82
|
+
returnFromAppointmentId?: string;
|
|
83
|
+
/*
|
|
65
84
|
* Procedures linked to this appointment (loaded via relation)
|
|
66
85
|
*/
|
|
67
86
|
procedures?: AppointmentProcedureResponseDto[];
|
|
@@ -8,7 +8,12 @@ import {
|
|
|
8
8
|
IsString,
|
|
9
9
|
IsUUID,
|
|
10
10
|
} from 'class-validator';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
APPOINTMENT_STATUSES,
|
|
13
|
+
APPOINTMENT_TYPES,
|
|
14
|
+
AppointmentStatusDto,
|
|
15
|
+
AppointmentTypeDto,
|
|
16
|
+
} from './appointment-status.dto';
|
|
12
17
|
|
|
13
18
|
|
|
14
19
|
|
|
@@ -86,4 +91,29 @@ export class CreateAppointmentDto {
|
|
|
86
91
|
@IsOptional()
|
|
87
92
|
@IsEnum(APPOINTMENT_STATUSES)
|
|
88
93
|
status?: AppointmentStatusDto;
|
|
94
|
+
|
|
95
|
+
@ApiPropertyOptional({
|
|
96
|
+
description: 'Tipo do agendamento (regular ou retorno)',
|
|
97
|
+
enum: APPOINTMENT_TYPES,
|
|
98
|
+
default: 'regular',
|
|
99
|
+
})
|
|
100
|
+
@IsOptional()
|
|
101
|
+
@IsEnum(APPOINTMENT_TYPES)
|
|
102
|
+
appointmentType?: AppointmentTypeDto;
|
|
103
|
+
|
|
104
|
+
@ApiPropertyOptional({
|
|
105
|
+
description: 'UUID do agendamento original que foi reagendado (se for reagendamento)',
|
|
106
|
+
example: '550e8400-e29b-41d4-a716-446655440003',
|
|
107
|
+
})
|
|
108
|
+
@IsOptional()
|
|
109
|
+
@IsUUID('4')
|
|
110
|
+
rescheduledFromId?: string;
|
|
111
|
+
|
|
112
|
+
@ApiPropertyOptional({
|
|
113
|
+
description: 'UUID do agendamento original ao qual este retorno está vinculado',
|
|
114
|
+
example: '550e8400-e29b-41d4-a716-446655440004',
|
|
115
|
+
})
|
|
116
|
+
@IsOptional()
|
|
117
|
+
@IsUUID('4')
|
|
118
|
+
returnFromAppointmentId?: string;
|
|
89
119
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All possible user intention types detected by the AI during a conversation.
|
|
3
|
+
* Used to drive follow-up logic when the user becomes inactive.
|
|
4
|
+
*/
|
|
5
|
+
export const CONVERSATION_INTENTIONS = [
|
|
6
|
+
'greeting',
|
|
7
|
+
'ask_services',
|
|
8
|
+
'ask_prices',
|
|
9
|
+
'ask_availability',
|
|
10
|
+
'select_service',
|
|
11
|
+
'provide_datetime',
|
|
12
|
+
'confirm_appointment',
|
|
13
|
+
'reject_appointment',
|
|
14
|
+
'provide_data',
|
|
15
|
+
'reschedule',
|
|
16
|
+
'cancel_appointment',
|
|
17
|
+
'check_appointment',
|
|
18
|
+
'clinic_info',
|
|
19
|
+
'human_handoff',
|
|
20
|
+
'out_of_scope',
|
|
21
|
+
'unclear',
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
export type ConversationIntentionDto = (typeof CONVERSATION_INTENTIONS)[number];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import { IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';
|
|
2
|
+
import { IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';
|
|
3
|
+
import { CONVERSATION_INTENTIONS, ConversationIntentionDto } from './conversation-intention.dto';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Represents a conversation session record returned by the API.
|
|
@@ -37,6 +38,15 @@ export class ConversationSessionResponseDto {
|
|
|
37
38
|
@IsOptional()
|
|
38
39
|
unitId?: number;
|
|
39
40
|
|
|
41
|
+
@ApiPropertyOptional({
|
|
42
|
+
description: 'User intention detected by the AI for this session',
|
|
43
|
+
enum: CONVERSATION_INTENTIONS,
|
|
44
|
+
example: 'ask_services',
|
|
45
|
+
})
|
|
46
|
+
@IsOptional()
|
|
47
|
+
@IsEnum(CONVERSATION_INTENTIONS)
|
|
48
|
+
intention?: ConversationIntentionDto;
|
|
49
|
+
|
|
40
50
|
@ApiProperty({
|
|
41
51
|
description: 'Session start timestamp (ISO 8601)',
|
|
42
52
|
example: '2024-01-01T00:00:00.000Z',
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { IsBoolean, IsInt, IsNotEmpty, IsOptional, IsString, Min } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents a follow-up timing configuration for a tenant.
|
|
6
|
+
* Defines timing and enabled flags for all follow-up types:
|
|
7
|
+
* abandonment, appointment confirmation, satisfaction surveys,
|
|
8
|
+
* no-show reschedule, wellness check, and return suggestion.
|
|
9
|
+
*/
|
|
10
|
+
export class FollowupConfigResponseDto {
|
|
11
|
+
@ApiProperty({ description: 'Config primary key (UUID)' })
|
|
12
|
+
@IsString()
|
|
13
|
+
@IsNotEmpty()
|
|
14
|
+
id: string;
|
|
15
|
+
|
|
16
|
+
@ApiProperty({ description: 'Tenant slug', example: 'clinic-alpha' })
|
|
17
|
+
@IsString()
|
|
18
|
+
@IsNotEmpty()
|
|
19
|
+
tenant: string;
|
|
20
|
+
|
|
21
|
+
@ApiPropertyOptional({ description: 'Tenant unit id', example: 1 })
|
|
22
|
+
@IsOptional()
|
|
23
|
+
@IsInt()
|
|
24
|
+
@Min(1)
|
|
25
|
+
unitId?: number;
|
|
26
|
+
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
// Abandonment follow-up settings
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
@ApiProperty({
|
|
32
|
+
description: 'Minutes since last AI/human message to consider the session as abandoned',
|
|
33
|
+
example: 30,
|
|
34
|
+
})
|
|
35
|
+
@IsInt()
|
|
36
|
+
@Min(1)
|
|
37
|
+
abandonmentThresholdMinutes: number;
|
|
38
|
+
|
|
39
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #1 after abandonment', example: 5 })
|
|
40
|
+
@IsInt()
|
|
41
|
+
@Min(1)
|
|
42
|
+
followup1DelayMinutes: number;
|
|
43
|
+
|
|
44
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #2 after #1', example: 15 })
|
|
45
|
+
@IsInt()
|
|
46
|
+
@Min(1)
|
|
47
|
+
followup2DelayMinutes: number;
|
|
48
|
+
|
|
49
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #3 after #2', example: 60 })
|
|
50
|
+
@IsInt()
|
|
51
|
+
@Min(1)
|
|
52
|
+
followup3DelayMinutes: number;
|
|
53
|
+
|
|
54
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #4 after #3', example: 1440 })
|
|
55
|
+
@IsInt()
|
|
56
|
+
@Min(1)
|
|
57
|
+
followup4DelayMinutes: number;
|
|
58
|
+
|
|
59
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #5 (final) after #4', example: 2880 })
|
|
60
|
+
@IsInt()
|
|
61
|
+
@Min(1)
|
|
62
|
+
followup5DelayMinutes: number;
|
|
63
|
+
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// Appointment confirmation settings
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
|
|
68
|
+
@ApiProperty({ description: 'Minutes before the appointment to send the confirmation reminder', example: 60 })
|
|
69
|
+
@IsInt()
|
|
70
|
+
@Min(1)
|
|
71
|
+
confirmationMinutesBefore: number;
|
|
72
|
+
|
|
73
|
+
@ApiProperty({ description: 'Whether appointment confirmation follow-up is enabled' })
|
|
74
|
+
@IsBoolean()
|
|
75
|
+
confirmationEnabled: boolean;
|
|
76
|
+
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
// Satisfaction survey settings
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
|
|
81
|
+
@ApiProperty({ description: 'Minutes after booking confirmation to send the satisfaction survey', example: 10 })
|
|
82
|
+
@IsInt()
|
|
83
|
+
@Min(1)
|
|
84
|
+
satisfactionBookingDelayMinutes: number;
|
|
85
|
+
|
|
86
|
+
@ApiProperty({ description: 'Whether satisfaction survey after booking is enabled' })
|
|
87
|
+
@IsBoolean()
|
|
88
|
+
satisfactionBookingEnabled: boolean;
|
|
89
|
+
|
|
90
|
+
@ApiProperty({ description: 'Minutes after appointment finishes to send the satisfaction survey', example: 30 })
|
|
91
|
+
@IsInt()
|
|
92
|
+
@Min(1)
|
|
93
|
+
satisfactionFinishedDelayMinutes: number;
|
|
94
|
+
|
|
95
|
+
@ApiProperty({ description: 'Whether satisfaction survey after finished appointment is enabled' })
|
|
96
|
+
@IsBoolean()
|
|
97
|
+
satisfactionFinishedEnabled: boolean;
|
|
98
|
+
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// No-show reschedule settings
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
|
|
103
|
+
@ApiProperty({ description: 'Minutes after a no-show to send the reschedule follow-up', example: 60 })
|
|
104
|
+
@IsInt()
|
|
105
|
+
@Min(1)
|
|
106
|
+
noShowDelayMinutes: number;
|
|
107
|
+
|
|
108
|
+
@ApiProperty({ description: 'Whether no-show follow-up is enabled' })
|
|
109
|
+
@IsBoolean()
|
|
110
|
+
noShowEnabled: boolean;
|
|
111
|
+
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
// Wellness check settings
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
|
|
116
|
+
@ApiProperty({ description: 'Minutes after appointment finishes to send the wellness check', example: 1440 })
|
|
117
|
+
@IsInt()
|
|
118
|
+
@Min(1)
|
|
119
|
+
wellnessCheckDelayMinutes: number;
|
|
120
|
+
|
|
121
|
+
@ApiProperty({ description: 'Whether wellness check follow-up is enabled' })
|
|
122
|
+
@IsBoolean()
|
|
123
|
+
wellnessCheckEnabled: boolean;
|
|
124
|
+
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
// Return suggestion settings
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
|
|
129
|
+
@ApiProperty({ description: 'Minutes after appointment finishes to send the return suggestion', example: 2880 })
|
|
130
|
+
@IsInt()
|
|
131
|
+
@Min(1)
|
|
132
|
+
returnSuggestionDelayMinutes: number;
|
|
133
|
+
|
|
134
|
+
@ApiProperty({ description: 'Whether return suggestion follow-up is enabled' })
|
|
135
|
+
@IsBoolean()
|
|
136
|
+
returnSuggestionEnabled: boolean;
|
|
137
|
+
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
// Global setting
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
|
|
142
|
+
@ApiProperty({ description: 'Whether abandonment follow-up is enabled for this tenant' })
|
|
143
|
+
@IsBoolean()
|
|
144
|
+
enabled: boolean;
|
|
145
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { IsIn, IsInt, IsNotEmpty, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
3
|
+
import { FOLLOWUP_TYPES, FollowupTypeDto } from './followup-type.dto';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a follow-up attempt log entry.
|
|
7
|
+
* Tracks each follow-up message sent to a patient within a session or appointment.
|
|
8
|
+
*/
|
|
9
|
+
export class FollowupLogResponseDto {
|
|
10
|
+
@ApiProperty({ description: 'Log primary key (UUID)' })
|
|
11
|
+
@IsString()
|
|
12
|
+
@IsNotEmpty()
|
|
13
|
+
id: string;
|
|
14
|
+
|
|
15
|
+
@ApiProperty({ description: 'Tenant slug', example: 'clinic-alpha' })
|
|
16
|
+
@IsString()
|
|
17
|
+
@IsNotEmpty()
|
|
18
|
+
tenant: string;
|
|
19
|
+
|
|
20
|
+
@ApiPropertyOptional({ description: 'Session UUID from conversation_sessions (null for appointment-based)' })
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsString()
|
|
23
|
+
sessionUuid?: string | null;
|
|
24
|
+
|
|
25
|
+
@ApiProperty({ description: 'Patient UUID' })
|
|
26
|
+
@IsString()
|
|
27
|
+
@IsNotEmpty()
|
|
28
|
+
patientId: string;
|
|
29
|
+
|
|
30
|
+
@ApiProperty({ description: 'Follow-up attempt number (1-5 for abandonment, 1 for appointment-based)', example: 1 })
|
|
31
|
+
@IsInt()
|
|
32
|
+
@Min(1)
|
|
33
|
+
@Max(5)
|
|
34
|
+
attempt: number;
|
|
35
|
+
|
|
36
|
+
@ApiProperty({ description: 'The follow-up message sent to the patient' })
|
|
37
|
+
@IsString()
|
|
38
|
+
@IsNotEmpty()
|
|
39
|
+
message: string;
|
|
40
|
+
|
|
41
|
+
@ApiPropertyOptional({ description: 'The intention detected at the time of follow-up' })
|
|
42
|
+
@IsOptional()
|
|
43
|
+
@IsString()
|
|
44
|
+
intention?: string;
|
|
45
|
+
|
|
46
|
+
@ApiProperty({
|
|
47
|
+
description: 'Type of follow-up',
|
|
48
|
+
enum: FOLLOWUP_TYPES,
|
|
49
|
+
example: 'abandonment',
|
|
50
|
+
})
|
|
51
|
+
@IsIn(FOLLOWUP_TYPES)
|
|
52
|
+
followupType: FollowupTypeDto;
|
|
53
|
+
|
|
54
|
+
@ApiPropertyOptional({ description: 'Appointment UUID (for appointment-based follow-ups)' })
|
|
55
|
+
@IsOptional()
|
|
56
|
+
@IsString()
|
|
57
|
+
appointmentId?: string | null;
|
|
58
|
+
|
|
59
|
+
@ApiProperty({ description: 'Timestamp when the follow-up was sent (ISO 8601)' })
|
|
60
|
+
@IsString()
|
|
61
|
+
@IsNotEmpty()
|
|
62
|
+
sentAt: string;
|
|
63
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All follow-up types supported by the follow-up service.
|
|
3
|
+
*
|
|
4
|
+
* - "abandonment" → Patient stopped responding during a conversation.
|
|
5
|
+
* - "appointment_confirmation" → Reminder sent before an upcoming appointment.
|
|
6
|
+
* - "satisfaction_booking" → Satisfaction survey after the patient books an appointment.
|
|
7
|
+
* - "satisfaction_finished" → Satisfaction survey after an appointment is marked as finished.
|
|
8
|
+
* - "no_show_reschedule" → Follow-up for patients who did not show up (no_show status).
|
|
9
|
+
* - "wellness_check" → Check on patient well-being after procedures (side effects).
|
|
10
|
+
* - "return_suggestion" → Suggest a return visit based on procedure return_days.
|
|
11
|
+
*/
|
|
12
|
+
export const FOLLOWUP_TYPES = [
|
|
13
|
+
'abandonment',
|
|
14
|
+
'appointment_confirmation',
|
|
15
|
+
'satisfaction_booking',
|
|
16
|
+
'satisfaction_finished',
|
|
17
|
+
'no_show_reschedule',
|
|
18
|
+
'wellness_check',
|
|
19
|
+
'return_suggestion',
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
export type FollowupTypeDto = (typeof FOLLOWUP_TYPES)[number];
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from './conversation-type.dto';
|
|
2
|
+
export * from './conversation-intention.dto';
|
|
2
3
|
export * from './create-conversation-session.dto';
|
|
3
4
|
export * from './conversation-session-response.dto';
|
|
4
5
|
export * from './create-conversation.dto';
|
|
5
6
|
export * from './conversation-response.dto';
|
|
7
|
+
export * from './followup-type.dto';
|
|
8
|
+
export * from './followup-config-response.dto';
|
|
9
|
+
export * from './followup-log-response.dto';
|
package/src/patients/index.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allowed patient engagement statuses.
|
|
3
|
+
* - "active" → patient is actively engaged in conversations.
|
|
4
|
+
* - "inactive" → patient stopped responding after all follow-up attempts.
|
|
5
|
+
* Reactivated automatically when the patient sends a new message.
|
|
6
|
+
*/
|
|
7
|
+
export const PATIENT_STATUSES = ['active', 'inactive'] as const;
|
|
8
|
+
|
|
9
|
+
export type PatientStatusDto = (typeof PATIENT_STATUSES)[number];
|