tychat-contracts 1.6.21 → 1.6.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -33
- package/dist/storage/delete-object-rpc.dto.d.ts +9 -0
- package/dist/storage/delete-object-rpc.dto.d.ts.map +1 -0
- package/dist/storage/delete-object-rpc.dto.js +48 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +1 -0
- package/dist/storage/storage-rmq-patterns.d.ts +2 -0
- package/dist/storage/storage-rmq-patterns.d.ts.map +1 -1
- package/dist/storage/storage-rmq-patterns.js +3 -1
- package/jest.config.ts +5 -5
- package/package.json +2 -1
- package/src/ai/ai-usage-response.dto.ts +47 -47
- package/src/ai/create-ai-usage.dto.ts +43 -43
- package/src/analytics/analytics-emitter.helper.ts +54 -54
- package/src/analytics/analytics-query.dto.ts +222 -222
- package/src/analytics/create-analytic-event.dto.ts +85 -85
- package/src/analytics/event-analytic.enum.ts +119 -119
- package/src/appointments/appointment-procedure.dto.ts +76 -76
- package/src/appointments/create-appointment.dto.ts +153 -153
- package/src/appointments/index.ts +10 -10
- package/src/appointments/list-appointments-query.dto.ts +157 -157
- package/src/appointments/update-appointment-procedure.dto.ts +10 -10
- package/src/appointments/update-appointment.dto.ts +4 -4
- package/src/auth/refresh-token.dto.ts +10 -10
- package/src/billing/billing-response.dto.ts +68 -68
- package/src/billing/create-billing.dto.ts +70 -70
- package/src/billing/index.ts +6 -6
- package/src/billing/list-billings-query.dto.ts +61 -61
- package/src/billing/update-billing.dto.ts +4 -4
- package/src/cashback/cashback-balance-response.dto.ts +33 -33
- package/src/cashback/cashback-config-response.dto.ts +43 -43
- package/src/cashback/cashback-enums.ts +33 -33
- package/src/cashback/cashback-kafka-payloads.ts +102 -102
- package/src/cashback/cashback-kafka-topics.ts +23 -23
- package/src/cashback/index.ts +7 -7
- package/src/cashback/referral-code-response.dto.ts +49 -49
- package/src/cashback/use-referral-code-response.dto.ts +15 -15
- package/src/configurations/clinic-configuration.dto.ts +39 -39
- package/src/configurations/opening-hours-slot.dto.ts +41 -41
- package/src/configurations/update-clinic-configuration.dto.ts +39 -39
- package/src/connections/whatsapp-official.dto.ts +113 -113
- package/src/conversations/conversation-contact-filters-query.validator.spec.ts +221 -221
- package/src/conversations/conversation-contact-filters-query.validator.ts +10 -10
- package/src/conversations/conversation-intention.dto.ts +24 -24
- package/src/conversations/conversation-response.dto.ts +69 -69
- package/src/conversations/conversation-session-response.dto.ts +65 -65
- package/src/conversations/conversation-type.dto.ts +15 -15
- package/src/conversations/create-conversation-session.dto.ts +28 -28
- package/src/conversations/create-conversation.dto.ts +69 -69
- package/src/conversations/followup-config-response.dto.ts +290 -290
- package/src/conversations/followup-log-response.dto.ts +58 -58
- package/src/conversations/followup-type.dto.ts +22 -22
- package/src/conversations/index.ts +17 -17
- package/src/conversations/list-conversation-contacts-filters.dto.ts +15 -15
- package/src/conversations/list-conversation-contacts-query.dto.ts +81 -81
- package/src/conversations/satisfaction-response.dto.ts +116 -116
- package/src/filters/index.ts +1 -1
- package/src/filters/parsed-filter.dto.ts +41 -41
- package/src/index.ts +23 -23
- package/src/patients/create-patient.dto.ts +122 -122
- package/src/patients/index.ts +10 -10
- package/src/patients/list-patients-filters.dto.ts +15 -15
- package/src/patients/list-patients-query.dto.ts +61 -61
- package/src/patients/patient-document-response.dto.ts +33 -33
- package/src/patients/patient-history-entry.dto.ts +22 -22
- package/src/patients/patient-status.dto.ts +9 -9
- package/src/patients/update-patient-document.dto.ts +10 -10
- package/src/patients/update-patient.dto.ts +15 -15
- package/src/payment-gateway/create-gateway-payment.dto.ts +123 -123
- package/src/payment-gateway/gateway-payment-response.dto.ts +65 -65
- package/src/payment-gateway/index.ts +12 -12
- package/src/payment-gateway/list-gateway-payments-query.dto.ts +63 -63
- package/src/payment-gateway/payment-gateway-kafka-topics.ts +25 -25
- package/src/payment-gateway/payment-gateway.enums.ts +34 -34
- package/src/payment-gateway/update-gateway-payment.dto.ts +7 -7
- package/src/payment-gateway/webhook-payload.dto.ts +32 -32
- package/src/payments/create-payment.dto.ts +73 -73
- package/src/payments/index.ts +6 -6
- package/src/payments/list-payments-query.dto.ts +44 -44
- package/src/payments/payment-response.dto.ts +67 -67
- package/src/payments/update-payment.dto.ts +4 -4
- package/src/procedures/create-procedure.dto.ts +104 -104
- package/src/procedures/index.ts +6 -6
- package/src/procedures/list-procedures-query.dto.ts +59 -59
- package/src/procedures/update-procedure.dto.ts +4 -4
- package/src/storage/delete-object-rpc.dto.ts +28 -0
- package/src/storage/index.ts +1 -0
- package/src/storage/storage-rmq-patterns.ts +3 -0
- package/src/tenants/index.ts +10 -10
- package/src/tenants/whatsapp-provider-kind.dto.ts +12 -12
- package/dist/analytics/should-skip-analytics-tenant-lookup.d.ts +0 -7
- package/dist/analytics/should-skip-analytics-tenant-lookup.d.ts.map +0 -1
- package/dist/analytics/should-skip-analytics-tenant-lookup.js +0 -13
- package/dist/appointments/opening-hours-slot.dto.d.ts +0 -6
- package/dist/appointments/opening-hours-slot.dto.d.ts.map +0 -1
- package/dist/appointments/opening-hours-slot.dto.js +0 -2
- package/dist/patients/patient-procedure.dto.d.ts +0 -9
- package/dist/patients/patient-procedure.dto.d.ts.map +0 -1
- package/dist/patients/patient-procedure.dto.js +0 -79
- package/dist/patients/update-patient-procedure.dto.d.ts +0 -6
- package/dist/patients/update-patient-procedure.dto.d.ts.map +0 -1
- package/dist/patients/update-patient-procedure.dto.js +0 -8
- package/dist/payments/payment.dto.d.ts +0 -15
- package/dist/payments/payment.dto.d.ts.map +0 -1
- package/dist/payments/payment.dto.js +0 -2
- package/dist/tenants/create-tenant.dto.d.ts +0 -10
- package/dist/tenants/create-tenant.dto.d.ts.map +0 -1
- package/dist/tenants/create-tenant.dto.js +0 -73
- package/dist/tenants/tenant-slug.util.spec.d.ts +0 -2
- package/dist/tenants/tenant-slug.util.spec.d.ts.map +0 -1
- package/dist/tenants/tenant-slug.util.spec.js +0 -102
- package/dist/tenants/update-tenant-payload.dto.d.ts +0 -6
- package/dist/tenants/update-tenant-payload.dto.d.ts.map +0 -1
- package/dist/tenants/update-tenant-payload.dto.js +0 -25
- package/dist/tenants/update-tenant.dto.d.ts +0 -10
- package/dist/tenants/update-tenant.dto.d.ts.map +0 -1
- package/dist/tenants/update-tenant.dto.js +0 -78
|
@@ -1,290 +1,290 @@
|
|
|
1
|
-
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import {
|
|
3
|
-
IsBoolean,
|
|
4
|
-
IsInt,
|
|
5
|
-
IsNotEmpty,
|
|
6
|
-
IsOptional,
|
|
7
|
-
IsString,
|
|
8
|
-
MaxLength,
|
|
9
|
-
Min,
|
|
10
|
-
} from 'class-validator';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Represents a follow-up timing configuration for a tenant.
|
|
14
|
-
* Defines timing and enabled flags for all follow-up types:
|
|
15
|
-
* abandonment, appointment confirmation, satisfaction surveys,
|
|
16
|
-
* no-show reschedule, wellness check, and return suggestion.
|
|
17
|
-
*/
|
|
18
|
-
export class FollowupConfigResponseDto {
|
|
19
|
-
@ApiProperty({ description: 'Config primary key (UUID)' })
|
|
20
|
-
@IsString()
|
|
21
|
-
@IsNotEmpty()
|
|
22
|
-
id: string;
|
|
23
|
-
|
|
24
|
-
@ApiPropertyOptional({ description: 'Tenant unit id', example: 1 })
|
|
25
|
-
@IsOptional()
|
|
26
|
-
@IsInt()
|
|
27
|
-
@Min(1)
|
|
28
|
-
unitId?: number;
|
|
29
|
-
|
|
30
|
-
// ---------------------------------------------------------------------------
|
|
31
|
-
// Abandonment follow-up settings
|
|
32
|
-
// ---------------------------------------------------------------------------
|
|
33
|
-
|
|
34
|
-
@ApiProperty({
|
|
35
|
-
description: 'Minutes since last AI/human message to consider the session as abandoned',
|
|
36
|
-
example: 30,
|
|
37
|
-
})
|
|
38
|
-
@IsInt()
|
|
39
|
-
@Min(1)
|
|
40
|
-
abandonmentThresholdMinutes: number;
|
|
41
|
-
|
|
42
|
-
@ApiProperty({ description: 'Minutes to wait before sending follow-up #1 after abandonment', example: 5 })
|
|
43
|
-
@IsInt()
|
|
44
|
-
@Min(1)
|
|
45
|
-
followup1DelayMinutes: number;
|
|
46
|
-
|
|
47
|
-
@ApiProperty({ description: 'Minutes to wait before sending follow-up #2 after #1', example: 15 })
|
|
48
|
-
@IsInt()
|
|
49
|
-
@Min(1)
|
|
50
|
-
followup2DelayMinutes: number;
|
|
51
|
-
|
|
52
|
-
@ApiProperty({ description: 'Minutes to wait before sending follow-up #3 after #2', example: 60 })
|
|
53
|
-
@IsInt()
|
|
54
|
-
@Min(1)
|
|
55
|
-
followup3DelayMinutes: number;
|
|
56
|
-
|
|
57
|
-
@ApiProperty({ description: 'Minutes to wait before sending follow-up #4 after #3', example: 1440 })
|
|
58
|
-
@IsInt()
|
|
59
|
-
@Min(1)
|
|
60
|
-
followup4DelayMinutes: number;
|
|
61
|
-
|
|
62
|
-
@ApiProperty({ description: 'Minutes to wait before sending follow-up #5 (final) after #4', example: 2880 })
|
|
63
|
-
@IsInt()
|
|
64
|
-
@Min(1)
|
|
65
|
-
followup5DelayMinutes: number;
|
|
66
|
-
|
|
67
|
-
// ---------------------------------------------------------------------------
|
|
68
|
-
// Appointment confirmation settings
|
|
69
|
-
// ---------------------------------------------------------------------------
|
|
70
|
-
|
|
71
|
-
@ApiProperty({ description: 'Minutes before the appointment to send the confirmation reminder', example: 60 })
|
|
72
|
-
@IsInt()
|
|
73
|
-
@Min(1)
|
|
74
|
-
confirmationMinutesBefore: number;
|
|
75
|
-
|
|
76
|
-
@ApiProperty({ description: 'Whether appointment confirmation follow-up is enabled' })
|
|
77
|
-
@IsBoolean()
|
|
78
|
-
confirmationEnabled: boolean;
|
|
79
|
-
|
|
80
|
-
// ---------------------------------------------------------------------------
|
|
81
|
-
// Satisfaction survey settings
|
|
82
|
-
// ---------------------------------------------------------------------------
|
|
83
|
-
|
|
84
|
-
@ApiProperty({ description: 'Minutes after booking confirmation to send the satisfaction survey', example: 10 })
|
|
85
|
-
@IsInt()
|
|
86
|
-
@Min(1)
|
|
87
|
-
satisfactionBookingDelayMinutes: number;
|
|
88
|
-
|
|
89
|
-
@ApiProperty({ description: 'Whether satisfaction survey after booking is enabled' })
|
|
90
|
-
@IsBoolean()
|
|
91
|
-
satisfactionBookingEnabled: boolean;
|
|
92
|
-
|
|
93
|
-
@ApiProperty({ description: 'Minutes after appointment finishes to send the satisfaction survey', example: 30 })
|
|
94
|
-
@IsInt()
|
|
95
|
-
@Min(1)
|
|
96
|
-
satisfactionFinishedDelayMinutes: number;
|
|
97
|
-
|
|
98
|
-
@ApiProperty({ description: 'Whether satisfaction survey after finished appointment is enabled' })
|
|
99
|
-
@IsBoolean()
|
|
100
|
-
satisfactionFinishedEnabled: boolean;
|
|
101
|
-
|
|
102
|
-
// ---------------------------------------------------------------------------
|
|
103
|
-
// No-show reschedule settings
|
|
104
|
-
// ---------------------------------------------------------------------------
|
|
105
|
-
|
|
106
|
-
@ApiProperty({ description: 'Minutes after a no-show to send the reschedule follow-up', example: 60 })
|
|
107
|
-
@IsInt()
|
|
108
|
-
@Min(1)
|
|
109
|
-
noShowDelayMinutes: number;
|
|
110
|
-
|
|
111
|
-
@ApiProperty({ description: 'Whether no-show follow-up is enabled' })
|
|
112
|
-
@IsBoolean()
|
|
113
|
-
noShowEnabled: boolean;
|
|
114
|
-
|
|
115
|
-
// ---------------------------------------------------------------------------
|
|
116
|
-
// Wellness check settings
|
|
117
|
-
// ---------------------------------------------------------------------------
|
|
118
|
-
|
|
119
|
-
@ApiProperty({ description: 'Minutes after appointment finishes to send the wellness check', example: 1440 })
|
|
120
|
-
@IsInt()
|
|
121
|
-
@Min(1)
|
|
122
|
-
wellnessCheckDelayMinutes: number;
|
|
123
|
-
|
|
124
|
-
@ApiProperty({ description: 'Whether wellness check follow-up is enabled' })
|
|
125
|
-
@IsBoolean()
|
|
126
|
-
wellnessCheckEnabled: boolean;
|
|
127
|
-
|
|
128
|
-
// ---------------------------------------------------------------------------
|
|
129
|
-
// Return suggestion settings
|
|
130
|
-
// ---------------------------------------------------------------------------
|
|
131
|
-
|
|
132
|
-
@ApiProperty({ description: 'Minutes after appointment finishes to send the return suggestion', example: 2880 })
|
|
133
|
-
@IsInt()
|
|
134
|
-
@Min(1)
|
|
135
|
-
returnSuggestionDelayMinutes: number;
|
|
136
|
-
|
|
137
|
-
@ApiProperty({ description: 'Whether return suggestion follow-up is enabled' })
|
|
138
|
-
@IsBoolean()
|
|
139
|
-
returnSuggestionEnabled: boolean;
|
|
140
|
-
|
|
141
|
-
// ---------------------------------------------------------------------------
|
|
142
|
-
// WhatsApp Official template IDs (per follow-up type)
|
|
143
|
-
// ---------------------------------------------------------------------------
|
|
144
|
-
|
|
145
|
-
@ApiPropertyOptional({
|
|
146
|
-
description: 'WhatsApp Official template name for appointment confirmation follow-ups',
|
|
147
|
-
example: 'appointment_confirmation',
|
|
148
|
-
})
|
|
149
|
-
@IsOptional()
|
|
150
|
-
@IsString()
|
|
151
|
-
templateAppointmentConfirmation?: string;
|
|
152
|
-
|
|
153
|
-
@ApiPropertyOptional({
|
|
154
|
-
description: 'WhatsApp Official template name for satisfaction booking follow-ups',
|
|
155
|
-
example: 'satisfaction_booking',
|
|
156
|
-
})
|
|
157
|
-
@IsOptional()
|
|
158
|
-
@IsString()
|
|
159
|
-
templateSatisfactionBooking?: string;
|
|
160
|
-
|
|
161
|
-
@ApiPropertyOptional({
|
|
162
|
-
description: 'WhatsApp Official template name for satisfaction finished follow-ups',
|
|
163
|
-
example: 'satisfaction_finished',
|
|
164
|
-
})
|
|
165
|
-
@IsOptional()
|
|
166
|
-
@IsString()
|
|
167
|
-
templateSatisfactionFinished?: string;
|
|
168
|
-
|
|
169
|
-
@ApiPropertyOptional({
|
|
170
|
-
description: 'WhatsApp Official template name for no-show reschedule follow-ups',
|
|
171
|
-
example: 'no_show_reschedule',
|
|
172
|
-
})
|
|
173
|
-
@IsOptional()
|
|
174
|
-
@IsString()
|
|
175
|
-
templateNoShowReschedule?: string;
|
|
176
|
-
|
|
177
|
-
@ApiPropertyOptional({
|
|
178
|
-
description: 'WhatsApp Official template name for wellness check follow-ups',
|
|
179
|
-
example: 'wellness_check',
|
|
180
|
-
})
|
|
181
|
-
@IsOptional()
|
|
182
|
-
@IsString()
|
|
183
|
-
templateWellnessCheck?: string;
|
|
184
|
-
|
|
185
|
-
@ApiPropertyOptional({
|
|
186
|
-
description: 'WhatsApp Official template name for return suggestion follow-ups',
|
|
187
|
-
example: 'return_suggestion',
|
|
188
|
-
})
|
|
189
|
-
@IsOptional()
|
|
190
|
-
@IsString()
|
|
191
|
-
templateReturnSuggestion?: string;
|
|
192
|
-
|
|
193
|
-
@ApiPropertyOptional({
|
|
194
|
-
description: 'WhatsApp Official template name for abandonment follow-ups',
|
|
195
|
-
example: 'abandonment_followup',
|
|
196
|
-
})
|
|
197
|
-
@IsOptional()
|
|
198
|
-
@IsString()
|
|
199
|
-
templateAbandonment?: string;
|
|
200
|
-
|
|
201
|
-
// ---------------------------------------------------------------------------
|
|
202
|
-
// Global setting
|
|
203
|
-
// ---------------------------------------------------------------------------
|
|
204
|
-
|
|
205
|
-
@ApiProperty({ description: 'Whether abandonment follow-up is enabled for this tenant' })
|
|
206
|
-
@IsBoolean()
|
|
207
|
-
enabled: boolean;
|
|
208
|
-
|
|
209
|
-
@ApiProperty({
|
|
210
|
-
description:
|
|
211
|
-
'Minutes to send warning when attendant sent the last message and patient did not reply',
|
|
212
|
-
example: 5,
|
|
213
|
-
})
|
|
214
|
-
@IsInt()
|
|
215
|
-
@Min(1)
|
|
216
|
-
humanPatientIdleWarningDelayMinutes: number;
|
|
217
|
-
|
|
218
|
-
@ApiProperty({
|
|
219
|
-
description:
|
|
220
|
-
'Minutes after warning to finalize human attendance and return session to IA',
|
|
221
|
-
example: 10,
|
|
222
|
-
})
|
|
223
|
-
@IsInt()
|
|
224
|
-
@Min(1)
|
|
225
|
-
humanPatientIdleFinalizeDelayMinutes: number;
|
|
226
|
-
|
|
227
|
-
@ApiProperty({
|
|
228
|
-
description:
|
|
229
|
-
'Minutes to requeue when patient sent the last message and attendant did not reply',
|
|
230
|
-
example: 15,
|
|
231
|
-
})
|
|
232
|
-
@IsInt()
|
|
233
|
-
@Min(1)
|
|
234
|
-
humanAttendantIdleRequeueDelayMinutes: number;
|
|
235
|
-
|
|
236
|
-
@ApiProperty({
|
|
237
|
-
description:
|
|
238
|
-
'Minutes before requeue to send a push to the responsible attendant (0 = disabled). Must be less than humanAttendantIdleRequeueDelayMinutes when > 0.',
|
|
239
|
-
example: 3,
|
|
240
|
-
})
|
|
241
|
-
@IsInt()
|
|
242
|
-
@Min(0)
|
|
243
|
-
humanAttendantIdlePushWarningLeadMinutes: number;
|
|
244
|
-
|
|
245
|
-
@ApiProperty({
|
|
246
|
-
description: 'Message sent as warning when patient is idle during human attendance',
|
|
247
|
-
example:
|
|
248
|
-
'Ainda estamos aguardando sua resposta. Em alguns minutos, o atendimento humano sera finalizado caso nao haja retorno.',
|
|
249
|
-
})
|
|
250
|
-
@IsString()
|
|
251
|
-
@MaxLength(5000)
|
|
252
|
-
humanPatientIdleWarningMessage: string;
|
|
253
|
-
|
|
254
|
-
@ApiProperty({
|
|
255
|
-
description: 'Message sent when human attendance is finalized due to patient inactivity',
|
|
256
|
-
example:
|
|
257
|
-
'Como nao recebemos seu retorno, encerramos o atendimento humano por agora. Se precisar, posso continuar seu atendimento por IA.',
|
|
258
|
-
})
|
|
259
|
-
@IsString()
|
|
260
|
-
@MaxLength(5000)
|
|
261
|
-
humanPatientIdleFinalizeMessage: string;
|
|
262
|
-
|
|
263
|
-
@ApiProperty({
|
|
264
|
-
description: 'Message sent when session is requeued due to attendant inactivity',
|
|
265
|
-
example:
|
|
266
|
-
'Devido a alta demanda, outro atendente continuara seu atendimento em breve.',
|
|
267
|
-
})
|
|
268
|
-
@IsString()
|
|
269
|
-
@MaxLength(5000)
|
|
270
|
-
humanAttendantIdleRequeueMessage: string;
|
|
271
|
-
|
|
272
|
-
@ApiProperty({
|
|
273
|
-
description: 'Message sent when clinic is closed and session remains in waiting queue',
|
|
274
|
-
example:
|
|
275
|
-
'Nosso horario de atendimento foi encerrado. Retornaremos o contato no proximo dia util.',
|
|
276
|
-
})
|
|
277
|
-
@IsString()
|
|
278
|
-
@MaxLength(5000)
|
|
279
|
-
humanAfterHoursWaitingMessage: string;
|
|
280
|
-
|
|
281
|
-
@ApiProperty({
|
|
282
|
-
description:
|
|
283
|
-
'Message sent when patient requests human support outside clinic hours',
|
|
284
|
-
example:
|
|
285
|
-
'No momento estamos fora do horario de atendimento humano. Sua conversa foi para a fila e retornaremos no proximo dia util.',
|
|
286
|
-
})
|
|
287
|
-
@IsString()
|
|
288
|
-
@MaxLength(5000)
|
|
289
|
-
humanRequestOutsideHoursMessage: string;
|
|
290
|
-
}
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import {
|
|
3
|
+
IsBoolean,
|
|
4
|
+
IsInt,
|
|
5
|
+
IsNotEmpty,
|
|
6
|
+
IsOptional,
|
|
7
|
+
IsString,
|
|
8
|
+
MaxLength,
|
|
9
|
+
Min,
|
|
10
|
+
} from 'class-validator';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Represents a follow-up timing configuration for a tenant.
|
|
14
|
+
* Defines timing and enabled flags for all follow-up types:
|
|
15
|
+
* abandonment, appointment confirmation, satisfaction surveys,
|
|
16
|
+
* no-show reschedule, wellness check, and return suggestion.
|
|
17
|
+
*/
|
|
18
|
+
export class FollowupConfigResponseDto {
|
|
19
|
+
@ApiProperty({ description: 'Config primary key (UUID)' })
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
id: string;
|
|
23
|
+
|
|
24
|
+
@ApiPropertyOptional({ description: 'Tenant unit id', example: 1 })
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@IsInt()
|
|
27
|
+
@Min(1)
|
|
28
|
+
unitId?: number;
|
|
29
|
+
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Abandonment follow-up settings
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
@ApiProperty({
|
|
35
|
+
description: 'Minutes since last AI/human message to consider the session as abandoned',
|
|
36
|
+
example: 30,
|
|
37
|
+
})
|
|
38
|
+
@IsInt()
|
|
39
|
+
@Min(1)
|
|
40
|
+
abandonmentThresholdMinutes: number;
|
|
41
|
+
|
|
42
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #1 after abandonment', example: 5 })
|
|
43
|
+
@IsInt()
|
|
44
|
+
@Min(1)
|
|
45
|
+
followup1DelayMinutes: number;
|
|
46
|
+
|
|
47
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #2 after #1', example: 15 })
|
|
48
|
+
@IsInt()
|
|
49
|
+
@Min(1)
|
|
50
|
+
followup2DelayMinutes: number;
|
|
51
|
+
|
|
52
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #3 after #2', example: 60 })
|
|
53
|
+
@IsInt()
|
|
54
|
+
@Min(1)
|
|
55
|
+
followup3DelayMinutes: number;
|
|
56
|
+
|
|
57
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #4 after #3', example: 1440 })
|
|
58
|
+
@IsInt()
|
|
59
|
+
@Min(1)
|
|
60
|
+
followup4DelayMinutes: number;
|
|
61
|
+
|
|
62
|
+
@ApiProperty({ description: 'Minutes to wait before sending follow-up #5 (final) after #4', example: 2880 })
|
|
63
|
+
@IsInt()
|
|
64
|
+
@Min(1)
|
|
65
|
+
followup5DelayMinutes: number;
|
|
66
|
+
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Appointment confirmation settings
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
@ApiProperty({ description: 'Minutes before the appointment to send the confirmation reminder', example: 60 })
|
|
72
|
+
@IsInt()
|
|
73
|
+
@Min(1)
|
|
74
|
+
confirmationMinutesBefore: number;
|
|
75
|
+
|
|
76
|
+
@ApiProperty({ description: 'Whether appointment confirmation follow-up is enabled' })
|
|
77
|
+
@IsBoolean()
|
|
78
|
+
confirmationEnabled: boolean;
|
|
79
|
+
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
// Satisfaction survey settings
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
|
|
84
|
+
@ApiProperty({ description: 'Minutes after booking confirmation to send the satisfaction survey', example: 10 })
|
|
85
|
+
@IsInt()
|
|
86
|
+
@Min(1)
|
|
87
|
+
satisfactionBookingDelayMinutes: number;
|
|
88
|
+
|
|
89
|
+
@ApiProperty({ description: 'Whether satisfaction survey after booking is enabled' })
|
|
90
|
+
@IsBoolean()
|
|
91
|
+
satisfactionBookingEnabled: boolean;
|
|
92
|
+
|
|
93
|
+
@ApiProperty({ description: 'Minutes after appointment finishes to send the satisfaction survey', example: 30 })
|
|
94
|
+
@IsInt()
|
|
95
|
+
@Min(1)
|
|
96
|
+
satisfactionFinishedDelayMinutes: number;
|
|
97
|
+
|
|
98
|
+
@ApiProperty({ description: 'Whether satisfaction survey after finished appointment is enabled' })
|
|
99
|
+
@IsBoolean()
|
|
100
|
+
satisfactionFinishedEnabled: boolean;
|
|
101
|
+
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// No-show reschedule settings
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
|
|
106
|
+
@ApiProperty({ description: 'Minutes after a no-show to send the reschedule follow-up', example: 60 })
|
|
107
|
+
@IsInt()
|
|
108
|
+
@Min(1)
|
|
109
|
+
noShowDelayMinutes: number;
|
|
110
|
+
|
|
111
|
+
@ApiProperty({ description: 'Whether no-show follow-up is enabled' })
|
|
112
|
+
@IsBoolean()
|
|
113
|
+
noShowEnabled: boolean;
|
|
114
|
+
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
// Wellness check settings
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
|
|
119
|
+
@ApiProperty({ description: 'Minutes after appointment finishes to send the wellness check', example: 1440 })
|
|
120
|
+
@IsInt()
|
|
121
|
+
@Min(1)
|
|
122
|
+
wellnessCheckDelayMinutes: number;
|
|
123
|
+
|
|
124
|
+
@ApiProperty({ description: 'Whether wellness check follow-up is enabled' })
|
|
125
|
+
@IsBoolean()
|
|
126
|
+
wellnessCheckEnabled: boolean;
|
|
127
|
+
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
// Return suggestion settings
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
|
|
132
|
+
@ApiProperty({ description: 'Minutes after appointment finishes to send the return suggestion', example: 2880 })
|
|
133
|
+
@IsInt()
|
|
134
|
+
@Min(1)
|
|
135
|
+
returnSuggestionDelayMinutes: number;
|
|
136
|
+
|
|
137
|
+
@ApiProperty({ description: 'Whether return suggestion follow-up is enabled' })
|
|
138
|
+
@IsBoolean()
|
|
139
|
+
returnSuggestionEnabled: boolean;
|
|
140
|
+
|
|
141
|
+
// ---------------------------------------------------------------------------
|
|
142
|
+
// WhatsApp Official template IDs (per follow-up type)
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
|
|
145
|
+
@ApiPropertyOptional({
|
|
146
|
+
description: 'WhatsApp Official template name for appointment confirmation follow-ups',
|
|
147
|
+
example: 'appointment_confirmation',
|
|
148
|
+
})
|
|
149
|
+
@IsOptional()
|
|
150
|
+
@IsString()
|
|
151
|
+
templateAppointmentConfirmation?: string;
|
|
152
|
+
|
|
153
|
+
@ApiPropertyOptional({
|
|
154
|
+
description: 'WhatsApp Official template name for satisfaction booking follow-ups',
|
|
155
|
+
example: 'satisfaction_booking',
|
|
156
|
+
})
|
|
157
|
+
@IsOptional()
|
|
158
|
+
@IsString()
|
|
159
|
+
templateSatisfactionBooking?: string;
|
|
160
|
+
|
|
161
|
+
@ApiPropertyOptional({
|
|
162
|
+
description: 'WhatsApp Official template name for satisfaction finished follow-ups',
|
|
163
|
+
example: 'satisfaction_finished',
|
|
164
|
+
})
|
|
165
|
+
@IsOptional()
|
|
166
|
+
@IsString()
|
|
167
|
+
templateSatisfactionFinished?: string;
|
|
168
|
+
|
|
169
|
+
@ApiPropertyOptional({
|
|
170
|
+
description: 'WhatsApp Official template name for no-show reschedule follow-ups',
|
|
171
|
+
example: 'no_show_reschedule',
|
|
172
|
+
})
|
|
173
|
+
@IsOptional()
|
|
174
|
+
@IsString()
|
|
175
|
+
templateNoShowReschedule?: string;
|
|
176
|
+
|
|
177
|
+
@ApiPropertyOptional({
|
|
178
|
+
description: 'WhatsApp Official template name for wellness check follow-ups',
|
|
179
|
+
example: 'wellness_check',
|
|
180
|
+
})
|
|
181
|
+
@IsOptional()
|
|
182
|
+
@IsString()
|
|
183
|
+
templateWellnessCheck?: string;
|
|
184
|
+
|
|
185
|
+
@ApiPropertyOptional({
|
|
186
|
+
description: 'WhatsApp Official template name for return suggestion follow-ups',
|
|
187
|
+
example: 'return_suggestion',
|
|
188
|
+
})
|
|
189
|
+
@IsOptional()
|
|
190
|
+
@IsString()
|
|
191
|
+
templateReturnSuggestion?: string;
|
|
192
|
+
|
|
193
|
+
@ApiPropertyOptional({
|
|
194
|
+
description: 'WhatsApp Official template name for abandonment follow-ups',
|
|
195
|
+
example: 'abandonment_followup',
|
|
196
|
+
})
|
|
197
|
+
@IsOptional()
|
|
198
|
+
@IsString()
|
|
199
|
+
templateAbandonment?: string;
|
|
200
|
+
|
|
201
|
+
// ---------------------------------------------------------------------------
|
|
202
|
+
// Global setting
|
|
203
|
+
// ---------------------------------------------------------------------------
|
|
204
|
+
|
|
205
|
+
@ApiProperty({ description: 'Whether abandonment follow-up is enabled for this tenant' })
|
|
206
|
+
@IsBoolean()
|
|
207
|
+
enabled: boolean;
|
|
208
|
+
|
|
209
|
+
@ApiProperty({
|
|
210
|
+
description:
|
|
211
|
+
'Minutes to send warning when attendant sent the last message and patient did not reply',
|
|
212
|
+
example: 5,
|
|
213
|
+
})
|
|
214
|
+
@IsInt()
|
|
215
|
+
@Min(1)
|
|
216
|
+
humanPatientIdleWarningDelayMinutes: number;
|
|
217
|
+
|
|
218
|
+
@ApiProperty({
|
|
219
|
+
description:
|
|
220
|
+
'Minutes after warning to finalize human attendance and return session to IA',
|
|
221
|
+
example: 10,
|
|
222
|
+
})
|
|
223
|
+
@IsInt()
|
|
224
|
+
@Min(1)
|
|
225
|
+
humanPatientIdleFinalizeDelayMinutes: number;
|
|
226
|
+
|
|
227
|
+
@ApiProperty({
|
|
228
|
+
description:
|
|
229
|
+
'Minutes to requeue when patient sent the last message and attendant did not reply',
|
|
230
|
+
example: 15,
|
|
231
|
+
})
|
|
232
|
+
@IsInt()
|
|
233
|
+
@Min(1)
|
|
234
|
+
humanAttendantIdleRequeueDelayMinutes: number;
|
|
235
|
+
|
|
236
|
+
@ApiProperty({
|
|
237
|
+
description:
|
|
238
|
+
'Minutes before requeue to send a push to the responsible attendant (0 = disabled). Must be less than humanAttendantIdleRequeueDelayMinutes when > 0.',
|
|
239
|
+
example: 3,
|
|
240
|
+
})
|
|
241
|
+
@IsInt()
|
|
242
|
+
@Min(0)
|
|
243
|
+
humanAttendantIdlePushWarningLeadMinutes: number;
|
|
244
|
+
|
|
245
|
+
@ApiProperty({
|
|
246
|
+
description: 'Message sent as warning when patient is idle during human attendance',
|
|
247
|
+
example:
|
|
248
|
+
'Ainda estamos aguardando sua resposta. Em alguns minutos, o atendimento humano sera finalizado caso nao haja retorno.',
|
|
249
|
+
})
|
|
250
|
+
@IsString()
|
|
251
|
+
@MaxLength(5000)
|
|
252
|
+
humanPatientIdleWarningMessage: string;
|
|
253
|
+
|
|
254
|
+
@ApiProperty({
|
|
255
|
+
description: 'Message sent when human attendance is finalized due to patient inactivity',
|
|
256
|
+
example:
|
|
257
|
+
'Como nao recebemos seu retorno, encerramos o atendimento humano por agora. Se precisar, posso continuar seu atendimento por IA.',
|
|
258
|
+
})
|
|
259
|
+
@IsString()
|
|
260
|
+
@MaxLength(5000)
|
|
261
|
+
humanPatientIdleFinalizeMessage: string;
|
|
262
|
+
|
|
263
|
+
@ApiProperty({
|
|
264
|
+
description: 'Message sent when session is requeued due to attendant inactivity',
|
|
265
|
+
example:
|
|
266
|
+
'Devido a alta demanda, outro atendente continuara seu atendimento em breve.',
|
|
267
|
+
})
|
|
268
|
+
@IsString()
|
|
269
|
+
@MaxLength(5000)
|
|
270
|
+
humanAttendantIdleRequeueMessage: string;
|
|
271
|
+
|
|
272
|
+
@ApiProperty({
|
|
273
|
+
description: 'Message sent when clinic is closed and session remains in waiting queue',
|
|
274
|
+
example:
|
|
275
|
+
'Nosso horario de atendimento foi encerrado. Retornaremos o contato no proximo dia util.',
|
|
276
|
+
})
|
|
277
|
+
@IsString()
|
|
278
|
+
@MaxLength(5000)
|
|
279
|
+
humanAfterHoursWaitingMessage: string;
|
|
280
|
+
|
|
281
|
+
@ApiProperty({
|
|
282
|
+
description:
|
|
283
|
+
'Message sent when patient requests human support outside clinic hours',
|
|
284
|
+
example:
|
|
285
|
+
'No momento estamos fora do horario de atendimento humano. Sua conversa foi para a fila e retornaremos no proximo dia util.',
|
|
286
|
+
})
|
|
287
|
+
@IsString()
|
|
288
|
+
@MaxLength(5000)
|
|
289
|
+
humanRequestOutsideHoursMessage: string;
|
|
290
|
+
}
|