@blackcode_sa/metaestetics-api 1.14.57 → 1.14.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3232,6 +3232,7 @@ declare enum NotificationType {
3232
3232
  APPOINTMENT_REMINDER = "appointmentReminder",// For upcoming appointments
3233
3233
  APPOINTMENT_STATUS_CHANGE = "appointmentStatusChange",// Generic for status changes like confirmed, checked-in etc.
3234
3234
  APPOINTMENT_RESCHEDULED_PROPOSAL = "appointmentRescheduledProposal",// When clinic proposes a new time
3235
+ APPOINTMENT_RESCHEDULED_REMINDER = "appointmentRescheduledReminder",// Reminder for pending reschedule request
3235
3236
  APPOINTMENT_CANCELLED = "appointmentCancelled",// When an appointment is cancelled
3236
3237
  PRE_REQUIREMENT_INSTRUCTION_DUE = "preRequirementInstructionDue",
3237
3238
  POST_REQUIREMENT_INSTRUCTION_DUE = "postRequirementInstructionDue",
@@ -3367,6 +3368,16 @@ interface AppointmentRescheduledProposalNotification extends BaseNotification {
3367
3368
  newProposedEndTime: Timestamp;
3368
3369
  procedureName?: string;
3369
3370
  }
3371
+ /**
3372
+ * Notification reminding the patient about a pending reschedule request they haven't responded to.
3373
+ * Example: "Reminder: You have a pending reschedule request for your [Procedure Name] appointment."
3374
+ */
3375
+ interface AppointmentRescheduledReminderNotification extends BaseNotification {
3376
+ notificationType: NotificationType.APPOINTMENT_RESCHEDULED_REMINDER;
3377
+ appointmentId: string;
3378
+ procedureName?: string;
3379
+ reminderCount?: number;
3380
+ }
3370
3381
  /**
3371
3382
  * Notification informing about a cancelled appointment.
3372
3383
  * Example: "Your appointment for [Procedure Name] on [Date] has been cancelled."
@@ -3442,7 +3453,7 @@ interface PaymentConfirmationNotification extends BaseNotification {
3442
3453
  /**
3443
3454
  * Unija svih tipova notifikacija
3444
3455
  */
3445
- type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | ProcedureRecommendationNotification | GeneralMessageNotification | PaymentConfirmationNotification;
3456
+ type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentRescheduledReminderNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | ProcedureRecommendationNotification | GeneralMessageNotification | PaymentConfirmationNotification;
3446
3457
 
3447
3458
  declare enum AllergyType {
3448
3459
  MEDICATION = "medication",
@@ -5787,6 +5798,9 @@ interface Appointment {
5787
5798
  confirmationTime?: Timestamp | null;
5788
5799
  cancellationTime?: Timestamp | null;
5789
5800
  rescheduleTime?: Timestamp | null;
5801
+ /** Reschedule reminder tracking */
5802
+ rescheduleReminderSentAt?: Timestamp | null;
5803
+ rescheduleReminderCount?: number;
5790
5804
  appointmentStartTime: Timestamp;
5791
5805
  appointmentEndTime: Timestamp;
5792
5806
  procedureActualStartTime?: Timestamp | null;
@@ -5870,6 +5884,9 @@ interface UpdateAppointmentData {
5870
5884
  confirmationTime?: Timestamp | FieldValue | null;
5871
5885
  cancellationTime?: Timestamp | FieldValue | null;
5872
5886
  rescheduleTime?: Timestamp | FieldValue | null;
5887
+ /** Reschedule reminder tracking */
5888
+ rescheduleReminderSentAt?: Timestamp | FieldValue | null;
5889
+ rescheduleReminderCount?: number | FieldValue;
5873
5890
  procedureActualStartTime?: Timestamp | FieldValue | null;
5874
5891
  actualDurationMinutes?: number;
5875
5892
  cancellationReason?: string | null;
@@ -6899,10 +6916,29 @@ declare class ProcedureService extends BaseService {
6899
6916
  procedures: Procedure[];
6900
6917
  lastDoc: any;
6901
6918
  }>;
6919
+ /**
6920
+ * Creates a serializable cursor from a DocumentSnapshot or returns the cursor values.
6921
+ * This format can be passed through React Native state/Redux without losing data.
6922
+ *
6923
+ * @param doc - The Firestore DocumentSnapshot
6924
+ * @param orderByField - The field used in orderBy clause
6925
+ * @returns Serializable cursor object with values needed for startAfter
6926
+ */
6927
+ private createSerializableCursor;
6928
+ /**
6929
+ * Converts a serializable cursor back to values for startAfter.
6930
+ * Handles both native DocumentSnapshots and serialized cursor objects.
6931
+ *
6932
+ * @param lastDoc - Either a DocumentSnapshot or a serializable cursor object
6933
+ * @param orderByField - The field used in orderBy clause (for validation)
6934
+ * @returns Values to spread into startAfter, or null if invalid
6935
+ */
6936
+ private getCursorValuesForStartAfter;
6902
6937
  /**
6903
6938
  * Searches and filters procedures based on multiple criteria
6904
6939
  *
6905
- * @note Frontend MORA da šalje ceo snapshot (ili barem sva polja po kojima sortiraš, npr. nameLower) kao lastDoc za paginaciju, a ne samo id!
6940
+ * @note Frontend can now send either a DocumentSnapshot or a serializable cursor object.
6941
+ * The serializable cursor format is: { __cursor: true, values: [...], id: string, orderByField: string }
6906
6942
  *
6907
6943
  * @param filters - Various filters to apply
6908
6944
  * @param filters.nameSearch - Optional search text for procedure name
@@ -9307,4 +9343,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
9307
9343
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
9308
9344
  declare const getFirebaseFunctions: () => Promise<Functions>;
9309
9345
 
9310
- 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 };
9346
+ 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, type AppointmentRescheduledReminderNotification, 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
@@ -3232,6 +3232,7 @@ declare enum NotificationType {
3232
3232
  APPOINTMENT_REMINDER = "appointmentReminder",// For upcoming appointments
3233
3233
  APPOINTMENT_STATUS_CHANGE = "appointmentStatusChange",// Generic for status changes like confirmed, checked-in etc.
3234
3234
  APPOINTMENT_RESCHEDULED_PROPOSAL = "appointmentRescheduledProposal",// When clinic proposes a new time
3235
+ APPOINTMENT_RESCHEDULED_REMINDER = "appointmentRescheduledReminder",// Reminder for pending reschedule request
3235
3236
  APPOINTMENT_CANCELLED = "appointmentCancelled",// When an appointment is cancelled
3236
3237
  PRE_REQUIREMENT_INSTRUCTION_DUE = "preRequirementInstructionDue",
3237
3238
  POST_REQUIREMENT_INSTRUCTION_DUE = "postRequirementInstructionDue",
@@ -3367,6 +3368,16 @@ interface AppointmentRescheduledProposalNotification extends BaseNotification {
3367
3368
  newProposedEndTime: Timestamp;
3368
3369
  procedureName?: string;
3369
3370
  }
3371
+ /**
3372
+ * Notification reminding the patient about a pending reschedule request they haven't responded to.
3373
+ * Example: "Reminder: You have a pending reschedule request for your [Procedure Name] appointment."
3374
+ */
3375
+ interface AppointmentRescheduledReminderNotification extends BaseNotification {
3376
+ notificationType: NotificationType.APPOINTMENT_RESCHEDULED_REMINDER;
3377
+ appointmentId: string;
3378
+ procedureName?: string;
3379
+ reminderCount?: number;
3380
+ }
3370
3381
  /**
3371
3382
  * Notification informing about a cancelled appointment.
3372
3383
  * Example: "Your appointment for [Procedure Name] on [Date] has been cancelled."
@@ -3442,7 +3453,7 @@ interface PaymentConfirmationNotification extends BaseNotification {
3442
3453
  /**
3443
3454
  * Unija svih tipova notifikacija
3444
3455
  */
3445
- type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | ProcedureRecommendationNotification | GeneralMessageNotification | PaymentConfirmationNotification;
3456
+ type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentRescheduledReminderNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | ProcedureRecommendationNotification | GeneralMessageNotification | PaymentConfirmationNotification;
3446
3457
 
3447
3458
  declare enum AllergyType {
3448
3459
  MEDICATION = "medication",
@@ -5787,6 +5798,9 @@ interface Appointment {
5787
5798
  confirmationTime?: Timestamp | null;
5788
5799
  cancellationTime?: Timestamp | null;
5789
5800
  rescheduleTime?: Timestamp | null;
5801
+ /** Reschedule reminder tracking */
5802
+ rescheduleReminderSentAt?: Timestamp | null;
5803
+ rescheduleReminderCount?: number;
5790
5804
  appointmentStartTime: Timestamp;
5791
5805
  appointmentEndTime: Timestamp;
5792
5806
  procedureActualStartTime?: Timestamp | null;
@@ -5870,6 +5884,9 @@ interface UpdateAppointmentData {
5870
5884
  confirmationTime?: Timestamp | FieldValue | null;
5871
5885
  cancellationTime?: Timestamp | FieldValue | null;
5872
5886
  rescheduleTime?: Timestamp | FieldValue | null;
5887
+ /** Reschedule reminder tracking */
5888
+ rescheduleReminderSentAt?: Timestamp | FieldValue | null;
5889
+ rescheduleReminderCount?: number | FieldValue;
5873
5890
  procedureActualStartTime?: Timestamp | FieldValue | null;
5874
5891
  actualDurationMinutes?: number;
5875
5892
  cancellationReason?: string | null;
@@ -6899,10 +6916,29 @@ declare class ProcedureService extends BaseService {
6899
6916
  procedures: Procedure[];
6900
6917
  lastDoc: any;
6901
6918
  }>;
6919
+ /**
6920
+ * Creates a serializable cursor from a DocumentSnapshot or returns the cursor values.
6921
+ * This format can be passed through React Native state/Redux without losing data.
6922
+ *
6923
+ * @param doc - The Firestore DocumentSnapshot
6924
+ * @param orderByField - The field used in orderBy clause
6925
+ * @returns Serializable cursor object with values needed for startAfter
6926
+ */
6927
+ private createSerializableCursor;
6928
+ /**
6929
+ * Converts a serializable cursor back to values for startAfter.
6930
+ * Handles both native DocumentSnapshots and serialized cursor objects.
6931
+ *
6932
+ * @param lastDoc - Either a DocumentSnapshot or a serializable cursor object
6933
+ * @param orderByField - The field used in orderBy clause (for validation)
6934
+ * @returns Values to spread into startAfter, or null if invalid
6935
+ */
6936
+ private getCursorValuesForStartAfter;
6902
6937
  /**
6903
6938
  * Searches and filters procedures based on multiple criteria
6904
6939
  *
6905
- * @note Frontend MORA da šalje ceo snapshot (ili barem sva polja po kojima sortiraš, npr. nameLower) kao lastDoc za paginaciju, a ne samo id!
6940
+ * @note Frontend can now send either a DocumentSnapshot or a serializable cursor object.
6941
+ * The serializable cursor format is: { __cursor: true, values: [...], id: string, orderByField: string }
6906
6942
  *
6907
6943
  * @param filters - Various filters to apply
6908
6944
  * @param filters.nameSearch - Optional search text for procedure name
@@ -9307,4 +9343,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
9307
9343
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
9308
9344
  declare const getFirebaseFunctions: () => Promise<Functions>;
9309
9345
 
9310
- 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 };
9346
+ 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, type AppointmentRescheduledReminderNotification, 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
@@ -7771,6 +7771,7 @@ var NotificationType = /* @__PURE__ */ ((NotificationType3) => {
7771
7771
  NotificationType3["APPOINTMENT_REMINDER"] = "appointmentReminder";
7772
7772
  NotificationType3["APPOINTMENT_STATUS_CHANGE"] = "appointmentStatusChange";
7773
7773
  NotificationType3["APPOINTMENT_RESCHEDULED_PROPOSAL"] = "appointmentRescheduledProposal";
7774
+ NotificationType3["APPOINTMENT_RESCHEDULED_REMINDER"] = "appointmentRescheduledReminder";
7774
7775
  NotificationType3["APPOINTMENT_CANCELLED"] = "appointmentCancelled";
7775
7776
  NotificationType3["PRE_REQUIREMENT_INSTRUCTION_DUE"] = "preRequirementInstructionDue";
7776
7777
  NotificationType3["POST_REQUIREMENT_INSTRUCTION_DUE"] = "postRequirementInstructionDue";
@@ -22601,10 +22602,72 @@ var ProcedureService = class extends BaseService {
22601
22602
  throw error;
22602
22603
  }
22603
22604
  }
22605
+ /**
22606
+ * Creates a serializable cursor from a DocumentSnapshot or returns the cursor values.
22607
+ * This format can be passed through React Native state/Redux without losing data.
22608
+ *
22609
+ * @param doc - The Firestore DocumentSnapshot
22610
+ * @param orderByField - The field used in orderBy clause
22611
+ * @returns Serializable cursor object with values needed for startAfter
22612
+ */
22613
+ createSerializableCursor(doc47, orderByField = "createdAt") {
22614
+ if (!doc47) return null;
22615
+ const data = typeof doc47.data === "function" ? doc47.data() : doc47;
22616
+ const docId = doc47.id || (data == null ? void 0 : data.id);
22617
+ if (!docId) return null;
22618
+ let orderByValue = data == null ? void 0 : data[orderByField];
22619
+ if (orderByValue && typeof orderByValue.toDate === "function") {
22620
+ orderByValue = orderByValue.toMillis();
22621
+ } else if (orderByValue && orderByValue.seconds) {
22622
+ orderByValue = orderByValue.seconds * 1e3 + (orderByValue.nanoseconds || 0) / 1e6;
22623
+ }
22624
+ return {
22625
+ __cursor: true,
22626
+ values: [orderByValue],
22627
+ id: docId,
22628
+ orderByField
22629
+ };
22630
+ }
22631
+ /**
22632
+ * Converts a serializable cursor back to values for startAfter.
22633
+ * Handles both native DocumentSnapshots and serialized cursor objects.
22634
+ *
22635
+ * @param lastDoc - Either a DocumentSnapshot or a serializable cursor object
22636
+ * @param orderByField - The field used in orderBy clause (for validation)
22637
+ * @returns Values to spread into startAfter, or null if invalid
22638
+ */
22639
+ getCursorValuesForStartAfter(lastDoc, orderByField = "createdAt") {
22640
+ if (!lastDoc) return null;
22641
+ if (typeof lastDoc.data === "function") {
22642
+ return [lastDoc];
22643
+ }
22644
+ if (lastDoc.__cursor && Array.isArray(lastDoc.values)) {
22645
+ if (orderByField === "createdAt" && typeof lastDoc.values[0] === "number") {
22646
+ const timestamp = import_firestore58.Timestamp.fromMillis(lastDoc.values[0]);
22647
+ return [timestamp];
22648
+ }
22649
+ return lastDoc.values;
22650
+ }
22651
+ if (Array.isArray(lastDoc)) {
22652
+ return lastDoc;
22653
+ }
22654
+ if (lastDoc[orderByField]) {
22655
+ let value = lastDoc[orderByField];
22656
+ if (typeof value === "number" && orderByField === "createdAt") {
22657
+ value = import_firestore58.Timestamp.fromMillis(value);
22658
+ } else if (value.seconds && orderByField === "createdAt") {
22659
+ value = new import_firestore58.Timestamp(value.seconds, value.nanoseconds || 0);
22660
+ }
22661
+ return [value];
22662
+ }
22663
+ console.warn("[PROCEDURE_SERVICE] Could not parse lastDoc cursor:", typeof lastDoc);
22664
+ return null;
22665
+ }
22604
22666
  /**
22605
22667
  * Searches and filters procedures based on multiple criteria
22606
22668
  *
22607
- * @note Frontend MORA da šalje ceo snapshot (ili barem sva polja po kojima sortiraš, npr. nameLower) kao lastDoc za paginaciju, a ne samo id!
22669
+ * @note Frontend can now send either a DocumentSnapshot or a serializable cursor object.
22670
+ * The serializable cursor format is: { __cursor: true, values: [...], id: string, orderByField: string }
22608
22671
  *
22609
22672
  * @param filters - Various filters to apply
22610
22673
  * @param filters.nameSearch - Optional search text for procedure name
@@ -22700,12 +22763,10 @@ var ProcedureService = class extends BaseService {
22700
22763
  constraints.push((0, import_firestore58.where)("nameLower", "<=", searchTerm + "\uF8FF"));
22701
22764
  constraints.push((0, import_firestore58.orderBy)("nameLower"));
22702
22765
  if (filters.lastDoc) {
22703
- if (typeof filters.lastDoc.data === "function") {
22704
- constraints.push((0, import_firestore58.startAfter)(filters.lastDoc));
22705
- } else if (Array.isArray(filters.lastDoc)) {
22706
- constraints.push((0, import_firestore58.startAfter)(...filters.lastDoc));
22707
- } else {
22708
- constraints.push((0, import_firestore58.startAfter)(filters.lastDoc));
22766
+ const cursorValues = this.getCursorValuesForStartAfter(filters.lastDoc, "nameLower");
22767
+ if (cursorValues) {
22768
+ constraints.push((0, import_firestore58.startAfter)(...cursorValues));
22769
+ console.log("[PROCEDURE_SERVICE] Strategy 1: Using cursor for pagination");
22709
22770
  }
22710
22771
  }
22711
22772
  constraints.push((0, import_firestore58.limit)(filters.pagination || 10));
@@ -22724,8 +22785,9 @@ var ProcedureService = class extends BaseService {
22724
22785
  if (querySnapshot.docs.length < (filters.pagination || 10)) {
22725
22786
  return { procedures, lastDoc: null };
22726
22787
  }
22727
- const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
22728
- return { procedures, lastDoc };
22788
+ const lastDocSnapshot = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
22789
+ const serializableCursor = this.createSerializableCursor(lastDocSnapshot, "nameLower");
22790
+ return { procedures, lastDoc: serializableCursor };
22729
22791
  } catch (error) {
22730
22792
  console.log("[PROCEDURE_SERVICE] Strategy 1 failed:", error);
22731
22793
  }
@@ -22743,12 +22805,10 @@ var ProcedureService = class extends BaseService {
22743
22805
  constraints.push((0, import_firestore58.where)("name", "<=", searchTerm + "\uF8FF"));
22744
22806
  constraints.push((0, import_firestore58.orderBy)("name"));
22745
22807
  if (filters.lastDoc) {
22746
- if (typeof filters.lastDoc.data === "function") {
22747
- constraints.push((0, import_firestore58.startAfter)(filters.lastDoc));
22748
- } else if (Array.isArray(filters.lastDoc)) {
22749
- constraints.push((0, import_firestore58.startAfter)(...filters.lastDoc));
22750
- } else {
22751
- constraints.push((0, import_firestore58.startAfter)(filters.lastDoc));
22808
+ const cursorValues = this.getCursorValuesForStartAfter(filters.lastDoc, "name");
22809
+ if (cursorValues) {
22810
+ constraints.push((0, import_firestore58.startAfter)(...cursorValues));
22811
+ console.log("[PROCEDURE_SERVICE] Strategy 2: Using cursor for pagination");
22752
22812
  }
22753
22813
  }
22754
22814
  constraints.push((0, import_firestore58.limit)(filters.pagination || 10));
@@ -22767,8 +22827,9 @@ var ProcedureService = class extends BaseService {
22767
22827
  if (querySnapshot.docs.length < (filters.pagination || 10)) {
22768
22828
  return { procedures, lastDoc: null };
22769
22829
  }
22770
- const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
22771
- return { procedures, lastDoc };
22830
+ const lastDocSnapshot = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
22831
+ const serializableCursor = this.createSerializableCursor(lastDocSnapshot, "name");
22832
+ return { procedures, lastDoc: serializableCursor };
22772
22833
  } catch (error) {
22773
22834
  console.log("[PROCEDURE_SERVICE] Strategy 2 failed:", error);
22774
22835
  }
@@ -22818,12 +22879,10 @@ var ProcedureService = class extends BaseService {
22818
22879
  );
22819
22880
  constraints.push((0, import_firestore58.orderBy)("createdAt", "desc"));
22820
22881
  if (filters.lastDoc) {
22821
- if (typeof filters.lastDoc.data === "function") {
22822
- constraints.push((0, import_firestore58.startAfter)(filters.lastDoc));
22823
- } else if (Array.isArray(filters.lastDoc)) {
22824
- constraints.push((0, import_firestore58.startAfter)(...filters.lastDoc));
22825
- } else {
22826
- constraints.push((0, import_firestore58.startAfter)(filters.lastDoc));
22882
+ const cursorValues = this.getCursorValuesForStartAfter(filters.lastDoc, "createdAt");
22883
+ if (cursorValues) {
22884
+ constraints.push((0, import_firestore58.startAfter)(...cursorValues));
22885
+ console.log("[PROCEDURE_SERVICE] Strategy 3: Using cursor for pagination");
22827
22886
  }
22828
22887
  }
22829
22888
  constraints.push((0, import_firestore58.limit)(filters.pagination || 10));
@@ -22854,8 +22913,9 @@ var ProcedureService = class extends BaseService {
22854
22913
  if (querySnapshot.docs.length < (filters.pagination || 10)) {
22855
22914
  return { procedures, lastDoc: null };
22856
22915
  }
22857
- const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
22858
- return { procedures, lastDoc };
22916
+ const lastDocSnapshot = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
22917
+ const serializableCursor = this.createSerializableCursor(lastDocSnapshot, "createdAt");
22918
+ return { procedures, lastDoc: serializableCursor };
22859
22919
  } catch (error) {
22860
22920
  console.log("[PROCEDURE_SERVICE] Strategy 3 failed:", error);
22861
22921
  }
@@ -22871,6 +22931,13 @@ var ProcedureService = class extends BaseService {
22871
22931
  if (filters.clinicId) {
22872
22932
  constraints.push((0, import_firestore58.where)("clinicBranchId", "==", filters.clinicId));
22873
22933
  }
22934
+ if (filters.lastDoc) {
22935
+ const cursorValues = this.getCursorValuesForStartAfter(filters.lastDoc, "createdAt");
22936
+ if (cursorValues) {
22937
+ constraints.push((0, import_firestore58.startAfter)(...cursorValues));
22938
+ console.log("[PROCEDURE_SERVICE] Strategy 4: Using cursor for pagination");
22939
+ }
22940
+ }
22874
22941
  constraints.push((0, import_firestore58.limit)(filters.pagination || 10));
22875
22942
  const q = (0, import_firestore58.query)((0, import_firestore58.collection)(this.db, PROCEDURES_COLLECTION), ...constraints);
22876
22943
  const querySnapshot = await (0, import_firestore58.getDocs)(q);
@@ -22885,8 +22952,9 @@ var ProcedureService = class extends BaseService {
22885
22952
  if (querySnapshot.docs.length < (filters.pagination || 10)) {
22886
22953
  return { procedures, lastDoc: null };
22887
22954
  }
22888
- const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
22889
- return { procedures, lastDoc };
22955
+ const lastDocSnapshot = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
22956
+ const serializableCursor = this.createSerializableCursor(lastDocSnapshot, "createdAt");
22957
+ return { procedures, lastDoc: serializableCursor };
22890
22958
  } catch (error) {
22891
22959
  console.log("[PROCEDURE_SERVICE] Strategy 4 failed:", error);
22892
22960
  }