@blackcode_sa/metaestetics-api 1.14.41 → 1.14.44

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.
@@ -8,6 +8,18 @@ declare enum UserRole {
8
8
  APP_ADMIN = "app_admin",
9
9
  CLINIC_ADMIN = "clinic_admin"
10
10
  }
11
+ /**
12
+ * Enum for acquisition source - how the user found out about the app
13
+ */
14
+ declare enum AcquisitionSource {
15
+ FRIEND_FAMILY = "friend_family",
16
+ ONLINE_SEARCH = "online_search",
17
+ SOCIAL_MEDIA_AD = "social_media_ad",
18
+ TRADITIONAL_AD = "traditional_ad",
19
+ BLOG_ARTICLE = "blog_article",
20
+ HEALTHCARE_PROVIDER = "healthcare_provider",
21
+ OTHER = "other"
22
+ }
11
23
  interface User {
12
24
  uid: string;
13
25
  email: string | null;
@@ -19,6 +31,12 @@ interface User {
19
31
  patientProfile?: string;
20
32
  practitionerProfile?: string;
21
33
  adminProfile?: string;
34
+ /** How the user found out about the app (marketing attribution) */
35
+ acquisitionSource?: AcquisitionSource | null;
36
+ /** Custom text when acquisitionSource is 'other' */
37
+ acquisitionSourceOther?: string | null;
38
+ /** Timestamp when acquisition source was collected */
39
+ acquisitionSourceTimestamp?: Timestamp | null;
22
40
  }
23
41
 
24
42
  /**
@@ -1684,6 +1702,8 @@ interface ZoneItemData {
1684
1702
  notes?: string;
1685
1703
  subtotal?: number;
1686
1704
  ionNumber?: string;
1705
+ lotNumber?: string;
1706
+ expiryDate?: string;
1687
1707
  createdAt?: string;
1688
1708
  updatedAt?: string;
1689
1709
  }
@@ -8,6 +8,18 @@ declare enum UserRole {
8
8
  APP_ADMIN = "app_admin",
9
9
  CLINIC_ADMIN = "clinic_admin"
10
10
  }
11
+ /**
12
+ * Enum for acquisition source - how the user found out about the app
13
+ */
14
+ declare enum AcquisitionSource {
15
+ FRIEND_FAMILY = "friend_family",
16
+ ONLINE_SEARCH = "online_search",
17
+ SOCIAL_MEDIA_AD = "social_media_ad",
18
+ TRADITIONAL_AD = "traditional_ad",
19
+ BLOG_ARTICLE = "blog_article",
20
+ HEALTHCARE_PROVIDER = "healthcare_provider",
21
+ OTHER = "other"
22
+ }
11
23
  interface User {
12
24
  uid: string;
13
25
  email: string | null;
@@ -19,6 +31,12 @@ interface User {
19
31
  patientProfile?: string;
20
32
  practitionerProfile?: string;
21
33
  adminProfile?: string;
34
+ /** How the user found out about the app (marketing attribution) */
35
+ acquisitionSource?: AcquisitionSource | null;
36
+ /** Custom text when acquisitionSource is 'other' */
37
+ acquisitionSourceOther?: string | null;
38
+ /** Timestamp when acquisition source was collected */
39
+ acquisitionSourceTimestamp?: Timestamp | null;
22
40
  }
23
41
 
24
42
  /**
@@ -1684,6 +1702,8 @@ interface ZoneItemData {
1684
1702
  notes?: string;
1685
1703
  subtotal?: number;
1686
1704
  ionNumber?: string;
1705
+ lotNumber?: string;
1706
+ expiryDate?: string;
1687
1707
  createdAt?: string;
1688
1708
  updatedAt?: string;
1689
1709
  }
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Firestore, FieldValue, DocumentData, QueryDocumentSnapshot, Timestamp, DocumentSnapshot } from 'firebase/firestore';
1
+ import { Firestore, Timestamp, FieldValue, DocumentData, QueryDocumentSnapshot, DocumentSnapshot } from 'firebase/firestore';
2
2
  import { Auth, User as User$1 } from 'firebase/auth';
3
3
  import { FirebaseApp } from 'firebase/app';
4
4
  import { FirebaseStorage } from 'firebase/storage';
@@ -1122,6 +1122,18 @@ declare enum UserRole {
1122
1122
  APP_ADMIN = "app_admin",
1123
1123
  CLINIC_ADMIN = "clinic_admin"
1124
1124
  }
1125
+ /**
1126
+ * Enum for acquisition source - how the user found out about the app
1127
+ */
1128
+ declare enum AcquisitionSource {
1129
+ FRIEND_FAMILY = "friend_family",
1130
+ ONLINE_SEARCH = "online_search",
1131
+ SOCIAL_MEDIA_AD = "social_media_ad",
1132
+ TRADITIONAL_AD = "traditional_ad",
1133
+ BLOG_ARTICLE = "blog_article",
1134
+ HEALTHCARE_PROVIDER = "healthcare_provider",
1135
+ OTHER = "other"
1136
+ }
1125
1137
  interface User {
1126
1138
  uid: string;
1127
1139
  email: string | null;
@@ -1133,6 +1145,12 @@ interface User {
1133
1145
  patientProfile?: string;
1134
1146
  practitionerProfile?: string;
1135
1147
  adminProfile?: string;
1148
+ /** How the user found out about the app (marketing attribution) */
1149
+ acquisitionSource?: AcquisitionSource | null;
1150
+ /** Custom text when acquisitionSource is 'other' */
1151
+ acquisitionSourceOther?: string | null;
1152
+ /** Timestamp when acquisition source was collected */
1153
+ acquisitionSourceTimestamp?: Timestamp | null;
1136
1154
  }
1137
1155
  interface CreateUserData {
1138
1156
  uid: string;
@@ -1142,6 +1160,9 @@ interface CreateUserData {
1142
1160
  createdAt: FieldValue;
1143
1161
  updatedAt: FieldValue;
1144
1162
  lastLoginAt: FieldValue;
1163
+ acquisitionSource?: AcquisitionSource | null;
1164
+ acquisitionSourceOther?: string | null;
1165
+ acquisitionSourceTimestamp?: FieldValue | Timestamp | null;
1145
1166
  }
1146
1167
  declare const USERS_COLLECTION = "users";
1147
1168
  type FirebaseUser = User$1;
@@ -5618,6 +5639,8 @@ interface ZoneItemData {
5618
5639
  notes?: string;
5619
5640
  subtotal?: number;
5620
5641
  ionNumber?: string;
5642
+ lotNumber?: string;
5643
+ expiryDate?: string;
5621
5644
  createdAt?: string;
5622
5645
  updatedAt?: string;
5623
5646
  }
@@ -8324,6 +8347,15 @@ declare class UserService extends BaseService {
8324
8347
  * Uklanja rolu korisniku i briše odgovarajući profil
8325
8348
  */
8326
8349
  removeRoleAndProfile(uid: string, role: UserRole): Promise<void>;
8350
+ /**
8351
+ * Updates the acquisition source information for a user
8352
+ * @param uid - User ID
8353
+ * @param data - Acquisition source data
8354
+ */
8355
+ updateAcquisitionSource(uid: string, data: {
8356
+ acquisitionSource: AcquisitionSource | null;
8357
+ acquisitionSourceOther?: string | null;
8358
+ }): Promise<void>;
8327
8359
  deleteUser(uid: string): Promise<void>;
8328
8360
  }
8329
8361
 
@@ -9212,4 +9244,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
9212
9244
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
9213
9245
  declare const getFirebaseFunctions: () => Promise<Functions>;
9214
9246
 
9215
- export { AESTHETIC_ANALYSIS_COLLECTION, ANALYTICS_COLLECTION, APPOINTMENTS_COLLECTION, 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 Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AppointmentTrend, type AssessmentScales, AuthService, type BaseDocumentElement, type BaseMetrics, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, BlockingCondition, 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 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, ClinicService, 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 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, DASHBOARD_ANALYTICS_SUBCOLLECTION, DEFAULT_MEDICAL_INFO, 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 EmergencyContact, type EntityType, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, 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 GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, 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, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NextStepsRecommendation, type NoShowMetrics, 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, PRACTITIONERS_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PRACTITIONER_INVITES_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 PlanDetails, 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, 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, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeEfficiencyMetrics, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, type TrendPeriod, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, 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, type ZoneItemData, type ZonePhotoUploadData, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
9247
+ export { AESTHETIC_ANALYSIS_COLLECTION, ANALYTICS_COLLECTION, APPOINTMENTS_COLLECTION, 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 Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AppointmentTrend, type AssessmentScales, AuthService, type BaseDocumentElement, type BaseMetrics, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, BlockingCondition, 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 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, ClinicService, 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 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, DASHBOARD_ANALYTICS_SUBCOLLECTION, DEFAULT_MEDICAL_INFO, 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 EmergencyContact, type EntityType, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, 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 GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, 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, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NextStepsRecommendation, type NoShowMetrics, 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, PRACTITIONERS_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PRACTITIONER_INVITES_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 PlanDetails, 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, 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, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeEfficiencyMetrics, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, type TrendPeriod, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, 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, type ZoneItemData, type ZonePhotoUploadData, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Firestore, FieldValue, DocumentData, QueryDocumentSnapshot, Timestamp, DocumentSnapshot } from 'firebase/firestore';
1
+ import { Firestore, Timestamp, FieldValue, DocumentData, QueryDocumentSnapshot, DocumentSnapshot } from 'firebase/firestore';
2
2
  import { Auth, User as User$1 } from 'firebase/auth';
3
3
  import { FirebaseApp } from 'firebase/app';
4
4
  import { FirebaseStorage } from 'firebase/storage';
@@ -1122,6 +1122,18 @@ declare enum UserRole {
1122
1122
  APP_ADMIN = "app_admin",
1123
1123
  CLINIC_ADMIN = "clinic_admin"
1124
1124
  }
1125
+ /**
1126
+ * Enum for acquisition source - how the user found out about the app
1127
+ */
1128
+ declare enum AcquisitionSource {
1129
+ FRIEND_FAMILY = "friend_family",
1130
+ ONLINE_SEARCH = "online_search",
1131
+ SOCIAL_MEDIA_AD = "social_media_ad",
1132
+ TRADITIONAL_AD = "traditional_ad",
1133
+ BLOG_ARTICLE = "blog_article",
1134
+ HEALTHCARE_PROVIDER = "healthcare_provider",
1135
+ OTHER = "other"
1136
+ }
1125
1137
  interface User {
1126
1138
  uid: string;
1127
1139
  email: string | null;
@@ -1133,6 +1145,12 @@ interface User {
1133
1145
  patientProfile?: string;
1134
1146
  practitionerProfile?: string;
1135
1147
  adminProfile?: string;
1148
+ /** How the user found out about the app (marketing attribution) */
1149
+ acquisitionSource?: AcquisitionSource | null;
1150
+ /** Custom text when acquisitionSource is 'other' */
1151
+ acquisitionSourceOther?: string | null;
1152
+ /** Timestamp when acquisition source was collected */
1153
+ acquisitionSourceTimestamp?: Timestamp | null;
1136
1154
  }
1137
1155
  interface CreateUserData {
1138
1156
  uid: string;
@@ -1142,6 +1160,9 @@ interface CreateUserData {
1142
1160
  createdAt: FieldValue;
1143
1161
  updatedAt: FieldValue;
1144
1162
  lastLoginAt: FieldValue;
1163
+ acquisitionSource?: AcquisitionSource | null;
1164
+ acquisitionSourceOther?: string | null;
1165
+ acquisitionSourceTimestamp?: FieldValue | Timestamp | null;
1145
1166
  }
1146
1167
  declare const USERS_COLLECTION = "users";
1147
1168
  type FirebaseUser = User$1;
@@ -5618,6 +5639,8 @@ interface ZoneItemData {
5618
5639
  notes?: string;
5619
5640
  subtotal?: number;
5620
5641
  ionNumber?: string;
5642
+ lotNumber?: string;
5643
+ expiryDate?: string;
5621
5644
  createdAt?: string;
5622
5645
  updatedAt?: string;
5623
5646
  }
@@ -8324,6 +8347,15 @@ declare class UserService extends BaseService {
8324
8347
  * Uklanja rolu korisniku i briše odgovarajući profil
8325
8348
  */
8326
8349
  removeRoleAndProfile(uid: string, role: UserRole): Promise<void>;
8350
+ /**
8351
+ * Updates the acquisition source information for a user
8352
+ * @param uid - User ID
8353
+ * @param data - Acquisition source data
8354
+ */
8355
+ updateAcquisitionSource(uid: string, data: {
8356
+ acquisitionSource: AcquisitionSource | null;
8357
+ acquisitionSourceOther?: string | null;
8358
+ }): Promise<void>;
8327
8359
  deleteUser(uid: string): Promise<void>;
8328
8360
  }
8329
8361
 
@@ -9212,4 +9244,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
9212
9244
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
9213
9245
  declare const getFirebaseFunctions: () => Promise<Functions>;
9214
9246
 
9215
- export { AESTHETIC_ANALYSIS_COLLECTION, ANALYTICS_COLLECTION, APPOINTMENTS_COLLECTION, 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 Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AppointmentTrend, type AssessmentScales, AuthService, type BaseDocumentElement, type BaseMetrics, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, BlockingCondition, 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 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, ClinicService, 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 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, DASHBOARD_ANALYTICS_SUBCOLLECTION, DEFAULT_MEDICAL_INFO, 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 EmergencyContact, type EntityType, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, 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 GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, 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, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NextStepsRecommendation, type NoShowMetrics, 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, PRACTITIONERS_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PRACTITIONER_INVITES_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 PlanDetails, 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, 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, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeEfficiencyMetrics, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, type TrendPeriod, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, 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, type ZoneItemData, type ZonePhotoUploadData, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
9247
+ export { AESTHETIC_ANALYSIS_COLLECTION, ANALYTICS_COLLECTION, APPOINTMENTS_COLLECTION, 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 Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AppointmentTrend, type AssessmentScales, AuthService, type BaseDocumentElement, type BaseMetrics, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, BlockingCondition, 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 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, ClinicService, 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 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, DASHBOARD_ANALYTICS_SUBCOLLECTION, DEFAULT_MEDICAL_INFO, 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 EmergencyContact, type EntityType, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, 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 GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, 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, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NextStepsRecommendation, type NoShowMetrics, 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, PRACTITIONERS_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PRACTITIONER_INVITES_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 PlanDetails, 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, 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, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeEfficiencyMetrics, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, type TrendPeriod, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, 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, type ZoneItemData, type ZonePhotoUploadData, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ __export(index_exports, {
33
33
  AESTHETIC_ANALYSIS_COLLECTION: () => AESTHETIC_ANALYSIS_COLLECTION,
34
34
  ANALYTICS_COLLECTION: () => ANALYTICS_COLLECTION,
35
35
  APPOINTMENTS_COLLECTION: () => APPOINTMENTS_COLLECTION,
36
+ AcquisitionSource: () => AcquisitionSource,
36
37
  AdminTokenStatus: () => AdminTokenStatus,
37
38
  AllergyType: () => AllergyType,
38
39
  AnalyticsCloudService: () => AnalyticsCloudService,
@@ -3963,6 +3964,9 @@ var zoneItemDataSchema = import_zod3.z.object({
3963
3964
  notes: import_zod3.z.string().max(MAX_STRING_LENGTH_LONG, "Notes too long").optional(),
3964
3965
  subtotal: import_zod3.z.number().min(0, "Subtotal must be non-negative").optional(),
3965
3966
  ionNumber: import_zod3.z.string().optional(),
3967
+ lotNumber: import_zod3.z.string().max(MAX_STRING_LENGTH, "Lot number too long").optional(),
3968
+ expiryDate: import_zod3.z.string().optional(),
3969
+ // ISO date string (YYYY-MM-DD format)
3966
3970
  createdAt: import_zod3.z.string().optional(),
3967
3971
  updatedAt: import_zod3.z.string().optional()
3968
3972
  }).refine(
@@ -7231,6 +7235,16 @@ var UserRole = /* @__PURE__ */ ((UserRole2) => {
7231
7235
  UserRole2["CLINIC_ADMIN"] = "clinic_admin";
7232
7236
  return UserRole2;
7233
7237
  })(UserRole || {});
7238
+ var AcquisitionSource = /* @__PURE__ */ ((AcquisitionSource2) => {
7239
+ AcquisitionSource2["FRIEND_FAMILY"] = "friend_family";
7240
+ AcquisitionSource2["ONLINE_SEARCH"] = "online_search";
7241
+ AcquisitionSource2["SOCIAL_MEDIA_AD"] = "social_media_ad";
7242
+ AcquisitionSource2["TRADITIONAL_AD"] = "traditional_ad";
7243
+ AcquisitionSource2["BLOG_ARTICLE"] = "blog_article";
7244
+ AcquisitionSource2["HEALTHCARE_PROVIDER"] = "healthcare_provider";
7245
+ AcquisitionSource2["OTHER"] = "other";
7246
+ return AcquisitionSource2;
7247
+ })(AcquisitionSource || {});
7234
7248
  var USERS_COLLECTION = "users";
7235
7249
 
7236
7250
  // src/types/calendar/synced-calendar.types.ts
@@ -7366,6 +7380,7 @@ var passwordSchema = import_zod4.z.string().min(8, "Password must be at least 8
7366
7380
  );
7367
7381
  var userRoleSchema = import_zod4.z.nativeEnum(UserRole);
7368
7382
  var userRolesSchema = import_zod4.z.array(userRoleSchema).min(1, "User must have at least one role").max(3, "User cannot have more than 3 roles");
7383
+ var acquisitionSourceSchema = import_zod4.z.nativeEnum(AcquisitionSource);
7369
7384
  var clinicAdminOptionsSchema = import_zod4.z.object({
7370
7385
  isGroupOwner: import_zod4.z.boolean(),
7371
7386
  groupToken: import_zod4.z.string().optional(),
@@ -7397,7 +7412,10 @@ var userSchema = import_zod4.z.object({
7397
7412
  lastLoginAt: import_zod4.z.any(),
7398
7413
  patientProfile: import_zod4.z.string().optional(),
7399
7414
  practitionerProfile: import_zod4.z.string().optional(),
7400
- adminProfile: import_zod4.z.string().optional()
7415
+ adminProfile: import_zod4.z.string().optional(),
7416
+ acquisitionSource: acquisitionSourceSchema.nullable().optional(),
7417
+ acquisitionSourceOther: import_zod4.z.string().max(200).nullable().optional(),
7418
+ acquisitionSourceTimestamp: import_zod4.z.any().nullable().optional()
7401
7419
  });
7402
7420
 
7403
7421
  // src/errors/auth.errors.ts
@@ -13274,6 +13292,29 @@ var UserService = class extends BaseService {
13274
13292
  updatedAt: (0, import_firestore33.serverTimestamp)()
13275
13293
  });
13276
13294
  }
13295
+ /**
13296
+ * Updates the acquisition source information for a user
13297
+ * @param uid - User ID
13298
+ * @param data - Acquisition source data
13299
+ */
13300
+ async updateAcquisitionSource(uid, data) {
13301
+ const userRef = (0, import_firestore33.doc)(this.db, USERS_COLLECTION, uid);
13302
+ const userDoc = await (0, import_firestore33.getDoc)(userRef);
13303
+ if (!userDoc.exists()) {
13304
+ throw USER_ERRORS.NOT_FOUND;
13305
+ }
13306
+ const updateData = {
13307
+ acquisitionSource: data.acquisitionSource,
13308
+ acquisitionSourceTimestamp: import_firestore33.Timestamp.now(),
13309
+ updatedAt: (0, import_firestore33.serverTimestamp)()
13310
+ };
13311
+ if (data.acquisitionSource === "other" /* OTHER */) {
13312
+ updateData.acquisitionSourceOther = data.acquisitionSourceOther || null;
13313
+ } else {
13314
+ updateData.acquisitionSourceOther = null;
13315
+ }
13316
+ await (0, import_firestore33.updateDoc)(userRef, updateData);
13317
+ }
13277
13318
  // Delete operations
13278
13319
  async deleteUser(uid) {
13279
13320
  const userRef = (0, import_firestore33.doc)(this.db, USERS_COLLECTION, uid);
@@ -25846,6 +25887,7 @@ var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
25846
25887
  AESTHETIC_ANALYSIS_COLLECTION,
25847
25888
  ANALYTICS_COLLECTION,
25848
25889
  APPOINTMENTS_COLLECTION,
25890
+ AcquisitionSource,
25849
25891
  AdminTokenStatus,
25850
25892
  AllergyType,
25851
25893
  AnalyticsCloudService,
package/dist/index.mjs CHANGED
@@ -3819,6 +3819,9 @@ var zoneItemDataSchema = z3.object({
3819
3819
  notes: z3.string().max(MAX_STRING_LENGTH_LONG, "Notes too long").optional(),
3820
3820
  subtotal: z3.number().min(0, "Subtotal must be non-negative").optional(),
3821
3821
  ionNumber: z3.string().optional(),
3822
+ lotNumber: z3.string().max(MAX_STRING_LENGTH, "Lot number too long").optional(),
3823
+ expiryDate: z3.string().optional(),
3824
+ // ISO date string (YYYY-MM-DD format)
3822
3825
  createdAt: z3.string().optional(),
3823
3826
  updatedAt: z3.string().optional()
3824
3827
  }).refine(
@@ -7137,6 +7140,16 @@ var UserRole = /* @__PURE__ */ ((UserRole2) => {
7137
7140
  UserRole2["CLINIC_ADMIN"] = "clinic_admin";
7138
7141
  return UserRole2;
7139
7142
  })(UserRole || {});
7143
+ var AcquisitionSource = /* @__PURE__ */ ((AcquisitionSource2) => {
7144
+ AcquisitionSource2["FRIEND_FAMILY"] = "friend_family";
7145
+ AcquisitionSource2["ONLINE_SEARCH"] = "online_search";
7146
+ AcquisitionSource2["SOCIAL_MEDIA_AD"] = "social_media_ad";
7147
+ AcquisitionSource2["TRADITIONAL_AD"] = "traditional_ad";
7148
+ AcquisitionSource2["BLOG_ARTICLE"] = "blog_article";
7149
+ AcquisitionSource2["HEALTHCARE_PROVIDER"] = "healthcare_provider";
7150
+ AcquisitionSource2["OTHER"] = "other";
7151
+ return AcquisitionSource2;
7152
+ })(AcquisitionSource || {});
7140
7153
  var USERS_COLLECTION = "users";
7141
7154
 
7142
7155
  // src/types/calendar/synced-calendar.types.ts
@@ -7272,6 +7285,7 @@ var passwordSchema = z4.string().min(8, "Password must be at least 8 characters"
7272
7285
  );
7273
7286
  var userRoleSchema = z4.nativeEnum(UserRole);
7274
7287
  var userRolesSchema = z4.array(userRoleSchema).min(1, "User must have at least one role").max(3, "User cannot have more than 3 roles");
7288
+ var acquisitionSourceSchema = z4.nativeEnum(AcquisitionSource);
7275
7289
  var clinicAdminOptionsSchema = z4.object({
7276
7290
  isGroupOwner: z4.boolean(),
7277
7291
  groupToken: z4.string().optional(),
@@ -7303,7 +7317,10 @@ var userSchema = z4.object({
7303
7317
  lastLoginAt: z4.any(),
7304
7318
  patientProfile: z4.string().optional(),
7305
7319
  practitionerProfile: z4.string().optional(),
7306
- adminProfile: z4.string().optional()
7320
+ adminProfile: z4.string().optional(),
7321
+ acquisitionSource: acquisitionSourceSchema.nullable().optional(),
7322
+ acquisitionSourceOther: z4.string().max(200).nullable().optional(),
7323
+ acquisitionSourceTimestamp: z4.any().nullable().optional()
7307
7324
  });
7308
7325
 
7309
7326
  // src/errors/auth.errors.ts
@@ -13297,6 +13314,29 @@ var UserService = class extends BaseService {
13297
13314
  updatedAt: serverTimestamp18()
13298
13315
  });
13299
13316
  }
13317
+ /**
13318
+ * Updates the acquisition source information for a user
13319
+ * @param uid - User ID
13320
+ * @param data - Acquisition source data
13321
+ */
13322
+ async updateAcquisitionSource(uid, data) {
13323
+ const userRef = doc21(this.db, USERS_COLLECTION, uid);
13324
+ const userDoc = await getDoc23(userRef);
13325
+ if (!userDoc.exists()) {
13326
+ throw USER_ERRORS.NOT_FOUND;
13327
+ }
13328
+ const updateData = {
13329
+ acquisitionSource: data.acquisitionSource,
13330
+ acquisitionSourceTimestamp: Timestamp18.now(),
13331
+ updatedAt: serverTimestamp18()
13332
+ };
13333
+ if (data.acquisitionSource === "other" /* OTHER */) {
13334
+ updateData.acquisitionSourceOther = data.acquisitionSourceOther || null;
13335
+ } else {
13336
+ updateData.acquisitionSourceOther = null;
13337
+ }
13338
+ await updateDoc17(userRef, updateData);
13339
+ }
13300
13340
  // Delete operations
13301
13341
  async deleteUser(uid) {
13302
13342
  const userRef = doc21(this.db, USERS_COLLECTION, uid);
@@ -26169,6 +26209,7 @@ export {
26169
26209
  AESTHETIC_ANALYSIS_COLLECTION,
26170
26210
  ANALYTICS_COLLECTION,
26171
26211
  APPOINTMENTS_COLLECTION,
26212
+ AcquisitionSource,
26172
26213
  AdminTokenStatus,
26173
26214
  AllergyType,
26174
26215
  AnalyticsCloudService,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.14.41",
4
+ "version": "1.14.44",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -13,7 +13,7 @@ import {
13
13
  serverTimestamp,
14
14
  } from 'firebase/firestore';
15
15
  import { initializeFirebase } from '../../config/firebase';
16
- import { User, UserRole, USERS_COLLECTION, CreateUserData } from '../../types';
16
+ import { User, UserRole, USERS_COLLECTION, CreateUserData, AcquisitionSource } from '../../types';
17
17
  import { userSchema } from '../../validations/schemas';
18
18
  import { AuthError } from '../../errors/auth.errors';
19
19
  import { USER_ERRORS } from '../../errors/user.errors';
@@ -453,6 +453,47 @@ export class UserService extends BaseService {
453
453
  });
454
454
  }
455
455
 
456
+ /**
457
+ * Updates the acquisition source information for a user
458
+ * @param uid - User ID
459
+ * @param data - Acquisition source data
460
+ */
461
+ async updateAcquisitionSource(
462
+ uid: string,
463
+ data: {
464
+ acquisitionSource: AcquisitionSource | null;
465
+ acquisitionSourceOther?: string | null;
466
+ }
467
+ ): Promise<void> {
468
+ const userRef = doc(this.db, USERS_COLLECTION, uid);
469
+ const userDoc = await getDoc(userRef);
470
+
471
+ if (!userDoc.exists()) {
472
+ throw USER_ERRORS.NOT_FOUND;
473
+ }
474
+
475
+ const updateData: {
476
+ acquisitionSource: AcquisitionSource | null;
477
+ acquisitionSourceOther?: string | null;
478
+ acquisitionSourceTimestamp: Timestamp;
479
+ updatedAt: ReturnType<typeof serverTimestamp>;
480
+ } = {
481
+ acquisitionSource: data.acquisitionSource,
482
+ acquisitionSourceTimestamp: Timestamp.now(),
483
+ updatedAt: serverTimestamp(),
484
+ };
485
+
486
+ // Only include acquisitionSourceOther if acquisitionSource is 'other'
487
+ if (data.acquisitionSource === AcquisitionSource.OTHER) {
488
+ updateData.acquisitionSourceOther = data.acquisitionSourceOther || null;
489
+ } else {
490
+ // Clear acquisitionSourceOther if not 'other'
491
+ updateData.acquisitionSourceOther = null;
492
+ }
493
+
494
+ await updateDoc(userRef, updateData);
495
+ }
496
+
456
497
  // Delete operations
457
498
  async deleteUser(uid: string): Promise<void> {
458
499
  const userRef = doc(this.db, USERS_COLLECTION, uid);
@@ -157,6 +157,8 @@ export interface ZoneItemData {
157
157
  notes?: string;
158
158
  subtotal?: number;
159
159
  ionNumber?: string;
160
+ lotNumber?: string; // Optional lot/batch number for the product
161
+ expiryDate?: string; // Optional expiry date (ISO date string)
160
162
  createdAt?: string; // ISO timestamp
161
163
  updatedAt?: string; // ISO timestamp
162
164
  }
@@ -9,6 +9,19 @@ export enum UserRole {
9
9
  CLINIC_ADMIN = "clinic_admin",
10
10
  }
11
11
 
12
+ /**
13
+ * Enum for acquisition source - how the user found out about the app
14
+ */
15
+ export enum AcquisitionSource {
16
+ FRIEND_FAMILY = "friend_family",
17
+ ONLINE_SEARCH = "online_search",
18
+ SOCIAL_MEDIA_AD = "social_media_ad",
19
+ TRADITIONAL_AD = "traditional_ad",
20
+ BLOG_ARTICLE = "blog_article",
21
+ HEALTHCARE_PROVIDER = "healthcare_provider",
22
+ OTHER = "other",
23
+ }
24
+
12
25
  export interface User {
13
26
  uid: string;
14
27
  email: string | null;
@@ -20,6 +33,12 @@ export interface User {
20
33
  patientProfile?: string;
21
34
  practitionerProfile?: string;
22
35
  adminProfile?: string;
36
+ /** How the user found out about the app (marketing attribution) */
37
+ acquisitionSource?: AcquisitionSource | null;
38
+ /** Custom text when acquisitionSource is 'other' */
39
+ acquisitionSourceOther?: string | null;
40
+ /** Timestamp when acquisition source was collected */
41
+ acquisitionSourceTimestamp?: Timestamp | null;
23
42
  }
24
43
 
25
44
  export interface CreateUserData {
@@ -30,6 +49,9 @@ export interface CreateUserData {
30
49
  createdAt: FieldValue;
31
50
  updatedAt: FieldValue;
32
51
  lastLoginAt: FieldValue;
52
+ acquisitionSource?: AcquisitionSource | null;
53
+ acquisitionSourceOther?: string | null;
54
+ acquisitionSourceTimestamp?: FieldValue | Timestamp | null;
33
55
  }
34
56
 
35
57
  export const USERS_COLLECTION = "users";
@@ -222,6 +222,8 @@ export const zoneItemDataSchema = z
222
222
  notes: z.string().max(MAX_STRING_LENGTH_LONG, 'Notes too long').optional(),
223
223
  subtotal: z.number().min(0, 'Subtotal must be non-negative').optional(),
224
224
  ionNumber: z.string().optional(),
225
+ lotNumber: z.string().max(MAX_STRING_LENGTH, 'Lot number too long').optional(),
226
+ expiryDate: z.string().optional(), // ISO date string (YYYY-MM-DD format)
225
227
  createdAt: z.string().optional(),
226
228
  updatedAt: z.string().optional(),
227
229
  })
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { UserRole } from "../types";
2
+ import { UserRole, AcquisitionSource } from "../types";
3
3
  import { Timestamp, FieldValue } from "firebase/firestore";
4
4
 
5
5
  export const emailSchema = z
@@ -24,6 +24,8 @@ export const userRolesSchema = z
24
24
  .min(1, "User must have at least one role")
25
25
  .max(3, "User cannot have more than 3 roles");
26
26
 
27
+ export const acquisitionSourceSchema = z.nativeEnum(AcquisitionSource);
28
+
27
29
  // export const timestampSchema = z.custom<Timestamp | FieldValue | Date>(
28
30
  // (data) => {
29
31
  // // If it's a serverTimestamp (FieldValue), it's valid
@@ -96,6 +98,9 @@ export const userSchema = z.object({
96
98
  patientProfile: z.string().optional(),
97
99
  practitionerProfile: z.string().optional(),
98
100
  adminProfile: z.string().optional(),
101
+ acquisitionSource: acquisitionSourceSchema.nullable().optional(),
102
+ acquisitionSourceOther: z.string().max(200).nullable().optional(),
103
+ acquisitionSourceTimestamp: z.any().nullable().optional(),
99
104
  });
100
105
 
101
106
  export type ValidationSchema = z.infer<typeof userSchema>;