@blackcode_sa/metaestetics-api 1.12.3 → 1.12.4

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,86 @@ 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
+ ACTIVE = "active",
3901
+ PENDING_CANCELLATION = "pending_cancellation",
3902
+ CANCELED = "canceled",
3903
+ PAST_DUE = "past_due",
3904
+ TRIALING = "trialing"
3905
+ }
3906
+ /**
3907
+ * Interface for billing information
3908
+ */
3909
+ interface BillingInfo {
3910
+ stripeCustomerId: string;
3911
+ subscriptionStatus: SubscriptionStatus;
3912
+ planType: string;
3913
+ stripeSubscriptionId: string | null;
3914
+ stripePriceId: string | null;
3915
+ currentPeriodStart: Timestamp | null;
3916
+ currentPeriodEnd: Timestamp | null;
3917
+ updatedAt: Timestamp;
3918
+ }
3919
+ /**
3920
+ * Enum for billing transaction types
3921
+ */
3922
+ declare enum BillingTransactionType {
3923
+ SUBSCRIPTION_ACTIVATED = "subscription_activated",
3924
+ SUBSCRIPTION_RENEWED = "subscription_renewed",
3925
+ SUBSCRIPTION_UPDATED = "subscription_updated",
3926
+ SUBSCRIPTION_CANCELED = "subscription_canceled",
3927
+ SUBSCRIPTION_REACTIVATED = "subscription_reactivated",
3928
+ SUBSCRIPTION_DELETED = "subscription_deleted"
3929
+ }
3930
+ /**
3931
+ * Interface for Stripe data in billing transactions
3932
+ */
3933
+ interface StripeTransactionData {
3934
+ sessionId?: string;
3935
+ subscriptionId?: string;
3936
+ invoiceId?: string;
3937
+ priceId: string;
3938
+ customerId: string;
3939
+ }
3940
+ /**
3941
+ * Interface for plan details in billing transactions
3942
+ */
3943
+ interface PlanDetails {
3944
+ planName: string;
3945
+ planPeriod: string;
3946
+ planDisplayName: string;
3947
+ }
3948
+ /**
3949
+ * Interface for billing transactions
3950
+ */
3951
+ interface BillingTransaction {
3952
+ id: string;
3953
+ clinicGroupId: string;
3954
+ type: BillingTransactionType;
3955
+ description: string;
3956
+ amount: number;
3957
+ currency: string;
3958
+ stripeData: StripeTransactionData;
3959
+ planDetails: PlanDetails;
3960
+ metadata?: Record<string, any>;
3961
+ timestamp: Timestamp;
3962
+ createdAt: Timestamp;
3963
+ }
3964
+ /**
3965
+ * Interface for creating a billing transaction
3966
+ */
3967
+ interface CreateBillingTransactionData {
3968
+ type: BillingTransactionType;
3969
+ description: string;
3970
+ amount: number;
3971
+ currency: string;
3972
+ stripeData: StripeTransactionData;
3973
+ planDetails: PlanDetails;
3974
+ metadata?: Record<string, any>;
3975
+ }
3896
3976
  /**
3897
3977
  * Interface for clinic group
3898
3978
  */
@@ -3916,6 +3996,7 @@ interface ClinicGroup {
3916
3996
  practiceType?: PracticeType;
3917
3997
  languages?: Language[];
3918
3998
  subscriptionModel: SubscriptionModel;
3999
+ billing?: BillingInfo;
3919
4000
  calendarSyncEnabled?: boolean;
3920
4001
  autoConfirmAppointments?: boolean;
3921
4002
  businessIdentificationNumber?: string | null;
@@ -3939,6 +4020,7 @@ interface CreateClinicGroupData {
3939
4020
  practiceType?: PracticeType;
3940
4021
  languages?: Language[];
3941
4022
  subscriptionModel?: SubscriptionModel;
4023
+ billing?: BillingInfo;
3942
4024
  calendarSyncEnabled?: boolean;
3943
4025
  autoConfirmAppointments?: boolean;
3944
4026
  businessIdentificationNumber?: string | null;
@@ -6722,4 +6804,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
6722
6804
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
6723
6805
  declare const getFirebaseFunctions: () => Promise<Functions>;
6724
6806
 
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 };
6807
+ 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,86 @@ 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
+ ACTIVE = "active",
3901
+ PENDING_CANCELLATION = "pending_cancellation",
3902
+ CANCELED = "canceled",
3903
+ PAST_DUE = "past_due",
3904
+ TRIALING = "trialing"
3905
+ }
3906
+ /**
3907
+ * Interface for billing information
3908
+ */
3909
+ interface BillingInfo {
3910
+ stripeCustomerId: string;
3911
+ subscriptionStatus: SubscriptionStatus;
3912
+ planType: string;
3913
+ stripeSubscriptionId: string | null;
3914
+ stripePriceId: string | null;
3915
+ currentPeriodStart: Timestamp | null;
3916
+ currentPeriodEnd: Timestamp | null;
3917
+ updatedAt: Timestamp;
3918
+ }
3919
+ /**
3920
+ * Enum for billing transaction types
3921
+ */
3922
+ declare enum BillingTransactionType {
3923
+ SUBSCRIPTION_ACTIVATED = "subscription_activated",
3924
+ SUBSCRIPTION_RENEWED = "subscription_renewed",
3925
+ SUBSCRIPTION_UPDATED = "subscription_updated",
3926
+ SUBSCRIPTION_CANCELED = "subscription_canceled",
3927
+ SUBSCRIPTION_REACTIVATED = "subscription_reactivated",
3928
+ SUBSCRIPTION_DELETED = "subscription_deleted"
3929
+ }
3930
+ /**
3931
+ * Interface for Stripe data in billing transactions
3932
+ */
3933
+ interface StripeTransactionData {
3934
+ sessionId?: string;
3935
+ subscriptionId?: string;
3936
+ invoiceId?: string;
3937
+ priceId: string;
3938
+ customerId: string;
3939
+ }
3940
+ /**
3941
+ * Interface for plan details in billing transactions
3942
+ */
3943
+ interface PlanDetails {
3944
+ planName: string;
3945
+ planPeriod: string;
3946
+ planDisplayName: string;
3947
+ }
3948
+ /**
3949
+ * Interface for billing transactions
3950
+ */
3951
+ interface BillingTransaction {
3952
+ id: string;
3953
+ clinicGroupId: string;
3954
+ type: BillingTransactionType;
3955
+ description: string;
3956
+ amount: number;
3957
+ currency: string;
3958
+ stripeData: StripeTransactionData;
3959
+ planDetails: PlanDetails;
3960
+ metadata?: Record<string, any>;
3961
+ timestamp: Timestamp;
3962
+ createdAt: Timestamp;
3963
+ }
3964
+ /**
3965
+ * Interface for creating a billing transaction
3966
+ */
3967
+ interface CreateBillingTransactionData {
3968
+ type: BillingTransactionType;
3969
+ description: string;
3970
+ amount: number;
3971
+ currency: string;
3972
+ stripeData: StripeTransactionData;
3973
+ planDetails: PlanDetails;
3974
+ metadata?: Record<string, any>;
3975
+ }
3896
3976
  /**
3897
3977
  * Interface for clinic group
3898
3978
  */
@@ -3916,6 +3996,7 @@ interface ClinicGroup {
3916
3996
  practiceType?: PracticeType;
3917
3997
  languages?: Language[];
3918
3998
  subscriptionModel: SubscriptionModel;
3999
+ billing?: BillingInfo;
3919
4000
  calendarSyncEnabled?: boolean;
3920
4001
  autoConfirmAppointments?: boolean;
3921
4002
  businessIdentificationNumber?: string | null;
@@ -3939,6 +4020,7 @@ interface CreateClinicGroupData {
3939
4020
  practiceType?: PracticeType;
3940
4021
  languages?: Language[];
3941
4022
  subscriptionModel?: SubscriptionModel;
4023
+ billing?: BillingInfo;
3942
4024
  calendarSyncEnabled?: boolean;
3943
4025
  autoConfirmAppointments?: boolean;
3944
4026
  businessIdentificationNumber?: string | null;
@@ -6722,4 +6804,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
6722
6804
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
6723
6805
  declare const getFirebaseFunctions: () => Promise<Functions>;
6724
6806
 
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 };
6807
+ 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,23 @@ var SubscriptionModel = /* @__PURE__ */ ((SubscriptionModel2) => {
888
890
  SubscriptionModel2["ENTERPRISE"] = "enterprise";
889
891
  return SubscriptionModel2;
890
892
  })(SubscriptionModel || {});
893
+ var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
894
+ SubscriptionStatus2["ACTIVE"] = "active";
895
+ SubscriptionStatus2["PENDING_CANCELLATION"] = "pending_cancellation";
896
+ SubscriptionStatus2["CANCELED"] = "canceled";
897
+ SubscriptionStatus2["PAST_DUE"] = "past_due";
898
+ SubscriptionStatus2["TRIALING"] = "trialing";
899
+ return SubscriptionStatus2;
900
+ })(SubscriptionStatus || {});
901
+ var BillingTransactionType = /* @__PURE__ */ ((BillingTransactionType2) => {
902
+ BillingTransactionType2["SUBSCRIPTION_ACTIVATED"] = "subscription_activated";
903
+ BillingTransactionType2["SUBSCRIPTION_RENEWED"] = "subscription_renewed";
904
+ BillingTransactionType2["SUBSCRIPTION_UPDATED"] = "subscription_updated";
905
+ BillingTransactionType2["SUBSCRIPTION_CANCELED"] = "subscription_canceled";
906
+ BillingTransactionType2["SUBSCRIPTION_REACTIVATED"] = "subscription_reactivated";
907
+ BillingTransactionType2["SUBSCRIPTION_DELETED"] = "subscription_deleted";
908
+ return BillingTransactionType2;
909
+ })(BillingTransactionType || {});
891
910
 
892
911
  // src/types/patient/medical-info.types.ts
893
912
  var PATIENT_MEDICAL_INFO_COLLECTION = "medical_info";
@@ -3508,6 +3527,50 @@ var adminTokenSchema = import_zod10.z.object({
3508
3527
  expiresAt: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp))
3509
3528
  // Timestamp
3510
3529
  });
3530
+ var stripeTransactionDataSchema = import_zod10.z.object({
3531
+ sessionId: import_zod10.z.string().optional(),
3532
+ subscriptionId: import_zod10.z.string().optional(),
3533
+ invoiceId: import_zod10.z.string().optional(),
3534
+ priceId: import_zod10.z.string(),
3535
+ customerId: import_zod10.z.string()
3536
+ });
3537
+ var planDetailsSchema = import_zod10.z.object({
3538
+ planName: import_zod10.z.string(),
3539
+ planPeriod: import_zod10.z.string(),
3540
+ planDisplayName: import_zod10.z.string()
3541
+ });
3542
+ var billingInfoSchema = import_zod10.z.object({
3543
+ stripeCustomerId: import_zod10.z.string(),
3544
+ subscriptionStatus: import_zod10.z.nativeEnum(SubscriptionStatus),
3545
+ planType: import_zod10.z.string(),
3546
+ stripeSubscriptionId: import_zod10.z.string().nullable(),
3547
+ stripePriceId: import_zod10.z.string().nullable(),
3548
+ currentPeriodStart: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp)).nullable(),
3549
+ currentPeriodEnd: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp)).nullable(),
3550
+ updatedAt: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp))
3551
+ });
3552
+ var billingTransactionSchema = import_zod10.z.object({
3553
+ id: import_zod10.z.string(),
3554
+ clinicGroupId: import_zod10.z.string(),
3555
+ type: import_zod10.z.nativeEnum(BillingTransactionType),
3556
+ description: import_zod10.z.string(),
3557
+ amount: import_zod10.z.number(),
3558
+ currency: import_zod10.z.string(),
3559
+ stripeData: stripeTransactionDataSchema,
3560
+ planDetails: planDetailsSchema,
3561
+ metadata: import_zod10.z.record(import_zod10.z.any()).optional(),
3562
+ timestamp: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp)),
3563
+ createdAt: import_zod10.z.instanceof(Date).or(import_zod10.z.instanceof(import_firestore9.Timestamp))
3564
+ });
3565
+ var createBillingTransactionSchema = import_zod10.z.object({
3566
+ type: import_zod10.z.nativeEnum(BillingTransactionType),
3567
+ description: import_zod10.z.string(),
3568
+ amount: import_zod10.z.number(),
3569
+ currency: import_zod10.z.string(),
3570
+ stripeData: stripeTransactionDataSchema,
3571
+ planDetails: planDetailsSchema,
3572
+ metadata: import_zod10.z.record(import_zod10.z.any()).optional()
3573
+ });
3511
3574
  var createAdminTokenSchema = import_zod10.z.object({
3512
3575
  expiresInDays: import_zod10.z.number().min(1).max(30).optional(),
3513
3576
  email: import_zod10.z.string().email().optional().nullable()
@@ -3534,6 +3597,7 @@ var clinicGroupSchema = import_zod10.z.object({
3534
3597
  practiceType: import_zod10.z.nativeEnum(PracticeType).optional(),
3535
3598
  languages: import_zod10.z.array(import_zod10.z.nativeEnum(Language)).optional(),
3536
3599
  subscriptionModel: import_zod10.z.nativeEnum(SubscriptionModel),
3600
+ billing: billingInfoSchema.optional(),
3537
3601
  calendarSyncEnabled: import_zod10.z.boolean().optional(),
3538
3602
  autoConfirmAppointments: import_zod10.z.boolean().optional(),
3539
3603
  businessIdentificationNumber: import_zod10.z.string().optional().nullable(),
@@ -3599,6 +3663,7 @@ var createClinicGroupSchema = import_zod10.z.object({
3599
3663
  practiceType: import_zod10.z.nativeEnum(PracticeType).optional(),
3600
3664
  languages: import_zod10.z.array(import_zod10.z.nativeEnum(Language)).optional(),
3601
3665
  subscriptionModel: import_zod10.z.nativeEnum(SubscriptionModel).optional().default("no_subscription" /* NO_SUBSCRIPTION */),
3666
+ billing: billingInfoSchema.optional(),
3602
3667
  calendarSyncEnabled: import_zod10.z.boolean().optional(),
3603
3668
  autoConfirmAppointments: import_zod10.z.boolean().optional(),
3604
3669
  businessIdentificationNumber: import_zod10.z.string().optional().nullable(),
@@ -17964,6 +18029,7 @@ var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
17964
18029
  AppointmentStatus,
17965
18030
  AuthService,
17966
18031
  BaseService,
18032
+ BillingTransactionType,
17967
18033
  BlockingCondition,
17968
18034
  BrandService,
17969
18035
  CALENDAR_COLLECTION,
@@ -18047,6 +18113,7 @@ var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
18047
18113
  SearchLocationEnum,
18048
18114
  SubcategoryService,
18049
18115
  SubscriptionModel,
18116
+ SubscriptionStatus,
18050
18117
  SyncedCalendarProvider,
18051
18118
  SyncedCalendarsService,
18052
18119
  TechnologyService,
package/dist/index.mjs CHANGED
@@ -772,6 +772,23 @@ var SubscriptionModel = /* @__PURE__ */ ((SubscriptionModel2) => {
772
772
  SubscriptionModel2["ENTERPRISE"] = "enterprise";
773
773
  return SubscriptionModel2;
774
774
  })(SubscriptionModel || {});
775
+ var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
776
+ SubscriptionStatus2["ACTIVE"] = "active";
777
+ SubscriptionStatus2["PENDING_CANCELLATION"] = "pending_cancellation";
778
+ SubscriptionStatus2["CANCELED"] = "canceled";
779
+ SubscriptionStatus2["PAST_DUE"] = "past_due";
780
+ SubscriptionStatus2["TRIALING"] = "trialing";
781
+ return SubscriptionStatus2;
782
+ })(SubscriptionStatus || {});
783
+ var BillingTransactionType = /* @__PURE__ */ ((BillingTransactionType2) => {
784
+ BillingTransactionType2["SUBSCRIPTION_ACTIVATED"] = "subscription_activated";
785
+ BillingTransactionType2["SUBSCRIPTION_RENEWED"] = "subscription_renewed";
786
+ BillingTransactionType2["SUBSCRIPTION_UPDATED"] = "subscription_updated";
787
+ BillingTransactionType2["SUBSCRIPTION_CANCELED"] = "subscription_canceled";
788
+ BillingTransactionType2["SUBSCRIPTION_REACTIVATED"] = "subscription_reactivated";
789
+ BillingTransactionType2["SUBSCRIPTION_DELETED"] = "subscription_deleted";
790
+ return BillingTransactionType2;
791
+ })(BillingTransactionType || {});
775
792
 
776
793
  // src/types/patient/medical-info.types.ts
777
794
  var PATIENT_MEDICAL_INFO_COLLECTION = "medical_info";
@@ -3490,6 +3507,50 @@ var adminTokenSchema = z10.object({
3490
3507
  expiresAt: z10.instanceof(Date).or(z10.instanceof(Timestamp6))
3491
3508
  // Timestamp
3492
3509
  });
3510
+ var stripeTransactionDataSchema = z10.object({
3511
+ sessionId: z10.string().optional(),
3512
+ subscriptionId: z10.string().optional(),
3513
+ invoiceId: z10.string().optional(),
3514
+ priceId: z10.string(),
3515
+ customerId: z10.string()
3516
+ });
3517
+ var planDetailsSchema = z10.object({
3518
+ planName: z10.string(),
3519
+ planPeriod: z10.string(),
3520
+ planDisplayName: z10.string()
3521
+ });
3522
+ var billingInfoSchema = z10.object({
3523
+ stripeCustomerId: z10.string(),
3524
+ subscriptionStatus: z10.nativeEnum(SubscriptionStatus),
3525
+ planType: z10.string(),
3526
+ stripeSubscriptionId: z10.string().nullable(),
3527
+ stripePriceId: z10.string().nullable(),
3528
+ currentPeriodStart: z10.instanceof(Date).or(z10.instanceof(Timestamp6)).nullable(),
3529
+ currentPeriodEnd: z10.instanceof(Date).or(z10.instanceof(Timestamp6)).nullable(),
3530
+ updatedAt: z10.instanceof(Date).or(z10.instanceof(Timestamp6))
3531
+ });
3532
+ var billingTransactionSchema = z10.object({
3533
+ id: z10.string(),
3534
+ clinicGroupId: z10.string(),
3535
+ type: z10.nativeEnum(BillingTransactionType),
3536
+ description: z10.string(),
3537
+ amount: z10.number(),
3538
+ currency: z10.string(),
3539
+ stripeData: stripeTransactionDataSchema,
3540
+ planDetails: planDetailsSchema,
3541
+ metadata: z10.record(z10.any()).optional(),
3542
+ timestamp: z10.instanceof(Date).or(z10.instanceof(Timestamp6)),
3543
+ createdAt: z10.instanceof(Date).or(z10.instanceof(Timestamp6))
3544
+ });
3545
+ var createBillingTransactionSchema = z10.object({
3546
+ type: z10.nativeEnum(BillingTransactionType),
3547
+ description: z10.string(),
3548
+ amount: z10.number(),
3549
+ currency: z10.string(),
3550
+ stripeData: stripeTransactionDataSchema,
3551
+ planDetails: planDetailsSchema,
3552
+ metadata: z10.record(z10.any()).optional()
3553
+ });
3493
3554
  var createAdminTokenSchema = z10.object({
3494
3555
  expiresInDays: z10.number().min(1).max(30).optional(),
3495
3556
  email: z10.string().email().optional().nullable()
@@ -3516,6 +3577,7 @@ var clinicGroupSchema = z10.object({
3516
3577
  practiceType: z10.nativeEnum(PracticeType).optional(),
3517
3578
  languages: z10.array(z10.nativeEnum(Language)).optional(),
3518
3579
  subscriptionModel: z10.nativeEnum(SubscriptionModel),
3580
+ billing: billingInfoSchema.optional(),
3519
3581
  calendarSyncEnabled: z10.boolean().optional(),
3520
3582
  autoConfirmAppointments: z10.boolean().optional(),
3521
3583
  businessIdentificationNumber: z10.string().optional().nullable(),
@@ -3581,6 +3643,7 @@ var createClinicGroupSchema = z10.object({
3581
3643
  practiceType: z10.nativeEnum(PracticeType).optional(),
3582
3644
  languages: z10.array(z10.nativeEnum(Language)).optional(),
3583
3645
  subscriptionModel: z10.nativeEnum(SubscriptionModel).optional().default("no_subscription" /* NO_SUBSCRIPTION */),
3646
+ billing: billingInfoSchema.optional(),
3584
3647
  calendarSyncEnabled: z10.boolean().optional(),
3585
3648
  autoConfirmAppointments: z10.boolean().optional(),
3586
3649
  businessIdentificationNumber: z10.string().optional().nullable(),
@@ -18299,6 +18362,7 @@ export {
18299
18362
  AppointmentStatus,
18300
18363
  AuthService,
18301
18364
  BaseService,
18365
+ BillingTransactionType,
18302
18366
  BlockingCondition,
18303
18367
  BrandService,
18304
18368
  CALENDAR_COLLECTION,
@@ -18382,6 +18446,7 @@ export {
18382
18446
  SearchLocationEnum,
18383
18447
  SubcategoryService,
18384
18448
  SubscriptionModel,
18449
+ SubscriptionStatus,
18385
18450
  SyncedCalendarProvider,
18386
18451
  SyncedCalendarsService,
18387
18452
  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.4",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -174,6 +174,93 @@ export enum SubscriptionModel {
174
174
  ENTERPRISE = "enterprise",
175
175
  }
176
176
 
177
+ /**
178
+ * Enum for subscription status
179
+ */
180
+ export enum SubscriptionStatus {
181
+ ACTIVE = "active",
182
+ PENDING_CANCELLATION = "pending_cancellation",
183
+ CANCELED = "canceled",
184
+ PAST_DUE = "past_due",
185
+ TRIALING = "trialing",
186
+ }
187
+
188
+ /**
189
+ * Interface for billing information
190
+ */
191
+ export interface BillingInfo {
192
+ stripeCustomerId: string;
193
+ subscriptionStatus: SubscriptionStatus;
194
+ planType: string;
195
+ stripeSubscriptionId: string | null;
196
+ stripePriceId: string | null;
197
+ currentPeriodStart: Timestamp | null;
198
+ currentPeriodEnd: Timestamp | null;
199
+ updatedAt: Timestamp;
200
+ }
201
+
202
+ /**
203
+ * Enum for billing transaction types
204
+ */
205
+ export enum BillingTransactionType {
206
+ SUBSCRIPTION_ACTIVATED = "subscription_activated",
207
+ SUBSCRIPTION_RENEWED = "subscription_renewed",
208
+ SUBSCRIPTION_UPDATED = "subscription_updated",
209
+ SUBSCRIPTION_CANCELED = "subscription_canceled",
210
+ SUBSCRIPTION_REACTIVATED = "subscription_reactivated",
211
+ SUBSCRIPTION_DELETED = "subscription_deleted",
212
+ }
213
+
214
+ /**
215
+ * Interface for Stripe data in billing transactions
216
+ */
217
+ export interface StripeTransactionData {
218
+ sessionId?: string;
219
+ subscriptionId?: string;
220
+ invoiceId?: string;
221
+ priceId: string;
222
+ customerId: string;
223
+ }
224
+
225
+ /**
226
+ * Interface for plan details in billing transactions
227
+ */
228
+ export interface PlanDetails {
229
+ planName: string;
230
+ planPeriod: string;
231
+ planDisplayName: string;
232
+ }
233
+
234
+ /**
235
+ * Interface for billing transactions
236
+ */
237
+ export interface BillingTransaction {
238
+ id: string;
239
+ clinicGroupId: string;
240
+ type: BillingTransactionType;
241
+ description: string;
242
+ amount: number;
243
+ currency: string;
244
+ stripeData: StripeTransactionData;
245
+ planDetails: PlanDetails;
246
+ metadata?: Record<string, any>;
247
+ timestamp: Timestamp;
248
+ createdAt: Timestamp;
249
+ }
250
+
251
+ /**
252
+ * Interface for creating a billing transaction
253
+ */
254
+ export interface CreateBillingTransactionData {
255
+ type: BillingTransactionType;
256
+ description: string;
257
+ amount: number;
258
+ currency: string;
259
+ stripeData: StripeTransactionData;
260
+ planDetails: PlanDetails;
261
+ metadata?: Record<string, any>;
262
+ }
263
+
177
264
  /**
178
265
  * Interface for clinic group
179
266
  */
@@ -197,6 +284,7 @@ export interface ClinicGroup {
197
284
  practiceType?: PracticeType;
198
285
  languages?: Language[];
199
286
  subscriptionModel: SubscriptionModel;
287
+ billing?: BillingInfo;
200
288
  calendarSyncEnabled?: boolean;
201
289
  autoConfirmAppointments?: boolean;
202
290
  businessIdentificationNumber?: string | null;
@@ -221,6 +309,7 @@ export interface CreateClinicGroupData {
221
309
  practiceType?: PracticeType;
222
310
  languages?: Language[];
223
311
  subscriptionModel?: SubscriptionModel;
312
+ billing?: BillingInfo;
224
313
  calendarSyncEnabled?: boolean;
225
314
  autoConfirmAppointments?: boolean;
226
315
  businessIdentificationNumber?: string | null;
@@ -4,6 +4,8 @@ import {
4
4
  ClinicTag,
5
5
  AdminTokenStatus,
6
6
  SubscriptionModel,
7
+ SubscriptionStatus,
8
+ BillingTransactionType,
7
9
  PracticeType,
8
10
  Language,
9
11
  } from "../types/clinic";
@@ -145,6 +147,70 @@ export const adminTokenSchema = z.object({
145
147
  expiresAt: z.instanceof(Date).or(z.instanceof(Timestamp)), // Timestamp
146
148
  });
147
149
 
150
+ /**
151
+ * Validation schema for Stripe transaction data
152
+ */
153
+ export const stripeTransactionDataSchema = z.object({
154
+ sessionId: z.string().optional(),
155
+ subscriptionId: z.string().optional(),
156
+ invoiceId: z.string().optional(),
157
+ priceId: z.string(),
158
+ customerId: z.string(),
159
+ });
160
+
161
+ /**
162
+ * Validation schema for plan details
163
+ */
164
+ export const planDetailsSchema = z.object({
165
+ planName: z.string(),
166
+ planPeriod: z.string(),
167
+ planDisplayName: z.string(),
168
+ });
169
+
170
+ /**
171
+ * Validation schema for billing information
172
+ */
173
+ export const billingInfoSchema = z.object({
174
+ stripeCustomerId: z.string(),
175
+ subscriptionStatus: z.nativeEnum(SubscriptionStatus),
176
+ planType: z.string(),
177
+ stripeSubscriptionId: z.string().nullable(),
178
+ stripePriceId: z.string().nullable(),
179
+ currentPeriodStart: z.instanceof(Date).or(z.instanceof(Timestamp)).nullable(),
180
+ currentPeriodEnd: z.instanceof(Date).or(z.instanceof(Timestamp)).nullable(),
181
+ updatedAt: z.instanceof(Date).or(z.instanceof(Timestamp)),
182
+ });
183
+
184
+ /**
185
+ * Validation schema for billing transactions
186
+ */
187
+ export const billingTransactionSchema = z.object({
188
+ id: z.string(),
189
+ clinicGroupId: z.string(),
190
+ type: z.nativeEnum(BillingTransactionType),
191
+ description: z.string(),
192
+ amount: z.number(),
193
+ currency: z.string(),
194
+ stripeData: stripeTransactionDataSchema,
195
+ planDetails: planDetailsSchema,
196
+ metadata: z.record(z.any()).optional(),
197
+ timestamp: z.instanceof(Date).or(z.instanceof(Timestamp)),
198
+ createdAt: z.instanceof(Date).or(z.instanceof(Timestamp)),
199
+ });
200
+
201
+ /**
202
+ * Validation schema for creating billing transactions
203
+ */
204
+ export const createBillingTransactionSchema = z.object({
205
+ type: z.nativeEnum(BillingTransactionType),
206
+ description: z.string(),
207
+ amount: z.number(),
208
+ currency: z.string(),
209
+ stripeData: stripeTransactionDataSchema,
210
+ planDetails: planDetailsSchema,
211
+ metadata: z.record(z.any()).optional(),
212
+ });
213
+
148
214
  /**
149
215
  * Validaciona šema za kreiranje admin tokena
150
216
  */
@@ -176,6 +242,7 @@ export const clinicGroupSchema = z.object({
176
242
  practiceType: z.nativeEnum(PracticeType).optional(),
177
243
  languages: z.array(z.nativeEnum(Language)).optional(),
178
244
  subscriptionModel: z.nativeEnum(SubscriptionModel),
245
+ billing: billingInfoSchema.optional(),
179
246
  calendarSyncEnabled: z.boolean().optional(),
180
247
  autoConfirmAppointments: z.boolean().optional(),
181
248
  businessIdentificationNumber: z.string().optional().nullable(),
@@ -254,6 +321,7 @@ export const createClinicGroupSchema = z.object({
254
321
  .nativeEnum(SubscriptionModel)
255
322
  .optional()
256
323
  .default(SubscriptionModel.NO_SUBSCRIPTION),
324
+ billing: billingInfoSchema.optional(),
257
325
  calendarSyncEnabled: z.boolean().optional(),
258
326
  autoConfirmAppointments: z.boolean().optional(),
259
327
  businessIdentificationNumber: z.string().optional().nullable(),