@blackcode_sa/metaestetics-api 1.14.41 → 1.14.43

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
  /**
@@ -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
  /**
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;
@@ -8324,6 +8345,15 @@ declare class UserService extends BaseService {
8324
8345
  * Uklanja rolu korisniku i briše odgovarajući profil
8325
8346
  */
8326
8347
  removeRoleAndProfile(uid: string, role: UserRole): Promise<void>;
8348
+ /**
8349
+ * Updates the acquisition source information for a user
8350
+ * @param uid - User ID
8351
+ * @param data - Acquisition source data
8352
+ */
8353
+ updateAcquisitionSource(uid: string, data: {
8354
+ acquisitionSource: AcquisitionSource | null;
8355
+ acquisitionSourceOther?: string | null;
8356
+ }): Promise<void>;
8327
8357
  deleteUser(uid: string): Promise<void>;
8328
8358
  }
8329
8359
 
@@ -9212,4 +9242,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
9212
9242
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
9213
9243
  declare const getFirebaseFunctions: () => Promise<Functions>;
9214
9244
 
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 };
9245
+ 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;
@@ -8324,6 +8345,15 @@ declare class UserService extends BaseService {
8324
8345
  * Uklanja rolu korisniku i briše odgovarajući profil
8325
8346
  */
8326
8347
  removeRoleAndProfile(uid: string, role: UserRole): Promise<void>;
8348
+ /**
8349
+ * Updates the acquisition source information for a user
8350
+ * @param uid - User ID
8351
+ * @param data - Acquisition source data
8352
+ */
8353
+ updateAcquisitionSource(uid: string, data: {
8354
+ acquisitionSource: AcquisitionSource | null;
8355
+ acquisitionSourceOther?: string | null;
8356
+ }): Promise<void>;
8327
8357
  deleteUser(uid: string): Promise<void>;
8328
8358
  }
8329
8359
 
@@ -9212,4 +9242,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
9212
9242
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
9213
9243
  declare const getFirebaseFunctions: () => Promise<Functions>;
9214
9244
 
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 };
9245
+ 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,
@@ -7231,6 +7232,16 @@ var UserRole = /* @__PURE__ */ ((UserRole2) => {
7231
7232
  UserRole2["CLINIC_ADMIN"] = "clinic_admin";
7232
7233
  return UserRole2;
7233
7234
  })(UserRole || {});
7235
+ var AcquisitionSource = /* @__PURE__ */ ((AcquisitionSource2) => {
7236
+ AcquisitionSource2["FRIEND_FAMILY"] = "friend_family";
7237
+ AcquisitionSource2["ONLINE_SEARCH"] = "online_search";
7238
+ AcquisitionSource2["SOCIAL_MEDIA_AD"] = "social_media_ad";
7239
+ AcquisitionSource2["TRADITIONAL_AD"] = "traditional_ad";
7240
+ AcquisitionSource2["BLOG_ARTICLE"] = "blog_article";
7241
+ AcquisitionSource2["HEALTHCARE_PROVIDER"] = "healthcare_provider";
7242
+ AcquisitionSource2["OTHER"] = "other";
7243
+ return AcquisitionSource2;
7244
+ })(AcquisitionSource || {});
7234
7245
  var USERS_COLLECTION = "users";
7235
7246
 
7236
7247
  // src/types/calendar/synced-calendar.types.ts
@@ -7366,6 +7377,7 @@ var passwordSchema = import_zod4.z.string().min(8, "Password must be at least 8
7366
7377
  );
7367
7378
  var userRoleSchema = import_zod4.z.nativeEnum(UserRole);
7368
7379
  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");
7380
+ var acquisitionSourceSchema = import_zod4.z.nativeEnum(AcquisitionSource);
7369
7381
  var clinicAdminOptionsSchema = import_zod4.z.object({
7370
7382
  isGroupOwner: import_zod4.z.boolean(),
7371
7383
  groupToken: import_zod4.z.string().optional(),
@@ -7397,7 +7409,10 @@ var userSchema = import_zod4.z.object({
7397
7409
  lastLoginAt: import_zod4.z.any(),
7398
7410
  patientProfile: import_zod4.z.string().optional(),
7399
7411
  practitionerProfile: import_zod4.z.string().optional(),
7400
- adminProfile: import_zod4.z.string().optional()
7412
+ adminProfile: import_zod4.z.string().optional(),
7413
+ acquisitionSource: acquisitionSourceSchema.nullable().optional(),
7414
+ acquisitionSourceOther: import_zod4.z.string().max(200).nullable().optional(),
7415
+ acquisitionSourceTimestamp: import_zod4.z.any().nullable().optional()
7401
7416
  });
7402
7417
 
7403
7418
  // src/errors/auth.errors.ts
@@ -13274,6 +13289,29 @@ var UserService = class extends BaseService {
13274
13289
  updatedAt: (0, import_firestore33.serverTimestamp)()
13275
13290
  });
13276
13291
  }
13292
+ /**
13293
+ * Updates the acquisition source information for a user
13294
+ * @param uid - User ID
13295
+ * @param data - Acquisition source data
13296
+ */
13297
+ async updateAcquisitionSource(uid, data) {
13298
+ const userRef = (0, import_firestore33.doc)(this.db, USERS_COLLECTION, uid);
13299
+ const userDoc = await (0, import_firestore33.getDoc)(userRef);
13300
+ if (!userDoc.exists()) {
13301
+ throw USER_ERRORS.NOT_FOUND;
13302
+ }
13303
+ const updateData = {
13304
+ acquisitionSource: data.acquisitionSource,
13305
+ acquisitionSourceTimestamp: import_firestore33.Timestamp.now(),
13306
+ updatedAt: (0, import_firestore33.serverTimestamp)()
13307
+ };
13308
+ if (data.acquisitionSource === "other" /* OTHER */) {
13309
+ updateData.acquisitionSourceOther = data.acquisitionSourceOther || null;
13310
+ } else {
13311
+ updateData.acquisitionSourceOther = null;
13312
+ }
13313
+ await (0, import_firestore33.updateDoc)(userRef, updateData);
13314
+ }
13277
13315
  // Delete operations
13278
13316
  async deleteUser(uid) {
13279
13317
  const userRef = (0, import_firestore33.doc)(this.db, USERS_COLLECTION, uid);
@@ -25846,6 +25884,7 @@ var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
25846
25884
  AESTHETIC_ANALYSIS_COLLECTION,
25847
25885
  ANALYTICS_COLLECTION,
25848
25886
  APPOINTMENTS_COLLECTION,
25887
+ AcquisitionSource,
25849
25888
  AdminTokenStatus,
25850
25889
  AllergyType,
25851
25890
  AnalyticsCloudService,
package/dist/index.mjs CHANGED
@@ -7137,6 +7137,16 @@ var UserRole = /* @__PURE__ */ ((UserRole2) => {
7137
7137
  UserRole2["CLINIC_ADMIN"] = "clinic_admin";
7138
7138
  return UserRole2;
7139
7139
  })(UserRole || {});
7140
+ var AcquisitionSource = /* @__PURE__ */ ((AcquisitionSource2) => {
7141
+ AcquisitionSource2["FRIEND_FAMILY"] = "friend_family";
7142
+ AcquisitionSource2["ONLINE_SEARCH"] = "online_search";
7143
+ AcquisitionSource2["SOCIAL_MEDIA_AD"] = "social_media_ad";
7144
+ AcquisitionSource2["TRADITIONAL_AD"] = "traditional_ad";
7145
+ AcquisitionSource2["BLOG_ARTICLE"] = "blog_article";
7146
+ AcquisitionSource2["HEALTHCARE_PROVIDER"] = "healthcare_provider";
7147
+ AcquisitionSource2["OTHER"] = "other";
7148
+ return AcquisitionSource2;
7149
+ })(AcquisitionSource || {});
7140
7150
  var USERS_COLLECTION = "users";
7141
7151
 
7142
7152
  // src/types/calendar/synced-calendar.types.ts
@@ -7272,6 +7282,7 @@ var passwordSchema = z4.string().min(8, "Password must be at least 8 characters"
7272
7282
  );
7273
7283
  var userRoleSchema = z4.nativeEnum(UserRole);
7274
7284
  var userRolesSchema = z4.array(userRoleSchema).min(1, "User must have at least one role").max(3, "User cannot have more than 3 roles");
7285
+ var acquisitionSourceSchema = z4.nativeEnum(AcquisitionSource);
7275
7286
  var clinicAdminOptionsSchema = z4.object({
7276
7287
  isGroupOwner: z4.boolean(),
7277
7288
  groupToken: z4.string().optional(),
@@ -7303,7 +7314,10 @@ var userSchema = z4.object({
7303
7314
  lastLoginAt: z4.any(),
7304
7315
  patientProfile: z4.string().optional(),
7305
7316
  practitionerProfile: z4.string().optional(),
7306
- adminProfile: z4.string().optional()
7317
+ adminProfile: z4.string().optional(),
7318
+ acquisitionSource: acquisitionSourceSchema.nullable().optional(),
7319
+ acquisitionSourceOther: z4.string().max(200).nullable().optional(),
7320
+ acquisitionSourceTimestamp: z4.any().nullable().optional()
7307
7321
  });
7308
7322
 
7309
7323
  // src/errors/auth.errors.ts
@@ -13297,6 +13311,29 @@ var UserService = class extends BaseService {
13297
13311
  updatedAt: serverTimestamp18()
13298
13312
  });
13299
13313
  }
13314
+ /**
13315
+ * Updates the acquisition source information for a user
13316
+ * @param uid - User ID
13317
+ * @param data - Acquisition source data
13318
+ */
13319
+ async updateAcquisitionSource(uid, data) {
13320
+ const userRef = doc21(this.db, USERS_COLLECTION, uid);
13321
+ const userDoc = await getDoc23(userRef);
13322
+ if (!userDoc.exists()) {
13323
+ throw USER_ERRORS.NOT_FOUND;
13324
+ }
13325
+ const updateData = {
13326
+ acquisitionSource: data.acquisitionSource,
13327
+ acquisitionSourceTimestamp: Timestamp18.now(),
13328
+ updatedAt: serverTimestamp18()
13329
+ };
13330
+ if (data.acquisitionSource === "other" /* OTHER */) {
13331
+ updateData.acquisitionSourceOther = data.acquisitionSourceOther || null;
13332
+ } else {
13333
+ updateData.acquisitionSourceOther = null;
13334
+ }
13335
+ await updateDoc17(userRef, updateData);
13336
+ }
13300
13337
  // Delete operations
13301
13338
  async deleteUser(uid) {
13302
13339
  const userRef = doc21(this.db, USERS_COLLECTION, uid);
@@ -26169,6 +26206,7 @@ export {
26169
26206
  AESTHETIC_ANALYSIS_COLLECTION,
26170
26207
  ANALYTICS_COLLECTION,
26171
26208
  APPOINTMENTS_COLLECTION,
26209
+ AcquisitionSource,
26172
26210
  AdminTokenStatus,
26173
26211
  AllergyType,
26174
26212
  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.43",
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);
@@ -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";
@@ -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>;