@blackcode_sa/metaestetics-api 1.6.20 → 1.6.21

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/index.js CHANGED
@@ -1332,11 +1332,11 @@ var allergySubtypeSchema = import_zod5.z.union([
1332
1332
  var allergySchema = import_zod5.z.object({
1333
1333
  type: import_zod5.z.nativeEnum(AllergyType),
1334
1334
  subtype: allergySubtypeSchema,
1335
- name: import_zod5.z.string().optional(),
1335
+ name: import_zod5.z.string().optional().nullable(),
1336
1336
  severity: import_zod5.z.enum(["mild", "moderate", "severe"]).optional(),
1337
- reaction: import_zod5.z.string().optional(),
1338
- diagnosed: timestampSchema2.optional(),
1339
- notes: import_zod5.z.string().optional()
1337
+ reaction: import_zod5.z.string().optional().nullable(),
1338
+ diagnosed: timestampSchema2.optional().nullable(),
1339
+ notes: import_zod5.z.string().optional().nullable()
1340
1340
  });
1341
1341
  var vitalStatsSchema = import_zod5.z.object({
1342
1342
  height: import_zod5.z.number().positive().optional(),
@@ -1351,23 +1351,23 @@ var vitalStatsSchema = import_zod5.z.object({
1351
1351
  var blockingConditionSchema = import_zod5.z.object({
1352
1352
  condition: import_zod5.z.nativeEnum(BlockingCondition),
1353
1353
  diagnosedAt: timestampSchema2,
1354
- notes: import_zod5.z.string().optional(),
1354
+ notes: import_zod5.z.string().optional().nullable(),
1355
1355
  isActive: import_zod5.z.boolean()
1356
1356
  });
1357
1357
  var contraindicationSchema = import_zod5.z.object({
1358
1358
  condition: import_zod5.z.nativeEnum(Contraindication),
1359
1359
  lastOccurrence: timestampSchema2,
1360
1360
  frequency: import_zod5.z.enum(["rare", "occasional", "frequent"]),
1361
- notes: import_zod5.z.string().optional(),
1361
+ notes: import_zod5.z.string().optional().nullable(),
1362
1362
  isActive: import_zod5.z.boolean()
1363
1363
  });
1364
1364
  var medicationSchema = import_zod5.z.object({
1365
1365
  name: import_zod5.z.string().min(1),
1366
1366
  dosage: import_zod5.z.string().min(1),
1367
1367
  frequency: import_zod5.z.string().min(1),
1368
- startDate: timestampSchema2,
1369
- endDate: timestampSchema2.optional(),
1370
- prescribedBy: import_zod5.z.string().optional()
1368
+ startDate: timestampSchema2.optional().nullable(),
1369
+ endDate: timestampSchema2.optional().nullable(),
1370
+ prescribedBy: import_zod5.z.string().optional().nullable()
1371
1371
  });
1372
1372
  var patientMedicalInfoSchema = import_zod5.z.object({
1373
1373
  patientId: import_zod5.z.string(),
package/dist/index.mjs CHANGED
@@ -1149,11 +1149,11 @@ var allergySubtypeSchema = z5.union([
1149
1149
  var allergySchema = z5.object({
1150
1150
  type: z5.nativeEnum(AllergyType),
1151
1151
  subtype: allergySubtypeSchema,
1152
- name: z5.string().optional(),
1152
+ name: z5.string().optional().nullable(),
1153
1153
  severity: z5.enum(["mild", "moderate", "severe"]).optional(),
1154
- reaction: z5.string().optional(),
1155
- diagnosed: timestampSchema2.optional(),
1156
- notes: z5.string().optional()
1154
+ reaction: z5.string().optional().nullable(),
1155
+ diagnosed: timestampSchema2.optional().nullable(),
1156
+ notes: z5.string().optional().nullable()
1157
1157
  });
1158
1158
  var vitalStatsSchema = z5.object({
1159
1159
  height: z5.number().positive().optional(),
@@ -1168,23 +1168,23 @@ var vitalStatsSchema = z5.object({
1168
1168
  var blockingConditionSchema = z5.object({
1169
1169
  condition: z5.nativeEnum(BlockingCondition),
1170
1170
  diagnosedAt: timestampSchema2,
1171
- notes: z5.string().optional(),
1171
+ notes: z5.string().optional().nullable(),
1172
1172
  isActive: z5.boolean()
1173
1173
  });
1174
1174
  var contraindicationSchema = z5.object({
1175
1175
  condition: z5.nativeEnum(Contraindication),
1176
1176
  lastOccurrence: timestampSchema2,
1177
1177
  frequency: z5.enum(["rare", "occasional", "frequent"]),
1178
- notes: z5.string().optional(),
1178
+ notes: z5.string().optional().nullable(),
1179
1179
  isActive: z5.boolean()
1180
1180
  });
1181
1181
  var medicationSchema = z5.object({
1182
1182
  name: z5.string().min(1),
1183
1183
  dosage: z5.string().min(1),
1184
1184
  frequency: z5.string().min(1),
1185
- startDate: timestampSchema2,
1186
- endDate: timestampSchema2.optional(),
1187
- prescribedBy: z5.string().optional()
1185
+ startDate: timestampSchema2.optional().nullable(),
1186
+ endDate: timestampSchema2.optional().nullable(),
1187
+ prescribedBy: z5.string().optional().nullable()
1188
1188
  });
1189
1189
  var patientMedicalInfoSchema = z5.object({
1190
1190
  patientId: z5.string(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.6.20",
4
+ "version": "1.6.21",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -608,7 +608,8 @@ export class AppointmentAggregationService {
608
608
  return instructionObject;
609
609
  });
610
610
 
611
- const newInstanceData: Omit<PatientRequirementInstance, "id"> = {
611
+ const newInstanceData: PatientRequirementInstance = {
612
+ id: newInstanceRef.id, // Add the ID to the document data
612
613
  patientId: appointment.patientId,
613
614
  appointmentId: appointment.id,
614
615
  originalRequirementId: template.id,
@@ -8,11 +8,11 @@ export const PATIENT_MEDICAL_INFO_COLLECTION = "medical_info";
8
8
  export interface Allergy {
9
9
  type: AllergyType;
10
10
  subtype: AllergySubtype;
11
- name?: string;
12
- severity?: "mild" | "moderate" | "severe";
13
- reaction?: string;
14
- diagnosed?: Timestamp;
15
- notes?: string;
11
+ name?: string | null;
12
+ severity?: "mild" | "moderate" | "severe" | null;
13
+ reaction?: string | null;
14
+ diagnosed?: Timestamp | null;
15
+ notes?: string | null;
16
16
  }
17
17
 
18
18
  export interface VitalStats {
@@ -51,9 +51,9 @@ export interface PatientMedicalInfo {
51
51
  name: string;
52
52
  dosage: string;
53
53
  frequency: string;
54
- startDate: Timestamp;
55
- endDate?: Timestamp;
56
- prescribedBy?: string;
54
+ startDate?: Timestamp | null;
55
+ endDate?: Timestamp | null;
56
+ prescribedBy?: string | null;
57
57
  }[];
58
58
 
59
59
  emergencyNotes?: string;
@@ -87,11 +87,11 @@ export interface UpdateVitalStatsData {
87
87
  export interface AddAllergyData {
88
88
  type: AllergyType;
89
89
  subtype: AllergySubtype;
90
- name?: string;
90
+ name?: string | null;
91
91
  severity?: "mild" | "moderate" | "severe";
92
- reaction?: string;
93
- diagnosed?: Timestamp;
94
- notes?: string;
92
+ reaction?: string | null;
93
+ diagnosed?: Timestamp | null;
94
+ notes?: string | null;
95
95
  }
96
96
 
97
97
  export interface UpdateAllergyData extends Partial<AddAllergyData> {
@@ -21,11 +21,11 @@ export const allergySubtypeSchema = z.union([
21
21
  export const allergySchema = z.object({
22
22
  type: z.nativeEnum(AllergyType),
23
23
  subtype: allergySubtypeSchema,
24
- name: z.string().optional(),
24
+ name: z.string().optional().nullable(),
25
25
  severity: z.enum(["mild", "moderate", "severe"]).optional(),
26
- reaction: z.string().optional(),
27
- diagnosed: timestampSchema.optional(),
28
- notes: z.string().optional(),
26
+ reaction: z.string().optional().nullable(),
27
+ diagnosed: timestampSchema.optional().nullable(),
28
+ notes: z.string().optional().nullable(),
29
29
  });
30
30
 
31
31
  export const vitalStatsSchema = z.object({
@@ -46,7 +46,7 @@ export const vitalStatsSchema = z.object({
46
46
  export const blockingConditionSchema = z.object({
47
47
  condition: z.nativeEnum(BlockingCondition),
48
48
  diagnosedAt: timestampSchema,
49
- notes: z.string().optional(),
49
+ notes: z.string().optional().nullable(),
50
50
  isActive: z.boolean(),
51
51
  });
52
52
 
@@ -54,7 +54,7 @@ export const contraindicationSchema = z.object({
54
54
  condition: z.nativeEnum(Contraindication),
55
55
  lastOccurrence: timestampSchema,
56
56
  frequency: z.enum(["rare", "occasional", "frequent"]),
57
- notes: z.string().optional(),
57
+ notes: z.string().optional().nullable(),
58
58
  isActive: z.boolean(),
59
59
  });
60
60
 
@@ -62,9 +62,9 @@ export const medicationSchema = z.object({
62
62
  name: z.string().min(1),
63
63
  dosage: z.string().min(1),
64
64
  frequency: z.string().min(1),
65
- startDate: timestampSchema,
66
- endDate: timestampSchema.optional(),
67
- prescribedBy: z.string().optional(),
65
+ startDate: timestampSchema.optional().nullable(),
66
+ endDate: timestampSchema.optional().nullable(),
67
+ prescribedBy: z.string().optional().nullable(),
68
68
  });
69
69
 
70
70
  export const patientMedicalInfoSchema = z.object({