@blackcode_sa/metaestetics-api 1.12.3 → 1.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3893,6 +3893,88 @@ declare enum SubscriptionModel {
3893
3893
  PREMIUM = "premium",
3894
3894
  ENTERPRISE = "enterprise"
3895
3895
  }
3896
+ /**
3897
+ * Enum for subscription status
3898
+ */
3899
+ declare enum SubscriptionStatus {
3900
+ PENDING = "pending",
3901
+ ACTIVE = "active",
3902
+ PENDING_CANCELLATION = "pending_cancellation",
3903
+ CANCELED = "canceled",
3904
+ PAST_DUE = "past_due",
3905
+ TRIALING = "trialing"
3906
+ }
3907
+ /**
3908
+ * Interface for billing information
3909
+ */
3910
+ interface BillingInfo {
3911
+ stripeCustomerId: string;
3912
+ subscriptionStatus: SubscriptionStatus;
3913
+ planType: string;
3914
+ stripeSubscriptionId: string | null;
3915
+ stripePriceId: string | null;
3916
+ currentPeriodStart: Timestamp | null;
3917
+ currentPeriodEnd: Timestamp | null;
3918
+ updatedAt: Timestamp;
3919
+ }
3920
+ /**
3921
+ * Enum for billing transaction types
3922
+ */
3923
+ declare enum BillingTransactionType {
3924
+ SUBSCRIPTION_CREATED = "subscription_created",
3925
+ SUBSCRIPTION_ACTIVATED = "subscription_activated",
3926
+ SUBSCRIPTION_RENEWED = "subscription_renewed",
3927
+ SUBSCRIPTION_UPDATED = "subscription_updated",
3928
+ SUBSCRIPTION_CANCELED = "subscription_canceled",
3929
+ SUBSCRIPTION_REACTIVATED = "subscription_reactivated",
3930
+ SUBSCRIPTION_DELETED = "subscription_deleted"
3931
+ }
3932
+ /**
3933
+ * Interface for Stripe data in billing transactions
3934
+ */
3935
+ interface StripeTransactionData {
3936
+ sessionId?: string;
3937
+ subscriptionId?: string;
3938
+ invoiceId?: string;
3939
+ priceId: string;
3940
+ customerId: string;
3941
+ }
3942
+ /**
3943
+ * Interface for plan details in billing transactions
3944
+ */
3945
+ interface PlanDetails {
3946
+ planName: string;
3947
+ planPeriod: string;
3948
+ planDisplayName: string;
3949
+ }
3950
+ /**
3951
+ * Interface for billing transactions
3952
+ */
3953
+ interface BillingTransaction {
3954
+ id: string;
3955
+ clinicGroupId: string;
3956
+ type: BillingTransactionType;
3957
+ description: string;
3958
+ amount: number;
3959
+ currency: string;
3960
+ stripeData: StripeTransactionData;
3961
+ planDetails: PlanDetails;
3962
+ metadata?: Record<string, any>;
3963
+ timestamp: Timestamp;
3964
+ createdAt: Timestamp;
3965
+ }
3966
+ /**
3967
+ * Interface for creating a billing transaction
3968
+ */
3969
+ interface CreateBillingTransactionData {
3970
+ type: BillingTransactionType;
3971
+ description: string;
3972
+ amount: number;
3973
+ currency: string;
3974
+ stripeData: StripeTransactionData;
3975
+ planDetails: PlanDetails;
3976
+ metadata?: Record<string, any>;
3977
+ }
3896
3978
  /**
3897
3979
  * Interface for clinic group
3898
3980
  */
@@ -3916,6 +3998,7 @@ interface ClinicGroup {
3916
3998
  practiceType?: PracticeType;
3917
3999
  languages?: Language[];
3918
4000
  subscriptionModel: SubscriptionModel;
4001
+ billing?: BillingInfo;
3919
4002
  calendarSyncEnabled?: boolean;
3920
4003
  autoConfirmAppointments?: boolean;
3921
4004
  businessIdentificationNumber?: string | null;
@@ -3939,6 +4022,7 @@ interface CreateClinicGroupData {
3939
4022
  practiceType?: PracticeType;
3940
4023
  languages?: Language[];
3941
4024
  subscriptionModel?: SubscriptionModel;
4025
+ billing?: BillingInfo;
3942
4026
  calendarSyncEnabled?: boolean;
3943
4027
  autoConfirmAppointments?: boolean;
3944
4028
  businessIdentificationNumber?: string | null;
@@ -6722,4 +6806,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
6722
6806
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
6723
6807
  declare const getFirebaseFunctions: () => Promise<Functions>;
6724
6808
 
6725
- export { APPOINTMENTS_COLLECTION, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, AuthService, type BaseDocumentElement, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingPerZone, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBlockingEventParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DEFAULT_MEDICAL_INFO, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, NOTIFICATIONS_COLLECTION, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PRACTITIONER_INVITES_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerInvite, type PractitionerInviteFilters, PractitionerInviteService, PractitionerInviteStatus, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedureProduct, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, ProductService, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, RequirementType, type Review, type ReviewRequestNotification, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type Subcategory, SubcategoryService, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
6809
+ export { APPOINTMENTS_COLLECTION, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, AuthService, type BaseDocumentElement, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBillingTransactionData, type CreateBlockingEventParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DEFAULT_MEDICAL_INFO, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, NOTIFICATIONS_COLLECTION, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PRACTITIONER_INVITES_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PlanDetails, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerInvite, type PractitionerInviteFilters, PractitionerInviteService, PractitionerInviteStatus, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedureProduct, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, ProductService, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, RequirementType, type Review, type ReviewRequestNotification, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
package/dist/index.d.ts CHANGED
@@ -3893,6 +3893,88 @@ declare enum SubscriptionModel {
3893
3893
  PREMIUM = "premium",
3894
3894
  ENTERPRISE = "enterprise"
3895
3895
  }
3896
+ /**
3897
+ * Enum for subscription status
3898
+ */
3899
+ declare enum SubscriptionStatus {
3900
+ PENDING = "pending",
3901
+ ACTIVE = "active",
3902
+ PENDING_CANCELLATION = "pending_cancellation",
3903
+ CANCELED = "canceled",
3904
+ PAST_DUE = "past_due",
3905
+ TRIALING = "trialing"
3906
+ }
3907
+ /**
3908
+ * Interface for billing information
3909
+ */
3910
+ interface BillingInfo {
3911
+ stripeCustomerId: string;
3912
+ subscriptionStatus: SubscriptionStatus;
3913
+ planType: string;
3914
+ stripeSubscriptionId: string | null;
3915
+ stripePriceId: string | null;
3916
+ currentPeriodStart: Timestamp | null;
3917
+ currentPeriodEnd: Timestamp | null;
3918
+ updatedAt: Timestamp;
3919
+ }
3920
+ /**
3921
+ * Enum for billing transaction types
3922
+ */
3923
+ declare enum BillingTransactionType {
3924
+ SUBSCRIPTION_CREATED = "subscription_created",
3925
+ SUBSCRIPTION_ACTIVATED = "subscription_activated",
3926
+ SUBSCRIPTION_RENEWED = "subscription_renewed",
3927
+ SUBSCRIPTION_UPDATED = "subscription_updated",
3928
+ SUBSCRIPTION_CANCELED = "subscription_canceled",
3929
+ SUBSCRIPTION_REACTIVATED = "subscription_reactivated",
3930
+ SUBSCRIPTION_DELETED = "subscription_deleted"
3931
+ }
3932
+ /**
3933
+ * Interface for Stripe data in billing transactions
3934
+ */
3935
+ interface StripeTransactionData {
3936
+ sessionId?: string;
3937
+ subscriptionId?: string;
3938
+ invoiceId?: string;
3939
+ priceId: string;
3940
+ customerId: string;
3941
+ }
3942
+ /**
3943
+ * Interface for plan details in billing transactions
3944
+ */
3945
+ interface PlanDetails {
3946
+ planName: string;
3947
+ planPeriod: string;
3948
+ planDisplayName: string;
3949
+ }
3950
+ /**
3951
+ * Interface for billing transactions
3952
+ */
3953
+ interface BillingTransaction {
3954
+ id: string;
3955
+ clinicGroupId: string;
3956
+ type: BillingTransactionType;
3957
+ description: string;
3958
+ amount: number;
3959
+ currency: string;
3960
+ stripeData: StripeTransactionData;
3961
+ planDetails: PlanDetails;
3962
+ metadata?: Record<string, any>;
3963
+ timestamp: Timestamp;
3964
+ createdAt: Timestamp;
3965
+ }
3966
+ /**
3967
+ * Interface for creating a billing transaction
3968
+ */
3969
+ interface CreateBillingTransactionData {
3970
+ type: BillingTransactionType;
3971
+ description: string;
3972
+ amount: number;
3973
+ currency: string;
3974
+ stripeData: StripeTransactionData;
3975
+ planDetails: PlanDetails;
3976
+ metadata?: Record<string, any>;
3977
+ }
3896
3978
  /**
3897
3979
  * Interface for clinic group
3898
3980
  */
@@ -3916,6 +3998,7 @@ interface ClinicGroup {
3916
3998
  practiceType?: PracticeType;
3917
3999
  languages?: Language[];
3918
4000
  subscriptionModel: SubscriptionModel;
4001
+ billing?: BillingInfo;
3919
4002
  calendarSyncEnabled?: boolean;
3920
4003
  autoConfirmAppointments?: boolean;
3921
4004
  businessIdentificationNumber?: string | null;
@@ -3939,6 +4022,7 @@ interface CreateClinicGroupData {
3939
4022
  practiceType?: PracticeType;
3940
4023
  languages?: Language[];
3941
4024
  subscriptionModel?: SubscriptionModel;
4025
+ billing?: BillingInfo;
3942
4026
  calendarSyncEnabled?: boolean;
3943
4027
  autoConfirmAppointments?: boolean;
3944
4028
  businessIdentificationNumber?: string | null;
@@ -6722,4 +6806,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
6722
6806
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
6723
6807
  declare const getFirebaseFunctions: () => Promise<Functions>;
6724
6808
 
6725
- export { APPOINTMENTS_COLLECTION, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, AuthService, type BaseDocumentElement, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingPerZone, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBlockingEventParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DEFAULT_MEDICAL_INFO, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, NOTIFICATIONS_COLLECTION, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PRACTITIONER_INVITES_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerInvite, type PractitionerInviteFilters, PractitionerInviteService, PractitionerInviteStatus, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedureProduct, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, ProductService, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, RequirementType, type Review, type ReviewRequestNotification, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type Subcategory, SubcategoryService, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
6809
+ export { APPOINTMENTS_COLLECTION, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, AuthService, type BaseDocumentElement, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBillingTransactionData, type CreateBlockingEventParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DEFAULT_MEDICAL_INFO, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, NOTIFICATIONS_COLLECTION, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PRACTITIONER_INVITES_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PlanDetails, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerInvite, type PractitionerInviteFilters, PractitionerInviteService, PractitionerInviteStatus, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedureProduct, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, ProductService, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, RequirementType, type Review, type ReviewRequestNotification, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
package/dist/index.js CHANGED
@@ -37,6 +37,7 @@ __export(index_exports, {
37
37
  AppointmentStatus: () => AppointmentStatus,
38
38
  AuthService: () => AuthService,
39
39
  BaseService: () => BaseService,
40
+ BillingTransactionType: () => BillingTransactionType,
40
41
  BlockingCondition: () => BlockingCondition,
41
42
  BrandService: () => BrandService,
42
43
  CALENDAR_COLLECTION: () => CALENDAR_COLLECTION,
@@ -120,6 +121,7 @@ __export(index_exports, {
120
121
  SearchLocationEnum: () => SearchLocationEnum,
121
122
  SubcategoryService: () => SubcategoryService,
122
123
  SubscriptionModel: () => SubscriptionModel,
124
+ SubscriptionStatus: () => SubscriptionStatus,
123
125
  SyncedCalendarProvider: () => SyncedCalendarProvider,
124
126
  SyncedCalendarsService: () => SyncedCalendarsService,
125
127
  TechnologyService: () => TechnologyService,
@@ -888,6 +890,25 @@ var SubscriptionModel = /* @__PURE__ */ ((SubscriptionModel2) => {
888
890
  SubscriptionModel2["ENTERPRISE"] = "enterprise";
889
891
  return SubscriptionModel2;
890
892
  })(SubscriptionModel || {});
893
+ var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
894
+ SubscriptionStatus2["PENDING"] = "pending";
895
+ SubscriptionStatus2["ACTIVE"] = "active";
896
+ SubscriptionStatus2["PENDING_CANCELLATION"] = "pending_cancellation";
897
+ SubscriptionStatus2["CANCELED"] = "canceled";
898
+ SubscriptionStatus2["PAST_DUE"] = "past_due";
899
+ SubscriptionStatus2["TRIALING"] = "trialing";
900
+ return SubscriptionStatus2;
901
+ })(SubscriptionStatus || {});
902
+ var BillingTransactionType = /* @__PURE__ */ ((BillingTransactionType2) => {
903
+ BillingTransactionType2["SUBSCRIPTION_CREATED"] = "subscription_created";
904
+ BillingTransactionType2["SUBSCRIPTION_ACTIVATED"] = "subscription_activated";
905
+ BillingTransactionType2["SUBSCRIPTION_RENEWED"] = "subscription_renewed";
906
+ BillingTransactionType2["SUBSCRIPTION_UPDATED"] = "subscription_updated";
907
+ BillingTransactionType2["SUBSCRIPTION_CANCELED"] = "subscription_canceled";
908
+ BillingTransactionType2["SUBSCRIPTION_REACTIVATED"] = "subscription_reactivated";
909
+ BillingTransactionType2["SUBSCRIPTION_DELETED"] = "subscription_deleted";
910
+ return BillingTransactionType2;
911
+ })(BillingTransactionType || {});
891
912
 
892
913
  // src/types/patient/medical-info.types.ts
893
914
  var PATIENT_MEDICAL_INFO_COLLECTION = "medical_info";
@@ -3508,6 +3529,50 @@ var adminTokenSchema = import_zod10.z.object({
3508
3529
  expiresAt: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp))
3509
3530
  // Timestamp
3510
3531
  });
3532
+ var stripeTransactionDataSchema = import_zod10.z.object({
3533
+ sessionId: import_zod10.z.string().optional(),
3534
+ subscriptionId: import_zod10.z.string().optional(),
3535
+ invoiceId: import_zod10.z.string().optional(),
3536
+ priceId: import_zod10.z.string(),
3537
+ customerId: import_zod10.z.string()
3538
+ });
3539
+ var planDetailsSchema = import_zod10.z.object({
3540
+ planName: import_zod10.z.string(),
3541
+ planPeriod: import_zod10.z.string(),
3542
+ planDisplayName: import_zod10.z.string()
3543
+ });
3544
+ var billingInfoSchema = import_zod10.z.object({
3545
+ stripeCustomerId: import_zod10.z.string(),
3546
+ subscriptionStatus: import_zod10.z.nativeEnum(SubscriptionStatus),
3547
+ planType: import_zod10.z.string(),
3548
+ stripeSubscriptionId: import_zod10.z.string().nullable(),
3549
+ stripePriceId: import_zod10.z.string().nullable(),
3550
+ currentPeriodStart: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp)).nullable(),
3551
+ currentPeriodEnd: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp)).nullable(),
3552
+ updatedAt: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp))
3553
+ });
3554
+ var billingTransactionSchema = import_zod10.z.object({
3555
+ id: import_zod10.z.string(),
3556
+ clinicGroupId: import_zod10.z.string(),
3557
+ type: import_zod10.z.nativeEnum(BillingTransactionType),
3558
+ description: import_zod10.z.string(),
3559
+ amount: import_zod10.z.number(),
3560
+ currency: import_zod10.z.string(),
3561
+ stripeData: stripeTransactionDataSchema,
3562
+ planDetails: planDetailsSchema,
3563
+ metadata: import_zod10.z.record(import_zod10.z.any()).optional(),
3564
+ timestamp: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp)),
3565
+ createdAt: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp))
3566
+ });
3567
+ var createBillingTransactionSchema = import_zod10.z.object({
3568
+ type: import_zod10.z.nativeEnum(BillingTransactionType),
3569
+ description: import_zod10.z.string(),
3570
+ amount: import_zod10.z.number(),
3571
+ currency: import_zod10.z.string(),
3572
+ stripeData: stripeTransactionDataSchema,
3573
+ planDetails: planDetailsSchema,
3574
+ metadata: import_zod10.z.record(import_zod10.z.any()).optional()
3575
+ });
3511
3576
  var createAdminTokenSchema = import_zod10.z.object({
3512
3577
  expiresInDays: import_zod10.z.number().min(1).max(30).optional(),
3513
3578
  email: import_zod10.z.string().email().optional().nullable()
@@ -3534,6 +3599,7 @@ var clinicGroupSchema = import_zod10.z.object({
3534
3599
  practiceType: import_zod10.z.nativeEnum(PracticeType).optional(),
3535
3600
  languages: import_zod10.z.array(import_zod10.z.nativeEnum(Language)).optional(),
3536
3601
  subscriptionModel: import_zod10.z.nativeEnum(SubscriptionModel),
3602
+ billing: billingInfoSchema.optional(),
3537
3603
  calendarSyncEnabled: import_zod10.z.boolean().optional(),
3538
3604
  autoConfirmAppointments: import_zod10.z.boolean().optional(),
3539
3605
  businessIdentificationNumber: import_zod10.z.string().optional().nullable(),
@@ -3599,6 +3665,7 @@ var createClinicGroupSchema = import_zod10.z.object({
3599
3665
  practiceType: import_zod10.z.nativeEnum(PracticeType).optional(),
3600
3666
  languages: import_zod10.z.array(import_zod10.z.nativeEnum(Language)).optional(),
3601
3667
  subscriptionModel: import_zod10.z.nativeEnum(SubscriptionModel).optional().default("no_subscription" /* NO_SUBSCRIPTION */),
3668
+ billing: billingInfoSchema.optional(),
3602
3669
  calendarSyncEnabled: import_zod10.z.boolean().optional(),
3603
3670
  autoConfirmAppointments: import_zod10.z.boolean().optional(),
3604
3671
  businessIdentificationNumber: import_zod10.z.string().optional().nullable(),
@@ -17964,6 +18031,7 @@ var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
17964
18031
  AppointmentStatus,
17965
18032
  AuthService,
17966
18033
  BaseService,
18034
+ BillingTransactionType,
17967
18035
  BlockingCondition,
17968
18036
  BrandService,
17969
18037
  CALENDAR_COLLECTION,
@@ -18047,6 +18115,7 @@ var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
18047
18115
  SearchLocationEnum,
18048
18116
  SubcategoryService,
18049
18117
  SubscriptionModel,
18118
+ SubscriptionStatus,
18050
18119
  SyncedCalendarProvider,
18051
18120
  SyncedCalendarsService,
18052
18121
  TechnologyService,
package/dist/index.mjs CHANGED
@@ -772,6 +772,25 @@ var SubscriptionModel = /* @__PURE__ */ ((SubscriptionModel2) => {
772
772
  SubscriptionModel2["ENTERPRISE"] = "enterprise";
773
773
  return SubscriptionModel2;
774
774
  })(SubscriptionModel || {});
775
+ var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
776
+ SubscriptionStatus2["PENDING"] = "pending";
777
+ SubscriptionStatus2["ACTIVE"] = "active";
778
+ SubscriptionStatus2["PENDING_CANCELLATION"] = "pending_cancellation";
779
+ SubscriptionStatus2["CANCELED"] = "canceled";
780
+ SubscriptionStatus2["PAST_DUE"] = "past_due";
781
+ SubscriptionStatus2["TRIALING"] = "trialing";
782
+ return SubscriptionStatus2;
783
+ })(SubscriptionStatus || {});
784
+ var BillingTransactionType = /* @__PURE__ */ ((BillingTransactionType2) => {
785
+ BillingTransactionType2["SUBSCRIPTION_CREATED"] = "subscription_created";
786
+ BillingTransactionType2["SUBSCRIPTION_ACTIVATED"] = "subscription_activated";
787
+ BillingTransactionType2["SUBSCRIPTION_RENEWED"] = "subscription_renewed";
788
+ BillingTransactionType2["SUBSCRIPTION_UPDATED"] = "subscription_updated";
789
+ BillingTransactionType2["SUBSCRIPTION_CANCELED"] = "subscription_canceled";
790
+ BillingTransactionType2["SUBSCRIPTION_REACTIVATED"] = "subscription_reactivated";
791
+ BillingTransactionType2["SUBSCRIPTION_DELETED"] = "subscription_deleted";
792
+ return BillingTransactionType2;
793
+ })(BillingTransactionType || {});
775
794
 
776
795
  // src/types/patient/medical-info.types.ts
777
796
  var PATIENT_MEDICAL_INFO_COLLECTION = "medical_info";
@@ -3490,6 +3509,50 @@ var adminTokenSchema = z10.object({
3490
3509
  expiresAt: z10.instanceof(Date).or(z10.instanceof(Timestamp6))
3491
3510
  // Timestamp
3492
3511
  });
3512
+ var stripeTransactionDataSchema = z10.object({
3513
+ sessionId: z10.string().optional(),
3514
+ subscriptionId: z10.string().optional(),
3515
+ invoiceId: z10.string().optional(),
3516
+ priceId: z10.string(),
3517
+ customerId: z10.string()
3518
+ });
3519
+ var planDetailsSchema = z10.object({
3520
+ planName: z10.string(),
3521
+ planPeriod: z10.string(),
3522
+ planDisplayName: z10.string()
3523
+ });
3524
+ var billingInfoSchema = z10.object({
3525
+ stripeCustomerId: z10.string(),
3526
+ subscriptionStatus: z10.nativeEnum(SubscriptionStatus),
3527
+ planType: z10.string(),
3528
+ stripeSubscriptionId: z10.string().nullable(),
3529
+ stripePriceId: z10.string().nullable(),
3530
+ currentPeriodStart: z10.instanceof(Date).or(z10.instanceof(Timestamp6)).nullable(),
3531
+ currentPeriodEnd: z10.instanceof(Date).or(z10.instanceof(Timestamp6)).nullable(),
3532
+ updatedAt: z10.instanceof(Date).or(z10.instanceof(Timestamp6))
3533
+ });
3534
+ var billingTransactionSchema = z10.object({
3535
+ id: z10.string(),
3536
+ clinicGroupId: z10.string(),
3537
+ type: z10.nativeEnum(BillingTransactionType),
3538
+ description: z10.string(),
3539
+ amount: z10.number(),
3540
+ currency: z10.string(),
3541
+ stripeData: stripeTransactionDataSchema,
3542
+ planDetails: planDetailsSchema,
3543
+ metadata: z10.record(z10.any()).optional(),
3544
+ timestamp: z10.instanceof(Date).or(z10.instanceof(Timestamp6)),
3545
+ createdAt: z10.instanceof(Date).or(z10.instanceof(Timestamp6))
3546
+ });
3547
+ var createBillingTransactionSchema = z10.object({
3548
+ type: z10.nativeEnum(BillingTransactionType),
3549
+ description: z10.string(),
3550
+ amount: z10.number(),
3551
+ currency: z10.string(),
3552
+ stripeData: stripeTransactionDataSchema,
3553
+ planDetails: planDetailsSchema,
3554
+ metadata: z10.record(z10.any()).optional()
3555
+ });
3493
3556
  var createAdminTokenSchema = z10.object({
3494
3557
  expiresInDays: z10.number().min(1).max(30).optional(),
3495
3558
  email: z10.string().email().optional().nullable()
@@ -3516,6 +3579,7 @@ var clinicGroupSchema = z10.object({
3516
3579
  practiceType: z10.nativeEnum(PracticeType).optional(),
3517
3580
  languages: z10.array(z10.nativeEnum(Language)).optional(),
3518
3581
  subscriptionModel: z10.nativeEnum(SubscriptionModel),
3582
+ billing: billingInfoSchema.optional(),
3519
3583
  calendarSyncEnabled: z10.boolean().optional(),
3520
3584
  autoConfirmAppointments: z10.boolean().optional(),
3521
3585
  businessIdentificationNumber: z10.string().optional().nullable(),
@@ -3581,6 +3645,7 @@ var createClinicGroupSchema = z10.object({
3581
3645
  practiceType: z10.nativeEnum(PracticeType).optional(),
3582
3646
  languages: z10.array(z10.nativeEnum(Language)).optional(),
3583
3647
  subscriptionModel: z10.nativeEnum(SubscriptionModel).optional().default("no_subscription" /* NO_SUBSCRIPTION */),
3648
+ billing: billingInfoSchema.optional(),
3584
3649
  calendarSyncEnabled: z10.boolean().optional(),
3585
3650
  autoConfirmAppointments: z10.boolean().optional(),
3586
3651
  businessIdentificationNumber: z10.string().optional().nullable(),
@@ -18299,6 +18364,7 @@ export {
18299
18364
  AppointmentStatus,
18300
18365
  AuthService,
18301
18366
  BaseService,
18367
+ BillingTransactionType,
18302
18368
  BlockingCondition,
18303
18369
  BrandService,
18304
18370
  CALENDAR_COLLECTION,
@@ -18382,6 +18448,7 @@ export {
18382
18448
  SearchLocationEnum,
18383
18449
  SubcategoryService,
18384
18450
  SubscriptionModel,
18451
+ SubscriptionStatus,
18385
18452
  SyncedCalendarProvider,
18386
18453
  SyncedCalendarsService,
18387
18454
  TechnologyService,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.12.3",
4
+ "version": "1.12.5",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -1,22 +1,17 @@
1
- import { Timestamp, FieldValue } from "firebase/firestore";
1
+ import { Timestamp, FieldValue } from 'firebase/firestore';
2
2
 
3
- import type { ClinicInfo } from "../profile";
4
- import { ClinicReviewInfo } from "../reviews";
5
- import { ProcedureSummaryInfo } from "../procedure";
3
+ import type { ClinicInfo } from '../profile';
4
+ import { ClinicReviewInfo } from '../reviews';
5
+ import { ProcedureSummaryInfo } from '../procedure';
6
6
 
7
- export const CLINIC_GROUPS_COLLECTION = "clinic_groups";
8
- export const CLINIC_ADMINS_COLLECTION = "clinic_admins";
9
- export const CLINICS_COLLECTION = "clinics";
7
+ export const CLINIC_GROUPS_COLLECTION = 'clinic_groups';
8
+ export const CLINIC_ADMINS_COLLECTION = 'clinic_admins';
9
+ export const CLINICS_COLLECTION = 'clinics';
10
10
 
11
- import {
12
- PracticeType,
13
- Language,
14
- ClinicTag,
15
- ClinicPhotoTag,
16
- } from "./preferences.types";
17
- import type { MediaResource } from "../../services/media/media.service";
11
+ import { PracticeType, Language, ClinicTag, ClinicPhotoTag } from './preferences.types';
12
+ import type { MediaResource } from '../../services/media/media.service';
18
13
 
19
- export * from "./preferences.types";
14
+ export * from './preferences.types';
20
15
 
21
16
  /**
22
17
  * Interface for clinic contact information
@@ -137,9 +132,9 @@ export interface UpdateClinicAdminData extends Partial<CreateClinicAdminData> {
137
132
  * Enum for admin token status
138
133
  */
139
134
  export enum AdminTokenStatus {
140
- ACTIVE = "active",
141
- USED = "used",
142
- EXPIRED = "expired",
135
+ ACTIVE = 'active',
136
+ USED = 'used',
137
+ EXPIRED = 'expired',
143
138
  }
144
139
 
145
140
  /**
@@ -168,10 +163,99 @@ export interface AdminInfo {
168
163
  * Enum for subscription models
169
164
  */
170
165
  export enum SubscriptionModel {
171
- NO_SUBSCRIPTION = "no_subscription",
172
- BASIC = "basic",
173
- PREMIUM = "premium",
174
- ENTERPRISE = "enterprise",
166
+ NO_SUBSCRIPTION = 'no_subscription',
167
+ BASIC = 'basic',
168
+ PREMIUM = 'premium',
169
+ ENTERPRISE = 'enterprise',
170
+ }
171
+
172
+ /**
173
+ * Enum for subscription status
174
+ */
175
+ export enum SubscriptionStatus {
176
+ PENDING = 'pending',
177
+ ACTIVE = 'active',
178
+ PENDING_CANCELLATION = 'pending_cancellation',
179
+ CANCELED = 'canceled',
180
+ PAST_DUE = 'past_due',
181
+ TRIALING = 'trialing',
182
+ }
183
+
184
+ /**
185
+ * Interface for billing information
186
+ */
187
+ export interface BillingInfo {
188
+ stripeCustomerId: string;
189
+ subscriptionStatus: SubscriptionStatus;
190
+ planType: string;
191
+ stripeSubscriptionId: string | null;
192
+ stripePriceId: string | null;
193
+ currentPeriodStart: Timestamp | null;
194
+ currentPeriodEnd: Timestamp | null;
195
+ updatedAt: Timestamp;
196
+ }
197
+
198
+ /**
199
+ * Enum for billing transaction types
200
+ */
201
+ export enum BillingTransactionType {
202
+ SUBSCRIPTION_CREATED = 'subscription_created',
203
+ SUBSCRIPTION_ACTIVATED = 'subscription_activated',
204
+ SUBSCRIPTION_RENEWED = 'subscription_renewed',
205
+ SUBSCRIPTION_UPDATED = 'subscription_updated',
206
+ SUBSCRIPTION_CANCELED = 'subscription_canceled',
207
+ SUBSCRIPTION_REACTIVATED = 'subscription_reactivated',
208
+ SUBSCRIPTION_DELETED = 'subscription_deleted',
209
+ }
210
+
211
+ /**
212
+ * Interface for Stripe data in billing transactions
213
+ */
214
+ export interface StripeTransactionData {
215
+ sessionId?: string;
216
+ subscriptionId?: string;
217
+ invoiceId?: string;
218
+ priceId: string;
219
+ customerId: string;
220
+ }
221
+
222
+ /**
223
+ * Interface for plan details in billing transactions
224
+ */
225
+ export interface PlanDetails {
226
+ planName: string;
227
+ planPeriod: string;
228
+ planDisplayName: string;
229
+ }
230
+
231
+ /**
232
+ * Interface for billing transactions
233
+ */
234
+ export interface BillingTransaction {
235
+ id: string;
236
+ clinicGroupId: string;
237
+ type: BillingTransactionType;
238
+ description: string;
239
+ amount: number;
240
+ currency: string;
241
+ stripeData: StripeTransactionData;
242
+ planDetails: PlanDetails;
243
+ metadata?: Record<string, any>;
244
+ timestamp: Timestamp;
245
+ createdAt: Timestamp;
246
+ }
247
+
248
+ /**
249
+ * Interface for creating a billing transaction
250
+ */
251
+ export interface CreateBillingTransactionData {
252
+ type: BillingTransactionType;
253
+ description: string;
254
+ amount: number;
255
+ currency: string;
256
+ stripeData: StripeTransactionData;
257
+ planDetails: PlanDetails;
258
+ metadata?: Record<string, any>;
175
259
  }
176
260
 
177
261
  /**
@@ -197,6 +281,7 @@ export interface ClinicGroup {
197
281
  practiceType?: PracticeType;
198
282
  languages?: Language[];
199
283
  subscriptionModel: SubscriptionModel;
284
+ billing?: BillingInfo;
200
285
  calendarSyncEnabled?: boolean;
201
286
  autoConfirmAppointments?: boolean;
202
287
  businessIdentificationNumber?: string | null;
@@ -221,6 +306,7 @@ export interface CreateClinicGroupData {
221
306
  practiceType?: PracticeType;
222
307
  languages?: Language[];
223
308
  subscriptionModel?: SubscriptionModel;
309
+ billing?: BillingInfo;
224
310
  calendarSyncEnabled?: boolean;
225
311
  autoConfirmAppointments?: boolean;
226
312
  businessIdentificationNumber?: string | null;
@@ -400,4 +486,4 @@ export interface ClinicTags {
400
486
  }
401
487
 
402
488
  // Export practitioner invite types
403
- export * from "./practitioner-invite.types";
489
+ export * from './practitioner-invite.types';
@@ -1,20 +1,18 @@
1
- import { z } from "zod";
2
- import { Timestamp } from "firebase/firestore";
1
+ import { z } from 'zod';
2
+ import { Timestamp } from 'firebase/firestore';
3
3
  import {
4
4
  ClinicTag,
5
5
  AdminTokenStatus,
6
6
  SubscriptionModel,
7
+ SubscriptionStatus,
8
+ BillingTransactionType,
7
9
  PracticeType,
8
10
  Language,
9
- } from "../types/clinic";
11
+ } from '../types/clinic';
10
12
 
11
- import { clinicReviewInfoSchema } from "./reviews.schema";
12
- import {
13
- procedureSummaryInfoSchema,
14
- clinicInfoSchema,
15
- doctorInfoSchema,
16
- } from "./shared.schema";
17
- import { mediaResourceSchema } from "./media.schema";
13
+ import { clinicReviewInfoSchema } from './reviews.schema';
14
+ import { procedureSummaryInfoSchema, clinicInfoSchema, doctorInfoSchema } from './shared.schema';
15
+ import { mediaResourceSchema } from './media.schema';
18
16
 
19
17
  /**
20
18
  * Validaciona šema za kontakt informacije
@@ -51,7 +49,7 @@ const workingHoursTimeSchema = z.object({
51
49
  z.object({
52
50
  start: z.string(),
53
51
  end: z.string(),
54
- })
52
+ }),
55
53
  )
56
54
  .optional(),
57
55
  });
@@ -145,6 +143,70 @@ export const adminTokenSchema = z.object({
145
143
  expiresAt: z.instanceof(Date).or(z.instanceof(Timestamp)), // Timestamp
146
144
  });
147
145
 
146
+ /**
147
+ * Validation schema for Stripe transaction data
148
+ */
149
+ export const stripeTransactionDataSchema = z.object({
150
+ sessionId: z.string().optional(),
151
+ subscriptionId: z.string().optional(),
152
+ invoiceId: z.string().optional(),
153
+ priceId: z.string(),
154
+ customerId: z.string(),
155
+ });
156
+
157
+ /**
158
+ * Validation schema for plan details
159
+ */
160
+ export const planDetailsSchema = z.object({
161
+ planName: z.string(),
162
+ planPeriod: z.string(),
163
+ planDisplayName: z.string(),
164
+ });
165
+
166
+ /**
167
+ * Validation schema for billing information
168
+ */
169
+ export const billingInfoSchema = z.object({
170
+ stripeCustomerId: z.string(),
171
+ subscriptionStatus: z.nativeEnum(SubscriptionStatus),
172
+ planType: z.string(),
173
+ stripeSubscriptionId: z.string().nullable(),
174
+ stripePriceId: z.string().nullable(),
175
+ currentPeriodStart: z.instanceof(Date).or(z.instanceof(Timestamp)).nullable(),
176
+ currentPeriodEnd: z.instanceof(Date).or(z.instanceof(Timestamp)).nullable(),
177
+ updatedAt: z.instanceof(Date).or(z.instanceof(Timestamp)),
178
+ });
179
+
180
+ /**
181
+ * Validation schema for billing transactions
182
+ */
183
+ export const billingTransactionSchema = z.object({
184
+ id: z.string(),
185
+ clinicGroupId: z.string(),
186
+ type: z.nativeEnum(BillingTransactionType),
187
+ description: z.string(),
188
+ amount: z.number(),
189
+ currency: z.string(),
190
+ stripeData: stripeTransactionDataSchema,
191
+ planDetails: planDetailsSchema,
192
+ metadata: z.record(z.any()).optional(),
193
+ timestamp: z.instanceof(Date).or(z.instanceof(Timestamp)),
194
+ createdAt: z.instanceof(Date).or(z.instanceof(Timestamp)),
195
+ });
196
+
197
+ /**
198
+ * Validation schema for creating billing transactions
199
+ */
200
+ export const createBillingTransactionSchema = z.object({
201
+ type: z.nativeEnum(BillingTransactionType),
202
+ description: z.string(),
203
+ amount: z.number(),
204
+ currency: z.string(),
205
+ stripeData: stripeTransactionDataSchema,
206
+ planDetails: planDetailsSchema,
207
+ metadata: z.record(z.any()).optional(),
208
+ });
209
+
148
210
  /**
149
211
  * Validaciona šema za kreiranje admin tokena
150
212
  */
@@ -176,6 +238,7 @@ export const clinicGroupSchema = z.object({
176
238
  practiceType: z.nativeEnum(PracticeType).optional(),
177
239
  languages: z.array(z.nativeEnum(Language)).optional(),
178
240
  subscriptionModel: z.nativeEnum(SubscriptionModel),
241
+ billing: billingInfoSchema.optional(),
179
242
  calendarSyncEnabled: z.boolean().optional(),
180
243
  autoConfirmAppointments: z.boolean().optional(),
181
244
  businessIdentificationNumber: z.string().optional().nullable(),
@@ -206,7 +269,7 @@ export const clinicSchema = z.object({
206
269
  z.object({
207
270
  url: mediaResourceSchema,
208
271
  tag: z.string(),
209
- })
272
+ }),
210
273
  )
211
274
  .optional(),
212
275
  doctors: z.array(z.string()), // List of practitioner IDs
@@ -254,6 +317,7 @@ export const createClinicGroupSchema = z.object({
254
317
  .nativeEnum(SubscriptionModel)
255
318
  .optional()
256
319
  .default(SubscriptionModel.NO_SUBSCRIPTION),
320
+ billing: billingInfoSchema.optional(),
257
321
  calendarSyncEnabled: z.boolean().optional(),
258
322
  autoConfirmAppointments: z.boolean().optional(),
259
323
  businessIdentificationNumber: z.string().optional().nullable(),
@@ -284,7 +348,7 @@ export const createClinicSchema = z.object({
284
348
  z.object({
285
349
  url: mediaResourceSchema,
286
350
  tag: z.string(),
287
- })
351
+ }),
288
352
  )
289
353
  .optional(),
290
354
  doctors: z.array(z.string()).optional().default([]),
@@ -384,7 +448,7 @@ export const clinicBranchSetupSchema = z.object({
384
448
  z.object({
385
449
  url: mediaResourceSchema,
386
450
  tag: z.string(),
387
- })
451
+ }),
388
452
  )
389
453
  .optional(),
390
454
  featuredPhotos: z.array(mediaResourceSchema).optional(),
@@ -416,7 +480,7 @@ export const updateClinicSchema = z.object({
416
480
  z.object({
417
481
  url: mediaResourceSchema,
418
482
  tag: z.string(),
419
- })
483
+ }),
420
484
  )
421
485
  .optional(),
422
486
  doctors: z.array(z.string()).optional(),