@blackcode_sa/metaestetics-api 1.14.63 → 1.14.69

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.
@@ -852,6 +852,41 @@ interface ProcedureSummaryInfo {
852
852
  practitionerName: string;
853
853
  }
854
854
 
855
+ /**
856
+ * Enum for practice types
857
+ */
858
+ declare enum PracticeType {
859
+ GENERAL_PRACTICE = "general_practice",
860
+ DENTAL = "dental",
861
+ DERMATOLOGY = "dermatology",
862
+ CARDIOLOGY = "cardiology",
863
+ ORTHOPEDICS = "orthopedics",
864
+ GYNECOLOGY = "gynecology",
865
+ PEDIATRICS = "pediatrics",
866
+ OPHTHALMOLOGY = "ophthalmology",
867
+ NEUROLOGY = "neurology",
868
+ PSYCHIATRY = "psychiatry",
869
+ UROLOGY = "urology",
870
+ ONCOLOGY = "oncology",
871
+ ENDOCRINOLOGY = "endocrinology",
872
+ GASTROENTEROLOGY = "gastroenterology",
873
+ PULMONOLOGY = "pulmonology",
874
+ RHEUMATOLOGY = "rheumatology",
875
+ PHYSICAL_THERAPY = "physical_therapy",
876
+ NUTRITION = "nutrition",
877
+ ALTERNATIVE_MEDICINE = "alternative_medicine",
878
+ OTHER = "other"
879
+ }
880
+ /**
881
+ * Enum for languages
882
+ */
883
+ declare enum Language {
884
+ ENGLISH = "english",
885
+ GERMAN = "german",
886
+ ITALIAN = "italian",
887
+ FRENCH = "french",
888
+ SPANISH = "spanish"
889
+ }
855
890
  /**
856
891
  * Enum for all possible clinic tags
857
892
  */
@@ -1058,6 +1093,53 @@ interface WorkingHours {
1058
1093
  breaks?: Break[];
1059
1094
  } | null;
1060
1095
  }
1096
+ /**
1097
+ * Interface for contact person
1098
+ */
1099
+ interface ContactPerson {
1100
+ firstName: string;
1101
+ lastName: string;
1102
+ title?: string | null;
1103
+ email: string;
1104
+ phoneNumber?: string | null;
1105
+ }
1106
+ /**
1107
+ * Enum for admin token status
1108
+ */
1109
+ declare enum AdminTokenStatus {
1110
+ ACTIVE = "active",
1111
+ USED = "used",
1112
+ EXPIRED = "expired"
1113
+ }
1114
+ /**
1115
+ * Interface for admin token
1116
+ */
1117
+ interface AdminToken {
1118
+ id: string;
1119
+ token: string;
1120
+ email?: string | null;
1121
+ status: AdminTokenStatus;
1122
+ usedByUserRef?: string;
1123
+ createdAt: Timestamp;
1124
+ expiresAt: Timestamp;
1125
+ }
1126
+ /**
1127
+ * Interface for admin information
1128
+ */
1129
+ interface AdminInfo {
1130
+ id: string;
1131
+ name: string;
1132
+ email: string;
1133
+ }
1134
+ /**
1135
+ * Enum for subscription models
1136
+ */
1137
+ declare enum SubscriptionModel {
1138
+ NO_SUBSCRIPTION = "no_subscription",
1139
+ BASIC = "basic",
1140
+ PREMIUM = "premium",
1141
+ ENTERPRISE = "enterprise"
1142
+ }
1061
1143
  /**
1062
1144
  * Enum for subscription status
1063
1145
  */
@@ -1140,6 +1222,38 @@ interface CreateBillingTransactionData {
1140
1222
  planDetails: PlanDetails;
1141
1223
  metadata?: Record<string, any>;
1142
1224
  }
1225
+ /**
1226
+ * Interface for clinic group
1227
+ */
1228
+ interface ClinicGroup {
1229
+ id: string;
1230
+ name: string;
1231
+ description?: string;
1232
+ hqLocation: ClinicLocation;
1233
+ contactInfo: ClinicContactInfo;
1234
+ contactPerson: ContactPerson;
1235
+ clinics: string[];
1236
+ clinicsInfo: ClinicInfo[];
1237
+ admins: string[];
1238
+ adminsInfo: AdminInfo[];
1239
+ adminTokens: AdminToken[];
1240
+ ownerId: string | null;
1241
+ createdAt: Timestamp;
1242
+ updatedAt: Timestamp;
1243
+ isActive: boolean;
1244
+ logo?: MediaResource | null;
1245
+ practiceType?: PracticeType;
1246
+ languages?: Language[];
1247
+ subscriptionModel: SubscriptionModel;
1248
+ billing?: BillingInfo;
1249
+ calendarSyncEnabled?: boolean;
1250
+ autoConfirmAppointments?: boolean;
1251
+ businessIdentificationNumber?: string | null;
1252
+ onboarding?: {
1253
+ completed?: boolean;
1254
+ step?: number;
1255
+ };
1256
+ }
1143
1257
  /**
1144
1258
  * Interface for doctor information
1145
1259
  */
@@ -3174,11 +3288,11 @@ type Notification = PreRequirementNotification | PostRequirementNotification | R
3174
3288
  * This helps avoid a direct dependency on mailgun.js in the API package if not desired,
3175
3289
  * or provides clearer typing if it is.
3176
3290
  */
3177
- interface NewMailgunMessagesAPI$3 {
3291
+ interface NewMailgunMessagesAPI$4 {
3178
3292
  create(domain: string, data: any): Promise<any>;
3179
3293
  }
3180
- interface NewMailgunClient$3 {
3181
- messages: NewMailgunMessagesAPI$3;
3294
+ interface NewMailgunClient$4 {
3295
+ messages: NewMailgunMessagesAPI$4;
3182
3296
  }
3183
3297
  /**
3184
3298
  * Base mailing service class that provides common functionality for all mailing services
@@ -3186,13 +3300,13 @@ interface NewMailgunClient$3 {
3186
3300
  */
3187
3301
  declare class BaseMailingService {
3188
3302
  protected db: FirebaseFirestore.Firestore;
3189
- protected mailgunClient: NewMailgunClient$3;
3303
+ protected mailgunClient: NewMailgunClient$4;
3190
3304
  /**
3191
3305
  * Constructor for BaseMailingService
3192
3306
  * @param firestore Firestore instance provided by the caller
3193
3307
  * @param mailgunClient Mailgun client instance (mailgun.js v10+) provided by the caller
3194
3308
  */
3195
- constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$3);
3309
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$4);
3196
3310
  /**
3197
3311
  * Sends an email using the new Mailgun client API.
3198
3312
  * @param domain The Mailgun domain to send from (e.g., mg.metaesthetics.net)
@@ -3221,11 +3335,11 @@ declare class BaseMailingService {
3221
3335
  protected renderTemplate(template: string, variables: Record<string, string>): string;
3222
3336
  }
3223
3337
 
3224
- interface NewMailgunMessagesAPI$2 {
3338
+ interface NewMailgunMessagesAPI$3 {
3225
3339
  create(domain: string, data: any): Promise<any>;
3226
3340
  }
3227
- interface NewMailgunClient$2 {
3228
- messages: NewMailgunMessagesAPI$2;
3341
+ interface NewMailgunClient$3 {
3342
+ messages: NewMailgunMessagesAPI$3;
3229
3343
  }
3230
3344
  /**
3231
3345
  * Interface for the data required to send a practitioner invitation email
@@ -3271,7 +3385,7 @@ declare class PractitionerInviteMailingService extends BaseMailingService {
3271
3385
  * @param firestore Firestore instance provided by the caller
3272
3386
  * @param mailgunClient Mailgun client instance (mailgun.js v10+) provided by the caller
3273
3387
  */
3274
- constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$2);
3388
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$3);
3275
3389
  /**
3276
3390
  * Sends a practitioner invitation email
3277
3391
  * @param data The practitioner invitation data
@@ -3294,11 +3408,11 @@ declare class PractitionerInviteMailingService extends BaseMailingService {
3294
3408
  }): Promise<void>;
3295
3409
  }
3296
3410
 
3297
- interface NewMailgunMessagesAPI$1 {
3411
+ interface NewMailgunMessagesAPI$2 {
3298
3412
  create(domain: string, data: any): Promise<any>;
3299
3413
  }
3300
- interface NewMailgunClient$1 {
3301
- messages: NewMailgunMessagesAPI$1;
3414
+ interface NewMailgunClient$2 {
3415
+ messages: NewMailgunMessagesAPI$2;
3302
3416
  }
3303
3417
  /**
3304
3418
  * Interface for sending practitioner invitation email data
@@ -3384,7 +3498,7 @@ declare class ExistingPractitionerInviteMailingService extends BaseMailingServic
3384
3498
  * @param firestore Firestore instance provided by the caller
3385
3499
  * @param mailgunClient Mailgun client instance (mailgun.js v10+) provided by the caller
3386
3500
  */
3387
- constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$1);
3501
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$2);
3388
3502
  /**
3389
3503
  * Sends an invitation email to an existing practitioner
3390
3504
  * @param data The invitation email data
@@ -4558,11 +4672,11 @@ declare class Logger {
4558
4672
  /**
4559
4673
  * Minimal interface for the mailgun.js client if not importing full types
4560
4674
  */
4561
- interface NewMailgunMessagesAPI {
4675
+ interface NewMailgunMessagesAPI$1 {
4562
4676
  create(domain: string, data: any): Promise<any>;
4563
4677
  }
4564
- interface NewMailgunClient {
4565
- messages: NewMailgunMessagesAPI;
4678
+ interface NewMailgunClient$1 {
4679
+ messages: NewMailgunMessagesAPI$1;
4566
4680
  }
4567
4681
  /**
4568
4682
  * Interface for the data required to send a patient invitation email
@@ -4609,7 +4723,7 @@ declare class PatientInviteMailingService extends BaseMailingService {
4609
4723
  * @param firestore - Firestore instance provided by the caller
4610
4724
  * @param mailgunClient - Mailgun client instance (mailgun.js v10+) provided by the caller
4611
4725
  */
4612
- constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient);
4726
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$1);
4613
4727
  /**
4614
4728
  * Sends a patient invitation email
4615
4729
  * @param data - The patient invitation data
@@ -4671,7 +4785,7 @@ interface ReviewAddedEmailData extends AppointmentEmailDataBase {
4671
4785
  */
4672
4786
  declare class AppointmentMailingService extends BaseMailingService {
4673
4787
  private readonly DEFAULT_MAILGUN_DOMAIN;
4674
- constructor(firestore: admin.firestore.Firestore, mailgunClient: NewMailgunClient$3);
4788
+ constructor(firestore: admin.firestore.Firestore, mailgunClient: NewMailgunClient$4);
4675
4789
  /**
4676
4790
  * Formats a Firestore Timestamp in the clinic's timezone
4677
4791
  * @param timestamp - Firestore Timestamp (UTC)
@@ -4711,6 +4825,76 @@ declare class AppointmentMailingService extends BaseMailingService {
4711
4825
  sendReviewAddedEmail(data: ReviewAddedEmailData): Promise<any>;
4712
4826
  }
4713
4827
 
4828
+ /**
4829
+ * Minimal interface for the mailgun.js client
4830
+ */
4831
+ interface NewMailgunMessagesAPI {
4832
+ create(domain: string, data: any): Promise<any>;
4833
+ }
4834
+ interface NewMailgunClient {
4835
+ messages: NewMailgunMessagesAPI;
4836
+ }
4837
+ /**
4838
+ * Interface for clinic welcome email data
4839
+ */
4840
+ interface ClinicWelcomeEmailData {
4841
+ /** Admin information */
4842
+ admin: {
4843
+ name: string;
4844
+ email: string;
4845
+ };
4846
+ /** Clinic group information */
4847
+ clinicGroup: {
4848
+ id: string;
4849
+ name: string;
4850
+ };
4851
+ /** Config options */
4852
+ options?: {
4853
+ dashboardUrl?: string;
4854
+ supportEmail?: string;
4855
+ customSubject?: string;
4856
+ fromAddress?: string;
4857
+ mailgunDomain?: string;
4858
+ };
4859
+ }
4860
+ /**
4861
+ * Service for sending clinic welcome/confirmation emails
4862
+ * Sent to clinic admins after successful signup
4863
+ */
4864
+ declare class ClinicWelcomeMailingService extends BaseMailingService {
4865
+ private readonly DEFAULT_DASHBOARD_URL;
4866
+ private readonly DEFAULT_SUPPORT_EMAIL;
4867
+ private readonly DEFAULT_SUBJECT;
4868
+ private readonly DEFAULT_MAILGUN_DOMAIN;
4869
+ /**
4870
+ * Constructor for ClinicWelcomeMailingService
4871
+ * @param firestore - Firestore instance provided by the caller
4872
+ * @param mailgunClient - Mailgun client instance (mailgun.js v10+) provided by the caller
4873
+ */
4874
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient);
4875
+ /**
4876
+ * Sends a clinic welcome email
4877
+ * @param data - The clinic welcome email data
4878
+ * @returns Promise resolved when email is sent
4879
+ */
4880
+ sendWelcomeEmail(data: ClinicWelcomeEmailData): Promise<any>;
4881
+ /**
4882
+ * Handles the clinic group creation event from Cloud Functions.
4883
+ * Fetches necessary data and sends the welcome email to the admin.
4884
+ * @param clinicGroupData - The clinic group data including id
4885
+ * @param mailgunConfig - Mailgun configuration (from, domain)
4886
+ * @returns Promise resolved when the email is sent
4887
+ */
4888
+ handleClinicGroupCreationEvent(clinicGroupData: ClinicGroup & {
4889
+ id: string;
4890
+ }, mailgunConfig: {
4891
+ fromAddress: string;
4892
+ domain: string;
4893
+ dashboardUrl?: string;
4894
+ supportEmail?: string;
4895
+ }): Promise<void>;
4896
+ }
4897
+
4714
4898
  declare class NotificationsAdmin {
4715
4899
  private expo;
4716
4900
  private db;
@@ -4874,4 +5058,4 @@ declare class UserProfileAdminService {
4874
5058
  initializePractitionerRole(userId: string): Promise<User>;
4875
5059
  }
4876
5060
 
4877
- export { ANALYTICS_COLLECTION, AnalyticsAdminService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, type Appointment, AppointmentAggregationService, type AppointmentCancellationEmailData, type AppointmentConfirmationEmailData, type AppointmentEmailDataBase, AppointmentMailingService, type AppointmentReminderNotification, type AppointmentRequestedEmailData, type AppointmentRescheduledProposalEmailData, AppointmentStatus, type AppointmentTrend, type AvailableSlot, BaseMailingService, type BaseMetrics, type BaseNotification, type BillingInfo, type BillingTransaction, BillingTransactionType, BookingAdmin, BookingAvailabilityCalculator, type BookingAvailabilityRequest, type BookingAvailabilityResponse, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CalendarAdminService, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Clinic, type ClinicAdminNotificationData, ClinicAggregationService, type ClinicAnalytics, type ClinicComparisonMetrics, type ClinicInfo, type ClinicLocation, type CostPerPatientMetrics, type CreateBillingTransactionData, DASHBOARD_ANALYTICS_SUBCOLLECTION, type DashboardAnalytics, type DoctorInfo, DocumentManagerAdminService, type DurationTrend, type EntityType, type ExistingPractitionerInviteEmailData, ExistingPractitionerInviteMailingService, type FilledDocument, FilledFormsAggregationService, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, INVITE_TOKENS_COLLECTION, type InitializeAppointmentFormsResult, Logger, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NewMailgunClient$3 as NewMailgunClient, type NoShowMetrics, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type OrchestrateAppointmentCreationData, PATIENTS_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type PatientProfile as Patient, PatientAggregationService, type PatientAnalytics, PatientInstructionStatus, type PatientInviteEmailData, PatientInviteMailingService, type PatientLifetimeValueMetrics, type PatientProfile, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsAdminService, type PatientRetentionMetrics, type PatientSensitiveInfo, type PatientToken, PatientTokenStatus, type PaymentStatusBreakdown, type PlanDetails, type PostRequirementNotification, type Practitioner, PractitionerAggregationService, type PractitionerAnalytics, type PractitionerInvite, PractitionerInviteAggregationService, type PractitionerInviteEmailData, PractitionerInviteMailingService, PractitionerInviteStatus, type PractitionerToken, PractitionerTokenStatus, type PreRequirementNotification, type Procedure, ProcedureAggregationService, type ProcedureAnalytics, type ProcedurePopularity, type ProcedureProfitability, type ProcedureSummaryInfo, type ProductRevenueMetrics, type ProductUsageByProcedure, type ProductUsageMetrics, REVENUE_ANALYTICS_SUBCOLLECTION, type ReadStoredAnalyticsOptions, type RequirementSourceProcedure, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAddedEmailData, type ReviewMetrics, type ReviewRequestEmailData, type ReviewTrend, ReviewsAggregationService, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, SubscriptionStatus, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type TimeEfficiencyMetrics, type TimeInterval, type TrendPeriod, UserProfileAdminService, UserRole, freeConsultationInfrastructure };
5061
+ export { ANALYTICS_COLLECTION, AnalyticsAdminService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, type Appointment, AppointmentAggregationService, type AppointmentCancellationEmailData, type AppointmentConfirmationEmailData, type AppointmentEmailDataBase, AppointmentMailingService, type AppointmentReminderNotification, type AppointmentRequestedEmailData, type AppointmentRescheduledProposalEmailData, AppointmentStatus, type AppointmentTrend, type AvailableSlot, BaseMailingService, type BaseMetrics, type BaseNotification, type BillingInfo, type BillingTransaction, BillingTransactionType, BookingAdmin, BookingAvailabilityCalculator, type BookingAvailabilityRequest, type BookingAvailabilityResponse, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CalendarAdminService, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Clinic, type ClinicAdminNotificationData, ClinicAggregationService, type ClinicAnalytics, type ClinicComparisonMetrics, type ClinicGroup, type ClinicInfo, type ClinicLocation, type ClinicWelcomeEmailData, ClinicWelcomeMailingService, type CostPerPatientMetrics, type CreateBillingTransactionData, DASHBOARD_ANALYTICS_SUBCOLLECTION, type DashboardAnalytics, type DoctorInfo, DocumentManagerAdminService, type DurationTrend, type EntityType, type ExistingPractitionerInviteEmailData, ExistingPractitionerInviteMailingService, type FilledDocument, FilledFormsAggregationService, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, INVITE_TOKENS_COLLECTION, type InitializeAppointmentFormsResult, Logger, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NewMailgunClient$4 as NewMailgunClient, type NoShowMetrics, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type OrchestrateAppointmentCreationData, PATIENTS_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type PatientProfile as Patient, PatientAggregationService, type PatientAnalytics, PatientInstructionStatus, type PatientInviteEmailData, PatientInviteMailingService, type PatientLifetimeValueMetrics, type PatientProfile, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsAdminService, type PatientRetentionMetrics, type PatientSensitiveInfo, type PatientToken, PatientTokenStatus, type PaymentStatusBreakdown, type PlanDetails, type PostRequirementNotification, type Practitioner, PractitionerAggregationService, type PractitionerAnalytics, type PractitionerInvite, PractitionerInviteAggregationService, type PractitionerInviteEmailData, PractitionerInviteMailingService, PractitionerInviteStatus, type PractitionerToken, PractitionerTokenStatus, type PreRequirementNotification, type Procedure, ProcedureAggregationService, type ProcedureAnalytics, type ProcedurePopularity, type ProcedureProfitability, type ProcedureSummaryInfo, type ProductRevenueMetrics, type ProductUsageByProcedure, type ProductUsageMetrics, REVENUE_ANALYTICS_SUBCOLLECTION, type ReadStoredAnalyticsOptions, type RequirementSourceProcedure, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAddedEmailData, type ReviewMetrics, type ReviewRequestEmailData, type ReviewTrend, ReviewsAggregationService, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, SubscriptionStatus, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type TimeEfficiencyMetrics, type TimeInterval, type TrendPeriod, UserProfileAdminService, UserRole, freeConsultationInfrastructure };
@@ -852,6 +852,41 @@ interface ProcedureSummaryInfo {
852
852
  practitionerName: string;
853
853
  }
854
854
 
855
+ /**
856
+ * Enum for practice types
857
+ */
858
+ declare enum PracticeType {
859
+ GENERAL_PRACTICE = "general_practice",
860
+ DENTAL = "dental",
861
+ DERMATOLOGY = "dermatology",
862
+ CARDIOLOGY = "cardiology",
863
+ ORTHOPEDICS = "orthopedics",
864
+ GYNECOLOGY = "gynecology",
865
+ PEDIATRICS = "pediatrics",
866
+ OPHTHALMOLOGY = "ophthalmology",
867
+ NEUROLOGY = "neurology",
868
+ PSYCHIATRY = "psychiatry",
869
+ UROLOGY = "urology",
870
+ ONCOLOGY = "oncology",
871
+ ENDOCRINOLOGY = "endocrinology",
872
+ GASTROENTEROLOGY = "gastroenterology",
873
+ PULMONOLOGY = "pulmonology",
874
+ RHEUMATOLOGY = "rheumatology",
875
+ PHYSICAL_THERAPY = "physical_therapy",
876
+ NUTRITION = "nutrition",
877
+ ALTERNATIVE_MEDICINE = "alternative_medicine",
878
+ OTHER = "other"
879
+ }
880
+ /**
881
+ * Enum for languages
882
+ */
883
+ declare enum Language {
884
+ ENGLISH = "english",
885
+ GERMAN = "german",
886
+ ITALIAN = "italian",
887
+ FRENCH = "french",
888
+ SPANISH = "spanish"
889
+ }
855
890
  /**
856
891
  * Enum for all possible clinic tags
857
892
  */
@@ -1058,6 +1093,53 @@ interface WorkingHours {
1058
1093
  breaks?: Break[];
1059
1094
  } | null;
1060
1095
  }
1096
+ /**
1097
+ * Interface for contact person
1098
+ */
1099
+ interface ContactPerson {
1100
+ firstName: string;
1101
+ lastName: string;
1102
+ title?: string | null;
1103
+ email: string;
1104
+ phoneNumber?: string | null;
1105
+ }
1106
+ /**
1107
+ * Enum for admin token status
1108
+ */
1109
+ declare enum AdminTokenStatus {
1110
+ ACTIVE = "active",
1111
+ USED = "used",
1112
+ EXPIRED = "expired"
1113
+ }
1114
+ /**
1115
+ * Interface for admin token
1116
+ */
1117
+ interface AdminToken {
1118
+ id: string;
1119
+ token: string;
1120
+ email?: string | null;
1121
+ status: AdminTokenStatus;
1122
+ usedByUserRef?: string;
1123
+ createdAt: Timestamp;
1124
+ expiresAt: Timestamp;
1125
+ }
1126
+ /**
1127
+ * Interface for admin information
1128
+ */
1129
+ interface AdminInfo {
1130
+ id: string;
1131
+ name: string;
1132
+ email: string;
1133
+ }
1134
+ /**
1135
+ * Enum for subscription models
1136
+ */
1137
+ declare enum SubscriptionModel {
1138
+ NO_SUBSCRIPTION = "no_subscription",
1139
+ BASIC = "basic",
1140
+ PREMIUM = "premium",
1141
+ ENTERPRISE = "enterprise"
1142
+ }
1061
1143
  /**
1062
1144
  * Enum for subscription status
1063
1145
  */
@@ -1140,6 +1222,38 @@ interface CreateBillingTransactionData {
1140
1222
  planDetails: PlanDetails;
1141
1223
  metadata?: Record<string, any>;
1142
1224
  }
1225
+ /**
1226
+ * Interface for clinic group
1227
+ */
1228
+ interface ClinicGroup {
1229
+ id: string;
1230
+ name: string;
1231
+ description?: string;
1232
+ hqLocation: ClinicLocation;
1233
+ contactInfo: ClinicContactInfo;
1234
+ contactPerson: ContactPerson;
1235
+ clinics: string[];
1236
+ clinicsInfo: ClinicInfo[];
1237
+ admins: string[];
1238
+ adminsInfo: AdminInfo[];
1239
+ adminTokens: AdminToken[];
1240
+ ownerId: string | null;
1241
+ createdAt: Timestamp;
1242
+ updatedAt: Timestamp;
1243
+ isActive: boolean;
1244
+ logo?: MediaResource | null;
1245
+ practiceType?: PracticeType;
1246
+ languages?: Language[];
1247
+ subscriptionModel: SubscriptionModel;
1248
+ billing?: BillingInfo;
1249
+ calendarSyncEnabled?: boolean;
1250
+ autoConfirmAppointments?: boolean;
1251
+ businessIdentificationNumber?: string | null;
1252
+ onboarding?: {
1253
+ completed?: boolean;
1254
+ step?: number;
1255
+ };
1256
+ }
1143
1257
  /**
1144
1258
  * Interface for doctor information
1145
1259
  */
@@ -3174,11 +3288,11 @@ type Notification = PreRequirementNotification | PostRequirementNotification | R
3174
3288
  * This helps avoid a direct dependency on mailgun.js in the API package if not desired,
3175
3289
  * or provides clearer typing if it is.
3176
3290
  */
3177
- interface NewMailgunMessagesAPI$3 {
3291
+ interface NewMailgunMessagesAPI$4 {
3178
3292
  create(domain: string, data: any): Promise<any>;
3179
3293
  }
3180
- interface NewMailgunClient$3 {
3181
- messages: NewMailgunMessagesAPI$3;
3294
+ interface NewMailgunClient$4 {
3295
+ messages: NewMailgunMessagesAPI$4;
3182
3296
  }
3183
3297
  /**
3184
3298
  * Base mailing service class that provides common functionality for all mailing services
@@ -3186,13 +3300,13 @@ interface NewMailgunClient$3 {
3186
3300
  */
3187
3301
  declare class BaseMailingService {
3188
3302
  protected db: FirebaseFirestore.Firestore;
3189
- protected mailgunClient: NewMailgunClient$3;
3303
+ protected mailgunClient: NewMailgunClient$4;
3190
3304
  /**
3191
3305
  * Constructor for BaseMailingService
3192
3306
  * @param firestore Firestore instance provided by the caller
3193
3307
  * @param mailgunClient Mailgun client instance (mailgun.js v10+) provided by the caller
3194
3308
  */
3195
- constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$3);
3309
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$4);
3196
3310
  /**
3197
3311
  * Sends an email using the new Mailgun client API.
3198
3312
  * @param domain The Mailgun domain to send from (e.g., mg.metaesthetics.net)
@@ -3221,11 +3335,11 @@ declare class BaseMailingService {
3221
3335
  protected renderTemplate(template: string, variables: Record<string, string>): string;
3222
3336
  }
3223
3337
 
3224
- interface NewMailgunMessagesAPI$2 {
3338
+ interface NewMailgunMessagesAPI$3 {
3225
3339
  create(domain: string, data: any): Promise<any>;
3226
3340
  }
3227
- interface NewMailgunClient$2 {
3228
- messages: NewMailgunMessagesAPI$2;
3341
+ interface NewMailgunClient$3 {
3342
+ messages: NewMailgunMessagesAPI$3;
3229
3343
  }
3230
3344
  /**
3231
3345
  * Interface for the data required to send a practitioner invitation email
@@ -3271,7 +3385,7 @@ declare class PractitionerInviteMailingService extends BaseMailingService {
3271
3385
  * @param firestore Firestore instance provided by the caller
3272
3386
  * @param mailgunClient Mailgun client instance (mailgun.js v10+) provided by the caller
3273
3387
  */
3274
- constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$2);
3388
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$3);
3275
3389
  /**
3276
3390
  * Sends a practitioner invitation email
3277
3391
  * @param data The practitioner invitation data
@@ -3294,11 +3408,11 @@ declare class PractitionerInviteMailingService extends BaseMailingService {
3294
3408
  }): Promise<void>;
3295
3409
  }
3296
3410
 
3297
- interface NewMailgunMessagesAPI$1 {
3411
+ interface NewMailgunMessagesAPI$2 {
3298
3412
  create(domain: string, data: any): Promise<any>;
3299
3413
  }
3300
- interface NewMailgunClient$1 {
3301
- messages: NewMailgunMessagesAPI$1;
3414
+ interface NewMailgunClient$2 {
3415
+ messages: NewMailgunMessagesAPI$2;
3302
3416
  }
3303
3417
  /**
3304
3418
  * Interface for sending practitioner invitation email data
@@ -3384,7 +3498,7 @@ declare class ExistingPractitionerInviteMailingService extends BaseMailingServic
3384
3498
  * @param firestore Firestore instance provided by the caller
3385
3499
  * @param mailgunClient Mailgun client instance (mailgun.js v10+) provided by the caller
3386
3500
  */
3387
- constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$1);
3501
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$2);
3388
3502
  /**
3389
3503
  * Sends an invitation email to an existing practitioner
3390
3504
  * @param data The invitation email data
@@ -4558,11 +4672,11 @@ declare class Logger {
4558
4672
  /**
4559
4673
  * Minimal interface for the mailgun.js client if not importing full types
4560
4674
  */
4561
- interface NewMailgunMessagesAPI {
4675
+ interface NewMailgunMessagesAPI$1 {
4562
4676
  create(domain: string, data: any): Promise<any>;
4563
4677
  }
4564
- interface NewMailgunClient {
4565
- messages: NewMailgunMessagesAPI;
4678
+ interface NewMailgunClient$1 {
4679
+ messages: NewMailgunMessagesAPI$1;
4566
4680
  }
4567
4681
  /**
4568
4682
  * Interface for the data required to send a patient invitation email
@@ -4609,7 +4723,7 @@ declare class PatientInviteMailingService extends BaseMailingService {
4609
4723
  * @param firestore - Firestore instance provided by the caller
4610
4724
  * @param mailgunClient - Mailgun client instance (mailgun.js v10+) provided by the caller
4611
4725
  */
4612
- constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient);
4726
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient$1);
4613
4727
  /**
4614
4728
  * Sends a patient invitation email
4615
4729
  * @param data - The patient invitation data
@@ -4671,7 +4785,7 @@ interface ReviewAddedEmailData extends AppointmentEmailDataBase {
4671
4785
  */
4672
4786
  declare class AppointmentMailingService extends BaseMailingService {
4673
4787
  private readonly DEFAULT_MAILGUN_DOMAIN;
4674
- constructor(firestore: admin.firestore.Firestore, mailgunClient: NewMailgunClient$3);
4788
+ constructor(firestore: admin.firestore.Firestore, mailgunClient: NewMailgunClient$4);
4675
4789
  /**
4676
4790
  * Formats a Firestore Timestamp in the clinic's timezone
4677
4791
  * @param timestamp - Firestore Timestamp (UTC)
@@ -4711,6 +4825,76 @@ declare class AppointmentMailingService extends BaseMailingService {
4711
4825
  sendReviewAddedEmail(data: ReviewAddedEmailData): Promise<any>;
4712
4826
  }
4713
4827
 
4828
+ /**
4829
+ * Minimal interface for the mailgun.js client
4830
+ */
4831
+ interface NewMailgunMessagesAPI {
4832
+ create(domain: string, data: any): Promise<any>;
4833
+ }
4834
+ interface NewMailgunClient {
4835
+ messages: NewMailgunMessagesAPI;
4836
+ }
4837
+ /**
4838
+ * Interface for clinic welcome email data
4839
+ */
4840
+ interface ClinicWelcomeEmailData {
4841
+ /** Admin information */
4842
+ admin: {
4843
+ name: string;
4844
+ email: string;
4845
+ };
4846
+ /** Clinic group information */
4847
+ clinicGroup: {
4848
+ id: string;
4849
+ name: string;
4850
+ };
4851
+ /** Config options */
4852
+ options?: {
4853
+ dashboardUrl?: string;
4854
+ supportEmail?: string;
4855
+ customSubject?: string;
4856
+ fromAddress?: string;
4857
+ mailgunDomain?: string;
4858
+ };
4859
+ }
4860
+ /**
4861
+ * Service for sending clinic welcome/confirmation emails
4862
+ * Sent to clinic admins after successful signup
4863
+ */
4864
+ declare class ClinicWelcomeMailingService extends BaseMailingService {
4865
+ private readonly DEFAULT_DASHBOARD_URL;
4866
+ private readonly DEFAULT_SUPPORT_EMAIL;
4867
+ private readonly DEFAULT_SUBJECT;
4868
+ private readonly DEFAULT_MAILGUN_DOMAIN;
4869
+ /**
4870
+ * Constructor for ClinicWelcomeMailingService
4871
+ * @param firestore - Firestore instance provided by the caller
4872
+ * @param mailgunClient - Mailgun client instance (mailgun.js v10+) provided by the caller
4873
+ */
4874
+ constructor(firestore: FirebaseFirestore.Firestore, mailgunClient: NewMailgunClient);
4875
+ /**
4876
+ * Sends a clinic welcome email
4877
+ * @param data - The clinic welcome email data
4878
+ * @returns Promise resolved when email is sent
4879
+ */
4880
+ sendWelcomeEmail(data: ClinicWelcomeEmailData): Promise<any>;
4881
+ /**
4882
+ * Handles the clinic group creation event from Cloud Functions.
4883
+ * Fetches necessary data and sends the welcome email to the admin.
4884
+ * @param clinicGroupData - The clinic group data including id
4885
+ * @param mailgunConfig - Mailgun configuration (from, domain)
4886
+ * @returns Promise resolved when the email is sent
4887
+ */
4888
+ handleClinicGroupCreationEvent(clinicGroupData: ClinicGroup & {
4889
+ id: string;
4890
+ }, mailgunConfig: {
4891
+ fromAddress: string;
4892
+ domain: string;
4893
+ dashboardUrl?: string;
4894
+ supportEmail?: string;
4895
+ }): Promise<void>;
4896
+ }
4897
+
4714
4898
  declare class NotificationsAdmin {
4715
4899
  private expo;
4716
4900
  private db;
@@ -4874,4 +5058,4 @@ declare class UserProfileAdminService {
4874
5058
  initializePractitionerRole(userId: string): Promise<User>;
4875
5059
  }
4876
5060
 
4877
- export { ANALYTICS_COLLECTION, AnalyticsAdminService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, type Appointment, AppointmentAggregationService, type AppointmentCancellationEmailData, type AppointmentConfirmationEmailData, type AppointmentEmailDataBase, AppointmentMailingService, type AppointmentReminderNotification, type AppointmentRequestedEmailData, type AppointmentRescheduledProposalEmailData, AppointmentStatus, type AppointmentTrend, type AvailableSlot, BaseMailingService, type BaseMetrics, type BaseNotification, type BillingInfo, type BillingTransaction, BillingTransactionType, BookingAdmin, BookingAvailabilityCalculator, type BookingAvailabilityRequest, type BookingAvailabilityResponse, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CalendarAdminService, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Clinic, type ClinicAdminNotificationData, ClinicAggregationService, type ClinicAnalytics, type ClinicComparisonMetrics, type ClinicInfo, type ClinicLocation, type CostPerPatientMetrics, type CreateBillingTransactionData, DASHBOARD_ANALYTICS_SUBCOLLECTION, type DashboardAnalytics, type DoctorInfo, DocumentManagerAdminService, type DurationTrend, type EntityType, type ExistingPractitionerInviteEmailData, ExistingPractitionerInviteMailingService, type FilledDocument, FilledFormsAggregationService, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, INVITE_TOKENS_COLLECTION, type InitializeAppointmentFormsResult, Logger, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NewMailgunClient$3 as NewMailgunClient, type NoShowMetrics, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type OrchestrateAppointmentCreationData, PATIENTS_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type PatientProfile as Patient, PatientAggregationService, type PatientAnalytics, PatientInstructionStatus, type PatientInviteEmailData, PatientInviteMailingService, type PatientLifetimeValueMetrics, type PatientProfile, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsAdminService, type PatientRetentionMetrics, type PatientSensitiveInfo, type PatientToken, PatientTokenStatus, type PaymentStatusBreakdown, type PlanDetails, type PostRequirementNotification, type Practitioner, PractitionerAggregationService, type PractitionerAnalytics, type PractitionerInvite, PractitionerInviteAggregationService, type PractitionerInviteEmailData, PractitionerInviteMailingService, PractitionerInviteStatus, type PractitionerToken, PractitionerTokenStatus, type PreRequirementNotification, type Procedure, ProcedureAggregationService, type ProcedureAnalytics, type ProcedurePopularity, type ProcedureProfitability, type ProcedureSummaryInfo, type ProductRevenueMetrics, type ProductUsageByProcedure, type ProductUsageMetrics, REVENUE_ANALYTICS_SUBCOLLECTION, type ReadStoredAnalyticsOptions, type RequirementSourceProcedure, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAddedEmailData, type ReviewMetrics, type ReviewRequestEmailData, type ReviewTrend, ReviewsAggregationService, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, SubscriptionStatus, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type TimeEfficiencyMetrics, type TimeInterval, type TrendPeriod, UserProfileAdminService, UserRole, freeConsultationInfrastructure };
5061
+ export { ANALYTICS_COLLECTION, AnalyticsAdminService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, type Appointment, AppointmentAggregationService, type AppointmentCancellationEmailData, type AppointmentConfirmationEmailData, type AppointmentEmailDataBase, AppointmentMailingService, type AppointmentReminderNotification, type AppointmentRequestedEmailData, type AppointmentRescheduledProposalEmailData, AppointmentStatus, type AppointmentTrend, type AvailableSlot, BaseMailingService, type BaseMetrics, type BaseNotification, type BillingInfo, type BillingTransaction, BillingTransactionType, BookingAdmin, BookingAvailabilityCalculator, type BookingAvailabilityRequest, type BookingAvailabilityResponse, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CalendarAdminService, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Clinic, type ClinicAdminNotificationData, ClinicAggregationService, type ClinicAnalytics, type ClinicComparisonMetrics, type ClinicGroup, type ClinicInfo, type ClinicLocation, type ClinicWelcomeEmailData, ClinicWelcomeMailingService, type CostPerPatientMetrics, type CreateBillingTransactionData, DASHBOARD_ANALYTICS_SUBCOLLECTION, type DashboardAnalytics, type DoctorInfo, DocumentManagerAdminService, type DurationTrend, type EntityType, type ExistingPractitionerInviteEmailData, ExistingPractitionerInviteMailingService, type FilledDocument, FilledFormsAggregationService, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, INVITE_TOKENS_COLLECTION, type InitializeAppointmentFormsResult, Logger, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NewMailgunClient$4 as NewMailgunClient, type NoShowMetrics, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type OrchestrateAppointmentCreationData, PATIENTS_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type PatientProfile as Patient, PatientAggregationService, type PatientAnalytics, PatientInstructionStatus, type PatientInviteEmailData, PatientInviteMailingService, type PatientLifetimeValueMetrics, type PatientProfile, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsAdminService, type PatientRetentionMetrics, type PatientSensitiveInfo, type PatientToken, PatientTokenStatus, type PaymentStatusBreakdown, type PlanDetails, type PostRequirementNotification, type Practitioner, PractitionerAggregationService, type PractitionerAnalytics, type PractitionerInvite, PractitionerInviteAggregationService, type PractitionerInviteEmailData, PractitionerInviteMailingService, PractitionerInviteStatus, type PractitionerToken, PractitionerTokenStatus, type PreRequirementNotification, type Procedure, ProcedureAggregationService, type ProcedureAnalytics, type ProcedurePopularity, type ProcedureProfitability, type ProcedureSummaryInfo, type ProductRevenueMetrics, type ProductUsageByProcedure, type ProductUsageMetrics, REVENUE_ANALYTICS_SUBCOLLECTION, type ReadStoredAnalyticsOptions, type RequirementSourceProcedure, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAddedEmailData, type ReviewMetrics, type ReviewRequestEmailData, type ReviewTrend, ReviewsAggregationService, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, SubscriptionStatus, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type TimeEfficiencyMetrics, type TimeInterval, type TrendPeriod, UserProfileAdminService, UserRole, freeConsultationInfrastructure };