@blackcode_sa/metaestetics-api 1.15.10 → 1.15.13
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 +3 -8
- package/dist/index.d.ts +3 -8
- package/dist/index.js +8 -25
- package/dist/index.mjs +8 -24
- package/package.json +1 -1
- package/src/config/tiers.config.ts +2 -5
- package/src/services/tier-enforcement.ts +8 -30
- package/src/types/clinic/rbac.types.ts +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -5353,7 +5353,6 @@ interface TierLimits {
|
|
|
5353
5353
|
maxProcedures: number;
|
|
5354
5354
|
maxAppointmentsPerMonth: number;
|
|
5355
5355
|
maxMessagesPerMonth: number;
|
|
5356
|
-
maxStaff: number;
|
|
5357
5356
|
maxBranches: number;
|
|
5358
5357
|
}
|
|
5359
5358
|
/**
|
|
@@ -9765,10 +9764,6 @@ declare function enforceProcedureLimit(db: Firestore, clinicGroupId: string, cou
|
|
|
9765
9764
|
* Enforces tier limit before creating a clinic branch.
|
|
9766
9765
|
*/
|
|
9767
9766
|
declare function enforceBranchLimit(db: Firestore, clinicGroupId: string): Promise<void>;
|
|
9768
|
-
/**
|
|
9769
|
-
* Enforces tier limit before creating a staff member.
|
|
9770
|
-
*/
|
|
9771
|
-
declare function enforceStaffLimit(db: Firestore, clinicGroupId: string): Promise<void>;
|
|
9772
9767
|
/**
|
|
9773
9768
|
* Enforces tier limit before creating an appointment.
|
|
9774
9769
|
* Reads the monthly counter from clinic_groups/{id}/usage_counters/{YYYY-MM}.
|
|
@@ -9838,8 +9833,8 @@ type PermissionKey = keyof typeof PERMISSION_KEYS;
|
|
|
9838
9833
|
* -1 means unlimited.
|
|
9839
9834
|
*
|
|
9840
9835
|
* Confirmed by client on 2026-03-10:
|
|
9841
|
-
* - Free: 1 provider, 3 procedures, 3 appts/mo, 10 msgs/mo, 1
|
|
9842
|
-
* - Connect (CHF 59/mo): unlimited providers, 15 procedures, 100 appts/mo, unlimited msgs,
|
|
9836
|
+
* - Free: 1 provider, 3 procedures, 3 appts/mo, 10 msgs/mo, 1 location
|
|
9837
|
+
* - Connect (CHF 59/mo): unlimited providers, 15 procedures, 100 appts/mo, unlimited msgs, 1 location
|
|
9843
9838
|
* - Pro (CHF 149/mo): unlimited everything
|
|
9844
9839
|
*/
|
|
9845
9840
|
declare const TIER_CONFIG: Record<string, TierConfig>;
|
|
@@ -9853,4 +9848,4 @@ declare const DEFAULT_ROLE_PERMISSIONS: Record<ClinicRole, Record<string, boolea
|
|
|
9853
9848
|
*/
|
|
9854
9849
|
declare function resolveEffectiveTier(subscriptionModel: string): string;
|
|
9855
9850
|
|
|
9856
|
-
export { AESTHETIC_ANALYSIS_COLLECTION, ANALYTICS_COLLECTION, APPOINTMENTS_COLLECTION, type ASAClassification, AcquisitionSource, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type AestheticAnalysis, type AestheticAnalysisStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, AnalyticsCloudService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, AnalyticsService, type AnesthesiaHistory, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, type AppointmentRescheduledReminderNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AppointmentTrend, type AssessmentScales, AuthService, BODY_ASSESSMENT_COLLECTION, type BaseDocumentElement, type BaseMetrics, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, type BleedingRisk, type BleedingRiskLevel, BlockingCondition, type BodyAssessment, type BodyAssessmentStatus, type BodyCompositionData, type BodyMeasurementsData, type BodySymmetryData, type BodyZone, type BodyZoneAssessment, type Brand, BrandService, type Break, CALENDAR_COLLECTION, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type ClearanceStatus, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicAnalytics, type ClinicBranchSetupData, type ClinicComparisonMetrics, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicRole, ClinicService, type ClinicStaffMember, ClinicTag, type ClinicTags, type ClinicalFindingDetail, type ClinicalFindings, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CostPerPatientMetrics, type CreateAdminTokenData, type CreateAestheticAnalysisData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBillingTransactionData, type CreateBlockingEventParams, type CreateBodyAssessmentData, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateHairScalpAssessmentData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreatePreSurgicalAssessmentData, type CreateProcedureData, type CreateSkinQualityAssessmentData, type CreateSyncedCalendarData, type CreateUserData, Currency, DASHBOARD_ANALYTICS_SUBCOLLECTION, DEFAULT_MEDICAL_INFO, DEFAULT_ROLE_PERMISSIONS, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DashboardAnalytics, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DurationTrend, type DynamicTextElement, DynamicVariable, type ElastosisGrade, type EmergencyContact, type EntityType, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, type FitzpatrickType, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type GlogauClassification, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, HAIR_SCALP_ASSESSMENT_COLLECTION, type HairCharacteristics, type HairColor, type HairDensity, type HairLossPattern, type HairLossType, type HairLossZone, type HairLossZoneAssessment, type HairScalpAssessment, type HairScalpAssessmentStatus, type HairTextureGrade, type HairType, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, type LabResult, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, type LudwigStage, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, type MuscleDefinitionLevel, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NextStepsRecommendation, type NoShowMetrics, type NorwoodStage, type Notification, NotificationService, NotificationStatus, NotificationType, type OverallReviewAverages, 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, PERMISSION_KEYS, PRACTITIONERS_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PRACTITIONER_INVITES_COLLECTION, PRE_SURGICAL_ASSESSMENT_COLLECTION, PROCEDURES_COLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type ParagraphElement, type PatientAnalytics, type PatientClinic, type PatientDoctor, type PatientGoals, PatientInstructionStatus, type PatientLifetimeValueMetrics, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientRetentionMetrics, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PaymentStatusBreakdown, type PermissionKey, type PlanDetails, type PoreSizeLevel, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerAnalytics, 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, type PreSurgicalAssessment, type PreSurgicalAssessmentStatus, PricingMeasure, type Procedure, type ProcedureAnalytics, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedurePopularity, type ProcedureProduct, type ProcedureProfitability, type ProcedureRecommendationNotification, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, type ProductRevenueMetrics, ProductService, type ProductUsageByProcedure, type ProductUsageMetrics, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVENUE_ANALYTICS_SUBCOLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type ReadStoredAnalyticsOptions, type RecommendedProcedure, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, type RequirementSourceProcedure, RequirementType, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAnalyticsMetrics, ReviewAnalyticsService, type ReviewDetail, type ReviewMetrics, type ReviewRequestNotification, ReviewService, type ReviewTrend, type RolePermissionConfig, SKIN_QUALITY_ASSESSMENT_COLLECTION, SYNCED_CALENDARS_COLLECTION, type ScalpCondition, type ScalpRednessLevel, type ScalpScalinessLevel, type ScalpSebumLevel, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SeverityLevel, type SignatureElement, type SingleChoiceElement, type SkinCharacteristics, type SkinConditionEntry, type SkinConditionType, type SkinElasticityLevel, type SkinHydrationLevel, type SkinQualityAssessment, type SkinQualityAssessmentStatus, type SkinQualityScales, type SkinSensitivityLevel, type SkinTextureLevel, type SkinZone, type SkinZoneAssessment, type SmokingStatus, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SurgicalSiteAssessment, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, TIER_CONFIG, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TierConfig, TierLimitError, type TierLimits, type TimeEfficiencyMetrics, type TimeSlot, TimeUnit, type TissueQualityLevel, TreatmentBenefit, type TreatmentBenefitDynamic, type TrendPeriod, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateBodyAssessmentData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateHairScalpAssessmentData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdatePreSurgicalAssessmentData, type UpdateProcedureData, type UpdateSkinQualityAssessmentData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, type ZoneItemData, type ZonePhotoUploadData, enforceAppointmentLimit, enforceBranchLimit, enforceMessageLimit, enforceProcedureLimit, enforceProviderLimit, enforceStaffLimit, getEffectiveTier, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase, resolveEffectiveTier };
|
|
9851
|
+
export { AESTHETIC_ANALYSIS_COLLECTION, ANALYTICS_COLLECTION, APPOINTMENTS_COLLECTION, type ASAClassification, AcquisitionSource, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type AestheticAnalysis, type AestheticAnalysisStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, AnalyticsCloudService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, AnalyticsService, type AnesthesiaHistory, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, type AppointmentRescheduledReminderNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AppointmentTrend, type AssessmentScales, AuthService, BODY_ASSESSMENT_COLLECTION, type BaseDocumentElement, type BaseMetrics, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, type BleedingRisk, type BleedingRiskLevel, BlockingCondition, type BodyAssessment, type BodyAssessmentStatus, type BodyCompositionData, type BodyMeasurementsData, type BodySymmetryData, type BodyZone, type BodyZoneAssessment, type Brand, BrandService, type Break, CALENDAR_COLLECTION, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type ClearanceStatus, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicAnalytics, type ClinicBranchSetupData, type ClinicComparisonMetrics, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicRole, ClinicService, type ClinicStaffMember, ClinicTag, type ClinicTags, type ClinicalFindingDetail, type ClinicalFindings, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CostPerPatientMetrics, type CreateAdminTokenData, type CreateAestheticAnalysisData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBillingTransactionData, type CreateBlockingEventParams, type CreateBodyAssessmentData, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateHairScalpAssessmentData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreatePreSurgicalAssessmentData, type CreateProcedureData, type CreateSkinQualityAssessmentData, type CreateSyncedCalendarData, type CreateUserData, Currency, DASHBOARD_ANALYTICS_SUBCOLLECTION, DEFAULT_MEDICAL_INFO, DEFAULT_ROLE_PERMISSIONS, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DashboardAnalytics, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DurationTrend, type DynamicTextElement, DynamicVariable, type ElastosisGrade, type EmergencyContact, type EntityType, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, type FitzpatrickType, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type GlogauClassification, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, HAIR_SCALP_ASSESSMENT_COLLECTION, type HairCharacteristics, type HairColor, type HairDensity, type HairLossPattern, type HairLossType, type HairLossZone, type HairLossZoneAssessment, type HairScalpAssessment, type HairScalpAssessmentStatus, type HairTextureGrade, type HairType, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, type LabResult, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, type LudwigStage, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, type MuscleDefinitionLevel, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NextStepsRecommendation, type NoShowMetrics, type NorwoodStage, type Notification, NotificationService, NotificationStatus, NotificationType, type OverallReviewAverages, 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, PERMISSION_KEYS, PRACTITIONERS_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PRACTITIONER_INVITES_COLLECTION, PRE_SURGICAL_ASSESSMENT_COLLECTION, PROCEDURES_COLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type ParagraphElement, type PatientAnalytics, type PatientClinic, type PatientDoctor, type PatientGoals, PatientInstructionStatus, type PatientLifetimeValueMetrics, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientRetentionMetrics, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PaymentStatusBreakdown, type PermissionKey, type PlanDetails, type PoreSizeLevel, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerAnalytics, 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, type PreSurgicalAssessment, type PreSurgicalAssessmentStatus, PricingMeasure, type Procedure, type ProcedureAnalytics, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedurePopularity, type ProcedureProduct, type ProcedureProfitability, type ProcedureRecommendationNotification, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, type ProductRevenueMetrics, ProductService, type ProductUsageByProcedure, type ProductUsageMetrics, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVENUE_ANALYTICS_SUBCOLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type ReadStoredAnalyticsOptions, type RecommendedProcedure, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, type RequirementSourceProcedure, RequirementType, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAnalyticsMetrics, ReviewAnalyticsService, type ReviewDetail, type ReviewMetrics, type ReviewRequestNotification, ReviewService, type ReviewTrend, type RolePermissionConfig, SKIN_QUALITY_ASSESSMENT_COLLECTION, SYNCED_CALENDARS_COLLECTION, type ScalpCondition, type ScalpRednessLevel, type ScalpScalinessLevel, type ScalpSebumLevel, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SeverityLevel, type SignatureElement, type SingleChoiceElement, type SkinCharacteristics, type SkinConditionEntry, type SkinConditionType, type SkinElasticityLevel, type SkinHydrationLevel, type SkinQualityAssessment, type SkinQualityAssessmentStatus, type SkinQualityScales, type SkinSensitivityLevel, type SkinTextureLevel, type SkinZone, type SkinZoneAssessment, type SmokingStatus, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SurgicalSiteAssessment, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, TIER_CONFIG, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TierConfig, TierLimitError, type TierLimits, type TimeEfficiencyMetrics, type TimeSlot, TimeUnit, type TissueQualityLevel, TreatmentBenefit, type TreatmentBenefitDynamic, type TrendPeriod, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateBodyAssessmentData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateHairScalpAssessmentData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdatePreSurgicalAssessmentData, type UpdateProcedureData, type UpdateSkinQualityAssessmentData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, type ZoneItemData, type ZonePhotoUploadData, enforceAppointmentLimit, enforceBranchLimit, enforceMessageLimit, enforceProcedureLimit, enforceProviderLimit, getEffectiveTier, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase, resolveEffectiveTier };
|
package/dist/index.d.ts
CHANGED
|
@@ -5353,7 +5353,6 @@ interface TierLimits {
|
|
|
5353
5353
|
maxProcedures: number;
|
|
5354
5354
|
maxAppointmentsPerMonth: number;
|
|
5355
5355
|
maxMessagesPerMonth: number;
|
|
5356
|
-
maxStaff: number;
|
|
5357
5356
|
maxBranches: number;
|
|
5358
5357
|
}
|
|
5359
5358
|
/**
|
|
@@ -9765,10 +9764,6 @@ declare function enforceProcedureLimit(db: Firestore, clinicGroupId: string, cou
|
|
|
9765
9764
|
* Enforces tier limit before creating a clinic branch.
|
|
9766
9765
|
*/
|
|
9767
9766
|
declare function enforceBranchLimit(db: Firestore, clinicGroupId: string): Promise<void>;
|
|
9768
|
-
/**
|
|
9769
|
-
* Enforces tier limit before creating a staff member.
|
|
9770
|
-
*/
|
|
9771
|
-
declare function enforceStaffLimit(db: Firestore, clinicGroupId: string): Promise<void>;
|
|
9772
9767
|
/**
|
|
9773
9768
|
* Enforces tier limit before creating an appointment.
|
|
9774
9769
|
* Reads the monthly counter from clinic_groups/{id}/usage_counters/{YYYY-MM}.
|
|
@@ -9838,8 +9833,8 @@ type PermissionKey = keyof typeof PERMISSION_KEYS;
|
|
|
9838
9833
|
* -1 means unlimited.
|
|
9839
9834
|
*
|
|
9840
9835
|
* Confirmed by client on 2026-03-10:
|
|
9841
|
-
* - Free: 1 provider, 3 procedures, 3 appts/mo, 10 msgs/mo, 1
|
|
9842
|
-
* - Connect (CHF 59/mo): unlimited providers, 15 procedures, 100 appts/mo, unlimited msgs,
|
|
9836
|
+
* - Free: 1 provider, 3 procedures, 3 appts/mo, 10 msgs/mo, 1 location
|
|
9837
|
+
* - Connect (CHF 59/mo): unlimited providers, 15 procedures, 100 appts/mo, unlimited msgs, 1 location
|
|
9843
9838
|
* - Pro (CHF 149/mo): unlimited everything
|
|
9844
9839
|
*/
|
|
9845
9840
|
declare const TIER_CONFIG: Record<string, TierConfig>;
|
|
@@ -9853,4 +9848,4 @@ declare const DEFAULT_ROLE_PERMISSIONS: Record<ClinicRole, Record<string, boolea
|
|
|
9853
9848
|
*/
|
|
9854
9849
|
declare function resolveEffectiveTier(subscriptionModel: string): string;
|
|
9855
9850
|
|
|
9856
|
-
export { AESTHETIC_ANALYSIS_COLLECTION, ANALYTICS_COLLECTION, APPOINTMENTS_COLLECTION, type ASAClassification, AcquisitionSource, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type AestheticAnalysis, type AestheticAnalysisStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, AnalyticsCloudService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, AnalyticsService, type AnesthesiaHistory, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, type AppointmentRescheduledReminderNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AppointmentTrend, type AssessmentScales, AuthService, BODY_ASSESSMENT_COLLECTION, type BaseDocumentElement, type BaseMetrics, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, type BleedingRisk, type BleedingRiskLevel, BlockingCondition, type BodyAssessment, type BodyAssessmentStatus, type BodyCompositionData, type BodyMeasurementsData, type BodySymmetryData, type BodyZone, type BodyZoneAssessment, type Brand, BrandService, type Break, CALENDAR_COLLECTION, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type ClearanceStatus, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicAnalytics, type ClinicBranchSetupData, type ClinicComparisonMetrics, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicRole, ClinicService, type ClinicStaffMember, ClinicTag, type ClinicTags, type ClinicalFindingDetail, type ClinicalFindings, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CostPerPatientMetrics, type CreateAdminTokenData, type CreateAestheticAnalysisData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBillingTransactionData, type CreateBlockingEventParams, type CreateBodyAssessmentData, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateHairScalpAssessmentData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreatePreSurgicalAssessmentData, type CreateProcedureData, type CreateSkinQualityAssessmentData, type CreateSyncedCalendarData, type CreateUserData, Currency, DASHBOARD_ANALYTICS_SUBCOLLECTION, DEFAULT_MEDICAL_INFO, DEFAULT_ROLE_PERMISSIONS, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DashboardAnalytics, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DurationTrend, type DynamicTextElement, DynamicVariable, type ElastosisGrade, type EmergencyContact, type EntityType, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, type FitzpatrickType, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type GlogauClassification, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, HAIR_SCALP_ASSESSMENT_COLLECTION, type HairCharacteristics, type HairColor, type HairDensity, type HairLossPattern, type HairLossType, type HairLossZone, type HairLossZoneAssessment, type HairScalpAssessment, type HairScalpAssessmentStatus, type HairTextureGrade, type HairType, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, type LabResult, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, type LudwigStage, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, type MuscleDefinitionLevel, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NextStepsRecommendation, type NoShowMetrics, type NorwoodStage, type Notification, NotificationService, NotificationStatus, NotificationType, type OverallReviewAverages, 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, PERMISSION_KEYS, PRACTITIONERS_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PRACTITIONER_INVITES_COLLECTION, PRE_SURGICAL_ASSESSMENT_COLLECTION, PROCEDURES_COLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type ParagraphElement, type PatientAnalytics, type PatientClinic, type PatientDoctor, type PatientGoals, PatientInstructionStatus, type PatientLifetimeValueMetrics, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientRetentionMetrics, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PaymentStatusBreakdown, type PermissionKey, type PlanDetails, type PoreSizeLevel, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerAnalytics, 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, type PreSurgicalAssessment, type PreSurgicalAssessmentStatus, PricingMeasure, type Procedure, type ProcedureAnalytics, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedurePopularity, type ProcedureProduct, type ProcedureProfitability, type ProcedureRecommendationNotification, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, type ProductRevenueMetrics, ProductService, type ProductUsageByProcedure, type ProductUsageMetrics, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVENUE_ANALYTICS_SUBCOLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type ReadStoredAnalyticsOptions, type RecommendedProcedure, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, type RequirementSourceProcedure, RequirementType, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAnalyticsMetrics, ReviewAnalyticsService, type ReviewDetail, type ReviewMetrics, type ReviewRequestNotification, ReviewService, type ReviewTrend, type RolePermissionConfig, SKIN_QUALITY_ASSESSMENT_COLLECTION, SYNCED_CALENDARS_COLLECTION, type ScalpCondition, type ScalpRednessLevel, type ScalpScalinessLevel, type ScalpSebumLevel, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SeverityLevel, type SignatureElement, type SingleChoiceElement, type SkinCharacteristics, type SkinConditionEntry, type SkinConditionType, type SkinElasticityLevel, type SkinHydrationLevel, type SkinQualityAssessment, type SkinQualityAssessmentStatus, type SkinQualityScales, type SkinSensitivityLevel, type SkinTextureLevel, type SkinZone, type SkinZoneAssessment, type SmokingStatus, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SurgicalSiteAssessment, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, TIER_CONFIG, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TierConfig, TierLimitError, type TierLimits, type TimeEfficiencyMetrics, type TimeSlot, TimeUnit, type TissueQualityLevel, TreatmentBenefit, type TreatmentBenefitDynamic, type TrendPeriod, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateBodyAssessmentData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateHairScalpAssessmentData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdatePreSurgicalAssessmentData, type UpdateProcedureData, type UpdateSkinQualityAssessmentData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, type ZoneItemData, type ZonePhotoUploadData, enforceAppointmentLimit, enforceBranchLimit, enforceMessageLimit, enforceProcedureLimit, enforceProviderLimit, enforceStaffLimit, getEffectiveTier, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase, resolveEffectiveTier };
|
|
9851
|
+
export { AESTHETIC_ANALYSIS_COLLECTION, ANALYTICS_COLLECTION, APPOINTMENTS_COLLECTION, type ASAClassification, AcquisitionSource, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type AestheticAnalysis, type AestheticAnalysisStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, AnalyticsCloudService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, AnalyticsService, type AnesthesiaHistory, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, type AppointmentRescheduledReminderNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AppointmentTrend, type AssessmentScales, AuthService, BODY_ASSESSMENT_COLLECTION, type BaseDocumentElement, type BaseMetrics, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, type BleedingRisk, type BleedingRiskLevel, BlockingCondition, type BodyAssessment, type BodyAssessmentStatus, type BodyCompositionData, type BodyMeasurementsData, type BodySymmetryData, type BodyZone, type BodyZoneAssessment, type Brand, BrandService, type Break, CALENDAR_COLLECTION, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type ClearanceStatus, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicAnalytics, type ClinicBranchSetupData, type ClinicComparisonMetrics, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicRole, ClinicService, type ClinicStaffMember, ClinicTag, type ClinicTags, type ClinicalFindingDetail, type ClinicalFindings, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CostPerPatientMetrics, type CreateAdminTokenData, type CreateAestheticAnalysisData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBillingTransactionData, type CreateBlockingEventParams, type CreateBodyAssessmentData, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateHairScalpAssessmentData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreatePreSurgicalAssessmentData, type CreateProcedureData, type CreateSkinQualityAssessmentData, type CreateSyncedCalendarData, type CreateUserData, Currency, DASHBOARD_ANALYTICS_SUBCOLLECTION, DEFAULT_MEDICAL_INFO, DEFAULT_ROLE_PERMISSIONS, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DashboardAnalytics, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DurationTrend, type DynamicTextElement, DynamicVariable, type ElastosisGrade, type EmergencyContact, type EntityType, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, type FitzpatrickType, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type GlogauClassification, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, HAIR_SCALP_ASSESSMENT_COLLECTION, type HairCharacteristics, type HairColor, type HairDensity, type HairLossPattern, type HairLossType, type HairLossZone, type HairLossZoneAssessment, type HairScalpAssessment, type HairScalpAssessmentStatus, type HairTextureGrade, type HairType, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, type LabResult, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, type LudwigStage, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, type MuscleDefinitionLevel, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NextStepsRecommendation, type NoShowMetrics, type NorwoodStage, type Notification, NotificationService, NotificationStatus, NotificationType, type OverallReviewAverages, 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, PERMISSION_KEYS, PRACTITIONERS_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PRACTITIONER_INVITES_COLLECTION, PRE_SURGICAL_ASSESSMENT_COLLECTION, PROCEDURES_COLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type ParagraphElement, type PatientAnalytics, type PatientClinic, type PatientDoctor, type PatientGoals, PatientInstructionStatus, type PatientLifetimeValueMetrics, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientRetentionMetrics, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PaymentStatusBreakdown, type PermissionKey, type PlanDetails, type PoreSizeLevel, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerAnalytics, 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, type PreSurgicalAssessment, type PreSurgicalAssessmentStatus, PricingMeasure, type Procedure, type ProcedureAnalytics, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedurePopularity, type ProcedureProduct, type ProcedureProfitability, type ProcedureRecommendationNotification, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, type ProductRevenueMetrics, ProductService, type ProductUsageByProcedure, type ProductUsageMetrics, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVENUE_ANALYTICS_SUBCOLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type ReadStoredAnalyticsOptions, type RecommendedProcedure, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, type RequirementSourceProcedure, RequirementType, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAnalyticsMetrics, ReviewAnalyticsService, type ReviewDetail, type ReviewMetrics, type ReviewRequestNotification, ReviewService, type ReviewTrend, type RolePermissionConfig, SKIN_QUALITY_ASSESSMENT_COLLECTION, SYNCED_CALENDARS_COLLECTION, type ScalpCondition, type ScalpRednessLevel, type ScalpScalinessLevel, type ScalpSebumLevel, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SeverityLevel, type SignatureElement, type SingleChoiceElement, type SkinCharacteristics, type SkinConditionEntry, type SkinConditionType, type SkinElasticityLevel, type SkinHydrationLevel, type SkinQualityAssessment, type SkinQualityAssessmentStatus, type SkinQualityScales, type SkinSensitivityLevel, type SkinTextureLevel, type SkinZone, type SkinZoneAssessment, type SmokingStatus, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SurgicalSiteAssessment, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, TIER_CONFIG, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TierConfig, TierLimitError, type TierLimits, type TimeEfficiencyMetrics, type TimeSlot, TimeUnit, type TissueQualityLevel, TreatmentBenefit, type TreatmentBenefitDynamic, type TrendPeriod, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateBodyAssessmentData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateHairScalpAssessmentData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdatePreSurgicalAssessmentData, type UpdateProcedureData, type UpdateSkinQualityAssessmentData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, type ZoneItemData, type ZonePhotoUploadData, enforceAppointmentLimit, enforceBranchLimit, enforceMessageLimit, enforceProcedureLimit, enforceProviderLimit, getEffectiveTier, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase, resolveEffectiveTier };
|
package/dist/index.js
CHANGED
|
@@ -160,7 +160,6 @@ __export(index_exports, {
|
|
|
160
160
|
enforceMessageLimit: () => enforceMessageLimit,
|
|
161
161
|
enforceProcedureLimit: () => enforceProcedureLimit,
|
|
162
162
|
enforceProviderLimit: () => enforceProviderLimit,
|
|
163
|
-
enforceStaffLimit: () => enforceStaffLimit,
|
|
164
163
|
getEffectiveTier: () => getEffectiveTier,
|
|
165
164
|
getFirebaseApp: () => getFirebaseApp,
|
|
166
165
|
getFirebaseAuth: () => getFirebaseAuth,
|
|
@@ -12741,7 +12740,6 @@ var TIER_CONFIG = {
|
|
|
12741
12740
|
maxProcedures: 3,
|
|
12742
12741
|
maxAppointmentsPerMonth: 3,
|
|
12743
12742
|
maxMessagesPerMonth: 10,
|
|
12744
|
-
maxStaff: 1,
|
|
12745
12743
|
maxBranches: 1
|
|
12746
12744
|
}
|
|
12747
12745
|
},
|
|
@@ -12753,7 +12751,6 @@ var TIER_CONFIG = {
|
|
|
12753
12751
|
maxProcedures: 15,
|
|
12754
12752
|
maxAppointmentsPerMonth: 100,
|
|
12755
12753
|
maxMessagesPerMonth: -1,
|
|
12756
|
-
maxStaff: 5,
|
|
12757
12754
|
maxBranches: 1
|
|
12758
12755
|
}
|
|
12759
12756
|
},
|
|
@@ -12765,7 +12762,6 @@ var TIER_CONFIG = {
|
|
|
12765
12762
|
maxProcedures: -1,
|
|
12766
12763
|
maxAppointmentsPerMonth: -1,
|
|
12767
12764
|
maxMessagesPerMonth: -1,
|
|
12768
|
-
maxStaff: -1,
|
|
12769
12765
|
maxBranches: -1
|
|
12770
12766
|
}
|
|
12771
12767
|
}
|
|
@@ -12948,7 +12944,7 @@ async function countProceduresInGroup(db, clinicGroupId) {
|
|
|
12948
12944
|
const clinicsSnap = await (0, import_firestore35.getDocs)(clinicsQuery);
|
|
12949
12945
|
const clinicIds = clinicsSnap.docs.map((d) => d.id);
|
|
12950
12946
|
if (clinicIds.length === 0) return 0;
|
|
12951
|
-
|
|
12947
|
+
const uniqueTechnologyIds = /* @__PURE__ */ new Set();
|
|
12952
12948
|
for (let i = 0; i < clinicIds.length; i += 30) {
|
|
12953
12949
|
const batch = clinicIds.slice(i, i + 30);
|
|
12954
12950
|
const proceduresQuery = (0, import_firestore35.query)(
|
|
@@ -12957,9 +12953,14 @@ async function countProceduresInGroup(db, clinicGroupId) {
|
|
|
12957
12953
|
(0, import_firestore35.where)("isActive", "==", true)
|
|
12958
12954
|
);
|
|
12959
12955
|
const proceduresSnap = await (0, import_firestore35.getDocs)(proceduresQuery);
|
|
12960
|
-
|
|
12956
|
+
proceduresSnap.docs.forEach((d) => {
|
|
12957
|
+
const technologyId = d.data().technologyId;
|
|
12958
|
+
if (technologyId) {
|
|
12959
|
+
uniqueTechnologyIds.add(technologyId);
|
|
12960
|
+
}
|
|
12961
|
+
});
|
|
12961
12962
|
}
|
|
12962
|
-
return
|
|
12963
|
+
return uniqueTechnologyIds.size;
|
|
12963
12964
|
}
|
|
12964
12965
|
async function countBranchesInGroup(db, clinicGroupId) {
|
|
12965
12966
|
const clinicsQuery = (0, import_firestore35.query)(
|
|
@@ -13003,23 +13004,6 @@ async function enforceBranchLimit(db, clinicGroupId) {
|
|
|
13003
13004
|
throw new TierLimitError("clinic branches", tier, currentCount, max);
|
|
13004
13005
|
}
|
|
13005
13006
|
}
|
|
13006
|
-
async function enforceStaffLimit(db, clinicGroupId) {
|
|
13007
|
-
const tier = await getEffectiveTier(db, clinicGroupId);
|
|
13008
|
-
const config = TIER_CONFIG[tier];
|
|
13009
|
-
if (!config) return;
|
|
13010
|
-
const max = config.limits.maxStaff;
|
|
13011
|
-
if (max === -1) return;
|
|
13012
|
-
const staffQuery = (0, import_firestore35.query)(
|
|
13013
|
-
(0, import_firestore35.collection)(db, "clinic_staff_members"),
|
|
13014
|
-
(0, import_firestore35.where)("clinicGroupId", "==", clinicGroupId),
|
|
13015
|
-
(0, import_firestore35.where)("isActive", "==", true)
|
|
13016
|
-
);
|
|
13017
|
-
const staffSnap = await (0, import_firestore35.getDocs)(staffQuery);
|
|
13018
|
-
const currentCount = staffSnap.size;
|
|
13019
|
-
if (currentCount + 1 > max) {
|
|
13020
|
-
throw new TierLimitError("staff members", tier, currentCount, max);
|
|
13021
|
-
}
|
|
13022
|
-
}
|
|
13023
13007
|
async function enforceAppointmentLimit(db, clinicGroupId) {
|
|
13024
13008
|
var _a;
|
|
13025
13009
|
const tier = await getEffectiveTier(db, clinicGroupId);
|
|
@@ -28072,7 +28056,6 @@ var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
|
|
|
28072
28056
|
enforceMessageLimit,
|
|
28073
28057
|
enforceProcedureLimit,
|
|
28074
28058
|
enforceProviderLimit,
|
|
28075
|
-
enforceStaffLimit,
|
|
28076
28059
|
getEffectiveTier,
|
|
28077
28060
|
getFirebaseApp,
|
|
28078
28061
|
getFirebaseAuth,
|
package/dist/index.mjs
CHANGED
|
@@ -12756,7 +12756,6 @@ var TIER_CONFIG = {
|
|
|
12756
12756
|
maxProcedures: 3,
|
|
12757
12757
|
maxAppointmentsPerMonth: 3,
|
|
12758
12758
|
maxMessagesPerMonth: 10,
|
|
12759
|
-
maxStaff: 1,
|
|
12760
12759
|
maxBranches: 1
|
|
12761
12760
|
}
|
|
12762
12761
|
},
|
|
@@ -12768,7 +12767,6 @@ var TIER_CONFIG = {
|
|
|
12768
12767
|
maxProcedures: 15,
|
|
12769
12768
|
maxAppointmentsPerMonth: 100,
|
|
12770
12769
|
maxMessagesPerMonth: -1,
|
|
12771
|
-
maxStaff: 5,
|
|
12772
12770
|
maxBranches: 1
|
|
12773
12771
|
}
|
|
12774
12772
|
},
|
|
@@ -12780,7 +12778,6 @@ var TIER_CONFIG = {
|
|
|
12780
12778
|
maxProcedures: -1,
|
|
12781
12779
|
maxAppointmentsPerMonth: -1,
|
|
12782
12780
|
maxMessagesPerMonth: -1,
|
|
12783
|
-
maxStaff: -1,
|
|
12784
12781
|
maxBranches: -1
|
|
12785
12782
|
}
|
|
12786
12783
|
}
|
|
@@ -12963,7 +12960,7 @@ async function countProceduresInGroup(db, clinicGroupId) {
|
|
|
12963
12960
|
const clinicsSnap = await getDocs13(clinicsQuery);
|
|
12964
12961
|
const clinicIds = clinicsSnap.docs.map((d) => d.id);
|
|
12965
12962
|
if (clinicIds.length === 0) return 0;
|
|
12966
|
-
|
|
12963
|
+
const uniqueTechnologyIds = /* @__PURE__ */ new Set();
|
|
12967
12964
|
for (let i = 0; i < clinicIds.length; i += 30) {
|
|
12968
12965
|
const batch = clinicIds.slice(i, i + 30);
|
|
12969
12966
|
const proceduresQuery = query13(
|
|
@@ -12972,9 +12969,14 @@ async function countProceduresInGroup(db, clinicGroupId) {
|
|
|
12972
12969
|
where13("isActive", "==", true)
|
|
12973
12970
|
);
|
|
12974
12971
|
const proceduresSnap = await getDocs13(proceduresQuery);
|
|
12975
|
-
|
|
12972
|
+
proceduresSnap.docs.forEach((d) => {
|
|
12973
|
+
const technologyId = d.data().technologyId;
|
|
12974
|
+
if (technologyId) {
|
|
12975
|
+
uniqueTechnologyIds.add(technologyId);
|
|
12976
|
+
}
|
|
12977
|
+
});
|
|
12976
12978
|
}
|
|
12977
|
-
return
|
|
12979
|
+
return uniqueTechnologyIds.size;
|
|
12978
12980
|
}
|
|
12979
12981
|
async function countBranchesInGroup(db, clinicGroupId) {
|
|
12980
12982
|
const clinicsQuery = query13(
|
|
@@ -13018,23 +13020,6 @@ async function enforceBranchLimit(db, clinicGroupId) {
|
|
|
13018
13020
|
throw new TierLimitError("clinic branches", tier, currentCount, max);
|
|
13019
13021
|
}
|
|
13020
13022
|
}
|
|
13021
|
-
async function enforceStaffLimit(db, clinicGroupId) {
|
|
13022
|
-
const tier = await getEffectiveTier(db, clinicGroupId);
|
|
13023
|
-
const config = TIER_CONFIG[tier];
|
|
13024
|
-
if (!config) return;
|
|
13025
|
-
const max = config.limits.maxStaff;
|
|
13026
|
-
if (max === -1) return;
|
|
13027
|
-
const staffQuery = query13(
|
|
13028
|
-
collection13(db, "clinic_staff_members"),
|
|
13029
|
-
where13("clinicGroupId", "==", clinicGroupId),
|
|
13030
|
-
where13("isActive", "==", true)
|
|
13031
|
-
);
|
|
13032
|
-
const staffSnap = await getDocs13(staffQuery);
|
|
13033
|
-
const currentCount = staffSnap.size;
|
|
13034
|
-
if (currentCount + 1 > max) {
|
|
13035
|
-
throw new TierLimitError("staff members", tier, currentCount, max);
|
|
13036
|
-
}
|
|
13037
|
-
}
|
|
13038
13023
|
async function enforceAppointmentLimit(db, clinicGroupId) {
|
|
13039
13024
|
var _a;
|
|
13040
13025
|
const tier = await getEffectiveTier(db, clinicGroupId);
|
|
@@ -28388,7 +28373,6 @@ export {
|
|
|
28388
28373
|
enforceMessageLimit,
|
|
28389
28374
|
enforceProcedureLimit,
|
|
28390
28375
|
enforceProviderLimit,
|
|
28391
|
-
enforceStaffLimit,
|
|
28392
28376
|
getEffectiveTier,
|
|
28393
28377
|
getFirebaseApp,
|
|
28394
28378
|
getFirebaseAuth,
|
package/package.json
CHANGED
|
@@ -54,8 +54,8 @@ export type PermissionKey = keyof typeof PERMISSION_KEYS;
|
|
|
54
54
|
* -1 means unlimited.
|
|
55
55
|
*
|
|
56
56
|
* Confirmed by client on 2026-03-10:
|
|
57
|
-
* - Free: 1 provider, 3 procedures, 3 appts/mo, 10 msgs/mo, 1
|
|
58
|
-
* - Connect (CHF 59/mo): unlimited providers, 15 procedures, 100 appts/mo, unlimited msgs,
|
|
57
|
+
* - Free: 1 provider, 3 procedures, 3 appts/mo, 10 msgs/mo, 1 location
|
|
58
|
+
* - Connect (CHF 59/mo): unlimited providers, 15 procedures, 100 appts/mo, unlimited msgs, 1 location
|
|
59
59
|
* - Pro (CHF 149/mo): unlimited everything
|
|
60
60
|
*/
|
|
61
61
|
export const TIER_CONFIG: Record<string, TierConfig> = {
|
|
@@ -67,7 +67,6 @@ export const TIER_CONFIG: Record<string, TierConfig> = {
|
|
|
67
67
|
maxProcedures: 3,
|
|
68
68
|
maxAppointmentsPerMonth: 3,
|
|
69
69
|
maxMessagesPerMonth: 10,
|
|
70
|
-
maxStaff: 1,
|
|
71
70
|
maxBranches: 1,
|
|
72
71
|
},
|
|
73
72
|
},
|
|
@@ -79,7 +78,6 @@ export const TIER_CONFIG: Record<string, TierConfig> = {
|
|
|
79
78
|
maxProcedures: 15,
|
|
80
79
|
maxAppointmentsPerMonth: 100,
|
|
81
80
|
maxMessagesPerMonth: -1,
|
|
82
|
-
maxStaff: 5,
|
|
83
81
|
maxBranches: 1,
|
|
84
82
|
},
|
|
85
83
|
},
|
|
@@ -91,7 +89,6 @@ export const TIER_CONFIG: Record<string, TierConfig> = {
|
|
|
91
89
|
maxProcedures: -1,
|
|
92
90
|
maxAppointmentsPerMonth: -1,
|
|
93
91
|
maxMessagesPerMonth: -1,
|
|
94
|
-
maxStaff: -1,
|
|
95
92
|
maxBranches: -1,
|
|
96
93
|
},
|
|
97
94
|
},
|
|
@@ -108,7 +108,7 @@ async function countProceduresInGroup(
|
|
|
108
108
|
|
|
109
109
|
if (clinicIds.length === 0) return 0;
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
const uniqueTechnologyIds = new Set<string>();
|
|
112
112
|
for (let i = 0; i < clinicIds.length; i += 30) {
|
|
113
113
|
const batch = clinicIds.slice(i, i + 30);
|
|
114
114
|
const proceduresQuery = query(
|
|
@@ -117,10 +117,15 @@ async function countProceduresInGroup(
|
|
|
117
117
|
where('isActive', '==', true)
|
|
118
118
|
);
|
|
119
119
|
const proceduresSnap = await getDocs(proceduresQuery);
|
|
120
|
-
|
|
120
|
+
proceduresSnap.docs.forEach(d => {
|
|
121
|
+
const technologyId = d.data().technologyId;
|
|
122
|
+
if (technologyId) {
|
|
123
|
+
uniqueTechnologyIds.add(technologyId);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
121
126
|
}
|
|
122
127
|
|
|
123
|
-
return
|
|
128
|
+
return uniqueTechnologyIds.size;
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
/**
|
|
@@ -202,33 +207,6 @@ export async function enforceBranchLimit(
|
|
|
202
207
|
}
|
|
203
208
|
}
|
|
204
209
|
|
|
205
|
-
/**
|
|
206
|
-
* Enforces tier limit before creating a staff member.
|
|
207
|
-
*/
|
|
208
|
-
export async function enforceStaffLimit(
|
|
209
|
-
db: Firestore,
|
|
210
|
-
clinicGroupId: string
|
|
211
|
-
): Promise<void> {
|
|
212
|
-
const tier = await getEffectiveTier(db, clinicGroupId);
|
|
213
|
-
const config = TIER_CONFIG[tier];
|
|
214
|
-
if (!config) return;
|
|
215
|
-
|
|
216
|
-
const max = config.limits.maxStaff;
|
|
217
|
-
if (max === -1) return;
|
|
218
|
-
|
|
219
|
-
const staffQuery = query(
|
|
220
|
-
collection(db, 'clinic_staff_members'),
|
|
221
|
-
where('clinicGroupId', '==', clinicGroupId),
|
|
222
|
-
where('isActive', '==', true)
|
|
223
|
-
);
|
|
224
|
-
const staffSnap = await getDocs(staffQuery);
|
|
225
|
-
const currentCount = staffSnap.size;
|
|
226
|
-
|
|
227
|
-
if (currentCount + 1 > max) {
|
|
228
|
-
throw new TierLimitError('staff members', tier, currentCount, max);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
210
|
/**
|
|
233
211
|
* Enforces tier limit before creating an appointment.
|
|
234
212
|
* Reads the monthly counter from clinic_groups/{id}/usage_counters/{YYYY-MM}.
|