evo360-types 1.3.132 → 1.3.134
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/apps/evo-med/appointment/zod-schemas.d.ts +106 -0
- package/dist/apps/evo-med/appointment/zod-schemas.js +19 -1
- package/dist/apps/evo-med/appointment/zod-schemas.ts +19 -0
- package/dist/apps/evo-med/calendar/zod-schemas.d.ts +48 -0
- package/dist/apps/evo-med/calendar/zod-schemas.js +2 -0
- package/dist/apps/evo-med/calendar/zod-schemas.ts +2 -0
- package/dist/apps/evo-med/people/zod-schemas.d.ts +64 -3
- package/dist/apps/evo-med/people/zod-schemas.js +11 -2
- package/dist/apps/evo-med/people/zod-schemas.ts +11 -1
- package/dist/types/evo-med/appointment/index.d.ts +16 -0
- package/dist/types/evo-med/appointment/index.ts +18 -0
- package/dist/types/evo-med/calendar/index.d.ts +2 -0
- package/dist/types/evo-med/calendar/index.ts +3 -0
- package/dist/types/evo-med/people/index.d.ts +7 -1
- package/dist/types/evo-med/people/index.ts +10 -2
- package/package.json +1 -1
|
@@ -1117,3 +1117,109 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1117
1117
|
category?: string | null | undefined;
|
|
1118
1118
|
}>, "many">>>;
|
|
1119
1119
|
}>, z.ZodTypeAny, "passthrough">>;
|
|
1120
|
+
export declare const zPatientAppointmentSchema: z.ZodObject<{
|
|
1121
|
+
appointmentId: z.ZodString;
|
|
1122
|
+
startDate: z.ZodEffects<z.ZodDate, Date, unknown>;
|
|
1123
|
+
duration: z.ZodNumber;
|
|
1124
|
+
status: z.ZodString;
|
|
1125
|
+
statusBase: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
|
|
1126
|
+
appointmentMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["telemedicine", "in_person"]>>>;
|
|
1127
|
+
appointmentBaseType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>>>;
|
|
1128
|
+
procedures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
1129
|
+
professional: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1130
|
+
insurance: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1131
|
+
payment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1132
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1133
|
+
paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1134
|
+
due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1135
|
+
status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
|
|
1136
|
+
payment_type: z.ZodEnum<["patient", "insurance"]>;
|
|
1137
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1138
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1139
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1140
|
+
paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1141
|
+
due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1142
|
+
status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
|
|
1143
|
+
payment_type: z.ZodEnum<["patient", "insurance"]>;
|
|
1144
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1145
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1146
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1147
|
+
paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1148
|
+
due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1149
|
+
status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
|
|
1150
|
+
payment_type: z.ZodEnum<["patient", "insurance"]>;
|
|
1151
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1152
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1153
|
+
reschedule_count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1154
|
+
external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1155
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1156
|
+
appointmentId: z.ZodString;
|
|
1157
|
+
startDate: z.ZodEffects<z.ZodDate, Date, unknown>;
|
|
1158
|
+
duration: z.ZodNumber;
|
|
1159
|
+
status: z.ZodString;
|
|
1160
|
+
statusBase: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
|
|
1161
|
+
appointmentMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["telemedicine", "in_person"]>>>;
|
|
1162
|
+
appointmentBaseType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>>>;
|
|
1163
|
+
procedures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
1164
|
+
professional: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1165
|
+
insurance: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1166
|
+
payment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1167
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1168
|
+
paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1169
|
+
due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1170
|
+
status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
|
|
1171
|
+
payment_type: z.ZodEnum<["patient", "insurance"]>;
|
|
1172
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1173
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1174
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1175
|
+
paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1176
|
+
due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1177
|
+
status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
|
|
1178
|
+
payment_type: z.ZodEnum<["patient", "insurance"]>;
|
|
1179
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1180
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1181
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1182
|
+
paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1183
|
+
due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1184
|
+
status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
|
|
1185
|
+
payment_type: z.ZodEnum<["patient", "insurance"]>;
|
|
1186
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1187
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1188
|
+
reschedule_count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1189
|
+
external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1190
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1191
|
+
appointmentId: z.ZodString;
|
|
1192
|
+
startDate: z.ZodEffects<z.ZodDate, Date, unknown>;
|
|
1193
|
+
duration: z.ZodNumber;
|
|
1194
|
+
status: z.ZodString;
|
|
1195
|
+
statusBase: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
|
|
1196
|
+
appointmentMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["telemedicine", "in_person"]>>>;
|
|
1197
|
+
appointmentBaseType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>>>;
|
|
1198
|
+
procedures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
1199
|
+
professional: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1200
|
+
insurance: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1201
|
+
payment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1202
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1203
|
+
paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1204
|
+
due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1205
|
+
status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
|
|
1206
|
+
payment_type: z.ZodEnum<["patient", "insurance"]>;
|
|
1207
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1208
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1209
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1210
|
+
paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1211
|
+
due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1212
|
+
status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
|
|
1213
|
+
payment_type: z.ZodEnum<["patient", "insurance"]>;
|
|
1214
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1215
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1216
|
+
total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1217
|
+
paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1218
|
+
due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1219
|
+
status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
|
|
1220
|
+
payment_type: z.ZodEnum<["patient", "insurance"]>;
|
|
1221
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1222
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1223
|
+
reschedule_count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1224
|
+
external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1225
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zAppointmentSchema = exports.zAppointmentSpecialtySchema = exports.zAppointmentRescheduleSchema = exports.zAppointmentAppointmentSourceSchema = exports.zAppointmentAppointmentRequestTypeSchema = exports.zAppointmentProcedureSchema = exports.zAppointmentPaymentSchema = exports.zAppointmentInsuranceSchema = exports.zAppointmentProfessionalSchema = exports.zAppointmentPatientSchema = exports.zAppointmentAddressSchema = exports.zAppointmentTypeBaseSchema = exports.zAppointmentModeSchema = exports.zAppointmentStatusTypeSchema = exports.zAppointmentPaymentStatusSchema = void 0;
|
|
3
|
+
exports.zPatientAppointmentSchema = exports.zAppointmentSchema = exports.zAppointmentSpecialtySchema = exports.zAppointmentRescheduleSchema = exports.zAppointmentAppointmentSourceSchema = exports.zAppointmentAppointmentRequestTypeSchema = exports.zAppointmentProcedureSchema = exports.zAppointmentPaymentSchema = exports.zAppointmentInsuranceSchema = exports.zAppointmentProfessionalSchema = exports.zAppointmentPatientSchema = exports.zAppointmentAddressSchema = exports.zAppointmentTypeBaseSchema = exports.zAppointmentModeSchema = exports.zAppointmentStatusTypeSchema = exports.zAppointmentPaymentStatusSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const zod_schemas_1 = require("../../shared/zod-schemas");
|
|
6
6
|
// Enums para validação
|
|
@@ -187,3 +187,21 @@ exports.zAppointmentSchema = zod_schemas_1.zFireDocSchema
|
|
|
187
187
|
tags: zod_1.z.array(zod_schemas_1.zTagSchema).nullable().optional(),
|
|
188
188
|
})
|
|
189
189
|
.passthrough();
|
|
190
|
+
// Schema para a Replicação do Appointment para o Patient
|
|
191
|
+
exports.zPatientAppointmentSchema = zod_1.z
|
|
192
|
+
.object({
|
|
193
|
+
appointmentId: zod_1.z.string().min(1), // ID do agendamento
|
|
194
|
+
startDate: zod_schemas_1.zFirestoreDateSchema,
|
|
195
|
+
duration: zod_1.z.number(), // Duração em minutos
|
|
196
|
+
status: zod_1.z.string(), // Status customizado do dicionário
|
|
197
|
+
statusBase: exports.zAppointmentStatusTypeSchema, // Tipo base para lógica
|
|
198
|
+
appointmentMode: exports.zAppointmentModeSchema.nullable().optional(),
|
|
199
|
+
appointmentBaseType: exports.zAppointmentTypeBaseSchema.nullable().optional(), // Tipo base para lógica
|
|
200
|
+
procedures: zod_1.z.array(zod_1.z.string()).nullable().optional(), // Array de strings dos procedimentos
|
|
201
|
+
professional: zod_1.z.string().nullable().optional(), // String serializada do profissional
|
|
202
|
+
insurance: zod_1.z.string().nullable().optional(), // String serializada do seguro
|
|
203
|
+
payment: exports.zAppointmentPaymentSchema.nullable().optional(),
|
|
204
|
+
reschedule_count: zod_1.z.number().nullable().optional(), // Contador de remarcações
|
|
205
|
+
external_id: zod_1.z.string().nullable().optional(), // ID externo da consulta
|
|
206
|
+
})
|
|
207
|
+
.passthrough();
|
|
@@ -207,3 +207,22 @@ export const zAppointmentSchema = zFireDocSchema
|
|
|
207
207
|
tags: z.array(zTagSchema).nullable().optional(),
|
|
208
208
|
})
|
|
209
209
|
.passthrough();
|
|
210
|
+
|
|
211
|
+
// Schema para a Replicação do Appointment para o Patient
|
|
212
|
+
export const zPatientAppointmentSchema = z
|
|
213
|
+
.object({
|
|
214
|
+
appointmentId: z.string().min(1), // ID do agendamento
|
|
215
|
+
startDate: zFirestoreDateSchema,
|
|
216
|
+
duration: z.number(), // Duração em minutos
|
|
217
|
+
status: z.string(), // Status customizado do dicionário
|
|
218
|
+
statusBase: zAppointmentStatusTypeSchema, // Tipo base para lógica
|
|
219
|
+
appointmentMode: zAppointmentModeSchema.nullable().optional(),
|
|
220
|
+
appointmentBaseType: zAppointmentTypeBaseSchema.nullable().optional(), // Tipo base para lógica
|
|
221
|
+
procedures: z.array(z.string()).nullable().optional(), // Array de strings dos procedimentos
|
|
222
|
+
professional: z.string().nullable().optional(), // String serializada do profissional
|
|
223
|
+
insurance: z.string().nullable().optional(), // String serializada do seguro
|
|
224
|
+
payment: zAppointmentPaymentSchema.nullable().optional(),
|
|
225
|
+
reschedule_count: z.number().nullable().optional(), // Contador de remarcações
|
|
226
|
+
external_id: z.string().nullable().optional(), // ID externo da consulta
|
|
227
|
+
})
|
|
228
|
+
.passthrough();
|
|
@@ -42,6 +42,22 @@ export declare const zMedCalendarSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
42
42
|
category?: string | null | undefined;
|
|
43
43
|
}>, "many">>>;
|
|
44
44
|
userRef: z.ZodAny;
|
|
45
|
+
appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
46
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
47
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
48
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
51
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
52
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
53
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
56
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
57
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
58
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
45
61
|
}>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
|
|
46
62
|
id: z.ZodString;
|
|
47
63
|
ref: z.ZodAny;
|
|
@@ -85,6 +101,22 @@ export declare const zMedCalendarSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
85
101
|
category?: string | null | undefined;
|
|
86
102
|
}>, "many">>>;
|
|
87
103
|
userRef: z.ZodAny;
|
|
104
|
+
appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
105
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
106
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
107
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
110
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
111
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
112
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
115
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
116
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
117
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
88
120
|
}>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
|
|
89
121
|
id: z.ZodString;
|
|
90
122
|
ref: z.ZodAny;
|
|
@@ -128,4 +160,20 @@ export declare const zMedCalendarSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
128
160
|
category?: string | null | undefined;
|
|
129
161
|
}>, "many">>>;
|
|
130
162
|
userRef: z.ZodAny;
|
|
163
|
+
appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
164
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
165
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
166
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
169
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
170
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
171
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
174
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
175
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
176
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
177
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
131
179
|
}>, z.ZodTypeAny, "passthrough">>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.zMedCalendarSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const zod_schemas_1 = require("../../shared/zod-schemas");
|
|
6
|
+
const zod_schemas_2 = require("../people/zod-schemas");
|
|
6
7
|
exports.zMedCalendarSchema = zod_schemas_1.zFireDocSchema
|
|
7
8
|
.extend({
|
|
8
9
|
calendarId: zod_1.z.string().min(1).max(30),
|
|
@@ -24,5 +25,6 @@ exports.zMedCalendarSchema = zod_schemas_1.zFireDocSchema
|
|
|
24
25
|
external: zod_1.z.boolean().default(true).optional(),
|
|
25
26
|
tags: zod_1.z.array(zod_schemas_1.zTagSchema).nullable().optional(),
|
|
26
27
|
userRef: zod_1.z.any(),
|
|
28
|
+
appointmentCounters: zod_schemas_2.zAppointmentCountersSchema.nullable().optional(),
|
|
27
29
|
})
|
|
28
30
|
.passthrough();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { zFireDocSchema, zTagSchema } from "../../shared/zod-schemas";
|
|
3
|
+
import { zAppointmentCountersSchema } from "../people/zod-schemas";
|
|
3
4
|
|
|
4
5
|
export const zMedCalendarSchema = zFireDocSchema
|
|
5
6
|
.extend({
|
|
@@ -22,5 +23,6 @@ export const zMedCalendarSchema = zFireDocSchema
|
|
|
22
23
|
external: z.boolean().default(true).optional(),
|
|
23
24
|
tags: z.array(zTagSchema).nullable().optional(),
|
|
24
25
|
userRef: z.any(),
|
|
26
|
+
appointmentCounters: zAppointmentCountersSchema.nullable().optional(),
|
|
25
27
|
})
|
|
26
28
|
.passthrough();
|
|
@@ -541,6 +541,22 @@ export declare const zPatientChronicConditionSchema: z.ZodObject<{
|
|
|
541
541
|
}[] | null | undefined;
|
|
542
542
|
notes?: string | undefined;
|
|
543
543
|
}>;
|
|
544
|
+
export declare const zAppointmentCountersSchema: z.ZodObject<{
|
|
545
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
546
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
547
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
548
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
549
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
550
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
551
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
552
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
553
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
554
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
555
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
556
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
557
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
558
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
559
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
544
560
|
export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
545
561
|
id: z.ZodString;
|
|
546
562
|
ref: z.ZodAny;
|
|
@@ -682,7 +698,22 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
|
|
|
682
698
|
notes?: string | undefined;
|
|
683
699
|
}>, "many">>>;
|
|
684
700
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
685
|
-
appointmentCounters: z.ZodOptional<z.ZodNullable<z.
|
|
701
|
+
appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
702
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
703
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
704
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
705
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
706
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
707
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
708
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
709
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
710
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
711
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
712
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
713
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
714
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
715
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
716
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
686
717
|
tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
687
718
|
name: z.ZodString;
|
|
688
719
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -844,7 +875,22 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
|
|
|
844
875
|
notes?: string | undefined;
|
|
845
876
|
}>, "many">>>;
|
|
846
877
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
847
|
-
appointmentCounters: z.ZodOptional<z.ZodNullable<z.
|
|
878
|
+
appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
879
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
880
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
881
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
882
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
883
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
884
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
885
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
886
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
887
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
888
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
889
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
890
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
891
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
892
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
893
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
848
894
|
tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
849
895
|
name: z.ZodString;
|
|
850
896
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -1006,7 +1052,22 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
|
|
|
1006
1052
|
notes?: string | undefined;
|
|
1007
1053
|
}>, "many">>>;
|
|
1008
1054
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1009
|
-
appointmentCounters: z.ZodOptional<z.ZodNullable<z.
|
|
1055
|
+
appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1056
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1057
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1058
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
1059
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
1060
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1061
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1062
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1063
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
1064
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
1065
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1066
|
+
statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1067
|
+
appointmentBaseType: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1068
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
1069
|
+
deleted: z.ZodOptional<z.ZodNumber>;
|
|
1070
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1010
1071
|
tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1011
1072
|
name: z.ZodString;
|
|
1012
1073
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zPatientSchema = exports.zPatientChronicConditionSchema = exports.zPatientAllergySchema = exports.zBloodTypeSchema = exports.zPatientStatusSchema = exports.zProfessionalSchema = exports.zProfessionalOfficeSchema = exports.zProfessionalSpecialtySchema = exports.zProfessionalCouncilSchema = exports.zProfessionalStatusSchema = void 0;
|
|
3
|
+
exports.zPatientSchema = exports.zAppointmentCountersSchema = exports.zPatientChronicConditionSchema = exports.zPatientAllergySchema = exports.zBloodTypeSchema = exports.zPatientStatusSchema = exports.zProfessionalSchema = exports.zProfessionalOfficeSchema = exports.zProfessionalSpecialtySchema = exports.zProfessionalCouncilSchema = exports.zProfessionalStatusSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const zod_schemas_1 = require("../dic/zod-schemas");
|
|
6
6
|
const zod_schemas_2 = require("../../shared/zod-schemas");
|
|
@@ -78,6 +78,15 @@ exports.zPatientChronicConditionSchema = zod_1.z.object({
|
|
|
78
78
|
medications: zod_1.z.array(zod_schemas_1.zMedicationSchema).nullable().optional(),
|
|
79
79
|
notes: zod_1.z.string().max(2048).optional().default(""),
|
|
80
80
|
});
|
|
81
|
+
// Schema para contadores de appointments (usado em Patient e Calendar)
|
|
82
|
+
exports.zAppointmentCountersSchema = zod_1.z
|
|
83
|
+
.object({
|
|
84
|
+
statusBase: zod_1.z.record(zod_1.z.string(), zod_1.z.number()).optional(),
|
|
85
|
+
appointmentBaseType: zod_1.z.record(zod_1.z.string(), zod_1.z.number()).optional(),
|
|
86
|
+
total: zod_1.z.number().optional(),
|
|
87
|
+
deleted: zod_1.z.number().optional(),
|
|
88
|
+
})
|
|
89
|
+
.passthrough();
|
|
81
90
|
exports.zPatientSchema = zod_schemas_3.zProfileSchema // Extend from ProfileSchema
|
|
82
91
|
.extend({
|
|
83
92
|
external_id: zod_1.z.string().nullable().optional(),
|
|
@@ -97,7 +106,7 @@ exports.zPatientSchema = zod_schemas_3.zProfileSchema // Extend from ProfileSche
|
|
|
97
106
|
.nullable()
|
|
98
107
|
.optional(),
|
|
99
108
|
notes: zod_1.z.string().nullable().optional(),
|
|
100
|
-
appointmentCounters:
|
|
109
|
+
appointmentCounters: exports.zAppointmentCountersSchema.nullable().optional(),
|
|
101
110
|
tags: zod_1.z.array(zod_schemas_2.zTagSchema).nullable().optional(),
|
|
102
111
|
userRef: zod_1.z.any(),
|
|
103
112
|
})
|
|
@@ -95,6 +95,16 @@ export const zPatientChronicConditionSchema = z.object({
|
|
|
95
95
|
notes: z.string().max(2048).optional().default(""),
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
+
// Schema para contadores de appointments (usado em Patient e Calendar)
|
|
99
|
+
export const zAppointmentCountersSchema = z
|
|
100
|
+
.object({
|
|
101
|
+
statusBase: z.record(z.string(), z.number()).optional(),
|
|
102
|
+
appointmentBaseType: z.record(z.string(), z.number()).optional(),
|
|
103
|
+
total: z.number().optional(),
|
|
104
|
+
deleted: z.number().optional(),
|
|
105
|
+
})
|
|
106
|
+
.passthrough();
|
|
107
|
+
|
|
98
108
|
export const zPatientSchema = zProfileSchema // Extend from ProfileSchema
|
|
99
109
|
.extend({
|
|
100
110
|
external_id: z.string().nullable().optional(),
|
|
@@ -114,7 +124,7 @@ export const zPatientSchema = zProfileSchema // Extend from ProfileSchema
|
|
|
114
124
|
.nullable()
|
|
115
125
|
.optional(),
|
|
116
126
|
notes: z.string().nullable().optional(),
|
|
117
|
-
appointmentCounters:
|
|
127
|
+
appointmentCounters: zAppointmentCountersSchema.nullable().optional(),
|
|
118
128
|
tags: z.array(zTagSchema).nullable().optional(),
|
|
119
129
|
userRef: z.any(),
|
|
120
130
|
})
|
|
@@ -127,3 +127,19 @@ export interface IAppointment extends IFireDoc {
|
|
|
127
127
|
tags?: ITag[] | null;
|
|
128
128
|
[key: string]: unknown;
|
|
129
129
|
}
|
|
130
|
+
export interface IPatientAppointment {
|
|
131
|
+
appointmentId: string;
|
|
132
|
+
startDate: Date;
|
|
133
|
+
duration: number;
|
|
134
|
+
status: string;
|
|
135
|
+
statusBase: AppointmentStatusType;
|
|
136
|
+
appointmentMode?: AppointmentMode | null;
|
|
137
|
+
appointmentBaseType?: AppointmentType | null;
|
|
138
|
+
procedures?: string[];
|
|
139
|
+
professional?: string;
|
|
140
|
+
insurance?: string;
|
|
141
|
+
payment?: IAppointmentPayment | null;
|
|
142
|
+
reschedule_count?: number | null;
|
|
143
|
+
external_id?: string | null;
|
|
144
|
+
[key: string]: unknown;
|
|
145
|
+
}
|
|
@@ -164,3 +164,21 @@ export interface IAppointment extends IFireDoc {
|
|
|
164
164
|
tags?: ITag[] | null;
|
|
165
165
|
[key: string]: unknown; // index signature
|
|
166
166
|
}
|
|
167
|
+
|
|
168
|
+
// Interface da Replicação do Appointment para o Patient
|
|
169
|
+
export interface IPatientAppointment {
|
|
170
|
+
appointmentId: string;
|
|
171
|
+
startDate: Date;
|
|
172
|
+
duration: number;
|
|
173
|
+
status: string;
|
|
174
|
+
statusBase: AppointmentStatusType;
|
|
175
|
+
appointmentMode?: AppointmentMode | null;
|
|
176
|
+
appointmentBaseType?: AppointmentType | null;
|
|
177
|
+
procedures?: string[];
|
|
178
|
+
professional?: string;
|
|
179
|
+
insurance?: string;
|
|
180
|
+
payment?: IAppointmentPayment | null;
|
|
181
|
+
reschedule_count?: number | null;
|
|
182
|
+
external_id?: string | null; // ID externo da consulta
|
|
183
|
+
[key: string]: unknown; // index signature
|
|
184
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "../../evo-people/fb_collections";
|
|
2
2
|
import type { FirestoreDocumentReference, IFireDoc, ITag } from "../../shared";
|
|
3
|
+
import type { IAppointmentCounters } from "../people";
|
|
3
4
|
export interface IMedCalendar extends IFireDoc {
|
|
4
5
|
calendarId: string;
|
|
5
6
|
color?: string;
|
|
@@ -17,5 +18,6 @@ export interface IMedCalendar extends IFireDoc {
|
|
|
17
18
|
external?: boolean;
|
|
18
19
|
tags?: ITag[] | null;
|
|
19
20
|
userRef?: FirestoreDocumentReference;
|
|
21
|
+
appointmentCounters?: IAppointmentCounters | null;
|
|
20
22
|
[key: string]: unknown;
|
|
21
23
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "../../evo-people/fb_collections";
|
|
2
2
|
import type { FirestoreDocumentReference, IFireDoc, ITag } from "../../shared";
|
|
3
|
+
import type { IAppointmentCounters } from "../people";
|
|
3
4
|
|
|
4
5
|
// ----- MedCalendarTypes
|
|
5
6
|
|
|
@@ -20,5 +21,7 @@ export interface IMedCalendar extends IFireDoc {
|
|
|
20
21
|
external?: boolean;
|
|
21
22
|
tags?: ITag[] | null;
|
|
22
23
|
userRef?: FirestoreDocumentReference;
|
|
24
|
+
// Contadores de appointments
|
|
25
|
+
appointmentCounters?: IAppointmentCounters | null;
|
|
23
26
|
[key: string]: unknown; // index signature
|
|
24
27
|
}
|
|
@@ -107,6 +107,12 @@ export interface IPatientAllergy {
|
|
|
107
107
|
ref?: FirestoreDocumentReference;
|
|
108
108
|
severity?: Severity | null;
|
|
109
109
|
}
|
|
110
|
+
export interface IAppointmentCounters {
|
|
111
|
+
statusBase?: Record<string, number>;
|
|
112
|
+
appointmentBaseType?: Record<string, number>;
|
|
113
|
+
total?: number;
|
|
114
|
+
deleted?: number;
|
|
115
|
+
}
|
|
110
116
|
export interface IPatient extends IProfile {
|
|
111
117
|
external_id?: string | null;
|
|
112
118
|
social_id?: string | null;
|
|
@@ -122,7 +128,7 @@ export interface IPatient extends IProfile {
|
|
|
122
128
|
allergies?: IPatientAllergy[] | null;
|
|
123
129
|
chronic_conditions?: IPatientChronicCondition[] | null;
|
|
124
130
|
notes?: string | null;
|
|
125
|
-
appointmentCounters?:
|
|
131
|
+
appointmentCounters?: IAppointmentCounters | null;
|
|
126
132
|
tags?: ITag[] | null;
|
|
127
133
|
userRef?: FirestoreDocumentReference;
|
|
128
134
|
[key: string]: unknown;
|
|
@@ -161,6 +161,14 @@ export interface IPatientAllergy {
|
|
|
161
161
|
severity?: Severity | null; // Nível de gravidade
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
// Interface para contadores de appointments (usada em Patient e Calendar)
|
|
165
|
+
export interface IAppointmentCounters {
|
|
166
|
+
statusBase?: Record<string, number>; // Contadores por statusBase (ex: scheduled, in_progress, cancelled, etc.)
|
|
167
|
+
appointmentBaseType?: Record<string, number>; // Contadores por appointmentBaseType (ex: consultation, exam, procedure, etc.)
|
|
168
|
+
total?: number; // Total de appointments não deletados
|
|
169
|
+
deleted?: number; // Total de appointments deletados
|
|
170
|
+
}
|
|
171
|
+
|
|
164
172
|
export interface IPatient extends IProfile {
|
|
165
173
|
external_id?: string | null; // ID externo do paciente
|
|
166
174
|
social_id?: string | null; //CPF
|
|
@@ -177,8 +185,8 @@ export interface IPatient extends IProfile {
|
|
|
177
185
|
allergies?: IPatientAllergy[] | null; // Lista de alergias conhecidas
|
|
178
186
|
chronic_conditions?: IPatientChronicCondition[] | null; // Lista de doenças crônicas do paciente
|
|
179
187
|
notes?: string | null; // Anotações sobre o paciente
|
|
180
|
-
// Contadores de appointments
|
|
181
|
-
appointmentCounters?:
|
|
188
|
+
// Contadores de appointments
|
|
189
|
+
appointmentCounters?: IAppointmentCounters | null;
|
|
182
190
|
tags?: ITag[] | null;
|
|
183
191
|
userRef?: FirestoreDocumentReference;
|
|
184
192
|
[key: string]: unknown; // index signature
|