@blackcode_sa/metaestetics-api 1.12.7 → 1.12.10

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.
@@ -835,49 +835,67 @@ interface ProcedureSummaryInfo {
835
835
  declare enum ClinicTag {
836
836
  PARKING = "parking",
837
837
  WIFI = "wifi",
838
- WHEELCHAIR_ACCESS = "wheelchair_access",
839
- CAFE = "cafe",
840
- PHARMACY = "pharmacy",
841
- WAITING_ROOM = "waiting_room",
838
+ LUXURY_WAITING = "luxury_waiting",
839
+ REFRESHMENTS = "refreshments",
840
+ PRIVATE_ROOMS = "private_rooms",
841
+ RECOVERY_AREA = "recovery_area",
842
842
  CARD_PAYMENT = "card_payment",
843
- INSURANCE = "insurance",
844
- CHILDREN_AREA = "children_area",
845
- TV = "tv",
846
- AIR_CONDITIONING = "air_conditioning",
847
- WATER_DISPENSER = "water_dispenser",
848
- VENDING_MACHINE = "vending_machine",
849
- ELEVATOR = "elevator",
850
- RAMP = "ramp",
851
- HANDICAP_PARKING = "handicap_parking",
852
- BRAILLE = "braille",
853
- SIGN_LANGUAGE = "sign_language",
854
- EMERGENCY_SERVICE = "emergency_service",
855
- LAB = "lab",
856
- XRAY = "xray",
857
- ULTRASOUND = "ultrasound",
858
- DENTAL = "dental",
859
- PEDIATRIC = "pediatric",
860
- GYNECOLOGY = "gynecology",
861
- CARDIOLOGY = "cardiology",
862
- DERMATOLOGY = "dermatology",
863
- ORTHOPEDIC = "orthopedic",
864
- OPHTHALMOLOGY = "ophthalmology",
865
- TELEMEDICINE = "telemedicine",
866
- HOME_VISITS = "home_visits",
843
+ FINANCING = "financing",
844
+ FREE_CONSULTATION = "free_consultation",
845
+ VIRTUAL_CONSULTATION = "virtual_consultation",
846
+ BEFORE_AFTER_PHOTOS = "before_after_photos",
847
+ AFTERCARE_SUPPORT = "aftercare_support",
848
+ BOTOX = "botox",
849
+ DERMAL_FILLERS = "dermal_fillers",
850
+ LASER_HAIR_REMOVAL = "laser_hair_removal",
851
+ LASER_SKIN_RESURFACING = "laser_skin_resurfacing",
852
+ CHEMICAL_PEELS = "chemical_peels",
853
+ MICRONEEDLING = "microneedling",
854
+ COOLSCULPTING = "coolsculpting",
855
+ THREAD_LIFT = "thread_lift",
856
+ LIP_ENHANCEMENT = "lip_enhancement",
857
+ RHINOPLASTY = "rhinoplasty",
858
+ SKIN_TIGHTENING = "skin_tightening",
859
+ FAT_DISSOLVING = "fat_dissolving",
860
+ PRP_TREATMENT = "prp_treatment",
861
+ HYDRAFACIAL = "hydrafacial",
862
+ IPL_PHOTOFACIAL = "ipl_photofacial",
863
+ BODY_CONTOURING = "body_contouring",
864
+ FACELIFT = "facelift",
865
+ RHINOPLASTY_SURGICAL = "rhinoplasty_surgical",
866
+ BREAST_AUGMENTATION = "breast_augmentation",
867
+ BREAST_REDUCTION = "breast_reduction",
868
+ BREAST_LIFT = "breast_lift",
869
+ TUMMY_TUCK = "tummy_tuck",
870
+ LIPOSUCTION = "liposuction",
871
+ BBL = "bbl",
872
+ MOMMY_MAKEOVER = "mommy_makeover",
873
+ ARM_LIFT = "arm_lift",
874
+ THIGH_LIFT = "thigh_lift",
875
+ EYELID_SURGERY = "eyelid_surgery",
876
+ BROW_LIFT = "brow_lift",
877
+ NECK_LIFT = "neck_lift",
878
+ OTOPLASTY = "otoplasty",
879
+ LABIAPLASTY = "labiaplasty",
867
880
  ONLINE_BOOKING = "online_booking",
868
881
  MOBILE_APP = "mobile_app",
869
882
  SMS_NOTIFICATIONS = "sms_notifications",
870
883
  EMAIL_NOTIFICATIONS = "email_notifications",
884
+ VIRTUAL_TRY_ON = "virtual_try_on",
885
+ SKIN_ANALYSIS = "skin_analysis",
886
+ TREATMENT_TRACKING = "treatment_tracking",
887
+ LOYALTY_PROGRAM = "loyalty_program",
871
888
  ENGLISH = "english",
872
- SERBIAN = "serbian",
873
889
  GERMAN = "german",
874
- RUSSIAN = "russian",
875
- CHINESE = "chinese",
876
- SPANISH = "spanish",
877
890
  FRENCH = "french",
891
+ SPANISH = "spanish",
892
+ ITALIAN = "italian",
893
+ DUTCH = "dutch",
894
+ RUSSIAN = "russian",
895
+ PORTUGUESE = "portuguese",
878
896
  OPEN_24_7 = "open_24_7",
879
897
  WEEKEND_HOURS = "weekend_hours",
880
- NIGHT_SHIFT = "night_shift",
898
+ EXTENDED_HOURS = "extended_hours",
881
899
  HOLIDAY_HOURS = "holiday_hours"
882
900
  }
883
901
 
@@ -835,49 +835,67 @@ interface ProcedureSummaryInfo {
835
835
  declare enum ClinicTag {
836
836
  PARKING = "parking",
837
837
  WIFI = "wifi",
838
- WHEELCHAIR_ACCESS = "wheelchair_access",
839
- CAFE = "cafe",
840
- PHARMACY = "pharmacy",
841
- WAITING_ROOM = "waiting_room",
838
+ LUXURY_WAITING = "luxury_waiting",
839
+ REFRESHMENTS = "refreshments",
840
+ PRIVATE_ROOMS = "private_rooms",
841
+ RECOVERY_AREA = "recovery_area",
842
842
  CARD_PAYMENT = "card_payment",
843
- INSURANCE = "insurance",
844
- CHILDREN_AREA = "children_area",
845
- TV = "tv",
846
- AIR_CONDITIONING = "air_conditioning",
847
- WATER_DISPENSER = "water_dispenser",
848
- VENDING_MACHINE = "vending_machine",
849
- ELEVATOR = "elevator",
850
- RAMP = "ramp",
851
- HANDICAP_PARKING = "handicap_parking",
852
- BRAILLE = "braille",
853
- SIGN_LANGUAGE = "sign_language",
854
- EMERGENCY_SERVICE = "emergency_service",
855
- LAB = "lab",
856
- XRAY = "xray",
857
- ULTRASOUND = "ultrasound",
858
- DENTAL = "dental",
859
- PEDIATRIC = "pediatric",
860
- GYNECOLOGY = "gynecology",
861
- CARDIOLOGY = "cardiology",
862
- DERMATOLOGY = "dermatology",
863
- ORTHOPEDIC = "orthopedic",
864
- OPHTHALMOLOGY = "ophthalmology",
865
- TELEMEDICINE = "telemedicine",
866
- HOME_VISITS = "home_visits",
843
+ FINANCING = "financing",
844
+ FREE_CONSULTATION = "free_consultation",
845
+ VIRTUAL_CONSULTATION = "virtual_consultation",
846
+ BEFORE_AFTER_PHOTOS = "before_after_photos",
847
+ AFTERCARE_SUPPORT = "aftercare_support",
848
+ BOTOX = "botox",
849
+ DERMAL_FILLERS = "dermal_fillers",
850
+ LASER_HAIR_REMOVAL = "laser_hair_removal",
851
+ LASER_SKIN_RESURFACING = "laser_skin_resurfacing",
852
+ CHEMICAL_PEELS = "chemical_peels",
853
+ MICRONEEDLING = "microneedling",
854
+ COOLSCULPTING = "coolsculpting",
855
+ THREAD_LIFT = "thread_lift",
856
+ LIP_ENHANCEMENT = "lip_enhancement",
857
+ RHINOPLASTY = "rhinoplasty",
858
+ SKIN_TIGHTENING = "skin_tightening",
859
+ FAT_DISSOLVING = "fat_dissolving",
860
+ PRP_TREATMENT = "prp_treatment",
861
+ HYDRAFACIAL = "hydrafacial",
862
+ IPL_PHOTOFACIAL = "ipl_photofacial",
863
+ BODY_CONTOURING = "body_contouring",
864
+ FACELIFT = "facelift",
865
+ RHINOPLASTY_SURGICAL = "rhinoplasty_surgical",
866
+ BREAST_AUGMENTATION = "breast_augmentation",
867
+ BREAST_REDUCTION = "breast_reduction",
868
+ BREAST_LIFT = "breast_lift",
869
+ TUMMY_TUCK = "tummy_tuck",
870
+ LIPOSUCTION = "liposuction",
871
+ BBL = "bbl",
872
+ MOMMY_MAKEOVER = "mommy_makeover",
873
+ ARM_LIFT = "arm_lift",
874
+ THIGH_LIFT = "thigh_lift",
875
+ EYELID_SURGERY = "eyelid_surgery",
876
+ BROW_LIFT = "brow_lift",
877
+ NECK_LIFT = "neck_lift",
878
+ OTOPLASTY = "otoplasty",
879
+ LABIAPLASTY = "labiaplasty",
867
880
  ONLINE_BOOKING = "online_booking",
868
881
  MOBILE_APP = "mobile_app",
869
882
  SMS_NOTIFICATIONS = "sms_notifications",
870
883
  EMAIL_NOTIFICATIONS = "email_notifications",
884
+ VIRTUAL_TRY_ON = "virtual_try_on",
885
+ SKIN_ANALYSIS = "skin_analysis",
886
+ TREATMENT_TRACKING = "treatment_tracking",
887
+ LOYALTY_PROGRAM = "loyalty_program",
871
888
  ENGLISH = "english",
872
- SERBIAN = "serbian",
873
889
  GERMAN = "german",
874
- RUSSIAN = "russian",
875
- CHINESE = "chinese",
876
- SPANISH = "spanish",
877
890
  FRENCH = "french",
891
+ SPANISH = "spanish",
892
+ ITALIAN = "italian",
893
+ DUTCH = "dutch",
894
+ RUSSIAN = "russian",
895
+ PORTUGUESE = "portuguese",
878
896
  OPEN_24_7 = "open_24_7",
879
897
  WEEKEND_HOURS = "weekend_hours",
880
- NIGHT_SHIFT = "night_shift",
898
+ EXTENDED_HOURS = "extended_hours",
881
899
  HOLIDAY_HOURS = "holiday_hours"
882
900
  }
883
901
 
@@ -3867,14 +3867,37 @@ var FilledFormsAggregationService = class {
3867
3867
  );
3868
3868
  return;
3869
3869
  }
3870
+ let templateData;
3871
+ const templateRef = this.db.collection("documentation-templates").doc(filledDocument.templateId);
3872
+ const templateDoc = await templateRef.get();
3873
+ if (templateDoc.exists) {
3874
+ const currentTemplateData = templateDoc.data();
3875
+ if (currentTemplateData && currentTemplateData.version === filledDocument.templateVersion) {
3876
+ templateData = currentTemplateData;
3877
+ } else {
3878
+ const versionRef = templateRef.collection("versions").doc(filledDocument.templateVersion.toString());
3879
+ const versionDoc = await versionRef.get();
3880
+ if (versionDoc.exists) {
3881
+ templateData = versionDoc.data();
3882
+ } else {
3883
+ Logger.warn(
3884
+ `[FilledFormsAggregationService] Template version ${filledDocument.templateVersion} not found for template ${filledDocument.templateId}. Falling back to the latest version.`
3885
+ );
3886
+ templateData = currentTemplateData;
3887
+ }
3888
+ }
3889
+ } else {
3890
+ Logger.error(
3891
+ `[FilledFormsAggregationService] Document template ${filledDocument.templateId} not found. Cannot retrieve title.`
3892
+ );
3893
+ }
3870
3894
  const appointment = appointmentDoc.data();
3871
3895
  const formSubcollection = filledDocument.isUserForm ? USER_FORMS_SUBCOLLECTION : DOCTOR_FORMS_SUBCOLLECTION;
3872
3896
  const linkedFormInfo = {
3873
3897
  formId: filledDocument.id,
3874
3898
  templateId: filledDocument.templateId,
3875
3899
  templateVersion: filledDocument.templateVersion,
3876
- title: filledDocument.isUserForm ? "User Form" : "Doctor Form",
3877
- // Default title if not available
3900
+ title: (templateData == null ? void 0 : templateData.title) || (filledDocument.isUserForm ? "User Form" : "Doctor Form"),
3878
3901
  isUserForm: filledDocument.isUserForm,
3879
3902
  isRequired: filledDocument.isRequired,
3880
3903
  status: filledDocument.status,
@@ -3909,7 +3932,9 @@ var FilledFormsAggregationService = class {
3909
3932
  }
3910
3933
  if (filledDocument.isUserForm && filledDocument.isRequired && (filledDocument.status === "completed" /* COMPLETED */ || filledDocument.status === "signed" /* SIGNED */)) {
3911
3934
  if (appointment.pendingUserFormsIds && appointment.pendingUserFormsIds.includes(filledDocument.id)) {
3912
- updateData.pendingUserFormsIds = admin8.firestore.FieldValue.arrayRemove(filledDocument.id);
3935
+ updateData.pendingUserFormsIds = admin8.firestore.FieldValue.arrayRemove(
3936
+ filledDocument.id
3937
+ );
3913
3938
  Logger.info(
3914
3939
  `[FilledFormsAggregationService] Removing form ${filledDocument.id} from pendingUserFormsIds`
3915
3940
  );
@@ -3957,9 +3982,7 @@ var FilledFormsAggregationService = class {
3957
3982
  }
3958
3983
  }
3959
3984
  if (appointment.linkedFormIds && appointment.linkedFormIds.includes(filledDocument.id)) {
3960
- updateData.linkedFormIds = admin8.firestore.FieldValue.arrayRemove(
3961
- filledDocument.id
3962
- );
3985
+ updateData.linkedFormIds = admin8.firestore.FieldValue.arrayRemove(filledDocument.id);
3963
3986
  }
3964
3987
  if (filledDocument.isUserForm && filledDocument.isRequired) {
3965
3988
  if (filledDocument.status !== "completed" /* COMPLETED */ && filledDocument.status !== "signed" /* SIGNED */) {
@@ -4009,9 +4032,7 @@ var FilledFormsAggregationService = class {
4009
4032
  return;
4010
4033
  }
4011
4034
  await appointmentRef.update({
4012
- pendingUserFormsIds: admin8.firestore.FieldValue.arrayUnion(
4013
- filledDocument.id
4014
- ),
4035
+ pendingUserFormsIds: admin8.firestore.FieldValue.arrayUnion(filledDocument.id),
4015
4036
  updatedAt: admin8.firestore.FieldValue.serverTimestamp()
4016
4037
  });
4017
4038
  Logger.info(
@@ -3805,14 +3805,37 @@ var FilledFormsAggregationService = class {
3805
3805
  );
3806
3806
  return;
3807
3807
  }
3808
+ let templateData;
3809
+ const templateRef = this.db.collection("documentation-templates").doc(filledDocument.templateId);
3810
+ const templateDoc = await templateRef.get();
3811
+ if (templateDoc.exists) {
3812
+ const currentTemplateData = templateDoc.data();
3813
+ if (currentTemplateData && currentTemplateData.version === filledDocument.templateVersion) {
3814
+ templateData = currentTemplateData;
3815
+ } else {
3816
+ const versionRef = templateRef.collection("versions").doc(filledDocument.templateVersion.toString());
3817
+ const versionDoc = await versionRef.get();
3818
+ if (versionDoc.exists) {
3819
+ templateData = versionDoc.data();
3820
+ } else {
3821
+ Logger.warn(
3822
+ `[FilledFormsAggregationService] Template version ${filledDocument.templateVersion} not found for template ${filledDocument.templateId}. Falling back to the latest version.`
3823
+ );
3824
+ templateData = currentTemplateData;
3825
+ }
3826
+ }
3827
+ } else {
3828
+ Logger.error(
3829
+ `[FilledFormsAggregationService] Document template ${filledDocument.templateId} not found. Cannot retrieve title.`
3830
+ );
3831
+ }
3808
3832
  const appointment = appointmentDoc.data();
3809
3833
  const formSubcollection = filledDocument.isUserForm ? USER_FORMS_SUBCOLLECTION : DOCTOR_FORMS_SUBCOLLECTION;
3810
3834
  const linkedFormInfo = {
3811
3835
  formId: filledDocument.id,
3812
3836
  templateId: filledDocument.templateId,
3813
3837
  templateVersion: filledDocument.templateVersion,
3814
- title: filledDocument.isUserForm ? "User Form" : "Doctor Form",
3815
- // Default title if not available
3838
+ title: (templateData == null ? void 0 : templateData.title) || (filledDocument.isUserForm ? "User Form" : "Doctor Form"),
3816
3839
  isUserForm: filledDocument.isUserForm,
3817
3840
  isRequired: filledDocument.isRequired,
3818
3841
  status: filledDocument.status,
@@ -3847,7 +3870,9 @@ var FilledFormsAggregationService = class {
3847
3870
  }
3848
3871
  if (filledDocument.isUserForm && filledDocument.isRequired && (filledDocument.status === "completed" /* COMPLETED */ || filledDocument.status === "signed" /* SIGNED */)) {
3849
3872
  if (appointment.pendingUserFormsIds && appointment.pendingUserFormsIds.includes(filledDocument.id)) {
3850
- updateData.pendingUserFormsIds = admin8.firestore.FieldValue.arrayRemove(filledDocument.id);
3873
+ updateData.pendingUserFormsIds = admin8.firestore.FieldValue.arrayRemove(
3874
+ filledDocument.id
3875
+ );
3851
3876
  Logger.info(
3852
3877
  `[FilledFormsAggregationService] Removing form ${filledDocument.id} from pendingUserFormsIds`
3853
3878
  );
@@ -3895,9 +3920,7 @@ var FilledFormsAggregationService = class {
3895
3920
  }
3896
3921
  }
3897
3922
  if (appointment.linkedFormIds && appointment.linkedFormIds.includes(filledDocument.id)) {
3898
- updateData.linkedFormIds = admin8.firestore.FieldValue.arrayRemove(
3899
- filledDocument.id
3900
- );
3923
+ updateData.linkedFormIds = admin8.firestore.FieldValue.arrayRemove(filledDocument.id);
3901
3924
  }
3902
3925
  if (filledDocument.isUserForm && filledDocument.isRequired) {
3903
3926
  if (filledDocument.status !== "completed" /* COMPLETED */ && filledDocument.status !== "signed" /* SIGNED */) {
@@ -3947,9 +3970,7 @@ var FilledFormsAggregationService = class {
3947
3970
  return;
3948
3971
  }
3949
3972
  await appointmentRef.update({
3950
- pendingUserFormsIds: admin8.firestore.FieldValue.arrayUnion(
3951
- filledDocument.id
3952
- ),
3973
+ pendingUserFormsIds: admin8.firestore.FieldValue.arrayUnion(filledDocument.id),
3953
3974
  updatedAt: admin8.firestore.FieldValue.serverTimestamp()
3954
3975
  });
3955
3976
  Logger.info(
package/dist/index.d.mts CHANGED
@@ -2785,49 +2785,67 @@ declare enum Language {
2785
2785
  declare enum ClinicTag {
2786
2786
  PARKING = "parking",
2787
2787
  WIFI = "wifi",
2788
- WHEELCHAIR_ACCESS = "wheelchair_access",
2789
- CAFE = "cafe",
2790
- PHARMACY = "pharmacy",
2791
- WAITING_ROOM = "waiting_room",
2788
+ LUXURY_WAITING = "luxury_waiting",
2789
+ REFRESHMENTS = "refreshments",
2790
+ PRIVATE_ROOMS = "private_rooms",
2791
+ RECOVERY_AREA = "recovery_area",
2792
2792
  CARD_PAYMENT = "card_payment",
2793
- INSURANCE = "insurance",
2794
- CHILDREN_AREA = "children_area",
2795
- TV = "tv",
2796
- AIR_CONDITIONING = "air_conditioning",
2797
- WATER_DISPENSER = "water_dispenser",
2798
- VENDING_MACHINE = "vending_machine",
2799
- ELEVATOR = "elevator",
2800
- RAMP = "ramp",
2801
- HANDICAP_PARKING = "handicap_parking",
2802
- BRAILLE = "braille",
2803
- SIGN_LANGUAGE = "sign_language",
2804
- EMERGENCY_SERVICE = "emergency_service",
2805
- LAB = "lab",
2806
- XRAY = "xray",
2807
- ULTRASOUND = "ultrasound",
2808
- DENTAL = "dental",
2809
- PEDIATRIC = "pediatric",
2810
- GYNECOLOGY = "gynecology",
2811
- CARDIOLOGY = "cardiology",
2812
- DERMATOLOGY = "dermatology",
2813
- ORTHOPEDIC = "orthopedic",
2814
- OPHTHALMOLOGY = "ophthalmology",
2815
- TELEMEDICINE = "telemedicine",
2816
- HOME_VISITS = "home_visits",
2793
+ FINANCING = "financing",
2794
+ FREE_CONSULTATION = "free_consultation",
2795
+ VIRTUAL_CONSULTATION = "virtual_consultation",
2796
+ BEFORE_AFTER_PHOTOS = "before_after_photos",
2797
+ AFTERCARE_SUPPORT = "aftercare_support",
2798
+ BOTOX = "botox",
2799
+ DERMAL_FILLERS = "dermal_fillers",
2800
+ LASER_HAIR_REMOVAL = "laser_hair_removal",
2801
+ LASER_SKIN_RESURFACING = "laser_skin_resurfacing",
2802
+ CHEMICAL_PEELS = "chemical_peels",
2803
+ MICRONEEDLING = "microneedling",
2804
+ COOLSCULPTING = "coolsculpting",
2805
+ THREAD_LIFT = "thread_lift",
2806
+ LIP_ENHANCEMENT = "lip_enhancement",
2807
+ RHINOPLASTY = "rhinoplasty",
2808
+ SKIN_TIGHTENING = "skin_tightening",
2809
+ FAT_DISSOLVING = "fat_dissolving",
2810
+ PRP_TREATMENT = "prp_treatment",
2811
+ HYDRAFACIAL = "hydrafacial",
2812
+ IPL_PHOTOFACIAL = "ipl_photofacial",
2813
+ BODY_CONTOURING = "body_contouring",
2814
+ FACELIFT = "facelift",
2815
+ RHINOPLASTY_SURGICAL = "rhinoplasty_surgical",
2816
+ BREAST_AUGMENTATION = "breast_augmentation",
2817
+ BREAST_REDUCTION = "breast_reduction",
2818
+ BREAST_LIFT = "breast_lift",
2819
+ TUMMY_TUCK = "tummy_tuck",
2820
+ LIPOSUCTION = "liposuction",
2821
+ BBL = "bbl",
2822
+ MOMMY_MAKEOVER = "mommy_makeover",
2823
+ ARM_LIFT = "arm_lift",
2824
+ THIGH_LIFT = "thigh_lift",
2825
+ EYELID_SURGERY = "eyelid_surgery",
2826
+ BROW_LIFT = "brow_lift",
2827
+ NECK_LIFT = "neck_lift",
2828
+ OTOPLASTY = "otoplasty",
2829
+ LABIAPLASTY = "labiaplasty",
2817
2830
  ONLINE_BOOKING = "online_booking",
2818
2831
  MOBILE_APP = "mobile_app",
2819
2832
  SMS_NOTIFICATIONS = "sms_notifications",
2820
2833
  EMAIL_NOTIFICATIONS = "email_notifications",
2834
+ VIRTUAL_TRY_ON = "virtual_try_on",
2835
+ SKIN_ANALYSIS = "skin_analysis",
2836
+ TREATMENT_TRACKING = "treatment_tracking",
2837
+ LOYALTY_PROGRAM = "loyalty_program",
2821
2838
  ENGLISH = "english",
2822
- SERBIAN = "serbian",
2823
2839
  GERMAN = "german",
2824
- RUSSIAN = "russian",
2825
- CHINESE = "chinese",
2826
- SPANISH = "spanish",
2827
2840
  FRENCH = "french",
2841
+ SPANISH = "spanish",
2842
+ ITALIAN = "italian",
2843
+ DUTCH = "dutch",
2844
+ RUSSIAN = "russian",
2845
+ PORTUGUESE = "portuguese",
2828
2846
  OPEN_24_7 = "open_24_7",
2829
2847
  WEEKEND_HOURS = "weekend_hours",
2830
- NIGHT_SHIFT = "night_shift",
2848
+ EXTENDED_HOURS = "extended_hours",
2831
2849
  HOLIDAY_HOURS = "holiday_hours"
2832
2850
  }
2833
2851
  /**
@@ -5867,7 +5885,7 @@ declare class AppointmentService extends BaseService {
5867
5885
  */
5868
5886
  updateAppointmentStatus(appointmentId: string, newStatus: AppointmentStatus, details?: {
5869
5887
  cancellationReason?: string;
5870
- canceledBy?: "patient" | "clinic" | "practitioner" | "system";
5888
+ canceledBy?: 'patient' | 'clinic' | 'practitioner' | 'system';
5871
5889
  }): Promise<Appointment>;
5872
5890
  /**
5873
5891
  * Confirms a PENDING appointment by an Admin/Clinic.
@@ -5926,7 +5944,7 @@ declare class AppointmentService extends BaseService {
5926
5944
  /**
5927
5945
  * Adds a media item to an appointment.
5928
5946
  */
5929
- addMediaToAppointment(appointmentId: string, mediaItemData: Omit<AppointmentMediaItem, "id" | "uploadedAt">): Promise<Appointment>;
5947
+ addMediaToAppointment(appointmentId: string, mediaItemData: Omit<AppointmentMediaItem, 'id' | 'uploadedAt'>): Promise<Appointment>;
5930
5948
  /**
5931
5949
  * Removes a media item from an appointment.
5932
5950
  */
@@ -5934,7 +5952,7 @@ declare class AppointmentService extends BaseService {
5934
5952
  /**
5935
5953
  * Adds or updates review information for an appointment.
5936
5954
  */
5937
- addReviewToAppointment(appointmentId: string, reviewData: Omit<PatientReviewInfo, "reviewedAt" | "reviewId">): Promise<Appointment>;
5955
+ addReviewToAppointment(appointmentId: string, reviewData: Omit<PatientReviewInfo, 'reviewedAt' | 'reviewId'>): Promise<Appointment>;
5938
5956
  /**
5939
5957
  * Updates the payment status of an appointment.
5940
5958
  */
@@ -5984,6 +6002,15 @@ declare class AppointmentService extends BaseService {
5984
6002
  appointments: Appointment[];
5985
6003
  lastDoc: DocumentSnapshot | null;
5986
6004
  }>;
6005
+ /**
6006
+ * Counts completed appointments for a patient with optional clinic filtering.
6007
+ *
6008
+ * @param patientId ID of the patient.
6009
+ * @param clinicBranchId Optional ID of the clinic branch to either include or exclude.
6010
+ * @param excludeClinic Optional boolean. If true (default), excludes the specified clinic. If false, includes only that clinic.
6011
+ * @returns The count of completed appointments.
6012
+ */
6013
+ countCompletedAppointments(patientId: string, clinicBranchId?: string, excludeClinic?: boolean): Promise<number>;
5987
6014
  }
5988
6015
 
5989
6016
  declare class UserService extends BaseService {
@@ -6048,8 +6075,6 @@ declare class UserService extends BaseService {
6048
6075
 
6049
6076
  declare class AuthService extends BaseService {
6050
6077
  private googleProvider;
6051
- private facebookProvider;
6052
- private appleProvider;
6053
6078
  private userService;
6054
6079
  constructor(db: Firestore, auth: Auth, app: FirebaseApp, userService: UserService);
6055
6080
  /**
@@ -6087,20 +6112,6 @@ declare class AuthService extends BaseService {
6087
6112
  clinicAdmin: ClinicAdmin;
6088
6113
  clinicGroup: ClinicGroup;
6089
6114
  }>;
6090
- /**
6091
- * Prijavljuje korisnika sa Facebook-om
6092
- */
6093
- signInWithFacebook(): Promise<User>;
6094
- /**
6095
- * Prijavljuje korisnika sa Google nalogom
6096
- */
6097
- signInWithGoogle(initialRole?: UserRole, options?: {
6098
- patientInviteToken?: string;
6099
- }): Promise<User>;
6100
- /**
6101
- * Prijavljuje korisnika sa Apple-om
6102
- */
6103
- signInWithApple(): Promise<User>;
6104
6115
  /**
6105
6116
  * Prijavljuje korisnika anonimno
6106
6117
  */
@@ -6118,19 +6129,6 @@ declare class AuthService extends BaseService {
6118
6129
  */
6119
6130
  onAuthStateChange(callback: (user: User$1 | null) => void): () => void;
6120
6131
  upgradeAnonymousUser(email: string, password: string): Promise<User>;
6121
- /**
6122
- * Upgrades an anonymous user to a regular user by signing in with a Google account.
6123
- *
6124
- * @throws {AuthError} If the user is not anonymous.
6125
- * @throws {AuthError} If the user is not authenticated.
6126
- * @throws {AuthError} If the popup window is closed by the user.
6127
- * @throws {FirebaseError} If any other Firebase error occurs.
6128
- *
6129
- * @returns {Promise<User>} The upgraded user.
6130
- */
6131
- upgradeAnonymousUserWithGoogle(): Promise<User>;
6132
- upgradeAnonymousUserWithFacebook(): Promise<User>;
6133
- upgradeAnonymousUserWithApple(): Promise<User>;
6134
6132
  /**
6135
6133
  * Šalje email za resetovanje lozinke korisniku
6136
6134
  * @param email Email adresa korisnika
@@ -6185,6 +6183,22 @@ declare class AuthService extends BaseService {
6185
6183
  user: User;
6186
6184
  practitioner: Practitioner;
6187
6185
  }>;
6186
+ /**
6187
+ * Signs in a user with a Google ID token from a mobile client.
6188
+ * If the user does not exist, a new user is created.
6189
+ * @param idToken - The Google ID token obtained from the mobile app.
6190
+ * @param initialRole - The role to assign to the user if they are being created.
6191
+ * @returns The signed-in or newly created user.
6192
+ */
6193
+ signInWithGoogleIdToken(idToken: string, initialRole?: UserRole): Promise<User>;
6194
+ /**
6195
+ * Links a Google account to the currently signed-in user using an ID token.
6196
+ * This is used to upgrade an anonymous user or to allow an existing user
6197
+ * to sign in with Google in the future.
6198
+ * @param idToken - The Google ID token obtained from the mobile app.
6199
+ * @returns The updated user profile.
6200
+ */
6201
+ linkGoogleAccount(idToken: string): Promise<User>;
6188
6202
  }
6189
6203
 
6190
6204
  /**