@blackcode_sa/metaestetics-api 1.10.0 → 1.11.1

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.
Files changed (43) hide show
  1. package/dist/admin/index.d.mts +337 -319
  2. package/dist/admin/index.d.ts +337 -319
  3. package/dist/admin/index.js +98 -79
  4. package/dist/admin/index.mjs +98 -79
  5. package/dist/backoffice/index.d.mts +284 -67
  6. package/dist/backoffice/index.d.ts +284 -67
  7. package/dist/backoffice/index.js +114 -6
  8. package/dist/backoffice/index.mjs +112 -6
  9. package/dist/index.d.mts +3145 -3065
  10. package/dist/index.d.ts +3145 -3065
  11. package/dist/index.js +460 -141
  12. package/dist/index.mjs +463 -143
  13. package/package.json +3 -1
  14. package/src/admin/booking/booking.admin.ts +2 -0
  15. package/src/admin/booking/booking.calculator.ts +121 -117
  16. package/src/admin/booking/booking.types.ts +3 -0
  17. package/src/backoffice/expo-safe/index.ts +2 -0
  18. package/src/backoffice/services/README.md +40 -0
  19. package/src/backoffice/services/constants.service.ts +268 -0
  20. package/src/backoffice/services/technology.service.ts +122 -10
  21. package/src/backoffice/types/admin-constants.types.ts +69 -0
  22. package/src/backoffice/types/index.ts +1 -0
  23. package/src/backoffice/types/product.types.ts +3 -1
  24. package/src/backoffice/types/technology.types.ts +4 -4
  25. package/src/backoffice/validations/schemas.ts +35 -9
  26. package/src/services/appointment/appointment.service.ts +0 -5
  27. package/src/services/appointment/utils/appointment.utils.ts +124 -113
  28. package/src/services/clinic/clinic.service.ts +163 -82
  29. package/src/services/procedure/procedure.service.ts +435 -234
  30. package/src/types/appointment/index.ts +9 -3
  31. package/src/types/clinic/index.ts +3 -6
  32. package/src/types/patient/medical-info.types.ts +3 -3
  33. package/src/types/procedure/index.ts +20 -17
  34. package/src/validations/appointment.schema.ts +2 -0
  35. package/src/validations/clinic.schema.ts +3 -6
  36. package/src/validations/patient/medical-info.schema.ts +7 -2
  37. package/src/validations/procedure.schema.ts +8 -10
  38. package/src/backoffice/services/__tests__/brand.service.test.ts +0 -196
  39. package/src/backoffice/services/__tests__/category.service.test.ts +0 -201
  40. package/src/backoffice/services/__tests__/product.service.test.ts +0 -358
  41. package/src/backoffice/services/__tests__/requirement.service.test.ts +0 -226
  42. package/src/backoffice/services/__tests__/subcategory.service.test.ts +0 -181
  43. package/src/backoffice/services/__tests__/technology.service.test.ts +0 -1097
@@ -184,33 +184,300 @@ interface Category {
184
184
  }
185
185
 
186
186
  /**
187
- * Podkategorija procedura
188
- * Podkategorije su drugi nivo hijerarhije i pripadaju određenoj kategoriji
189
- * One grupišu slične tehnologije u okviru kategorije
187
+ * Enum for element types in documentation templates
188
+ */
189
+ declare enum DocumentElementType {
190
+ HEADING = "heading",
191
+ PARAGRAPH = "paragraph",
192
+ LIST = "list",
193
+ DYNAMIC_TEXT = "dynamic_text",
194
+ BINARY_CHOICE = "binary_choice",
195
+ MULTIPLE_CHOICE = "multiple_choice",
196
+ SINGLE_CHOICE = "single_choice",
197
+ RATING_SCALE = "rating_scale",
198
+ TEXT_INPUT = "text_input",
199
+ DATE_PICKER = "date_picker",
200
+ SIGNATURE = "signature",
201
+ DITIGAL_SIGNATURE = "digital_signature",
202
+ FILE_UPLOAD = "file_upload"
203
+ }
204
+ /**
205
+ * Enum for list types
206
+ */
207
+ declare enum ListType {
208
+ ORDERED = "ordered",
209
+ UNORDERED = "unordered"
210
+ }
211
+ /**
212
+ * Enum for heading levels
213
+ */
214
+ declare enum HeadingLevel {
215
+ H1 = "h1",
216
+ H2 = "h2",
217
+ H3 = "h3",
218
+ H4 = "h4",
219
+ H5 = "h5",
220
+ H6 = "h6"
221
+ }
222
+ /**
223
+ * Base interface for all document elements
224
+ */
225
+ interface BaseDocumentElement {
226
+ id: string;
227
+ type: DocumentElementType;
228
+ required?: boolean;
229
+ }
230
+ /**
231
+ * Interface for heading element
232
+ */
233
+ interface HeadingElement extends BaseDocumentElement {
234
+ type: DocumentElementType.HEADING;
235
+ text: string;
236
+ level: HeadingLevel;
237
+ }
238
+ /**
239
+ * Interface for paragraph element
240
+ */
241
+ interface ParagraphElement extends BaseDocumentElement {
242
+ type: DocumentElementType.PARAGRAPH;
243
+ text: string;
244
+ }
245
+ /**
246
+ * Interface for list element
247
+ */
248
+ interface ListElement extends BaseDocumentElement {
249
+ type: DocumentElementType.LIST;
250
+ items: string[];
251
+ listType: ListType;
252
+ }
253
+ /**
254
+ * Interface for dynamic text element
255
+ */
256
+ interface DynamicTextElement extends BaseDocumentElement {
257
+ type: DocumentElementType.DYNAMIC_TEXT;
258
+ text: string;
259
+ }
260
+ /**
261
+ * Interface for binary choice element (Yes/No)
262
+ */
263
+ interface BinaryChoiceElement extends BaseDocumentElement {
264
+ type: DocumentElementType.BINARY_CHOICE;
265
+ question: string;
266
+ defaultValue?: boolean;
267
+ }
268
+ /**
269
+ * Interface for multiple choice element
270
+ */
271
+ interface MultipleChoiceElement extends BaseDocumentElement {
272
+ type: DocumentElementType.MULTIPLE_CHOICE;
273
+ question: string;
274
+ options: string[];
275
+ defaultValues?: string[];
276
+ }
277
+ /**
278
+ * Interface for single choice element
279
+ */
280
+ interface SingleChoiceElement extends BaseDocumentElement {
281
+ type: DocumentElementType.SINGLE_CHOICE;
282
+ question: string;
283
+ options: string[];
284
+ defaultValue?: string;
285
+ }
286
+ /**
287
+ * Interface for rating scale element
288
+ */
289
+ interface RatingScaleElement extends BaseDocumentElement {
290
+ type: DocumentElementType.RATING_SCALE;
291
+ question: string;
292
+ min: number;
293
+ max: number;
294
+ labels?: {
295
+ [key: number]: string;
296
+ };
297
+ defaultValue?: number;
298
+ }
299
+ /**
300
+ * Interface for text input element
301
+ */
302
+ interface TextInputElement extends BaseDocumentElement {
303
+ type: DocumentElementType.TEXT_INPUT;
304
+ label: string;
305
+ placeholder?: string;
306
+ multiline?: boolean;
307
+ defaultValue?: string;
308
+ }
309
+ /**
310
+ * Interface for date picker element
311
+ */
312
+ interface DatePickerElement extends BaseDocumentElement {
313
+ type: DocumentElementType.DATE_PICKER;
314
+ label: string;
315
+ defaultValue?: string;
316
+ }
317
+ /**
318
+ * Interface for signature element
319
+ */
320
+ interface SignatureElement extends BaseDocumentElement {
321
+ type: DocumentElementType.SIGNATURE;
322
+ label: string;
323
+ }
324
+ /**
325
+ * Interface for file upload element
326
+ */
327
+ interface FileUploadElement extends BaseDocumentElement {
328
+ type: DocumentElementType.FILE_UPLOAD;
329
+ label: string;
330
+ allowedFileTypes?: string[];
331
+ maxFileSizeMB?: number;
332
+ }
333
+ /**
334
+ * Union type for all document elements
335
+ */
336
+ type DocumentElement = HeadingElement | ParagraphElement | ListElement | DynamicTextElement | BinaryChoiceElement | MultipleChoiceElement | SingleChoiceElement | RatingScaleElement | TextInputElement | DatePickerElement | SignatureElement | FileUploadElement;
337
+ /**
338
+ * Interface for document template
339
+ */
340
+ interface DocumentTemplate {
341
+ id: string;
342
+ title: string;
343
+ description?: string;
344
+ createdAt: number;
345
+ updatedAt: number;
346
+ createdBy: string;
347
+ elements: DocumentElement[];
348
+ tags?: string[];
349
+ isUserForm?: boolean;
350
+ isRequired?: boolean;
351
+ sortingOrder?: number;
352
+ version: number;
353
+ isActive: boolean;
354
+ }
355
+ /**
356
+ * Interface for a filled document (completed form)
357
+ */
358
+ interface FilledDocument {
359
+ id: string;
360
+ templateId: string;
361
+ templateVersion: number;
362
+ isUserForm: boolean;
363
+ isRequired: boolean;
364
+ procedureId: string;
365
+ appointmentId: string;
366
+ patientId: string;
367
+ practitionerId: string;
368
+ clinicId: string;
369
+ createdAt: number;
370
+ updatedAt: number;
371
+ values: {
372
+ [elementId: string]: any | FilledDocumentFileValue;
373
+ };
374
+ status: FilledDocumentStatus;
375
+ }
376
+ /**
377
+ * Enum for filled document status
378
+ */
379
+ declare enum FilledDocumentStatus {
380
+ DRAFT = "draft",
381
+ SKIPPED = "skipped",
382
+ PENDING = "pending",
383
+ COMPLETED = "completed",// When doctor or patient completes the form
384
+ SIGNED = "signed",// Only used for user forms
385
+ REJECTED = "rejected"
386
+ }
387
+ /**
388
+ * Interface for file upload results to be stored in filled document values
389
+ */
390
+ interface FilledDocumentFileValue {
391
+ mediaId: string;
392
+ url: string;
393
+ name: string;
394
+ contentType: string;
395
+ size: number;
396
+ uploadedAt: number;
397
+ }
398
+
399
+ /**
400
+ * @file Defines types for dynamically managed administrative constants,
401
+ * such as treatment benefits and contraindications. These are stored in
402
+ * the 'admin-constants' collection in Firestore.
403
+ */
404
+ /**
405
+ * Represents a single dynamic treatment benefit.
406
+ * These are positive effects or results a patient can expect from a treatment.
407
+ */
408
+ interface TreatmentBenefitDynamic {
409
+ /**
410
+ * A unique identifier for the benefit, typically in snake_case.
411
+ * @example "wrinkle_reduction"
412
+ */
413
+ id: string;
414
+ /**
415
+ * A human-readable name for the treatment benefit.
416
+ * @example "Wrinkle Reduction"
417
+ */
418
+ name: string;
419
+ /**
420
+ * A detailed description of the benefit.
421
+ */
422
+ description?: string;
423
+ }
424
+ /**
425
+ * Represents a single dynamic contraindication.
426
+ * These are conditions or factors that can affect a procedure and require special attention.
427
+ */
428
+ interface ContraindicationDynamic {
429
+ /**
430
+ * A unique identifier for the contraindication, typically in snake_case.
431
+ * @example "sensitive_skin"
432
+ */
433
+ id: string;
434
+ /**
435
+ * A human-readable name for the contraindication.
436
+ * @example "Sensitive Skin"
437
+ */
438
+ name: string;
439
+ /**
440
+ * A detailed description of the contraindication.
441
+ */
442
+ description?: string;
443
+ }
444
+
445
+ /**
446
+ * Product used in procedures
447
+ * Can be consumables, equipment, or any other product needed for performing procedures
190
448
  *
191
- * @property id - Jedinstveni identifikator podkategorije
192
- * @property name - Naziv podkategorije
193
- * @property description - Detaljan opis podkategorije i njene namene
194
- * @property categoryId - ID kategorije kojoj podkategorija pripada
195
- * @property isActive - Da li je podkategorija aktivna u sistemu
196
- * @property createdAt - Datum kreiranja
197
- * @property updatedAt - Datum poslednjeg ažuriranja
449
+ * @property id - Unique identifier of the product
450
+ * @property name - Name of the product
451
+ * @property description - Detailed description of the product and its purpose
452
+ * @property brandId - ID of the brand that manufactures this product
453
+ * @property technologyId - ID of the technology this product is used with
454
+ * @property technicalDetails - Technical details and specifications
455
+ * @property warnings - List of warnings related to product use
456
+ * @property dosage - Dosage information (if applicable)
457
+ * @property composition - Product composition
458
+ * @property indications - List of indications for use
459
+ * @property contraindications - List of contraindications
460
+ * @property isActive - Whether the product is active in the system
461
+ * @property createdAt - Creation date
462
+ * @property updatedAt - Last update date
198
463
  */
199
- interface Subcategory {
200
- /** Jedinstveni identifikator podkategorije (automatski generisan od strane Firestore) */
464
+ interface Product {
201
465
  id?: string;
202
- /** Naziv podkategorije */
203
466
  name: string;
204
- /** Detaljniji opis podkategorije */
205
- description?: string;
206
- /** ID kategorije kojoj podkategorija pripada */
207
- categoryId: string;
208
- /** Flag koji označava da li je podkategorija aktivna */
209
- isActive: boolean;
210
- /** Datum kreiranja podkategorije */
467
+ brandId: string;
468
+ brandName: string;
469
+ technologyId: string;
470
+ technologyName: string;
211
471
  createdAt: Date;
212
- /** Datum poslednjeg ažuriranja podkategorije */
213
472
  updatedAt: Date;
473
+ isActive: boolean;
474
+ description?: string;
475
+ technicalDetails?: string;
476
+ warnings?: string[];
477
+ dosage?: string;
478
+ composition?: string;
479
+ indications?: string[];
480
+ contraindications?: ContraindicationDynamic[];
214
481
  }
215
482
 
216
483
  /**
@@ -268,6 +535,36 @@ interface Requirement {
268
535
  updatedAt: Date;
269
536
  }
270
537
 
538
+ /**
539
+ * Podkategorija procedura
540
+ * Podkategorije su drugi nivo hijerarhije i pripadaju određenoj kategoriji
541
+ * One grupišu slične tehnologije u okviru kategorije
542
+ *
543
+ * @property id - Jedinstveni identifikator podkategorije
544
+ * @property name - Naziv podkategorije
545
+ * @property description - Detaljan opis podkategorije i njene namene
546
+ * @property categoryId - ID kategorije kojoj podkategorija pripada
547
+ * @property isActive - Da li je podkategorija aktivna u sistemu
548
+ * @property createdAt - Datum kreiranja
549
+ * @property updatedAt - Datum poslednjeg ažuriranja
550
+ */
551
+ interface Subcategory {
552
+ /** Jedinstveni identifikator podkategorije (automatski generisan od strane Firestore) */
553
+ id?: string;
554
+ /** Naziv podkategorije */
555
+ name: string;
556
+ /** Detaljniji opis podkategorije */
557
+ description?: string;
558
+ /** ID kategorije kojoj podkategorija pripada */
559
+ categoryId: string;
560
+ /** Flag koji označava da li je podkategorija aktivna */
561
+ isActive: boolean;
562
+ /** Datum kreiranja podkategorije */
563
+ createdAt: Date;
564
+ /** Datum poslednjeg ažuriranja podkategorije */
565
+ updatedAt: Date;
566
+ }
567
+
271
568
  /**
272
569
  * Blokirajući uslovi koji mogu sprečiti proceduru
273
570
  * Ovi uslovi predstavljaju apsolutne kontraindikacije koje onemogućavaju izvođenje procedure
@@ -290,47 +587,6 @@ declare enum BlockingCondition {
290
587
  EPILEPSY = "epilepsy"
291
588
  }
292
589
 
293
- /**
294
- * Kontraindikacije koje mogu uticati na proceduru
295
- * Ovi uslovi predstavljaju relativne kontraindikacije koje zahtevaju posebnu pažnju
296
- */
297
- declare enum Contraindication {
298
- SENSITIVE_SKIN = "sensitive_skin",
299
- RECENT_TANNING = "recent_tanning",
300
- RECENT_BOTOX = "recent_botox",
301
- RECENT_FILLERS = "recent_fillers",
302
- SKIN_ALLERGIES = "skin_allergies",
303
- MEDICATIONS = "medications",
304
- RECENT_CHEMICAL_PEEL = "recent_chemical_peel",
305
- RECENT_LASER = "recent_laser",
306
- SKIN_INFLAMMATION = "skin_inflammation",
307
- OPEN_WOUNDS = "open_wounds",
308
- HERPES_SIMPLEX = "herpes_simplex",
309
- COLD_SORES = "cold_sores"
310
- }
311
-
312
- /**
313
- * Benefiti koji se mogu očekivati od procedure
314
- * Lista mogućih pozitivnih efekata i rezultata tretmana
315
- */
316
- declare enum TreatmentBenefit {
317
- WRINKLE_REDUCTION = "wrinkle_reduction",
318
- SKIN_TIGHTENING = "skin_tightening",
319
- COLLAGEN_PRODUCTION = "collagen_production",
320
- ACNE_REDUCTION = "acne_reduction",
321
- SCAR_REDUCTION = "scar_reduction",
322
- PIGMENTATION_IMPROVEMENT = "pigmentation_improvement",
323
- HAIR_REMOVAL = "hair_removal",
324
- MUSCLE_TONING = "muscle_toning",
325
- FAT_REDUCTION = "fat_reduction",
326
- CELLULITE_REDUCTION = "cellulite_reduction",
327
- SKIN_REJUVENATION = "skin_rejuvenation",
328
- PORE_REDUCTION = "pore_reduction",
329
- TEXTURE_IMPROVEMENT = "texture_improvement",
330
- HYDRATION_BOOST = "hydration_boost",
331
- CIRCULATION_IMPROVEMENT = "circulation_improvement"
332
- }
333
-
334
590
  /**
335
591
  * Nivoi sertifikacije medicinskog osoblja, poređani od najnižeg do najvišeg
336
592
  */
@@ -415,8 +671,8 @@ interface Technology {
415
671
  post: Requirement[];
416
672
  };
417
673
  blockingConditions: BlockingCondition[];
418
- contraindications: Contraindication[];
419
- benefits: TreatmentBenefit[];
674
+ contraindications: ContraindicationDynamic[];
675
+ benefits: TreatmentBenefitDynamic[];
420
676
  certificationRequirement: CertificationRequirement;
421
677
  documentationTemplates?: TechnologyDocumentationTemplate[];
422
678
  isActive: boolean;
@@ -424,44 +680,6 @@ interface Technology {
424
680
  updatedAt: Date;
425
681
  }
426
682
 
427
- /**
428
- * Product used in procedures
429
- * Can be consumables, equipment, or any other product needed for performing procedures
430
- *
431
- * @property id - Unique identifier of the product
432
- * @property name - Name of the product
433
- * @property description - Detailed description of the product and its purpose
434
- * @property brandId - ID of the brand that manufactures this product
435
- * @property technologyId - ID of the technology this product is used with
436
- * @property technicalDetails - Technical details and specifications
437
- * @property warnings - List of warnings related to product use
438
- * @property dosage - Dosage information (if applicable)
439
- * @property composition - Product composition
440
- * @property indications - List of indications for use
441
- * @property contraindications - List of contraindications
442
- * @property isActive - Whether the product is active in the system
443
- * @property createdAt - Creation date
444
- * @property updatedAt - Last update date
445
- */
446
- interface Product {
447
- id?: string;
448
- name: string;
449
- brandId: string;
450
- brandName: string;
451
- technologyId: string;
452
- technologyName: string;
453
- createdAt: Date;
454
- updatedAt: Date;
455
- isActive: boolean;
456
- description?: string;
457
- technicalDetails?: string;
458
- warnings?: string[];
459
- dosage?: string;
460
- composition?: string;
461
- indications?: string[];
462
- contraindications?: string[];
463
- }
464
-
465
683
  declare enum PricingMeasure {
466
684
  PER_ML = "per_ml",
467
685
  PER_ZONE = "per_zone",
@@ -519,9 +737,13 @@ interface Procedure {
519
737
  /** Blocking conditions that prevent this procedure */
520
738
  blockingConditions: BlockingCondition[];
521
739
  /** Treatment benefits of this procedure */
522
- treatmentBenefits: TreatmentBenefit[];
740
+ treatmentBenefits: TreatmentBenefitDynamic[];
741
+ /** A list of just the string IDs of the treatment benefits, for efficient querying. */
742
+ treatmentBenefitIds: string[];
523
743
  /** Contraindications of this procedure */
524
- contraindications: Contraindication[];
744
+ contraindications: ContraindicationDynamic[];
745
+ /** A list of just the string IDs of the contraindications, for efficient querying. */
746
+ contraindicationIds: string[];
525
747
  /** Pre-procedure requirements */
526
748
  preRequirements: Requirement[];
527
749
  /** Post-procedure requirements */
@@ -708,6 +930,7 @@ interface ClinicLocation {
708
930
  latitude: number;
709
931
  longitude: number;
710
932
  geohash?: string | null;
933
+ tz?: string | null;
711
934
  }
712
935
  /**
713
936
  * Interface for working hours
@@ -1011,7 +1234,7 @@ interface PatientMedicalInfo {
1011
1234
  notes?: string | null;
1012
1235
  }[];
1013
1236
  contraindications: {
1014
- condition: Contraindication;
1237
+ condition: ContraindicationDynamic;
1015
1238
  lastOccurrence: Timestamp;
1016
1239
  frequency: "rare" | "occasional" | "frequent";
1017
1240
  isActive: boolean;
@@ -1201,219 +1424,6 @@ interface PatientProfileInfo {
1201
1424
  gender: Gender;
1202
1425
  }
1203
1426
 
1204
- /**
1205
- * Enum for element types in documentation templates
1206
- */
1207
- declare enum DocumentElementType {
1208
- HEADING = "heading",
1209
- PARAGRAPH = "paragraph",
1210
- LIST = "list",
1211
- DYNAMIC_TEXT = "dynamic_text",
1212
- BINARY_CHOICE = "binary_choice",
1213
- MULTIPLE_CHOICE = "multiple_choice",
1214
- SINGLE_CHOICE = "single_choice",
1215
- RATING_SCALE = "rating_scale",
1216
- TEXT_INPUT = "text_input",
1217
- DATE_PICKER = "date_picker",
1218
- SIGNATURE = "signature",
1219
- DITIGAL_SIGNATURE = "digital_signature",
1220
- FILE_UPLOAD = "file_upload"
1221
- }
1222
- /**
1223
- * Enum for list types
1224
- */
1225
- declare enum ListType {
1226
- ORDERED = "ordered",
1227
- UNORDERED = "unordered"
1228
- }
1229
- /**
1230
- * Enum for heading levels
1231
- */
1232
- declare enum HeadingLevel {
1233
- H1 = "h1",
1234
- H2 = "h2",
1235
- H3 = "h3",
1236
- H4 = "h4",
1237
- H5 = "h5",
1238
- H6 = "h6"
1239
- }
1240
- /**
1241
- * Base interface for all document elements
1242
- */
1243
- interface BaseDocumentElement {
1244
- id: string;
1245
- type: DocumentElementType;
1246
- required?: boolean;
1247
- }
1248
- /**
1249
- * Interface for heading element
1250
- */
1251
- interface HeadingElement extends BaseDocumentElement {
1252
- type: DocumentElementType.HEADING;
1253
- text: string;
1254
- level: HeadingLevel;
1255
- }
1256
- /**
1257
- * Interface for paragraph element
1258
- */
1259
- interface ParagraphElement extends BaseDocumentElement {
1260
- type: DocumentElementType.PARAGRAPH;
1261
- text: string;
1262
- }
1263
- /**
1264
- * Interface for list element
1265
- */
1266
- interface ListElement extends BaseDocumentElement {
1267
- type: DocumentElementType.LIST;
1268
- items: string[];
1269
- listType: ListType;
1270
- }
1271
- /**
1272
- * Interface for dynamic text element
1273
- */
1274
- interface DynamicTextElement extends BaseDocumentElement {
1275
- type: DocumentElementType.DYNAMIC_TEXT;
1276
- text: string;
1277
- }
1278
- /**
1279
- * Interface for binary choice element (Yes/No)
1280
- */
1281
- interface BinaryChoiceElement extends BaseDocumentElement {
1282
- type: DocumentElementType.BINARY_CHOICE;
1283
- question: string;
1284
- defaultValue?: boolean;
1285
- }
1286
- /**
1287
- * Interface for multiple choice element
1288
- */
1289
- interface MultipleChoiceElement extends BaseDocumentElement {
1290
- type: DocumentElementType.MULTIPLE_CHOICE;
1291
- question: string;
1292
- options: string[];
1293
- defaultValues?: string[];
1294
- }
1295
- /**
1296
- * Interface for single choice element
1297
- */
1298
- interface SingleChoiceElement extends BaseDocumentElement {
1299
- type: DocumentElementType.SINGLE_CHOICE;
1300
- question: string;
1301
- options: string[];
1302
- defaultValue?: string;
1303
- }
1304
- /**
1305
- * Interface for rating scale element
1306
- */
1307
- interface RatingScaleElement extends BaseDocumentElement {
1308
- type: DocumentElementType.RATING_SCALE;
1309
- question: string;
1310
- min: number;
1311
- max: number;
1312
- labels?: {
1313
- [key: number]: string;
1314
- };
1315
- defaultValue?: number;
1316
- }
1317
- /**
1318
- * Interface for text input element
1319
- */
1320
- interface TextInputElement extends BaseDocumentElement {
1321
- type: DocumentElementType.TEXT_INPUT;
1322
- label: string;
1323
- placeholder?: string;
1324
- multiline?: boolean;
1325
- defaultValue?: string;
1326
- }
1327
- /**
1328
- * Interface for date picker element
1329
- */
1330
- interface DatePickerElement extends BaseDocumentElement {
1331
- type: DocumentElementType.DATE_PICKER;
1332
- label: string;
1333
- defaultValue?: string;
1334
- }
1335
- /**
1336
- * Interface for signature element
1337
- */
1338
- interface SignatureElement extends BaseDocumentElement {
1339
- type: DocumentElementType.SIGNATURE;
1340
- label: string;
1341
- }
1342
- /**
1343
- * Interface for file upload element
1344
- */
1345
- interface FileUploadElement extends BaseDocumentElement {
1346
- type: DocumentElementType.FILE_UPLOAD;
1347
- label: string;
1348
- allowedFileTypes?: string[];
1349
- maxFileSizeMB?: number;
1350
- }
1351
- /**
1352
- * Union type for all document elements
1353
- */
1354
- type DocumentElement = HeadingElement | ParagraphElement | ListElement | DynamicTextElement | BinaryChoiceElement | MultipleChoiceElement | SingleChoiceElement | RatingScaleElement | TextInputElement | DatePickerElement | SignatureElement | FileUploadElement;
1355
- /**
1356
- * Interface for document template
1357
- */
1358
- interface DocumentTemplate {
1359
- id: string;
1360
- title: string;
1361
- description?: string;
1362
- createdAt: number;
1363
- updatedAt: number;
1364
- createdBy: string;
1365
- elements: DocumentElement[];
1366
- tags?: string[];
1367
- isUserForm?: boolean;
1368
- isRequired?: boolean;
1369
- sortingOrder?: number;
1370
- version: number;
1371
- isActive: boolean;
1372
- }
1373
- /**
1374
- * Interface for a filled document (completed form)
1375
- */
1376
- interface FilledDocument {
1377
- id: string;
1378
- templateId: string;
1379
- templateVersion: number;
1380
- isUserForm: boolean;
1381
- isRequired: boolean;
1382
- procedureId: string;
1383
- appointmentId: string;
1384
- patientId: string;
1385
- practitionerId: string;
1386
- clinicId: string;
1387
- createdAt: number;
1388
- updatedAt: number;
1389
- values: {
1390
- [elementId: string]: any | FilledDocumentFileValue;
1391
- };
1392
- status: FilledDocumentStatus;
1393
- }
1394
- /**
1395
- * Enum for filled document status
1396
- */
1397
- declare enum FilledDocumentStatus {
1398
- DRAFT = "draft",
1399
- SKIPPED = "skipped",
1400
- PENDING = "pending",
1401
- COMPLETED = "completed",// When doctor or patient completes the form
1402
- SIGNED = "signed",// Only used for user forms
1403
- REJECTED = "rejected"
1404
- }
1405
- /**
1406
- * Interface for file upload results to be stored in filled document values
1407
- */
1408
- interface FilledDocumentFileValue {
1409
- mediaId: string;
1410
- url: string;
1411
- name: string;
1412
- contentType: string;
1413
- size: number;
1414
- uploadedAt: number;
1415
- }
1416
-
1417
1427
  /**
1418
1428
  * Enum defining the possible statuses of an appointment.
1419
1429
  */
@@ -1582,6 +1592,8 @@ interface Appointment {
1582
1592
  clinicBranchId: string;
1583
1593
  /** Aggregated clinic information (snapshot) */
1584
1594
  clinicInfo: ClinicInfo;
1595
+ /** IANA timezone of the clinic */
1596
+ clinic_tz: string;
1585
1597
  /** ID of the practitioner */
1586
1598
  practitionerId: string;
1587
1599
  /** Aggregated practitioner information (snapshot) */
@@ -1620,7 +1632,7 @@ interface Appointment {
1620
1632
  paymentTransactionId?: string | null;
1621
1633
  /** Procedure-related conditions and requirements */
1622
1634
  blockingConditions: BlockingCondition[];
1623
- contraindications: Contraindication[];
1635
+ contraindications: ContraindicationDynamic[];
1624
1636
  preProcedureRequirements: Requirement[];
1625
1637
  postProcedureRequirements: Requirement[];
1626
1638
  /** Tracking information for requirements completion */
@@ -2923,6 +2935,8 @@ interface BookingAvailabilityRequest {
2923
2935
  clinicCalendarEvents: CalendarEvent[];
2924
2936
  /** Calendar events for the practitioner during the specified timeframe */
2925
2937
  practitionerCalendarEvents: CalendarEvent[];
2938
+ /** IANA timezone of the clinic */
2939
+ tz: string;
2926
2940
  }
2927
2941
  /**
2928
2942
  * Represents a single available booking slot
@@ -2968,6 +2982,7 @@ declare class BookingAvailabilityCalculator {
2968
2982
  * @param intervals - Current available intervals
2969
2983
  * @param workingHours - Clinic working hours
2970
2984
  * @param timeframe - Overall timeframe being considered
2985
+ * @param tz - IANA timezone of the clinic
2971
2986
  * @returns Intervals filtered by clinic working hours
2972
2987
  */
2973
2988
  private static applyClinicWorkingHours;
@@ -2977,6 +2992,7 @@ declare class BookingAvailabilityCalculator {
2977
2992
  * @param workingHours - Working hours definition
2978
2993
  * @param startDate - Start date of the overall timeframe
2979
2994
  * @param endDate - End date of the overall timeframe
2995
+ * @param tz - IANA timezone of the clinic
2980
2996
  * @returns Array of time intervals representing working hours
2981
2997
  */
2982
2998
  private static createWorkingHoursIntervals;
@@ -2995,6 +3011,7 @@ declare class BookingAvailabilityCalculator {
2995
3011
  * @param practitioner - Practitioner object
2996
3012
  * @param clinicId - ID of the clinic
2997
3013
  * @param timeframe - Overall timeframe being considered
3014
+ * @param tz - IANA timezone of the clinic
2998
3015
  * @returns Intervals filtered by practitioner's working hours
2999
3016
  */
3000
3017
  private static applyPractitionerWorkingHours;
@@ -3004,6 +3021,7 @@ declare class BookingAvailabilityCalculator {
3004
3021
  * @param workingHours - Practitioner's working hours definition
3005
3022
  * @param startDate - Start date of the overall timeframe
3006
3023
  * @param endDate - End date of the overall timeframe
3024
+ * @param tz - IANA timezone of the clinic
3007
3025
  * @returns Array of time intervals representing practitioner's working hours
3008
3026
  */
3009
3027
  private static createPractitionerWorkingHoursIntervals;