evo360-types 1.3.62 → 1.3.65

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.
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
- export declare const zPaymentStatusSchema: z.ZodEnum<["paid", "partial", "pending", "not_informed"]>;
3
- export declare const zMedAppointmentStatusSchema: z.ZodEnum<["scheduled", "confirmed", "completed", "pre_checkin", "waiting", "no_show", "cancelled", "extra_slot", "in_progress", "rescheduled"]>;
2
+ export declare const zAppointmentPaymentStatusSchema: z.ZodEnum<["paid", "partial", "pending", "not_informed"]>;
3
+ export declare const zAppointmentStatusTypeSchema: 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"]>;
4
4
  export declare const zAppointmentModeSchema: z.ZodEnum<["telemedicine", "in_person"]>;
5
- export declare const zAppointmentTypeSchema: z.ZodEnum<["blocked", "consultation", "procedure", "follow_up", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
5
+ export declare const zAppointmentTypeBaseSchema: z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
6
6
  export declare const zAppointmentAddressSchema: z.ZodObject<{
7
7
  address_name: z.ZodOptional<z.ZodString>;
8
8
  address_line1: z.ZodOptional<z.ZodString>;
@@ -87,7 +87,7 @@ export declare const zAppointmentProfessionalSchema: z.ZodObject<{
87
87
  gender: z.ZodDefault<z.ZodOptional<z.ZodString>>;
88
88
  external_id: z.ZodOptional<z.ZodString>;
89
89
  }, z.ZodTypeAny, "passthrough">>;
90
- export declare const zInsuranceSchema: z.ZodObject<{
90
+ export declare const zAppointmentInsuranceSchema: z.ZodObject<{
91
91
  name: z.ZodString;
92
92
  external_id: z.ZodOptional<z.ZodString>;
93
93
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -97,7 +97,7 @@ export declare const zInsuranceSchema: z.ZodObject<{
97
97
  name: z.ZodString;
98
98
  external_id: z.ZodOptional<z.ZodString>;
99
99
  }, z.ZodTypeAny, "passthrough">>;
100
- export declare const zPaymentSchema: z.ZodObject<{
100
+ export declare const zAppointmentPaymentSchema: z.ZodObject<{
101
101
  total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
102
102
  paid: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
103
103
  due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -113,7 +113,7 @@ export declare const zPaymentSchema: z.ZodObject<{
113
113
  due: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
114
114
  status: z.ZodOptional<z.ZodEnum<["paid", "partial", "pending", "not_informed"]>>;
115
115
  }, z.ZodTypeAny, "passthrough">>;
116
- export declare const zProcedureSchema: z.ZodObject<{
116
+ export declare const zAppointmentProcedureSchema: z.ZodObject<{
117
117
  id: z.ZodOptional<z.ZodNumber>;
118
118
  name: z.ZodString;
119
119
  description: z.ZodOptional<z.ZodString>;
@@ -144,12 +144,12 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
144
144
  calendarId: z.ZodNumber;
145
145
  startDate: z.ZodString;
146
146
  endDate: z.ZodString;
147
- status: z.ZodEnum<["scheduled", "confirmed", "completed", "pre_checkin", "waiting", "no_show", "cancelled", "extra_slot", "in_progress", "rescheduled"]>;
148
- statusCaption: z.ZodString;
147
+ status: z.ZodString;
148
+ 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"]>;
149
149
  notes: z.ZodOptional<z.ZodString>;
150
150
  appointmentMode: z.ZodEnum<["telemedicine", "in_person"]>;
151
- appointmentType: z.ZodEnum<["blocked", "consultation", "procedure", "follow_up", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
152
- appointmentTypeCaption: z.ZodString;
151
+ appointmentType: z.ZodString;
152
+ appointmentBaseType: z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
153
153
  specialty: z.ZodOptional<z.ZodString>;
154
154
  address: z.ZodOptional<z.ZodObject<{
155
155
  address_name: z.ZodOptional<z.ZodString>;
@@ -314,12 +314,12 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
314
314
  calendarId: z.ZodNumber;
315
315
  startDate: z.ZodString;
316
316
  endDate: z.ZodString;
317
- status: z.ZodEnum<["scheduled", "confirmed", "completed", "pre_checkin", "waiting", "no_show", "cancelled", "extra_slot", "in_progress", "rescheduled"]>;
318
- statusCaption: z.ZodString;
317
+ status: z.ZodString;
318
+ 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"]>;
319
319
  notes: z.ZodOptional<z.ZodString>;
320
320
  appointmentMode: z.ZodEnum<["telemedicine", "in_person"]>;
321
- appointmentType: z.ZodEnum<["blocked", "consultation", "procedure", "follow_up", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
322
- appointmentTypeCaption: z.ZodString;
321
+ appointmentType: z.ZodString;
322
+ appointmentBaseType: z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
323
323
  specialty: z.ZodOptional<z.ZodString>;
324
324
  address: z.ZodOptional<z.ZodObject<{
325
325
  address_name: z.ZodOptional<z.ZodString>;
@@ -484,12 +484,12 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
484
484
  calendarId: z.ZodNumber;
485
485
  startDate: z.ZodString;
486
486
  endDate: z.ZodString;
487
- status: z.ZodEnum<["scheduled", "confirmed", "completed", "pre_checkin", "waiting", "no_show", "cancelled", "extra_slot", "in_progress", "rescheduled"]>;
488
- statusCaption: z.ZodString;
487
+ status: z.ZodString;
488
+ 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"]>;
489
489
  notes: z.ZodOptional<z.ZodString>;
490
490
  appointmentMode: z.ZodEnum<["telemedicine", "in_person"]>;
491
- appointmentType: z.ZodEnum<["blocked", "consultation", "procedure", "follow_up", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
492
- appointmentTypeCaption: z.ZodString;
491
+ appointmentType: z.ZodString;
492
+ appointmentBaseType: z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
493
493
  specialty: z.ZodOptional<z.ZodString>;
494
494
  address: z.ZodOptional<z.ZodObject<{
495
495
  address_name: z.ZodOptional<z.ZodString>;
@@ -1,33 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zAppointmentSchema = exports.zProcedureSchema = exports.zPaymentSchema = exports.zInsuranceSchema = exports.zAppointmentProfessionalSchema = exports.zAppointmentPatientSchema = exports.zAppointmentAddressSchema = exports.zAppointmentTypeSchema = exports.zAppointmentModeSchema = exports.zMedAppointmentStatusSchema = exports.zPaymentStatusSchema = void 0;
3
+ exports.zAppointmentSchema = 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
7
- exports.zPaymentStatusSchema = zod_1.z.enum([
7
+ exports.zAppointmentPaymentStatusSchema = zod_1.z.enum([
8
8
  "paid",
9
9
  "partial",
10
10
  "pending",
11
11
  "not_informed",
12
12
  ]);
13
- exports.zMedAppointmentStatusSchema = zod_1.z.enum([
13
+ // Schema para os tipos base de status de agendamento (para validação do statusBase)
14
+ exports.zAppointmentStatusTypeSchema = zod_1.z.enum([
14
15
  "scheduled",
15
16
  "confirmed",
16
- "completed",
17
+ "rescheduled",
17
18
  "pre_checkin",
18
19
  "waiting",
20
+ "in_progress",
21
+ "completed",
19
22
  "no_show",
20
23
  "cancelled",
24
+ "cancelled_by_clinic",
25
+ "cancelled_by_patient",
21
26
  "extra_slot",
22
- "in_progress",
23
- "rescheduled",
27
+ "awaiting_payment",
28
+ "paid",
29
+ "awaiting_documents",
30
+ "blocked",
31
+ "waiting_list",
32
+ "expired",
24
33
  ]);
25
34
  exports.zAppointmentModeSchema = zod_1.z.enum(["telemedicine", "in_person"]);
26
- exports.zAppointmentTypeSchema = zod_1.z.enum([
35
+ // Schema para os tipos base de agendamento (para validação do appointmentBaseType)
36
+ exports.zAppointmentTypeBaseSchema = zod_1.z.enum([
27
37
  "blocked",
28
38
  "consultation",
29
- "procedure",
30
39
  "follow_up",
40
+ "procedure",
31
41
  "surgery",
32
42
  "exam",
33
43
  "evaluation",
@@ -76,23 +86,23 @@ exports.zAppointmentProfessionalSchema = zod_1.z
76
86
  })
77
87
  .passthrough();
78
88
  // Schema para seguro
79
- exports.zInsuranceSchema = zod_1.z
89
+ exports.zAppointmentInsuranceSchema = zod_1.z
80
90
  .object({
81
91
  name: zod_1.z.string(),
82
92
  external_id: zod_1.z.string().optional(),
83
93
  })
84
94
  .passthrough();
85
95
  // Schema para pagamento
86
- exports.zPaymentSchema = zod_1.z
96
+ exports.zAppointmentPaymentSchema = zod_1.z
87
97
  .object({
88
98
  total: zod_1.z.number().nullable().optional(),
89
99
  paid: zod_1.z.number().nullable().optional(),
90
100
  due: zod_1.z.number().nullable().optional(),
91
- status: exports.zPaymentStatusSchema.optional(),
101
+ status: exports.zAppointmentPaymentStatusSchema.optional(),
92
102
  })
93
103
  .passthrough();
94
104
  // Schema para procedimento
95
- exports.zProcedureSchema = zod_1.z.object({
105
+ exports.zAppointmentProcedureSchema = zod_1.z.object({
96
106
  id: zod_1.z.number().optional(),
97
107
  name: zod_1.z.string(),
98
108
  description: zod_1.z.string().optional(),
@@ -105,19 +115,19 @@ exports.zAppointmentSchema = zod_schemas_1.zFireDocSchema
105
115
  calendarId: zod_1.z.number(),
106
116
  startDate: zod_1.z.string().datetime(), // ISO string
107
117
  endDate: zod_1.z.string().datetime(), // ISO string
108
- status: exports.zMedAppointmentStatusSchema,
109
- statusCaption: zod_1.z.string(),
118
+ status: zod_1.z.string(), // Status customizado do dicionário
119
+ statusBase: exports.zAppointmentStatusTypeSchema, // Tipo base para lógica
110
120
  notes: zod_1.z.string().optional(),
111
121
  appointmentMode: exports.zAppointmentModeSchema,
112
- appointmentType: exports.zAppointmentTypeSchema,
113
- appointmentTypeCaption: zod_1.z.string(),
122
+ appointmentType: zod_1.z.string(), // Tipo customizado do dicionário
123
+ appointmentBaseType: exports.zAppointmentTypeBaseSchema, // Tipo base para lógica
114
124
  specialty: zod_1.z.string().optional(),
115
125
  address: exports.zAppointmentAddressSchema.optional(),
116
- procedures: zod_1.z.array(exports.zProcedureSchema).optional(),
126
+ procedures: zod_1.z.array(exports.zAppointmentProcedureSchema).optional(),
117
127
  patient: exports.zAppointmentPatientSchema,
118
128
  professional: exports.zAppointmentProfessionalSchema.optional(),
119
- insurance: exports.zInsuranceSchema.optional(),
120
- payment: exports.zPaymentSchema.optional(),
129
+ insurance: exports.zAppointmentInsuranceSchema.optional(),
130
+ payment: exports.zAppointmentPaymentSchema.optional(),
121
131
  // Propriedades para controle de rascunho
122
132
  isDraft: zod_1.z.boolean(),
123
133
  draftExpirationMinutes: zod_1.z.number().optional(), // tempo em minutos para expiração do rascunho
@@ -2,33 +2,43 @@ import { z } from "zod";
2
2
  import { zFireDocSchema, zTagSchema } from "../../shared/zod-schemas";
3
3
 
4
4
  // Enums para validação
5
- export const zPaymentStatusSchema = z.enum([
5
+ export const zAppointmentPaymentStatusSchema = z.enum([
6
6
  "paid",
7
7
  "partial",
8
8
  "pending",
9
9
  "not_informed",
10
10
  ]);
11
11
 
12
- export const zMedAppointmentStatusSchema = z.enum([
12
+ // Schema para os tipos base de status de agendamento (para validação do statusBase)
13
+ export const zAppointmentStatusTypeSchema = z.enum([
13
14
  "scheduled",
14
15
  "confirmed",
15
- "completed",
16
+ "rescheduled",
16
17
  "pre_checkin",
17
18
  "waiting",
19
+ "in_progress",
20
+ "completed",
18
21
  "no_show",
19
22
  "cancelled",
23
+ "cancelled_by_clinic",
24
+ "cancelled_by_patient",
20
25
  "extra_slot",
21
- "in_progress",
22
- "rescheduled",
26
+ "awaiting_payment",
27
+ "paid",
28
+ "awaiting_documents",
29
+ "blocked",
30
+ "waiting_list",
31
+ "expired",
23
32
  ]);
24
33
 
25
34
  export const zAppointmentModeSchema = z.enum(["telemedicine", "in_person"]);
26
35
 
27
- export const zAppointmentTypeSchema = z.enum([
36
+ // Schema para os tipos base de agendamento (para validação do appointmentBaseType)
37
+ export const zAppointmentTypeBaseSchema = z.enum([
28
38
  "blocked",
29
39
  "consultation",
30
- "procedure",
31
40
  "follow_up",
41
+ "procedure",
32
42
  "surgery",
33
43
  "exam",
34
44
  "evaluation",
@@ -81,7 +91,7 @@ export const zAppointmentProfessionalSchema = z
81
91
  .passthrough();
82
92
 
83
93
  // Schema para seguro
84
- export const zInsuranceSchema = z
94
+ export const zAppointmentInsuranceSchema = z
85
95
  .object({
86
96
  name: z.string(),
87
97
  external_id: z.string().optional(),
@@ -89,17 +99,17 @@ export const zInsuranceSchema = z
89
99
  .passthrough();
90
100
 
91
101
  // Schema para pagamento
92
- export const zPaymentSchema = z
102
+ export const zAppointmentPaymentSchema = z
93
103
  .object({
94
104
  total: z.number().nullable().optional(),
95
105
  paid: z.number().nullable().optional(),
96
106
  due: z.number().nullable().optional(),
97
- status: zPaymentStatusSchema.optional(),
107
+ status: zAppointmentPaymentStatusSchema.optional(),
98
108
  })
99
109
  .passthrough();
100
110
 
101
111
  // Schema para procedimento
102
- export const zProcedureSchema = z.object({
112
+ export const zAppointmentProcedureSchema = z.object({
103
113
  id: z.number().optional(),
104
114
  name: z.string(),
105
115
  description: z.string().optional(),
@@ -113,19 +123,19 @@ export const zAppointmentSchema = zFireDocSchema
113
123
  calendarId: z.number(),
114
124
  startDate: z.string().datetime(), // ISO string
115
125
  endDate: z.string().datetime(), // ISO string
116
- status: zMedAppointmentStatusSchema,
117
- statusCaption: z.string(),
126
+ status: z.string(), // Status customizado do dicionário
127
+ statusBase: zAppointmentStatusTypeSchema, // Tipo base para lógica
118
128
  notes: z.string().optional(),
119
129
  appointmentMode: zAppointmentModeSchema,
120
- appointmentType: zAppointmentTypeSchema,
121
- appointmentTypeCaption: z.string(),
130
+ appointmentType: z.string(), // Tipo customizado do dicionário
131
+ appointmentBaseType: zAppointmentTypeBaseSchema, // Tipo base para lógica
122
132
  specialty: z.string().optional(),
123
133
  address: zAppointmentAddressSchema.optional(),
124
- procedures: z.array(zProcedureSchema).optional(),
134
+ procedures: z.array(zAppointmentProcedureSchema).optional(),
125
135
  patient: zAppointmentPatientSchema,
126
136
  professional: zAppointmentProfessionalSchema.optional(),
127
- insurance: zInsuranceSchema.optional(),
128
- payment: zPaymentSchema.optional(),
137
+ insurance: zAppointmentInsuranceSchema.optional(),
138
+ payment: zAppointmentPaymentSchema.optional(),
129
139
 
130
140
  // Propriedades para controle de rascunho
131
141
  isDraft: z.boolean(),
@@ -409,7 +409,8 @@ export declare const zAppointmentRequestTypeSchema: z.ZodObject<z.objectUtil.ext
409
409
  category?: string | null | undefined;
410
410
  }>, "many">>>;
411
411
  }>, z.ZodTypeAny, "passthrough">>;
412
- export declare const zAppointmentStatusTypeSchema: z.ZodEnum<["rs", "cf", "ci", "co", "cx", "ns"]>;
412
+ export declare const zDicAppointmentStatusTypeSchema: 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"]>;
413
+ export declare const zDicAppointmentTypeBaseSchema: z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
413
414
  export declare const zAppointmentStatusSchema: z.ZodObject<z.objectUtil.extendShape<{
414
415
  id: z.ZodString;
415
416
  ref: z.ZodAny;
@@ -419,31 +420,66 @@ export declare const zAppointmentStatusSchema: z.ZodObject<z.objectUtil.extendSh
419
420
  updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
420
421
  deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
421
422
  }, {
422
- code: z.ZodString;
423
423
  name: z.ZodString;
424
- type: z.ZodDefault<z.ZodEnum<["rs", "cf", "ci", "co", "cx", "ns"]>>;
424
+ order: z.ZodNumber;
425
+ base_type: 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"]>;
425
426
  }>, "strip", z.ZodTypeAny, {
426
- code: string;
427
427
  name: string;
428
428
  id: string;
429
429
  tenant: string;
430
430
  model_ver: number;
431
- type: "rs" | "cf" | "ci" | "co" | "cx" | "ns";
431
+ order: number;
432
+ base_type: "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";
433
+ ref?: any;
434
+ created_at?: Date | null | undefined;
435
+ updated_at?: Date | null | undefined;
436
+ deleted_at?: Date | null | undefined;
437
+ }, {
438
+ name: string;
439
+ id: string;
440
+ tenant: string;
441
+ order: number;
442
+ base_type: "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";
443
+ ref?: any;
444
+ model_ver?: number | undefined;
445
+ created_at?: Date | null | undefined;
446
+ updated_at?: Date | null | undefined;
447
+ deleted_at?: Date | null | undefined;
448
+ }>;
449
+ export declare const zAppointmentTypeSchema: z.ZodObject<z.objectUtil.extendShape<{
450
+ id: z.ZodString;
451
+ ref: z.ZodAny;
452
+ tenant: z.ZodString;
453
+ model_ver: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
454
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
455
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
456
+ deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
457
+ }, {
458
+ name: z.ZodString;
459
+ order: z.ZodNumber;
460
+ base_type: z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
461
+ }>, "strip", z.ZodTypeAny, {
462
+ name: string;
463
+ id: string;
464
+ tenant: string;
465
+ model_ver: number;
466
+ order: number;
467
+ base_type: "blocked" | "consultation" | "follow_up" | "procedure" | "surgery" | "exam" | "evaluation" | "emergency" | "check_up" | "vaccination" | "fit_test" | "therapy" | "meeting";
432
468
  ref?: any;
433
469
  created_at?: Date | null | undefined;
434
470
  updated_at?: Date | null | undefined;
435
471
  deleted_at?: Date | null | undefined;
436
472
  }, {
437
- code: string;
438
473
  name: string;
439
474
  id: string;
440
475
  tenant: string;
476
+ order: number;
477
+ base_type: "blocked" | "consultation" | "follow_up" | "procedure" | "surgery" | "exam" | "evaluation" | "emergency" | "check_up" | "vaccination" | "fit_test" | "therapy" | "meeting";
441
478
  ref?: any;
442
479
  model_ver?: number | undefined;
443
480
  created_at?: Date | null | undefined;
444
481
  updated_at?: Date | null | undefined;
445
482
  deleted_at?: Date | null | undefined;
446
- type?: "rs" | "cf" | "ci" | "co" | "cx" | "ns" | undefined;
447
483
  }>;
448
484
  export declare const zMedicationSchema: z.ZodObject<{
449
485
  name: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zMedicalCouncilSchema = exports.zMedicalCouncilUFSchema = exports.zAllergySchema = exports.zAllergyKindSchema = exports.zChronicConditionSchema = exports.zSeveritySchema = exports.zMedicationSchema = exports.zAppointmentStatusSchema = exports.zAppointmentStatusTypeSchema = exports.zAppointmentRequestTypeSchema = exports.zAppointmentSourceSchema = exports.zPatientSourceSchema = exports.zSpecialtySchema = exports.zSpecialtyTypeSchema = void 0;
3
+ exports.zMedicalCouncilSchema = exports.zMedicalCouncilUFSchema = exports.zAllergySchema = exports.zAllergyKindSchema = exports.zChronicConditionSchema = exports.zSeveritySchema = exports.zMedicationSchema = exports.zAppointmentTypeSchema = exports.zAppointmentStatusSchema = exports.zDicAppointmentTypeBaseSchema = exports.zDicAppointmentStatusTypeSchema = exports.zAppointmentRequestTypeSchema = exports.zAppointmentSourceSchema = exports.zPatientSourceSchema = exports.zSpecialtySchema = exports.zSpecialtyTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../../shared/zod-schemas");
6
6
  exports.zSpecialtyTypeSchema = zod_schemas_1.zFireDocSchema
@@ -41,18 +41,54 @@ exports.zAppointmentRequestTypeSchema = zod_schemas_1.zFireDocSchema
41
41
  tags: zod_1.z.array(zod_schemas_1.zTagSchema).nullable().optional(),
42
42
  })
43
43
  .passthrough();
44
- exports.zAppointmentStatusTypeSchema = zod_1.z.enum([
45
- "rs",
46
- "cf",
47
- "ci",
48
- "co",
49
- "cx",
50
- "ns",
44
+ // Schema para os tipos base de status de agendamento (para uso em dicionários)
45
+ exports.zDicAppointmentStatusTypeSchema = zod_1.z.enum([
46
+ "scheduled",
47
+ "confirmed",
48
+ "rescheduled",
49
+ "pre_checkin",
50
+ "waiting",
51
+ "in_progress",
52
+ "completed",
53
+ "no_show",
54
+ "cancelled",
55
+ "cancelled_by_clinic",
56
+ "cancelled_by_patient",
57
+ "extra_slot",
58
+ "awaiting_payment",
59
+ "paid",
60
+ "awaiting_documents",
61
+ "blocked",
62
+ "waiting_list",
63
+ "expired",
51
64
  ]);
65
+ // Schema para os tipos base de agendamento (para uso em dicionários)
66
+ exports.zDicAppointmentTypeBaseSchema = zod_1.z.enum([
67
+ "blocked",
68
+ "consultation",
69
+ "follow_up",
70
+ "procedure",
71
+ "surgery",
72
+ "exam",
73
+ "evaluation",
74
+ "emergency",
75
+ "check_up",
76
+ "vaccination",
77
+ "fit_test",
78
+ "therapy",
79
+ "meeting",
80
+ ]);
81
+ // Schema para IAppointmentStatus (status customizados do usuário)
52
82
  exports.zAppointmentStatusSchema = zod_schemas_1.zFireDocSchema.extend({
53
- code: zod_1.z.string().min(1).max(10),
54
83
  name: zod_1.z.string().min(1).max(255),
55
- type: exports.zAppointmentStatusTypeSchema.default("rs"),
84
+ order: zod_1.z.number(),
85
+ base_type: exports.zDicAppointmentStatusTypeSchema,
86
+ });
87
+ // Schema para IAppointmentType (tipos customizados do usuário)
88
+ exports.zAppointmentTypeSchema = zod_schemas_1.zFireDocSchema.extend({
89
+ name: zod_1.z.string().min(1).max(255),
90
+ order: zod_1.z.number(),
91
+ base_type: exports.zDicAppointmentTypeBaseSchema,
56
92
  });
57
93
  exports.zMedicationSchema = zod_1.z.object({
58
94
  name: zod_1.z.string().min(1).max(255),
@@ -44,19 +44,57 @@ export const zAppointmentRequestTypeSchema = zFireDocSchema
44
44
  })
45
45
  .passthrough();
46
46
 
47
- export const zAppointmentStatusTypeSchema = z.enum([
48
- "rs",
49
- "cf",
50
- "ci",
51
- "co",
52
- "cx",
53
- "ns",
47
+ // Schema para os tipos base de status de agendamento (para uso em dicionários)
48
+ export const zDicAppointmentStatusTypeSchema = z.enum([
49
+ "scheduled",
50
+ "confirmed",
51
+ "rescheduled",
52
+ "pre_checkin",
53
+ "waiting",
54
+ "in_progress",
55
+ "completed",
56
+ "no_show",
57
+ "cancelled",
58
+ "cancelled_by_clinic",
59
+ "cancelled_by_patient",
60
+ "extra_slot",
61
+ "awaiting_payment",
62
+ "paid",
63
+ "awaiting_documents",
64
+ "blocked",
65
+ "waiting_list",
66
+ "expired",
54
67
  ]);
55
68
 
69
+ // Schema para os tipos base de agendamento (para uso em dicionários)
70
+ export const zDicAppointmentTypeBaseSchema = z.enum([
71
+ "blocked",
72
+ "consultation",
73
+ "follow_up",
74
+ "procedure",
75
+ "surgery",
76
+ "exam",
77
+ "evaluation",
78
+ "emergency",
79
+ "check_up",
80
+ "vaccination",
81
+ "fit_test",
82
+ "therapy",
83
+ "meeting",
84
+ ]);
85
+
86
+ // Schema para IAppointmentStatus (status customizados do usuário)
56
87
  export const zAppointmentStatusSchema = zFireDocSchema.extend({
57
- code: z.string().min(1).max(10),
58
88
  name: z.string().min(1).max(255),
59
- type: zAppointmentStatusTypeSchema.default("rs"),
89
+ order: z.number(),
90
+ base_type: zDicAppointmentStatusTypeSchema,
91
+ });
92
+
93
+ // Schema para IAppointmentType (tipos customizados do usuário)
94
+ export const zAppointmentTypeSchema = zFireDocSchema.extend({
95
+ name: z.string().min(1).max(255),
96
+ order: z.number(),
97
+ base_type: zDicAppointmentTypeBaseSchema,
60
98
  });
61
99
 
62
100
  export const zMedicationSchema = z.object({
@@ -1108,7 +1108,7 @@ export declare const zSurveySubmissionSchema: z.ZodObject<z.objectUtil.extendSha
1108
1108
  id: string;
1109
1109
  tenant: string;
1110
1110
  model_ver: number;
1111
- status: "in_progress" | "not_started" | "completed";
1111
+ status: "in_progress" | "completed" | "not_started";
1112
1112
  user_name: string;
1113
1113
  modified_after_completion: boolean;
1114
1114
  answer_count: number;
@@ -1138,7 +1138,7 @@ export declare const zSurveySubmissionSchema: z.ZodObject<z.objectUtil.extendSha
1138
1138
  }, {
1139
1139
  id: string;
1140
1140
  tenant: string;
1141
- status: "in_progress" | "not_started" | "completed";
1141
+ status: "in_progress" | "completed" | "not_started";
1142
1142
  ref?: any;
1143
1143
  model_ver?: number | undefined;
1144
1144
  created_at?: Date | null | undefined;
@@ -1192,7 +1192,7 @@ export declare const zSurveyInviteeSchema: z.ZodObject<z.objectUtil.extendShape<
1192
1192
  model_ver: number;
1193
1193
  phone: string;
1194
1194
  isAnonymous: boolean;
1195
- submission_status: "in_progress" | "not_started" | "completed";
1195
+ submission_status: "in_progress" | "completed" | "not_started";
1196
1196
  ref?: any;
1197
1197
  created_at?: Date | null | undefined;
1198
1198
  updated_at?: Date | null | undefined;
@@ -1218,7 +1218,7 @@ export declare const zSurveyInviteeSchema: z.ZodObject<z.objectUtil.extendShape<
1218
1218
  invitedUserId?: string | undefined;
1219
1219
  isAnonymous?: boolean | undefined;
1220
1220
  submissionId?: string | undefined;
1221
- submission_status?: "in_progress" | "not_started" | "completed" | undefined;
1221
+ submission_status?: "in_progress" | "completed" | "not_started" | undefined;
1222
1222
  }>;
1223
1223
  export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendShape<{
1224
1224
  id: z.ZodString;
@@ -1369,7 +1369,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1369
1369
  model_ver: number;
1370
1370
  phone: string;
1371
1371
  isAnonymous: boolean;
1372
- submission_status: "in_progress" | "not_started" | "completed";
1372
+ submission_status: "in_progress" | "completed" | "not_started";
1373
1373
  ref?: any;
1374
1374
  created_at?: Date | null | undefined;
1375
1375
  updated_at?: Date | null | undefined;
@@ -1395,7 +1395,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1395
1395
  invitedUserId?: string | undefined;
1396
1396
  isAnonymous?: boolean | undefined;
1397
1397
  submissionId?: string | undefined;
1398
- submission_status?: "in_progress" | "not_started" | "completed" | undefined;
1398
+ submission_status?: "in_progress" | "completed" | "not_started" | undefined;
1399
1399
  }>, "many">>>;
1400
1400
  invitee_count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1401
1401
  submissions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
@@ -1471,7 +1471,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1471
1471
  id: string;
1472
1472
  tenant: string;
1473
1473
  model_ver: number;
1474
- status: "in_progress" | "not_started" | "completed";
1474
+ status: "in_progress" | "completed" | "not_started";
1475
1475
  user_name: string;
1476
1476
  modified_after_completion: boolean;
1477
1477
  answer_count: number;
@@ -1501,7 +1501,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1501
1501
  }, {
1502
1502
  id: string;
1503
1503
  tenant: string;
1504
- status: "in_progress" | "not_started" | "completed";
1504
+ status: "in_progress" | "completed" | "not_started";
1505
1505
  ref?: any;
1506
1506
  model_ver?: number | undefined;
1507
1507
  created_at?: Date | null | undefined;
@@ -1539,7 +1539,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1539
1539
  id: string;
1540
1540
  tenant: string;
1541
1541
  model_ver: number;
1542
- status: "draft" | "open" | "closed" | "in_progress" | "paused";
1542
+ status: "draft" | "in_progress" | "open" | "closed" | "paused";
1543
1543
  submission_count: number;
1544
1544
  start_date: Date | null;
1545
1545
  end_date: Date | null;
@@ -1595,7 +1595,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1595
1595
  id: string;
1596
1596
  tenant: string;
1597
1597
  model_ver: number;
1598
- status: "in_progress" | "not_started" | "completed";
1598
+ status: "in_progress" | "completed" | "not_started";
1599
1599
  user_name: string;
1600
1600
  modified_after_completion: boolean;
1601
1601
  answer_count: number;
@@ -1631,7 +1631,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1631
1631
  model_ver: number;
1632
1632
  phone: string;
1633
1633
  isAnonymous: boolean;
1634
- submission_status: "in_progress" | "not_started" | "completed";
1634
+ submission_status: "in_progress" | "completed" | "not_started";
1635
1635
  ref?: any;
1636
1636
  created_at?: Date | null | undefined;
1637
1637
  updated_at?: Date | null | undefined;
@@ -1646,7 +1646,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1646
1646
  name: string;
1647
1647
  id: string;
1648
1648
  tenant: string;
1649
- status: "draft" | "open" | "closed" | "in_progress" | "paused";
1649
+ status: "draft" | "in_progress" | "open" | "closed" | "paused";
1650
1650
  start_date: Date | null;
1651
1651
  end_date: Date | null;
1652
1652
  allow_edit_answers: boolean;
@@ -1695,7 +1695,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1695
1695
  submissions?: {
1696
1696
  id: string;
1697
1697
  tenant: string;
1698
- status: "in_progress" | "not_started" | "completed";
1698
+ status: "in_progress" | "completed" | "not_started";
1699
1699
  ref?: any;
1700
1700
  model_ver?: number | undefined;
1701
1701
  created_at?: Date | null | undefined;
@@ -1744,7 +1744,7 @@ export declare const zSurveyDeploymentSchema: z.ZodObject<z.objectUtil.extendSha
1744
1744
  invitedUserId?: string | undefined;
1745
1745
  isAnonymous?: boolean | undefined;
1746
1746
  submissionId?: string | undefined;
1747
- submission_status?: "in_progress" | "not_started" | "completed" | undefined;
1747
+ submission_status?: "in_progress" | "completed" | "not_started" | undefined;
1748
1748
  }[] | null | undefined;
1749
1749
  invitee_count?: number | undefined;
1750
1750
  submission_not_started_count?: number | undefined;
@@ -1,46 +1,18 @@
1
1
  import type { IFireDoc, IGeoPoint, ITag } from "../../shared";
2
- export declare const PaymentStatusEnum: {
2
+ import { AppointmentStatusType, AppointmentType } from "../dic";
3
+ export declare const AppointmentPaymentStatusEnum: {
3
4
  readonly Paid: "paid";
4
5
  readonly Partial: "partial";
5
6
  readonly Pending: "pending";
6
7
  readonly NotInformed: "not_informed";
7
8
  };
8
- export type PaymentStatus = (typeof PaymentStatusEnum)[keyof typeof PaymentStatusEnum];
9
- export declare const AppointmentStatusEnum: {
10
- readonly Scheduled: "scheduled";
11
- readonly Confirmed: "confirmed";
12
- readonly Completed: "completed";
13
- readonly PreCheckin: "pre_checkin";
14
- readonly Waiting: "waiting";
15
- readonly NoShow: "no_show";
16
- readonly Cancelled: "cancelled";
17
- readonly ExtraSlot: "extra_slot";
18
- readonly InProgress: "in_progress";
19
- readonly Rescheduled: "rescheduled";
20
- };
21
- export type AppointmentStatus = (typeof AppointmentStatusEnum)[keyof typeof AppointmentStatusEnum];
9
+ export type AppointmentPaymentStatus = (typeof AppointmentPaymentStatusEnum)[keyof typeof AppointmentPaymentStatusEnum];
22
10
  export declare const AppointmentModeEnum: {
23
11
  readonly Telemedicine: "telemedicine";
24
12
  readonly InPerson: "in_person";
25
13
  };
26
14
  export type AppointmentMode = (typeof AppointmentModeEnum)[keyof typeof AppointmentModeEnum];
27
- export declare const AppointmentTypeEnum: {
28
- readonly Blocked: "blocked";
29
- readonly Consultation: "consultation";
30
- readonly FollowUp: "follow_up";
31
- readonly Procedure: "procedure";
32
- readonly Surgery: "surgery";
33
- readonly Exam: "exam";
34
- readonly Evaluation: "evaluation";
35
- readonly Emergency: "emergency";
36
- readonly CheckUp: "check_up";
37
- readonly Vaccination: "vaccination";
38
- readonly FitTest: "fit_test";
39
- readonly Therapy: "therapy";
40
- readonly Meeting: "meeting";
41
- };
42
- export type AppointmentType = (typeof AppointmentTypeEnum)[keyof typeof AppointmentTypeEnum];
43
- export interface Address {
15
+ export interface IAppointmentAddress {
44
16
  address_name?: string;
45
17
  address_line1?: string;
46
18
  address_line2?: string;
@@ -53,7 +25,7 @@ export interface Address {
53
25
  address_notes?: string;
54
26
  address_geo?: IGeoPoint;
55
27
  }
56
- export interface Patient {
28
+ export interface IAppointmentPatient {
57
29
  id: number | null;
58
30
  name: string | null;
59
31
  email: string;
@@ -64,7 +36,7 @@ export interface Patient {
64
36
  external_id?: string;
65
37
  [key: string]: unknown;
66
38
  }
67
- export interface Professional {
39
+ export interface IAppointmentProfessional {
68
40
  id: number;
69
41
  name: string;
70
42
  email: string;
@@ -72,42 +44,42 @@ export interface Professional {
72
44
  external_id?: string;
73
45
  [key: string]: unknown;
74
46
  }
75
- export interface Insurance {
47
+ export interface IAppointmentInsurance {
76
48
  name: string;
77
49
  external_id?: string;
78
50
  [key: string]: unknown;
79
51
  }
80
- export interface Payment {
52
+ export interface IAppointmentPayment {
81
53
  total?: number | null;
82
54
  paid?: number | null;
83
55
  due?: number | null;
84
- status?: PaymentStatus;
56
+ status?: AppointmentPaymentStatus;
85
57
  [key: string]: unknown;
86
58
  }
87
- export interface Procedure {
59
+ export interface IAppointmentProcedure {
88
60
  id?: number;
89
61
  name: string;
90
62
  description?: string;
91
63
  duration?: number;
92
64
  price?: number;
93
65
  }
94
- export interface Appointment extends IFireDoc {
66
+ export interface IAppointment extends IFireDoc {
95
67
  calendarId: number;
96
68
  startDate: string;
97
69
  endDate: string;
98
- status: AppointmentStatus;
99
- statusCaption: string;
70
+ status: string;
71
+ statusBase: AppointmentStatusType;
100
72
  notes?: string;
101
73
  appointmentMode: AppointmentMode;
102
- appointmentType: AppointmentType;
103
- appointmentTypeCaption: string;
74
+ appointmentType: string;
75
+ appointmentBaseType: AppointmentType;
104
76
  specialty?: string;
105
- address?: Address;
106
- procedures?: Procedure[];
107
- patient: Patient;
108
- professional?: Professional;
109
- insurance?: Insurance;
110
- payment?: Payment;
77
+ address?: IAppointmentAddress;
78
+ procedures?: IAppointmentProcedure[];
79
+ patient: IAppointmentPatient;
80
+ professional?: IAppointmentProfessional;
81
+ insurance?: IAppointmentInsurance;
82
+ payment?: IAppointmentPayment;
111
83
  isDraft: boolean;
112
84
  draftExpirationMinutes?: number;
113
85
  rescheduleCount: number;
@@ -1,44 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppointmentTypeEnum = exports.AppointmentModeEnum = exports.AppointmentStatusEnum = exports.PaymentStatusEnum = void 0;
3
+ exports.AppointmentModeEnum = exports.AppointmentPaymentStatusEnum = void 0;
4
4
  // Enums para status de pagamento
5
- exports.PaymentStatusEnum = {
5
+ exports.AppointmentPaymentStatusEnum = {
6
6
  Paid: "paid",
7
7
  Partial: "partial",
8
8
  Pending: "pending",
9
9
  NotInformed: "not_informed",
10
10
  };
11
- // Enums para status do agendamento
12
- exports.AppointmentStatusEnum = {
13
- Scheduled: "scheduled",
14
- Confirmed: "confirmed",
15
- Completed: "completed",
16
- PreCheckin: "pre_checkin",
17
- Waiting: "waiting",
18
- NoShow: "no_show",
19
- Cancelled: "cancelled",
20
- ExtraSlot: "extra_slot",
21
- InProgress: "in_progress",
22
- Rescheduled: "rescheduled",
23
- };
24
11
  // Enums para modo do agendamento
25
12
  exports.AppointmentModeEnum = {
26
13
  Telemedicine: "telemedicine",
27
14
  InPerson: "in_person",
28
15
  };
29
- // Enums para tipo do agendamento
30
- exports.AppointmentTypeEnum = {
31
- Blocked: "blocked", // Horário bloqueado (sem atendimento)
32
- Consultation: "consultation", // Consulta médica
33
- FollowUp: "follow_up", // Retorno de consulta
34
- Procedure: "procedure", // Procedimento clínico
35
- Surgery: "surgery", // Cirurgia
36
- Exam: "exam", // Exame diagnóstico (ex: ultrassom, raio-x)
37
- Evaluation: "evaluation", // Avaliação inicial
38
- Emergency: "emergency", // Atendimento de urgência
39
- CheckUp: "check_up", // Check-up / revisão geral
40
- Vaccination: "vaccination", // Vacinação
41
- FitTest: "fit_test", // Teste de aptidão física / ocupacional
42
- Therapy: "therapy", // Sessão terapêutica (fisioterapia, psicoterapia etc.)
43
- Meeting: "meeting", // Reunião administrativa / interna
44
- };
@@ -1,31 +1,15 @@
1
1
  import type { IFireDoc, IGeoPoint, ITag } from "../../shared";
2
+ import { AppointmentStatusType, AppointmentType } from "../dic";
2
3
  // Enums para status de pagamento
3
- export const PaymentStatusEnum = {
4
+ export const AppointmentPaymentStatusEnum = {
4
5
  Paid: "paid",
5
6
  Partial: "partial",
6
7
  Pending: "pending",
7
8
  NotInformed: "not_informed",
8
9
  } as const;
9
10
 
10
- export type PaymentStatus =
11
- (typeof PaymentStatusEnum)[keyof typeof PaymentStatusEnum];
12
-
13
- // Enums para status do agendamento
14
- export const AppointmentStatusEnum = {
15
- Scheduled: "scheduled",
16
- Confirmed: "confirmed",
17
- Completed: "completed",
18
- PreCheckin: "pre_checkin",
19
- Waiting: "waiting",
20
- NoShow: "no_show",
21
- Cancelled: "cancelled",
22
- ExtraSlot: "extra_slot",
23
- InProgress: "in_progress",
24
- Rescheduled: "rescheduled",
25
- } as const;
26
-
27
- export type AppointmentStatus =
28
- (typeof AppointmentStatusEnum)[keyof typeof AppointmentStatusEnum];
11
+ export type AppointmentPaymentStatus =
12
+ (typeof AppointmentPaymentStatusEnum)[keyof typeof AppointmentPaymentStatusEnum];
29
13
 
30
14
  // Enums para modo do agendamento
31
15
  export const AppointmentModeEnum = {
@@ -36,28 +20,8 @@ export const AppointmentModeEnum = {
36
20
  export type AppointmentMode =
37
21
  (typeof AppointmentModeEnum)[keyof typeof AppointmentModeEnum];
38
22
 
39
- // Enums para tipo do agendamento
40
- export const AppointmentTypeEnum = {
41
- Blocked: "blocked", // Horário bloqueado (sem atendimento)
42
- Consultation: "consultation", // Consulta médica
43
- FollowUp: "follow_up", // Retorno de consulta
44
- Procedure: "procedure", // Procedimento clínico
45
- Surgery: "surgery", // Cirurgia
46
- Exam: "exam", // Exame diagnóstico (ex: ultrassom, raio-x)
47
- Evaluation: "evaluation", // Avaliação inicial
48
- Emergency: "emergency", // Atendimento de urgência
49
- CheckUp: "check_up", // Check-up / revisão geral
50
- Vaccination: "vaccination", // Vacinação
51
- FitTest: "fit_test", // Teste de aptidão física / ocupacional
52
- Therapy: "therapy", // Sessão terapêutica (fisioterapia, psicoterapia etc.)
53
- Meeting: "meeting", // Reunião administrativa / interna
54
- } as const;
55
-
56
- export type AppointmentType =
57
- (typeof AppointmentTypeEnum)[keyof typeof AppointmentTypeEnum];
58
-
59
23
  // Interface para endereço
60
- export interface Address {
24
+ export interface IAppointmentAddress {
61
25
  address_name?: string;
62
26
  address_line1?: string;
63
27
  address_line2?: string;
@@ -72,7 +36,7 @@ export interface Address {
72
36
  }
73
37
 
74
38
  // Interface para paciente
75
- export interface Patient {
39
+ export interface IAppointmentPatient {
76
40
  id: number | null;
77
41
  name: string | null;
78
42
  email: string;
@@ -85,7 +49,7 @@ export interface Patient {
85
49
  }
86
50
 
87
51
  // Interface para profissional
88
- export interface Professional {
52
+ export interface IAppointmentProfessional {
89
53
  id: number;
90
54
  name: string;
91
55
  email: string;
@@ -95,23 +59,23 @@ export interface Professional {
95
59
  }
96
60
 
97
61
  // Interface para seguro
98
- export interface Insurance {
62
+ export interface IAppointmentInsurance {
99
63
  name: string;
100
64
  external_id?: string;
101
65
  [key: string]: unknown; // index signature
102
66
  }
103
67
 
104
68
  // Interface para pagamento
105
- export interface Payment {
69
+ export interface IAppointmentPayment {
106
70
  total?: number | null;
107
71
  paid?: number | null;
108
72
  due?: number | null;
109
- status?: PaymentStatus;
73
+ status?: AppointmentPaymentStatus;
110
74
  [key: string]: unknown;
111
75
  }
112
76
 
113
77
  // Interface para procedimento
114
- export interface Procedure {
78
+ export interface IAppointmentProcedure {
115
79
  id?: number;
116
80
  name: string;
117
81
  description?: string;
@@ -120,23 +84,23 @@ export interface Procedure {
120
84
  }
121
85
 
122
86
  // Interface principal do Appointment
123
- export interface Appointment extends IFireDoc {
87
+ export interface IAppointment extends IFireDoc {
124
88
  calendarId: number;
125
89
  startDate: string; // ISO string
126
90
  endDate: string; // ISO string
127
- status: AppointmentStatus;
128
- statusCaption: string;
91
+ status: string;
92
+ statusBase: AppointmentStatusType;
129
93
  notes?: string;
130
94
  appointmentMode: AppointmentMode;
131
- appointmentType: AppointmentType;
132
- appointmentTypeCaption: string;
95
+ appointmentType: string;
96
+ appointmentBaseType: AppointmentType;
133
97
  specialty?: string;
134
- address?: Address;
135
- procedures?: Procedure[];
136
- patient: Patient;
137
- professional?: Professional;
138
- insurance?: Insurance;
139
- payment?: Payment;
98
+ address?: IAppointmentAddress;
99
+ procedures?: IAppointmentProcedure[];
100
+ patient: IAppointmentPatient;
101
+ professional?: IAppointmentProfessional;
102
+ insurance?: IAppointmentInsurance;
103
+ payment?: IAppointmentPayment;
140
104
 
141
105
  // Propriedades para controle de rascunho
142
106
  isDraft: boolean;
@@ -50,19 +50,52 @@ export interface IAppointmentRequestType extends IFireDoc {
50
50
  tags?: ITag[] | null;
51
51
  [key: string]: unknown;
52
52
  }
53
- export type AppointmentStatusType = "rs" | "cf" | "ci" | "co" | "cx" | "ns";
54
- export declare enum IAppointmentStatusType {
55
- Reserved = "rs",
56
- Confirmed = "cf",
57
- CheckedIn = "ci",
58
- CheckedOut = "co",
59
- Canceled = "cx",
60
- NoShow = "ns"
61
- }
53
+ export declare const AppointmentStatusTypeEnum: {
54
+ readonly Scheduled: "scheduled";
55
+ readonly Confirmed: "confirmed";
56
+ readonly Rescheduled: "rescheduled";
57
+ readonly PreCheckin: "pre_checkin";
58
+ readonly Waiting: "waiting";
59
+ readonly InProgress: "in_progress";
60
+ readonly Completed: "completed";
61
+ readonly NoShow: "no_show";
62
+ readonly Cancelled: "cancelled";
63
+ readonly CancelledByClinic: "cancelled_by_clinic";
64
+ readonly CancelledByPatient: "cancelled_by_patient";
65
+ readonly ExtraSlot: "extra_slot";
66
+ readonly AwaitingPayment: "awaiting_payment";
67
+ readonly Paid: "paid";
68
+ readonly AwaitingDocuments: "awaiting_documents";
69
+ readonly Blocked: "blocked";
70
+ readonly WaitingList: "waiting_list";
71
+ readonly Expired: "expired";
72
+ };
73
+ export type AppointmentStatusType = (typeof AppointmentStatusTypeEnum)[keyof typeof AppointmentStatusTypeEnum];
74
+ export declare const AppointmentTypeEnum: {
75
+ readonly Blocked: "blocked";
76
+ readonly Consultation: "consultation";
77
+ readonly FollowUp: "follow_up";
78
+ readonly Procedure: "procedure";
79
+ readonly Surgery: "surgery";
80
+ readonly Exam: "exam";
81
+ readonly Evaluation: "evaluation";
82
+ readonly Emergency: "emergency";
83
+ readonly CheckUp: "check_up";
84
+ readonly Vaccination: "vaccination";
85
+ readonly FitTest: "fit_test";
86
+ readonly Therapy: "therapy";
87
+ readonly Meeting: "meeting";
88
+ };
89
+ export type AppointmentType = (typeof AppointmentTypeEnum)[keyof typeof AppointmentTypeEnum];
62
90
  export interface IAppointmentStatus extends IFireDoc {
63
- code: string;
64
91
  name: string;
65
- type: AppointmentStatusType;
92
+ order: number;
93
+ base_type: AppointmentStatusType;
94
+ }
95
+ export interface IAppointmentType extends IFireDoc {
96
+ name: string;
97
+ order: number;
98
+ base_type: AppointmentType;
66
99
  }
67
100
  export interface IMedication {
68
101
  name: string;
@@ -86,8 +119,8 @@ export declare enum IAllergyKind {
86
119
  Other = "Other"
87
120
  }
88
121
  export interface IAllergy extends IFireDoc {
89
- code: string;
90
122
  name: string;
123
+ order: number;
91
124
  kind?: AllergyKind | null;
92
125
  }
93
126
  export interface IMedicalCouncil extends IFireDoc {
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.IAllergyKind = exports.IAppointmentStatusType = exports.IMedDicAction = void 0;
17
+ exports.IAllergyKind = exports.AppointmentTypeEnum = exports.AppointmentStatusTypeEnum = exports.IMedDicAction = void 0;
18
18
  __exportStar(require("../../evo-people/fb_collections"), exports);
19
19
  var IMedDicAction;
20
20
  (function (IMedDicAction) {
@@ -34,15 +34,48 @@ var IMedDicAction;
34
34
  IMedDicAction["Delete_appointment_status"] = "DELETE_APPOINTMENT_STATUS";
35
35
  IMedDicAction["Update_appointment_status"] = "UPDATE_APPOINTMENT_STATUS";
36
36
  })(IMedDicAction || (exports.IMedDicAction = IMedDicAction = {}));
37
- var IAppointmentStatusType;
38
- (function (IAppointmentStatusType) {
39
- IAppointmentStatusType["Reserved"] = "rs";
40
- IAppointmentStatusType["Confirmed"] = "cf";
41
- IAppointmentStatusType["CheckedIn"] = "ci";
42
- IAppointmentStatusType["CheckedOut"] = "co";
43
- IAppointmentStatusType["Canceled"] = "cx";
44
- IAppointmentStatusType["NoShow"] = "ns";
45
- })(IAppointmentStatusType || (exports.IAppointmentStatusType = IAppointmentStatusType = {}));
37
+ // Enums para status do agendamento
38
+ exports.AppointmentStatusTypeEnum = {
39
+ // 🔹 Agendamentos e confirmações
40
+ Scheduled: "scheduled", // Criado, aguardando confirmação
41
+ Confirmed: "confirmed", // Confirmado pelo paciente ou clínica
42
+ Rescheduled: "rescheduled", // Remarcado para outro horário
43
+ // 🔹 Pré-atendimento
44
+ PreCheckin: "pre_checkin", // Paciente realizou check-in antecipado (online)
45
+ Waiting: "waiting", // Paciente chegou, aguardando atendimento
46
+ InProgress: "in_progress", // Atendimento em andamento
47
+ // 🔹 Pós-atendimento
48
+ Completed: "completed", // Atendimento finalizado com sucesso
49
+ NoShow: "no_show", // Paciente não compareceu
50
+ Cancelled: "cancelled", // Cancelado (genérico)
51
+ CancelledByClinic: "cancelled_by_clinic", // Cancelado pela clínica
52
+ CancelledByPatient: "cancelled_by_patient", // Cancelado pelo paciente
53
+ ExtraSlot: "extra_slot", // Encaixe / horário adicional
54
+ // 🔹 Financeiro / Administrativo (opcionais)
55
+ AwaitingPayment: "awaiting_payment", // Aguardando pagamento
56
+ Paid: "paid", // Pagamento confirmado
57
+ AwaitingDocuments: "awaiting_documents", // Aguardando autorização / documentos
58
+ // 🔹 Controle e sistema
59
+ Blocked: "blocked", // Horário bloqueado (sem agendamento)
60
+ WaitingList: "waiting_list", // Em lista de espera
61
+ Expired: "expired", // Agendamento expirado sem atualização
62
+ };
63
+ // Enums para tipo do agendamento
64
+ exports.AppointmentTypeEnum = {
65
+ Blocked: "blocked", // Horário bloqueado (sem atendimento)
66
+ Consultation: "consultation", // Consulta médica
67
+ FollowUp: "follow_up", // Retorno de consulta
68
+ Procedure: "procedure", // Procedimento clínico
69
+ Surgery: "surgery", // Cirurgia
70
+ Exam: "exam", // Exame diagnóstico (ex: ultrassom, raio-x)
71
+ Evaluation: "evaluation", // Avaliação inicial
72
+ Emergency: "emergency", // Atendimento de urgência
73
+ CheckUp: "check_up", // Check-up / revisão geral
74
+ Vaccination: "vaccination", // Vacinação
75
+ FitTest: "fit_test", // Teste de aptidão física / ocupacional
76
+ Therapy: "therapy", // Sessão terapêutica (fisioterapia, psicoterapia etc.)
77
+ Meeting: "meeting", // Reunião administrativa / interna
78
+ };
46
79
  var IAllergyKind;
47
80
  (function (IAllergyKind) {
48
81
  IAllergyKind["Food"] = "Food";
@@ -76,20 +76,70 @@ export interface IAppointmentRequestType extends IFireDoc {
76
76
  [key: string]: unknown; // index signature
77
77
  }
78
78
 
79
- export type AppointmentStatusType = "rs" | "cf" | "ci" | "co" | "cx" | "ns";
80
- export enum IAppointmentStatusType {
81
- Reserved = "rs",
82
- Confirmed = "cf",
83
- CheckedIn = "ci",
84
- CheckedOut = "co",
85
- Canceled = "cx",
86
- NoShow = "ns",
87
- }
79
+ // Enums para status do agendamento
80
+ export const AppointmentStatusTypeEnum = {
81
+ // 🔹 Agendamentos e confirmações
82
+ Scheduled: "scheduled", // Criado, aguardando confirmação
83
+ Confirmed: "confirmed", // Confirmado pelo paciente ou clínica
84
+ Rescheduled: "rescheduled", // Remarcado para outro horário
85
+
86
+ // 🔹 Pré-atendimento
87
+ PreCheckin: "pre_checkin", // Paciente realizou check-in antecipado (online)
88
+ Waiting: "waiting", // Paciente chegou, aguardando atendimento
89
+ InProgress: "in_progress", // Atendimento em andamento
90
+
91
+ // 🔹 Pós-atendimento
92
+ Completed: "completed", // Atendimento finalizado com sucesso
93
+ NoShow: "no_show", // Paciente não compareceu
94
+ Cancelled: "cancelled", // Cancelado (genérico)
95
+ CancelledByClinic: "cancelled_by_clinic", // Cancelado pela clínica
96
+ CancelledByPatient: "cancelled_by_patient", // Cancelado pelo paciente
97
+ ExtraSlot: "extra_slot", // Encaixe / horário adicional
98
+
99
+ // 🔹 Financeiro / Administrativo (opcionais)
100
+ AwaitingPayment: "awaiting_payment", // Aguardando pagamento
101
+ Paid: "paid", // Pagamento confirmado
102
+ AwaitingDocuments: "awaiting_documents", // Aguardando autorização / documentos
103
+
104
+ // 🔹 Controle e sistema
105
+ Blocked: "blocked", // Horário bloqueado (sem agendamento)
106
+ WaitingList: "waiting_list", // Em lista de espera
107
+ Expired: "expired", // Agendamento expirado sem atualização
108
+ } as const;
109
+
110
+ export type AppointmentStatusType =
111
+ (typeof AppointmentStatusTypeEnum)[keyof typeof AppointmentStatusTypeEnum];
112
+
113
+ // Enums para tipo do agendamento
114
+ export const AppointmentTypeEnum = {
115
+ Blocked: "blocked", // Horário bloqueado (sem atendimento)
116
+ Consultation: "consultation", // Consulta médica
117
+ FollowUp: "follow_up", // Retorno de consulta
118
+ Procedure: "procedure", // Procedimento clínico
119
+ Surgery: "surgery", // Cirurgia
120
+ Exam: "exam", // Exame diagnóstico (ex: ultrassom, raio-x)
121
+ Evaluation: "evaluation", // Avaliação inicial
122
+ Emergency: "emergency", // Atendimento de urgência
123
+ CheckUp: "check_up", // Check-up / revisão geral
124
+ Vaccination: "vaccination", // Vacinação
125
+ FitTest: "fit_test", // Teste de aptidão física / ocupacional
126
+ Therapy: "therapy", // Sessão terapêutica (fisioterapia, psicoterapia etc.)
127
+ Meeting: "meeting", // Reunião administrativa / interna
128
+ } as const;
129
+
130
+ export type AppointmentType =
131
+ (typeof AppointmentTypeEnum)[keyof typeof AppointmentTypeEnum];
88
132
 
89
133
  export interface IAppointmentStatus extends IFireDoc {
90
- code: string;
91
134
  name: string;
92
- type: AppointmentStatusType;
135
+ order: number;
136
+ base_type: AppointmentStatusType;
137
+ }
138
+
139
+ export interface IAppointmentType extends IFireDoc {
140
+ name: string;
141
+ order: number;
142
+ base_type: AppointmentType;
93
143
  }
94
144
 
95
145
  export interface IMedication {
@@ -117,8 +167,8 @@ export enum IAllergyKind {
117
167
  }
118
168
 
119
169
  export interface IAllergy extends IFireDoc {
120
- code: string;
121
170
  name: string;
171
+ order: number;
122
172
  kind?: AllergyKind | null;
123
173
  }
124
174
 
@@ -15,6 +15,7 @@ export declare const PATIENT_SOURCES_COLLECTION = "patient_sources";
15
15
  export declare const APPOINTMENTS = "appointments";
16
16
  export declare const APPOINTMENT_SOURCES_COLLECTION = "appointment_sources";
17
17
  export declare const APPOINTMENT_STATUSES_COLLECTION = "appointment_statuses";
18
+ export declare const APPOINTMENT_TYPES_COLLECTION = "appointment_types";
18
19
  export declare const APPOINTMENT_REQUEST_TYPES_COLLECTION = "appointment_request_types";
19
20
  export declare const DISEASES = "diseases";
20
21
  export declare const ALLERGIES_COLLECTION = "allergies";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CHRONIC_CONDITIONS_COLLECTION = exports.ALLERGIES_COLLECTION = exports.DISEASES = exports.APPOINTMENT_REQUEST_TYPES_COLLECTION = exports.APPOINTMENT_STATUSES_COLLECTION = exports.APPOINTMENT_SOURCES_COLLECTION = exports.APPOINTMENTS = exports.PATIENT_SOURCES_COLLECTION = exports.SOURCES = exports.MEDICAL_COUNCILS_COLLECTION = exports.COUNCILS = exports.SPECIALTIES_COLLECTION = exports.SPECIALTIES_TYPES_COLLECTION = exports.SPECIALTIES = exports.DICS_COLLECTION = exports.CALENDARS_COLLECTION = exports.PROCEDURES_COLLECTION = exports.INSURANCES_COLLECTION = exports.PATIENTS_COLLECTION = exports.PROFESSIONALS_COLLECTION = exports.EVO_MED_APP = void 0;
3
+ exports.CHRONIC_CONDITIONS_COLLECTION = exports.ALLERGIES_COLLECTION = exports.DISEASES = exports.APPOINTMENT_REQUEST_TYPES_COLLECTION = exports.APPOINTMENT_TYPES_COLLECTION = exports.APPOINTMENT_STATUSES_COLLECTION = exports.APPOINTMENT_SOURCES_COLLECTION = exports.APPOINTMENTS = exports.PATIENT_SOURCES_COLLECTION = exports.SOURCES = exports.MEDICAL_COUNCILS_COLLECTION = exports.COUNCILS = exports.SPECIALTIES_COLLECTION = exports.SPECIALTIES_TYPES_COLLECTION = exports.SPECIALTIES = exports.DICS_COLLECTION = exports.CALENDARS_COLLECTION = exports.PROCEDURES_COLLECTION = exports.INSURANCES_COLLECTION = exports.PATIENTS_COLLECTION = exports.PROFESSIONALS_COLLECTION = exports.EVO_MED_APP = void 0;
4
4
  //EVO Med Application Doc
5
5
  exports.EVO_MED_APP = "evo-med";
6
6
  //people
@@ -24,6 +24,7 @@ exports.PATIENT_SOURCES_COLLECTION = "patient_sources";
24
24
  exports.APPOINTMENTS = "appointments";
25
25
  exports.APPOINTMENT_SOURCES_COLLECTION = "appointment_sources";
26
26
  exports.APPOINTMENT_STATUSES_COLLECTION = "appointment_statuses";
27
+ exports.APPOINTMENT_TYPES_COLLECTION = "appointment_types";
27
28
  exports.APPOINTMENT_REQUEST_TYPES_COLLECTION = "appointment_request_types";
28
29
  exports.DISEASES = "diseases";
29
30
  exports.ALLERGIES_COLLECTION = "allergies";
@@ -27,6 +27,7 @@ export const PATIENT_SOURCES_COLLECTION = "patient_sources";
27
27
  export const APPOINTMENTS = "appointments";
28
28
  export const APPOINTMENT_SOURCES_COLLECTION = "appointment_sources";
29
29
  export const APPOINTMENT_STATUSES_COLLECTION = "appointment_statuses";
30
+ export const APPOINTMENT_TYPES_COLLECTION = "appointment_types";
30
31
  export const APPOINTMENT_REQUEST_TYPES_COLLECTION = "appointment_request_types";
31
32
 
32
33
  export const DISEASES = "diseases";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.62",
3
+ "version": "1.3.65",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",