@blackcode_sa/metaestetics-api 1.5.27 → 1.5.29

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 (35) hide show
  1. package/dist/admin/index.d.mts +1199 -1
  2. package/dist/admin/index.d.ts +1199 -1
  3. package/dist/admin/index.js +1337 -2
  4. package/dist/admin/index.mjs +1333 -2
  5. package/dist/backoffice/index.d.mts +99 -7
  6. package/dist/backoffice/index.d.ts +99 -7
  7. package/dist/index.d.mts +4184 -2426
  8. package/dist/index.d.ts +4184 -2426
  9. package/dist/index.js +2692 -1546
  10. package/dist/index.mjs +2663 -1502
  11. package/package.json +1 -1
  12. package/src/admin/aggregation/clinic/clinic.aggregation.service.ts +642 -0
  13. package/src/admin/aggregation/patient/patient.aggregation.service.ts +141 -0
  14. package/src/admin/aggregation/practitioner/practitioner.aggregation.service.ts +433 -0
  15. package/src/admin/aggregation/procedure/procedure.aggregation.service.ts +508 -0
  16. package/src/admin/index.ts +53 -4
  17. package/src/index.ts +28 -4
  18. package/src/services/calendar/calendar-refactored.service.ts +1 -1
  19. package/src/services/clinic/clinic.service.ts +344 -77
  20. package/src/services/clinic/utils/clinic.utils.ts +187 -8
  21. package/src/services/clinic/utils/filter.utils.d.ts +23 -0
  22. package/src/services/clinic/utils/filter.utils.ts +264 -0
  23. package/src/services/practitioner/practitioner.service.ts +616 -5
  24. package/src/services/procedure/procedure.service.ts +678 -52
  25. package/src/services/reviews/reviews.service.ts +842 -0
  26. package/src/types/clinic/index.ts +24 -56
  27. package/src/types/practitioner/index.ts +34 -33
  28. package/src/types/procedure/index.ts +39 -0
  29. package/src/types/profile/index.ts +1 -1
  30. package/src/types/reviews/index.ts +126 -0
  31. package/src/validations/clinic.schema.ts +37 -64
  32. package/src/validations/practitioner.schema.ts +42 -32
  33. package/src/validations/procedure.schema.ts +14 -3
  34. package/src/validations/reviews.schema.ts +189 -0
  35. package/src/services/clinic/utils/review.utils.ts +0 -93
@@ -1,6 +1,957 @@
1
1
  import { Timestamp } from 'firebase/firestore';
2
2
  import * as admin from 'firebase-admin';
3
3
 
4
+ /**
5
+ * Enum for element types in documentation templates
6
+ */
7
+ declare enum DocumentElementType {
8
+ HEADING = "heading",
9
+ PARAGRAPH = "paragraph",
10
+ LIST = "list",
11
+ DYNAMIC_TEXT = "dynamic_text",
12
+ BINARY_CHOICE = "binary_choice",
13
+ MULTIPLE_CHOICE = "multiple_choice",
14
+ SINGLE_CHOICE = "single_choice",
15
+ RATING_SCALE = "rating_scale",
16
+ TEXT_INPUT = "text_input",
17
+ DATE_PICKER = "date_picker",
18
+ SIGNATURE = "signature",
19
+ FILE_UPLOAD = "file_upload"
20
+ }
21
+ /**
22
+ * Enum for list types
23
+ */
24
+ declare enum ListType {
25
+ ORDERED = "ordered",
26
+ UNORDERED = "unordered"
27
+ }
28
+ /**
29
+ * Enum for heading levels
30
+ */
31
+ declare enum HeadingLevel {
32
+ H1 = "h1",
33
+ H2 = "h2",
34
+ H3 = "h3",
35
+ H4 = "h4",
36
+ H5 = "h5",
37
+ H6 = "h6"
38
+ }
39
+ /**
40
+ * Base interface for all document elements
41
+ */
42
+ interface BaseDocumentElement {
43
+ id: string;
44
+ type: DocumentElementType;
45
+ required?: boolean;
46
+ }
47
+ /**
48
+ * Interface for heading element
49
+ */
50
+ interface HeadingElement extends BaseDocumentElement {
51
+ type: DocumentElementType.HEADING;
52
+ text: string;
53
+ level: HeadingLevel;
54
+ }
55
+ /**
56
+ * Interface for paragraph element
57
+ */
58
+ interface ParagraphElement extends BaseDocumentElement {
59
+ type: DocumentElementType.PARAGRAPH;
60
+ text: string;
61
+ }
62
+ /**
63
+ * Interface for list element
64
+ */
65
+ interface ListElement extends BaseDocumentElement {
66
+ type: DocumentElementType.LIST;
67
+ items: string[];
68
+ listType: ListType;
69
+ }
70
+ /**
71
+ * Interface for dynamic text element
72
+ */
73
+ interface DynamicTextElement extends BaseDocumentElement {
74
+ type: DocumentElementType.DYNAMIC_TEXT;
75
+ text: string;
76
+ }
77
+ /**
78
+ * Interface for binary choice element (Yes/No)
79
+ */
80
+ interface BinaryChoiceElement extends BaseDocumentElement {
81
+ type: DocumentElementType.BINARY_CHOICE;
82
+ question: string;
83
+ defaultValue?: boolean;
84
+ }
85
+ /**
86
+ * Interface for multiple choice element
87
+ */
88
+ interface MultipleChoiceElement extends BaseDocumentElement {
89
+ type: DocumentElementType.MULTIPLE_CHOICE;
90
+ question: string;
91
+ options: string[];
92
+ defaultValues?: string[];
93
+ }
94
+ /**
95
+ * Interface for single choice element
96
+ */
97
+ interface SingleChoiceElement extends BaseDocumentElement {
98
+ type: DocumentElementType.SINGLE_CHOICE;
99
+ question: string;
100
+ options: string[];
101
+ defaultValue?: string;
102
+ }
103
+ /**
104
+ * Interface for rating scale element
105
+ */
106
+ interface RatingScaleElement extends BaseDocumentElement {
107
+ type: DocumentElementType.RATING_SCALE;
108
+ question: string;
109
+ min: number;
110
+ max: number;
111
+ labels?: {
112
+ [key: number]: string;
113
+ };
114
+ defaultValue?: number;
115
+ }
116
+ /**
117
+ * Interface for text input element
118
+ */
119
+ interface TextInputElement extends BaseDocumentElement {
120
+ type: DocumentElementType.TEXT_INPUT;
121
+ label: string;
122
+ placeholder?: string;
123
+ multiline?: boolean;
124
+ defaultValue?: string;
125
+ }
126
+ /**
127
+ * Interface for date picker element
128
+ */
129
+ interface DatePickerElement extends BaseDocumentElement {
130
+ type: DocumentElementType.DATE_PICKER;
131
+ label: string;
132
+ defaultValue?: string;
133
+ }
134
+ /**
135
+ * Interface for signature element
136
+ */
137
+ interface SignatureElement extends BaseDocumentElement {
138
+ type: DocumentElementType.SIGNATURE;
139
+ label: string;
140
+ }
141
+ /**
142
+ * Interface for file upload element
143
+ */
144
+ interface FileUploadElement extends BaseDocumentElement {
145
+ type: DocumentElementType.FILE_UPLOAD;
146
+ label: string;
147
+ allowedFileTypes?: string[];
148
+ maxFileSizeMB?: number;
149
+ }
150
+ /**
151
+ * Union type for all document elements
152
+ */
153
+ type DocumentElement = HeadingElement | ParagraphElement | ListElement | DynamicTextElement | BinaryChoiceElement | MultipleChoiceElement | SingleChoiceElement | RatingScaleElement | TextInputElement | DatePickerElement | SignatureElement | FileUploadElement;
154
+ /**
155
+ * Interface for document template
156
+ */
157
+ interface DocumentTemplate {
158
+ id: string;
159
+ title: string;
160
+ description?: string;
161
+ createdAt: number;
162
+ updatedAt: number;
163
+ createdBy: string;
164
+ elements: DocumentElement[];
165
+ tags?: string[];
166
+ version: number;
167
+ isActive: boolean;
168
+ }
169
+
170
+ /**
171
+ * Nivoi sertifikacije medicinskog osoblja, poređani od najnižeg do najvišeg
172
+ */
173
+ declare enum CertificationLevel {
174
+ AESTHETICIAN = "aesthetician",// Osnovni estetičar
175
+ NURSE_ASSISTANT = "nurse_assistant",// Medicinski tehničar
176
+ NURSE = "nurse",// Medicinska sestra
177
+ NURSE_PRACTITIONER = "nurse_practitioner",// Viša medicinska sestra
178
+ PHYSICIAN_ASSISTANT = "physician_assistant",// Lekar asistent
179
+ DOCTOR = "doctor",// Doktor medicine
180
+ SPECIALIST = "specialist",// Specijalista
181
+ PLASTIC_SURGEON = "plastic_surgeon"
182
+ }
183
+ /**
184
+ * Dodatne specijalizacije potrebne za određene procedure
185
+ */
186
+ declare enum CertificationSpecialty {
187
+ LASER = "laser",// Sertifikat za laserske tretmane
188
+ INJECTABLES = "injectables",// Sertifikat za injekcione tretmane
189
+ CHEMICAL_PEELS = "chemical_peels",// Sertifikat za hemijske pilinge
190
+ MICRODERMABRASION = "microdermabrasion",// Sertifikat za mikrodermoabraziju
191
+ BODY_CONTOURING = "body_contouring",// Sertifikat za konturiranje tela
192
+ SKIN_CARE = "skin_care",// Sertifikat za negu kože
193
+ WOUND_CARE = "wound_care",// Sertifikat za tretman rana
194
+ ANESTHESIA = "anesthesia"
195
+ }
196
+ /**
197
+ * Zahtevi sertifikacije za izvođenje procedura
198
+ */
199
+ interface CertificationRequirement {
200
+ /** Minimalni nivo sertifikacije potreban za proceduru */
201
+ minimumLevel: CertificationLevel;
202
+ /** Dodatne specijalizacije potrebne za proceduru */
203
+ requiredSpecialties?: CertificationSpecialty[];
204
+ }
205
+
206
+ /**
207
+ * Condensed clinic review information
208
+ * @description Used for aggregated data attached to clinic documents
209
+ */
210
+ interface ClinicReviewInfo {
211
+ totalReviews: number;
212
+ averageRating: number;
213
+ cleanliness: number;
214
+ facilities: number;
215
+ staffFriendliness: number;
216
+ waitingTime: number;
217
+ accessibility: number;
218
+ recommendationPercentage: number;
219
+ }
220
+ /**
221
+ * Condensed practitioner review information
222
+ * @description Used for aggregated data attached to practitioner documents
223
+ */
224
+ interface PractitionerReviewInfo {
225
+ totalReviews: number;
226
+ averageRating: number;
227
+ knowledgeAndExpertise: number;
228
+ communicationSkills: number;
229
+ bedSideManner: number;
230
+ thoroughness: number;
231
+ trustworthiness: number;
232
+ recommendationPercentage: number;
233
+ }
234
+ /**
235
+ * Condensed procedure review information
236
+ * @description Used for aggregated data attached to procedure documents
237
+ */
238
+ interface ProcedureReviewInfo {
239
+ totalReviews: number;
240
+ averageRating: number;
241
+ effectivenessOfTreatment: number;
242
+ outcomeExplanation: number;
243
+ painManagement: number;
244
+ followUpCare: number;
245
+ valueForMoney: number;
246
+ recommendationPercentage: number;
247
+ }
248
+
249
+ /**
250
+ * Familije procedura u sistemu
251
+ * Predstavlja najviši nivo hijerarhije i deli procedure na estetske i hirurške
252
+ *
253
+ * @enum
254
+ * @property AESTHETICS - Estetske procedure (neivazivne i minimalno invazivne)
255
+ * @property SURGERY - Hirurške procedure (invazivne)
256
+ */
257
+ declare enum ProcedureFamily {
258
+ /** Estetske procedure koje ne zahtevaju hirurški zahvat */
259
+ AESTHETICS = "aesthetics",
260
+ /** Hirurške procedure koje zahtevaju operativni zahvat */
261
+ SURGERY = "surgery"
262
+ }
263
+
264
+ /**
265
+ * Kategorija procedura
266
+ * Kategorije su prvi nivo hijerarhije nakon procedure family
267
+ * One grupišu slične podkategorije u okviru familije procedura
268
+ *
269
+ * @property id - Jedinstveni identifikator kategorije
270
+ * @property name - Naziv kategorije
271
+ * @property description - Detaljan opis kategorije i njene namene
272
+ * @property family - Familija procedura kojoj kategorija pripada (aesthetics/surgery)
273
+ * @property isActive - Da li je kategorija aktivna u sistemu
274
+ * @property createdAt - Datum kreiranja
275
+ * @property updatedAt - Datum poslednjeg ažuriranja
276
+ */
277
+ interface Category {
278
+ /** Jedinstveni identifikator kategorije (automatski generisan od strane Firestore) */
279
+ id?: string;
280
+ /** Naziv kategorije */
281
+ name: string;
282
+ /** Detaljan opis kategorije i njene namene */
283
+ description: string;
284
+ /** Tip procedure kojoj kategorija pripada */
285
+ family: ProcedureFamily;
286
+ /** Datum kreiranja kategorije */
287
+ createdAt: Date;
288
+ /** Datum poslednjeg ažuriranja kategorije */
289
+ updatedAt: Date;
290
+ /** Flag koji označava da li je kategorija aktivna */
291
+ isActive: boolean;
292
+ }
293
+
294
+ /**
295
+ * Podkategorija procedura
296
+ * Podkategorije su drugi nivo hijerarhije i pripadaju određenoj kategoriji
297
+ * One grupišu slične tehnologije u okviru kategorije
298
+ *
299
+ * @property id - Jedinstveni identifikator podkategorije
300
+ * @property name - Naziv podkategorije
301
+ * @property description - Detaljan opis podkategorije i njene namene
302
+ * @property categoryId - ID kategorije kojoj podkategorija pripada
303
+ * @property isActive - Da li je podkategorija aktivna u sistemu
304
+ * @property createdAt - Datum kreiranja
305
+ * @property updatedAt - Datum poslednjeg ažuriranja
306
+ */
307
+ interface Subcategory {
308
+ /** Jedinstveni identifikator podkategorije (automatski generisan od strane Firestore) */
309
+ id?: string;
310
+ /** Naziv podkategorije */
311
+ name: string;
312
+ /** Detaljniji opis podkategorije */
313
+ description?: string;
314
+ /** ID kategorije kojoj podkategorija pripada */
315
+ categoryId: string;
316
+ /** Flag koji označava da li je podkategorija aktivna */
317
+ isActive: boolean;
318
+ /** Datum kreiranja podkategorije */
319
+ createdAt: Date;
320
+ /** Datum poslednjeg ažuriranja podkategorije */
321
+ updatedAt: Date;
322
+ }
323
+
324
+ /**
325
+ * Jedinica mere za vremenski period
326
+ */
327
+ declare enum TimeUnit {
328
+ HOURS = "hours",
329
+ DAYS = "days"
330
+ }
331
+ /**
332
+ * Tip zahteva - da li se odnosi na period pre ili posle procedure
333
+ */
334
+ declare enum RequirementType {
335
+ PRE = "pre",
336
+ POST = "post"
337
+ }
338
+ /**
339
+ * Nivo važnosti zahteva
340
+ */
341
+ type RequirementImportance = "low" | "medium" | "high";
342
+ /**
343
+ * Vremenski okvir za zahtev
344
+ * @property duration - Trajanje u odabranoj jedinici vremena
345
+ * @property unit - Jedinica vremena (sati ili dani)
346
+ * @property notifyAt - Lista trenutaka kada treba poslati obaveštenje (u istoj jedinici)
347
+ */
348
+ interface TimeFrame {
349
+ duration: number;
350
+ unit: TimeUnit;
351
+ notifyAt: number[];
352
+ }
353
+ /**
354
+ * Zahtev koji se može povezati sa tehnologijom
355
+ * Može biti zahtev pre procedure (pre) ili posle procedure (post)
356
+ *
357
+ * @property id - Jedinstveni identifikator zahteva
358
+ * @property type - Tip zahteva (pre/post)
359
+ * @property name - Naziv zahteva
360
+ * @property description - Detaljan opis zahteva
361
+ * @property timeframe - Vremenski okvir za zahtev
362
+ * @property importance - Nivo važnosti zahteva
363
+ * @property isActive - Da li je zahtev aktivan u sistemu
364
+ * @property createdAt - Datum kreiranja
365
+ * @property updatedAt - Datum poslednjeg ažuriranja
366
+ */
367
+ interface Requirement {
368
+ id: string;
369
+ type: RequirementType;
370
+ name: string;
371
+ description: string;
372
+ timeframe: TimeFrame;
373
+ importance: RequirementImportance;
374
+ isActive: boolean;
375
+ createdAt: Date;
376
+ updatedAt: Date;
377
+ }
378
+
379
+ /**
380
+ * Blokirajući uslovi koji mogu sprečiti proceduru
381
+ * Ovi uslovi predstavljaju apsolutne kontraindikacije koje onemogućavaju izvođenje procedure
382
+ */
383
+ declare enum BlockingCondition {
384
+ PREGNANCY = "pregnancy",
385
+ BREASTFEEDING = "breastfeeding",
386
+ ACTIVE_INFECTION = "active_infection",
387
+ SKIN_CONDITION = "skin_condition",
388
+ AUTOIMMUNE_DISEASE = "autoimmune_disease",
389
+ BLOOD_THINNERS = "blood_thinners",
390
+ RECENT_SURGERY = "recent_surgery",
391
+ DIABETES = "diabetes",
392
+ HEART_CONDITION = "heart_condition",
393
+ HIGH_BLOOD_PRESSURE = "high_blood_pressure",
394
+ KELOID_SCARRING = "keloid_scarring",
395
+ METAL_IMPLANTS = "metal_implants",
396
+ PACEMAKER = "pacemaker",
397
+ CANCER = "cancer",
398
+ EPILEPSY = "epilepsy"
399
+ }
400
+
401
+ /**
402
+ * Kontraindikacije koje mogu uticati na proceduru
403
+ * Ovi uslovi predstavljaju relativne kontraindikacije koje zahtevaju posebnu pažnju
404
+ */
405
+ declare enum Contraindication {
406
+ SENSITIVE_SKIN = "sensitive_skin",
407
+ RECENT_TANNING = "recent_tanning",
408
+ RECENT_BOTOX = "recent_botox",
409
+ RECENT_FILLERS = "recent_fillers",
410
+ SKIN_ALLERGIES = "skin_allergies",
411
+ MEDICATIONS = "medications",
412
+ RECENT_CHEMICAL_PEEL = "recent_chemical_peel",
413
+ RECENT_LASER = "recent_laser",
414
+ SKIN_INFLAMMATION = "skin_inflammation",
415
+ OPEN_WOUNDS = "open_wounds",
416
+ HERPES_SIMPLEX = "herpes_simplex",
417
+ COLD_SORES = "cold_sores"
418
+ }
419
+
420
+ /**
421
+ * Benefiti koji se mogu očekivati od procedure
422
+ * Lista mogućih pozitivnih efekata i rezultata tretmana
423
+ */
424
+ declare enum TreatmentBenefit {
425
+ WRINKLE_REDUCTION = "wrinkle_reduction",
426
+ SKIN_TIGHTENING = "skin_tightening",
427
+ COLLAGEN_PRODUCTION = "collagen_production",
428
+ ACNE_REDUCTION = "acne_reduction",
429
+ SCAR_REDUCTION = "scar_reduction",
430
+ PIGMENTATION_IMPROVEMENT = "pigmentation_improvement",
431
+ HAIR_REMOVAL = "hair_removal",
432
+ MUSCLE_TONING = "muscle_toning",
433
+ FAT_REDUCTION = "fat_reduction",
434
+ CELLULITE_REDUCTION = "cellulite_reduction",
435
+ SKIN_REJUVENATION = "skin_rejuvenation",
436
+ PORE_REDUCTION = "pore_reduction",
437
+ TEXTURE_IMPROVEMENT = "texture_improvement",
438
+ HYDRATION_BOOST = "hydration_boost",
439
+ CIRCULATION_IMPROVEMENT = "circulation_improvement"
440
+ }
441
+
442
+ /**
443
+ * Technology used in medical procedures
444
+ * Technologies are now a top-level collection that reference their full path in the hierarchy
445
+ * through family, category, and subcategory IDs
446
+ *
447
+ * @property id - Unique identifier of the technology
448
+ * @property name - Name of the technology
449
+ * @property description - Detailed description of the technology and its application
450
+ * @property family - The procedure family this technology belongs to (aesthetics/surgery)
451
+ * @property categoryId - ID of the category this technology belongs to
452
+ * @property subcategoryId - ID of the subcategory this technology belongs to
453
+ * @property technicalDetails - Technical specifications and details
454
+ * @property requirements - List of pre and post procedure requirements
455
+ * @property blockingConditions - List of conditions that prevent the procedure
456
+ * @property contraindications - List of conditions requiring special attention
457
+ * @property benefits - List of expected benefits from the procedure
458
+ * @property certificationRequirement - Required certification level and specialties
459
+ * @property documentationTemplates - List of documentation templates required for this technology
460
+ * @property isActive - Whether the technology is active in the system
461
+ * @property createdAt - Creation date
462
+ * @property updatedAt - Last update date
463
+ */
464
+ interface Technology {
465
+ id?: string;
466
+ name: string;
467
+ description: string;
468
+ family: ProcedureFamily;
469
+ categoryId: string;
470
+ subcategoryId: string;
471
+ technicalDetails?: string;
472
+ requirements: {
473
+ pre: Requirement[];
474
+ post: Requirement[];
475
+ };
476
+ blockingConditions: BlockingCondition[];
477
+ contraindications: Contraindication[];
478
+ benefits: TreatmentBenefit[];
479
+ certificationRequirement: CertificationRequirement;
480
+ documentationTemplates?: DocumentTemplate[];
481
+ isActive: boolean;
482
+ createdAt: Date;
483
+ updatedAt: Date;
484
+ }
485
+
486
+ /**
487
+ * Product used in procedures
488
+ * Can be consumables, equipment, or any other product needed for performing procedures
489
+ *
490
+ * @property id - Unique identifier of the product
491
+ * @property name - Name of the product
492
+ * @property description - Detailed description of the product and its purpose
493
+ * @property brandId - ID of the brand that manufactures this product
494
+ * @property technologyId - ID of the technology this product is used with
495
+ * @property technicalDetails - Technical details and specifications
496
+ * @property warnings - List of warnings related to product use
497
+ * @property dosage - Dosage information (if applicable)
498
+ * @property composition - Product composition
499
+ * @property indications - List of indications for use
500
+ * @property contraindications - List of contraindications
501
+ * @property isActive - Whether the product is active in the system
502
+ * @property createdAt - Creation date
503
+ * @property updatedAt - Last update date
504
+ */
505
+ interface Product {
506
+ id?: string;
507
+ name: string;
508
+ brandId: string;
509
+ technologyId: string;
510
+ createdAt: Date;
511
+ updatedAt: Date;
512
+ isActive: boolean;
513
+ description?: string;
514
+ technicalDetails?: string;
515
+ warnings?: string[];
516
+ dosage?: string;
517
+ composition?: string;
518
+ indications?: string[];
519
+ contraindications?: string[];
520
+ }
521
+
522
+ declare enum PricingMeasure {
523
+ PER_ML = "per_ml",
524
+ PER_ZONE = "per_zone",
525
+ PER_AREA = "per_area",
526
+ PER_SESSION = "per_session",
527
+ PER_TREATMENT = "per_treatment",
528
+ PER_PACKAGE = "per_package"
529
+ }
530
+ declare enum Currency {
531
+ EUR = "EUR",
532
+ USD = "USD",
533
+ GBP = "GBP",
534
+ CHF = "CHF",
535
+ AUD = "AUD"
536
+ }
537
+
538
+ /**
539
+ * Procedure represents a specific medical procedure that can be performed by a practitioner in a clinic
540
+ * It inherits properties from technology and adds clinic/practitioner specific details
541
+ */
542
+ interface Procedure {
543
+ /** Unique identifier of the procedure */
544
+ id: string;
545
+ /** Name of the procedure */
546
+ name: string;
547
+ /** Detailed description of the procedure */
548
+ description: string;
549
+ /** Family of procedures this belongs to (aesthetics/surgery) */
550
+ family: ProcedureFamily;
551
+ /** Category this procedure belongs to */
552
+ category: Category;
553
+ /** Subcategory this procedure belongs to */
554
+ subcategory: Subcategory;
555
+ /** Technology used in this procedure */
556
+ technology: Technology;
557
+ /** Product used in this procedure */
558
+ product: Product;
559
+ /** Price of the procedure */
560
+ price: number;
561
+ /** Currency for the price */
562
+ currency: Currency;
563
+ /** How the price is measured (per ml, per zone, etc.) */
564
+ pricingMeasure: PricingMeasure;
565
+ /** Duration of the procedure in minutes */
566
+ duration: number;
567
+ /** Blocking conditions that prevent this procedure */
568
+ blockingConditions: BlockingCondition[];
569
+ /** Treatment benefits of this procedure */
570
+ treatmentBenefits: TreatmentBenefit[];
571
+ /** Pre-procedure requirements */
572
+ preRequirements: Requirement[];
573
+ /** Post-procedure requirements */
574
+ postRequirements: Requirement[];
575
+ /** Certification requirements for performing this procedure */
576
+ certificationRequirement: CertificationRequirement;
577
+ /** Documentation templates required for this procedure */
578
+ documentationTemplates: DocumentTemplate[];
579
+ /** ID of the practitioner who performs this procedure */
580
+ practitionerId: string;
581
+ /** ID of the clinic branch where this procedure is performed */
582
+ clinicBranchId: string;
583
+ /** Aggregated clinic information */
584
+ clinicInfo: ClinicInfo;
585
+ /** Aggregated doctor information */
586
+ doctorInfo: DoctorInfo;
587
+ /** Aggregated review information for this procedure */
588
+ reviewInfo: ProcedureReviewInfo;
589
+ /** Whether this procedure is active */
590
+ isActive: boolean;
591
+ /** When this procedure was created */
592
+ createdAt: Date;
593
+ /** When this procedure was last updated */
594
+ updatedAt: Date;
595
+ }
596
+ /**
597
+ * Aggregated summary information for a procedure.
598
+ * Used in arrays within Clinic and Practitioner documents for quick display.
599
+ */
600
+ interface ProcedureSummaryInfo {
601
+ id: string;
602
+ name: string;
603
+ description?: string;
604
+ photo?: string;
605
+ family: ProcedureFamily;
606
+ categoryName: string;
607
+ subcategoryName: string;
608
+ technologyName: string;
609
+ price: number;
610
+ pricingMeasure: PricingMeasure;
611
+ currency: Currency;
612
+ duration: number;
613
+ clinicId: string;
614
+ clinicName: string;
615
+ practitionerId: string;
616
+ practitionerName: string;
617
+ }
618
+
619
+ /**
620
+ * Osnovne informacije o zdravstvenom radniku
621
+ */
622
+ interface PractitionerBasicInfo {
623
+ firstName: string;
624
+ lastName: string;
625
+ title: string;
626
+ email: string;
627
+ phoneNumber: string;
628
+ dateOfBirth: Timestamp | Date;
629
+ gender: "male" | "female" | "other";
630
+ profileImageUrl?: string;
631
+ bio?: string;
632
+ languages: string[];
633
+ }
634
+ /**
635
+ * Sertifikacija zdravstvenog radnika
636
+ */
637
+ interface PractitionerCertification {
638
+ level: CertificationLevel;
639
+ specialties: CertificationSpecialty[];
640
+ licenseNumber: string;
641
+ issuingAuthority: string;
642
+ issueDate: Timestamp | Date;
643
+ expiryDate?: Timestamp | Date;
644
+ verificationStatus: "pending" | "verified" | "rejected";
645
+ }
646
+ /**
647
+ * Interfejs za radno vreme zdravstvenog radnika u klinici
648
+ */
649
+ interface PractitionerClinicWorkingHours {
650
+ clinicId: string;
651
+ workingHours: {
652
+ monday: {
653
+ start: string;
654
+ end: string;
655
+ } | null;
656
+ tuesday: {
657
+ start: string;
658
+ end: string;
659
+ } | null;
660
+ wednesday: {
661
+ start: string;
662
+ end: string;
663
+ } | null;
664
+ thursday: {
665
+ start: string;
666
+ end: string;
667
+ } | null;
668
+ friday: {
669
+ start: string;
670
+ end: string;
671
+ } | null;
672
+ saturday: {
673
+ start: string;
674
+ end: string;
675
+ } | null;
676
+ sunday: {
677
+ start: string;
678
+ end: string;
679
+ } | null;
680
+ };
681
+ isActive: boolean;
682
+ createdAt: Timestamp | Date;
683
+ updatedAt: Timestamp | Date;
684
+ }
685
+ /**
686
+ * Status of practitioner profile
687
+ */
688
+ declare enum PractitionerStatus {
689
+ DRAFT = "draft",
690
+ ACTIVE = "active"
691
+ }
692
+ /**
693
+ * Interfejs za zdravstvenog radnika
694
+ */
695
+ interface Practitioner {
696
+ id: string;
697
+ userRef: string;
698
+ basicInfo: PractitionerBasicInfo;
699
+ certification: PractitionerCertification;
700
+ clinics: string[];
701
+ clinicWorkingHours: PractitionerClinicWorkingHours[];
702
+ clinicsInfo: ClinicInfo[];
703
+ procedures: string[];
704
+ proceduresInfo: ProcedureSummaryInfo[];
705
+ reviewInfo: PractitionerReviewInfo;
706
+ isActive: boolean;
707
+ isVerified: boolean;
708
+ status: PractitionerStatus;
709
+ createdAt: Timestamp;
710
+ updatedAt: Timestamp;
711
+ }
712
+
713
+ /**
714
+ * Interfejs za gamifikaciju
715
+ */
716
+ interface GamificationInfo {
717
+ /** Nivo korisnika */
718
+ level: number;
719
+ /** Trenutni poeni */
720
+ points: number;
721
+ }
722
+ /**
723
+ * Interfejs za doktora pacijenta
724
+ */
725
+ interface PatientDoctor {
726
+ userRef: string;
727
+ assignedAt: Timestamp;
728
+ assignedBy?: string;
729
+ isActive: boolean;
730
+ notes?: string;
731
+ }
732
+ /**
733
+ * Interfejs za kliniku pacijenta
734
+ */
735
+ interface PatientClinic {
736
+ clinicId: string;
737
+ assignedAt: Timestamp;
738
+ assignedBy?: string;
739
+ isActive: boolean;
740
+ notes?: string;
741
+ }
742
+ /**
743
+ * Glavni interfejs za Patient profil (top-level kolekcija)
744
+ */
745
+ interface PatientProfile {
746
+ id: string;
747
+ userRef: string;
748
+ displayName: string;
749
+ profilePhoto: string | null;
750
+ gamification: GamificationInfo;
751
+ expoTokens: string[];
752
+ isActive: boolean;
753
+ isVerified: boolean;
754
+ phoneNumber?: string | null;
755
+ dateOfBirth?: Timestamp | null;
756
+ doctors: PatientDoctor[];
757
+ clinics: PatientClinic[];
758
+ doctorIds: string[];
759
+ clinicIds: string[];
760
+ createdAt: Timestamp;
761
+ updatedAt: Timestamp;
762
+ }
763
+
764
+ /**
765
+ * Interface for clinic profile information
766
+ */
767
+ interface ClinicInfo {
768
+ id: string;
769
+ featuredPhoto: string;
770
+ name: string;
771
+ description?: string | null;
772
+ location: ClinicLocation;
773
+ contactInfo: ClinicContactInfo;
774
+ }
775
+
776
+ /**
777
+ * Enum for all possible clinic tags
778
+ */
779
+ declare enum ClinicTag {
780
+ PARKING = "parking",
781
+ WIFI = "wifi",
782
+ WHEELCHAIR_ACCESS = "wheelchair_access",
783
+ CAFE = "cafe",
784
+ PHARMACY = "pharmacy",
785
+ WAITING_ROOM = "waiting_room",
786
+ CARD_PAYMENT = "card_payment",
787
+ INSURANCE = "insurance",
788
+ CHILDREN_AREA = "children_area",
789
+ TV = "tv",
790
+ AIR_CONDITIONING = "air_conditioning",
791
+ WATER_DISPENSER = "water_dispenser",
792
+ VENDING_MACHINE = "vending_machine",
793
+ ELEVATOR = "elevator",
794
+ RAMP = "ramp",
795
+ HANDICAP_PARKING = "handicap_parking",
796
+ BRAILLE = "braille",
797
+ SIGN_LANGUAGE = "sign_language",
798
+ EMERGENCY_SERVICE = "emergency_service",
799
+ LAB = "lab",
800
+ XRAY = "xray",
801
+ ULTRASOUND = "ultrasound",
802
+ DENTAL = "dental",
803
+ PEDIATRIC = "pediatric",
804
+ GYNECOLOGY = "gynecology",
805
+ CARDIOLOGY = "cardiology",
806
+ DERMATOLOGY = "dermatology",
807
+ ORTHOPEDIC = "orthopedic",
808
+ OPHTHALMOLOGY = "ophthalmology",
809
+ TELEMEDICINE = "telemedicine",
810
+ HOME_VISITS = "home_visits",
811
+ ONLINE_BOOKING = "online_booking",
812
+ MOBILE_APP = "mobile_app",
813
+ SMS_NOTIFICATIONS = "sms_notifications",
814
+ EMAIL_NOTIFICATIONS = "email_notifications",
815
+ ENGLISH = "english",
816
+ SERBIAN = "serbian",
817
+ GERMAN = "german",
818
+ RUSSIAN = "russian",
819
+ CHINESE = "chinese",
820
+ SPANISH = "spanish",
821
+ FRENCH = "french",
822
+ OPEN_24_7 = "open_24_7",
823
+ WEEKEND_HOURS = "weekend_hours",
824
+ NIGHT_SHIFT = "night_shift",
825
+ HOLIDAY_HOURS = "holiday_hours"
826
+ }
827
+
828
+ /**
829
+ * Interface for clinic contact information
830
+ */
831
+ interface ClinicContactInfo {
832
+ email: string;
833
+ phoneNumber: string;
834
+ alternativePhoneNumber?: string | null;
835
+ website?: string | null;
836
+ }
837
+ /**
838
+ * Interface for clinic location
839
+ */
840
+ interface ClinicLocation {
841
+ address: string;
842
+ city: string;
843
+ country: string;
844
+ postalCode: string;
845
+ latitude: number;
846
+ longitude: number;
847
+ geohash?: string | null;
848
+ }
849
+ /**
850
+ * Interface for working hours
851
+ */
852
+ interface WorkingHours {
853
+ monday: {
854
+ open: string;
855
+ close: string;
856
+ breaks?: {
857
+ start: string;
858
+ end: string;
859
+ }[];
860
+ } | null;
861
+ tuesday: {
862
+ open: string;
863
+ close: string;
864
+ breaks?: {
865
+ start: string;
866
+ end: string;
867
+ }[];
868
+ } | null;
869
+ wednesday: {
870
+ open: string;
871
+ close: string;
872
+ breaks?: {
873
+ start: string;
874
+ end: string;
875
+ }[];
876
+ } | null;
877
+ thursday: {
878
+ open: string;
879
+ close: string;
880
+ breaks?: {
881
+ start: string;
882
+ end: string;
883
+ }[];
884
+ } | null;
885
+ friday: {
886
+ open: string;
887
+ close: string;
888
+ breaks?: {
889
+ start: string;
890
+ end: string;
891
+ }[];
892
+ } | null;
893
+ saturday: {
894
+ open: string;
895
+ close: string;
896
+ breaks?: {
897
+ start: string;
898
+ end: string;
899
+ }[];
900
+ } | null;
901
+ sunday: {
902
+ open: string;
903
+ close: string;
904
+ breaks?: {
905
+ start: string;
906
+ end: string;
907
+ }[];
908
+ } | null;
909
+ }
910
+ /**
911
+ * Interface for doctor information
912
+ */
913
+ interface DoctorInfo {
914
+ id: string;
915
+ name: string;
916
+ description?: string;
917
+ photo: string;
918
+ rating: number;
919
+ services: string[];
920
+ }
921
+ /**
922
+ * Interface for service information
923
+ */
924
+ /**
925
+ * Interface for clinic
926
+ */
927
+ interface Clinic {
928
+ id: string;
929
+ clinicGroupId: string;
930
+ name: string;
931
+ description?: string;
932
+ location: ClinicLocation;
933
+ contactInfo: ClinicContactInfo;
934
+ workingHours: WorkingHours;
935
+ tags: ClinicTag[];
936
+ featuredPhotos: string[];
937
+ coverPhoto: string | null;
938
+ photosWithTags?: {
939
+ url: string;
940
+ tag: string;
941
+ }[];
942
+ doctors: string[];
943
+ doctorsInfo: DoctorInfo[];
944
+ procedures: string[];
945
+ proceduresInfo: ProcedureSummaryInfo[];
946
+ reviewInfo: ClinicReviewInfo;
947
+ admins: string[];
948
+ createdAt: Timestamp;
949
+ updatedAt: Timestamp;
950
+ isActive: boolean;
951
+ isVerified: boolean;
952
+ logo?: string;
953
+ }
954
+
4
955
  declare enum UserRole {
5
956
  PATIENT = "patient",
6
957
  PRACTITIONER = "practitioner",
@@ -152,4 +1103,251 @@ declare class NotificationsAdmin {
152
1103
  cleanupOldNotifications(daysOld?: number, batchSize?: number): Promise<void>;
153
1104
  }
154
1105
 
155
- export { type AppointmentNotification, type AppointmentReminderNotification, type BaseNotification, NOTIFICATIONS_COLLECTION, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type PostRequirementNotification, type PreRequirementNotification, UserRole };
1106
+ /**
1107
+ * @class ClinicAggregationService
1108
+ * @description Handles aggregation tasks related to clinic data updates.
1109
+ * This service is intended to be used primarily by background functions (e.g., Cloud Functions)
1110
+ * triggered by changes in the clinics collection.
1111
+ */
1112
+ declare class ClinicAggregationService {
1113
+ private db;
1114
+ /**
1115
+ * Constructor for ClinicAggregationService.
1116
+ * @param firestore Optional Firestore instance. If not provided, it uses the default admin SDK instance.
1117
+ */
1118
+ constructor(firestore?: admin.firestore.Firestore);
1119
+ /**
1120
+ * Adds clinic information to a clinic group when a new clinic is created
1121
+ * @param clinicGroupId - ID of the parent clinic group
1122
+ * @param clinicInfo - The clinic information to add to the group
1123
+ * @returns {Promise<void>}
1124
+ * @throws Will throw an error if the batch write fails
1125
+ */
1126
+ addClinicToClinicGroup(clinicGroupId: string, clinicInfo: ClinicInfo): Promise<void>;
1127
+ /**
1128
+ * Updates the ClinicInfo within the clinicsInfo array for multiple practitioners.
1129
+ * This method is designed to be called when a clinic's core information changes.
1130
+ * @param practitionerIds - IDs of practitioners associated with the clinic.
1131
+ * @param clinicInfo - The updated ClinicInfo object to aggregate.
1132
+ * @returns {Promise<void>}
1133
+ * @throws Will throw an error if the batch write fails.
1134
+ */
1135
+ updateClinicInfoInPractitioners(practitionerIds: string[], clinicInfo: ClinicInfo): Promise<void>;
1136
+ /**
1137
+ * Updates the aggregated clinicInfo field within relevant Procedure documents.
1138
+ * @param procedureIds IDs of procedures performed at the clinic.
1139
+ * @param clinicInfo The updated ClinicInfo object.
1140
+ */
1141
+ updateClinicInfoInProcedures(procedureIds: string[], clinicInfo: ClinicInfo): Promise<void>;
1142
+ /**
1143
+ * Updates the aggregated clinicsInfo array within the parent ClinicGroup document.
1144
+ * @param clinicGroupId The ID of the parent clinic group.
1145
+ * @param clinicInfo The updated ClinicInfo object.
1146
+ */
1147
+ updateClinicInfoInClinicGroup(clinicGroupId: string, clinicInfo: ClinicInfo): Promise<void>;
1148
+ /**
1149
+ * Updates relevant clinic information within Patient documents.
1150
+ * NOTE: PatientProfile stores an array of PatientClinic objects, which only contain
1151
+ * clinicId, assignedAt, assignedBy, isActive, notes. It does *not* store aggregated
1152
+ * ClinicInfo (like name, photo). Therefore, this method currently has limited use
1153
+ * for general clinic info updates. It might be relevant if Clinic.isActive status changes.
1154
+ *
1155
+ * @param patientIds IDs of patients associated with the clinic (e.g., from PatientProfile.clinicIds).
1156
+ * @param clinicInfo The updated ClinicInfo object (primarily for logging/context).
1157
+ * @param clinicIsActive The current active status of the updated clinic.
1158
+ */
1159
+ updateClinicInfoInPatients(patientIds: string[], clinicInfo: ClinicInfo, clinicIsActive: boolean): Promise<void>;
1160
+ /**
1161
+ * Updates the eventLocation for upcoming calendar events associated with a specific clinic.
1162
+ * Uses a collection group query to find relevant events across all potential parent collections.
1163
+ *
1164
+ * @param clinicId The ID of the clinic whose location might have changed.
1165
+ * @param newLocation The new ClinicLocation object.
1166
+ */
1167
+ updateClinicLocationInCalendarEvents(clinicId: string, newLocation: ClinicLocation): Promise<void>;
1168
+ /**
1169
+ * Updates clinic info in all upcoming calendar events associated with a specific clinic.
1170
+ * @param clinicId The ID of the clinic whose info has been updated.
1171
+ * @param clinicInfo The updated ClinicInfo object.
1172
+ */
1173
+ updateClinicInfoInCalendarEvents(clinicId: string, clinicInfo: ClinicInfo): Promise<void>;
1174
+ /**
1175
+ * Removes clinic from practitioners when a clinic is deleted.
1176
+ * @param practitionerIds IDs of practitioners associated with the clinic.
1177
+ * @param clinicId The ID of the deleted clinic.
1178
+ */
1179
+ removeClinicFromPractitioners(practitionerIds: string[], clinicId: string): Promise<void>;
1180
+ /**
1181
+ * Inactivates all procedures associated with a deleted clinic
1182
+ * @param procedureIds IDs of procedures associated with the clinic
1183
+ */
1184
+ inactivateProceduresForClinic(procedureIds: string[]): Promise<void>;
1185
+ /**
1186
+ * Removes clinic from clinic group when a clinic is deleted
1187
+ * @param clinicGroupId ID of the parent clinic group
1188
+ * @param clinicId ID of the deleted clinic
1189
+ */
1190
+ removeClinicFromClinicGroup(clinicGroupId: string, clinicId: string): Promise<void>;
1191
+ /**
1192
+ * Removes clinic from patients when a clinic is deleted
1193
+ * @param patientIds IDs of patients associated with the clinic
1194
+ * @param clinicId ID of the deleted clinic
1195
+ */
1196
+ removeClinicFromPatients(patientIds: string[], clinicId: string): Promise<void>;
1197
+ /**
1198
+ * Cancels all upcoming calendar events associated with a deleted clinic
1199
+ * @param clinicId ID of the deleted clinic
1200
+ */
1201
+ cancelUpcomingCalendarEventsForClinic(clinicId: string): Promise<void>;
1202
+ }
1203
+
1204
+ /**
1205
+ * @class PractitionerAggregationService
1206
+ * @description Handles aggregation tasks related to practitioner data updates/deletions.
1207
+ */
1208
+ declare class PractitionerAggregationService {
1209
+ private db;
1210
+ constructor(firestore?: admin.firestore.Firestore);
1211
+ /**
1212
+ * Adds practitioner information to a clinic when a new practitioner is created
1213
+ * @param clinicId - ID of the clinic to update
1214
+ * @param doctorInfo - Doctor information to add to the clinic
1215
+ * @returns {Promise<void>}
1216
+ */
1217
+ addPractitionerToClinic(clinicId: string, doctorInfo: DoctorInfo): Promise<void>;
1218
+ /**
1219
+ * Updates practitioner information in associated clinics
1220
+ * @param clinicIds - IDs of clinics associated with the practitioner
1221
+ * @param doctorInfo - Updated doctor information
1222
+ * @returns {Promise<void>}
1223
+ */
1224
+ updatePractitionerInfoInClinics(clinicIds: string[], doctorInfo: DoctorInfo): Promise<void>;
1225
+ /**
1226
+ * Updates practitioner information in associated procedures
1227
+ * @param procedureIds - IDs of procedures associated with the practitioner
1228
+ * @param doctorInfo - Updated doctor information
1229
+ * @returns {Promise<void>}
1230
+ */
1231
+ updatePractitionerInfoInProcedures(procedureIds: string[], doctorInfo: DoctorInfo): Promise<void>;
1232
+ /**
1233
+ * Updates practitioner information in calendar events
1234
+ * @param practitionerId - ID of the practitioner
1235
+ * @param practitionerInfo - Updated practitioner information
1236
+ * @returns {Promise<void>}
1237
+ */
1238
+ updatePractitionerInfoInCalendarEvents(practitionerId: string, practitionerInfo: DoctorInfo): Promise<void>;
1239
+ /**
1240
+ * Removes practitioner from clinics when a practitioner is deleted
1241
+ * @param clinicIds - IDs of clinics associated with the practitioner
1242
+ * @param practitionerId - ID of the deleted practitioner
1243
+ * @returns {Promise<void>}
1244
+ */
1245
+ removePractitionerFromClinics(clinicIds: string[], practitionerId: string): Promise<void>;
1246
+ /**
1247
+ * Cancels all upcoming calendar events for a deleted practitioner
1248
+ * @param practitionerId - ID of the deleted practitioner
1249
+ * @returns {Promise<void>}
1250
+ */
1251
+ cancelUpcomingCalendarEventsForPractitioner(practitionerId: string): Promise<void>;
1252
+ /**
1253
+ * Removes practitioner from patients when a practitioner is deleted
1254
+ * @param patientIds - IDs of patients associated with the practitioner
1255
+ * @param practitionerId - ID of the deleted practitioner
1256
+ * @returns {Promise<void>}
1257
+ */
1258
+ removePractitionerFromPatients(patientIds: string[], practitionerId: string): Promise<void>;
1259
+ /**
1260
+ * Inactivates all procedures associated with a deleted practitioner
1261
+ * @param procedureIds - IDs of procedures provided by the practitioner
1262
+ * @returns {Promise<void>}
1263
+ */
1264
+ inactivateProceduresForPractitioner(procedureIds: string[]): Promise<void>;
1265
+ }
1266
+
1267
+ /**
1268
+ * @class ProcedureAggregationService
1269
+ * @description Handles aggregation tasks related to procedure data updates/deletions.
1270
+ */
1271
+ declare class ProcedureAggregationService {
1272
+ private db;
1273
+ constructor(firestore?: admin.firestore.Firestore);
1274
+ /**
1275
+ * Adds procedure information to a practitioner when a new procedure is created
1276
+ * @param practitionerId - ID of the practitioner who performs the procedure
1277
+ * @param procedureSummary - Summary information about the procedure
1278
+ * @returns {Promise<void>}
1279
+ */
1280
+ addProcedureToPractitioner(practitionerId: string, procedureSummary: ProcedureSummaryInfo): Promise<void>;
1281
+ /**
1282
+ * Adds procedure information to a clinic when a new procedure is created
1283
+ * @param clinicId - ID of the clinic where the procedure is performed
1284
+ * @param procedureSummary - Summary information about the procedure
1285
+ * @returns {Promise<void>}
1286
+ */
1287
+ addProcedureToClinic(clinicId: string, procedureSummary: ProcedureSummaryInfo): Promise<void>;
1288
+ /**
1289
+ * Updates procedure information in a practitioner document
1290
+ * @param practitionerId - ID of the practitioner who performs the procedure
1291
+ * @param procedureSummary - Updated summary information about the procedure
1292
+ * @returns {Promise<void>}
1293
+ */
1294
+ updateProcedureInfoInPractitioner(practitionerId: string, procedureSummary: ProcedureSummaryInfo): Promise<void>;
1295
+ /**
1296
+ * Updates procedure information in a clinic document
1297
+ * @param clinicId - ID of the clinic where the procedure is performed
1298
+ * @param procedureSummary - Updated summary information about the procedure
1299
+ * @returns {Promise<void>}
1300
+ */
1301
+ updateProcedureInfoInClinic(clinicId: string, procedureSummary: ProcedureSummaryInfo): Promise<void>;
1302
+ /**
1303
+ * Updates procedure information in calendar events
1304
+ * @param procedureId - ID of the procedure
1305
+ * @param procedureInfo - Updated procedure information
1306
+ * @returns {Promise<void>}
1307
+ */
1308
+ updateProcedureInfoInCalendarEvents(procedureId: string, procedureInfo: any): Promise<void>;
1309
+ /**
1310
+ * Cancels all upcoming calendar events for a procedure
1311
+ * @param procedureId - ID of the procedure
1312
+ * @returns {Promise<void>}
1313
+ */
1314
+ cancelUpcomingCalendarEventsForProcedure(procedureId: string): Promise<void>;
1315
+ /**
1316
+ * Removes procedure from a practitioner when a procedure is deleted or inactivated
1317
+ * @param practitionerId - ID of the practitioner who performs the procedure
1318
+ * @param procedureId - ID of the procedure
1319
+ * @returns {Promise<void>}
1320
+ */
1321
+ removeProcedureFromPractitioner(practitionerId: string, procedureId: string): Promise<void>;
1322
+ /**
1323
+ * Removes procedure from a clinic when a procedure is deleted or inactivated
1324
+ * @param clinicId - ID of the clinic where the procedure is performed
1325
+ * @param procedureId - ID of the procedure
1326
+ * @returns {Promise<void>}
1327
+ */
1328
+ removeProcedureFromClinic(clinicId: string, procedureId: string): Promise<void>;
1329
+ }
1330
+
1331
+ /**
1332
+ * @class PatientAggregationService
1333
+ * @description Handles aggregation tasks related to patient data updates/deletions.
1334
+ */
1335
+ declare class PatientAggregationService {
1336
+ private db;
1337
+ constructor(firestore?: admin.firestore.Firestore);
1338
+ /**
1339
+ * Updates patient information in calendar events
1340
+ * @param patientId - ID of the patient
1341
+ * @param patientInfo - Updated patient information
1342
+ * @returns {Promise<void>}
1343
+ */
1344
+ updatePatientInfoInCalendarEvents(patientId: string, patientInfo: any): Promise<void>;
1345
+ /**
1346
+ * Cancels all upcoming calendar events associated with a deleted patient
1347
+ * @param patientId - ID of the deleted patient
1348
+ * @returns {Promise<void>}
1349
+ */
1350
+ cancelUpcomingCalendarEventsForPatient(patientId: string): Promise<void>;
1351
+ }
1352
+
1353
+ export { type AppointmentNotification, type AppointmentReminderNotification, type BaseNotification, type Clinic, ClinicAggregationService, type ClinicInfo, type ClinicLocation, type DoctorInfo, NOTIFICATIONS_COLLECTION, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type PatientProfile as Patient, PatientAggregationService, type PostRequirementNotification, type Practitioner, PractitionerAggregationService, type PreRequirementNotification, type Procedure, ProcedureAggregationService, type ProcedureSummaryInfo, UserRole };