@blackcode_sa/metaestetics-api 1.14.58 → 1.14.60
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/admin/index.d.mts +42 -1
- package/dist/admin/index.d.ts +42 -1
- package/dist/admin/index.js +572 -19
- package/dist/admin/index.mjs +572 -19
- package/dist/index.d.mts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +1 -1
- package/src/admin/aggregation/appointment/appointment.aggregation.service.ts +28 -6
- package/src/admin/mailing/appointment/appointment.mailing.service.ts +498 -7
- package/src/admin/notifications/notifications.admin.ts +104 -6
- package/src/types/appointment/index.ts +6 -0
- package/src/types/notifications/index.ts +14 -0
package/dist/admin/index.d.mts
CHANGED
|
@@ -1850,6 +1850,9 @@ interface Appointment {
|
|
|
1850
1850
|
confirmationTime?: Timestamp | null;
|
|
1851
1851
|
cancellationTime?: Timestamp | null;
|
|
1852
1852
|
rescheduleTime?: Timestamp | null;
|
|
1853
|
+
/** Reschedule reminder tracking */
|
|
1854
|
+
rescheduleReminderSentAt?: Timestamp | null;
|
|
1855
|
+
rescheduleReminderCount?: number;
|
|
1853
1856
|
appointmentStartTime: Timestamp;
|
|
1854
1857
|
appointmentEndTime: Timestamp;
|
|
1855
1858
|
procedureActualStartTime?: Timestamp | null;
|
|
@@ -2943,6 +2946,7 @@ declare enum NotificationType {
|
|
|
2943
2946
|
APPOINTMENT_REMINDER = "appointmentReminder",// For upcoming appointments
|
|
2944
2947
|
APPOINTMENT_STATUS_CHANGE = "appointmentStatusChange",// Generic for status changes like confirmed, checked-in etc.
|
|
2945
2948
|
APPOINTMENT_RESCHEDULED_PROPOSAL = "appointmentRescheduledProposal",// When clinic proposes a new time
|
|
2949
|
+
APPOINTMENT_RESCHEDULED_REMINDER = "appointmentRescheduledReminder",// Reminder for pending reschedule request
|
|
2946
2950
|
APPOINTMENT_CANCELLED = "appointmentCancelled",// When an appointment is cancelled
|
|
2947
2951
|
PRE_REQUIREMENT_INSTRUCTION_DUE = "preRequirementInstructionDue",
|
|
2948
2952
|
POST_REQUIREMENT_INSTRUCTION_DUE = "postRequirementInstructionDue",
|
|
@@ -3078,6 +3082,16 @@ interface AppointmentRescheduledProposalNotification extends BaseNotification {
|
|
|
3078
3082
|
newProposedEndTime: Timestamp;
|
|
3079
3083
|
procedureName?: string;
|
|
3080
3084
|
}
|
|
3085
|
+
/**
|
|
3086
|
+
* Notification reminding the patient about a pending reschedule request they haven't responded to.
|
|
3087
|
+
* Example: "Reminder: You have a pending reschedule request for your [Procedure Name] appointment."
|
|
3088
|
+
*/
|
|
3089
|
+
interface AppointmentRescheduledReminderNotification extends BaseNotification {
|
|
3090
|
+
notificationType: NotificationType.APPOINTMENT_RESCHEDULED_REMINDER;
|
|
3091
|
+
appointmentId: string;
|
|
3092
|
+
procedureName?: string;
|
|
3093
|
+
reminderCount?: number;
|
|
3094
|
+
}
|
|
3081
3095
|
/**
|
|
3082
3096
|
* Notification informing about a cancelled appointment.
|
|
3083
3097
|
* Example: "Your appointment for [Procedure Name] on [Date] has been cancelled."
|
|
@@ -3153,7 +3167,7 @@ interface PaymentConfirmationNotification extends BaseNotification {
|
|
|
3153
3167
|
/**
|
|
3154
3168
|
* Unija svih tipova notifikacija
|
|
3155
3169
|
*/
|
|
3156
|
-
type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | ProcedureRecommendationNotification | GeneralMessageNotification | PaymentConfirmationNotification;
|
|
3170
|
+
type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentRescheduledReminderNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | ProcedureRecommendationNotification | GeneralMessageNotification | PaymentConfirmationNotification;
|
|
3157
3171
|
|
|
3158
3172
|
/**
|
|
3159
3173
|
* Minimal interface for the new mailgun.js client's messages API
|
|
@@ -4674,6 +4688,18 @@ declare class AppointmentMailingService extends BaseMailingService {
|
|
|
4674
4688
|
private getTimezoneDisplayName;
|
|
4675
4689
|
sendAppointmentConfirmedEmail(data: AppointmentConfirmationEmailData): Promise<any>;
|
|
4676
4690
|
sendAppointmentRequestedEmailToClinic(data: AppointmentRequestedEmailData): Promise<any>;
|
|
4691
|
+
/**
|
|
4692
|
+
* Gets a user-friendly display text for who cancelled the appointment
|
|
4693
|
+
* @param cancelledBy - The entity that cancelled the appointment
|
|
4694
|
+
* @param clinicName - The clinic name for context
|
|
4695
|
+
* @returns User-friendly cancellation source text
|
|
4696
|
+
*/
|
|
4697
|
+
private getCancelledByDisplayText;
|
|
4698
|
+
/**
|
|
4699
|
+
* Sends an appointment cancellation email to the recipient
|
|
4700
|
+
* @param data - Appointment cancellation email data
|
|
4701
|
+
* @returns Promise with the sending result
|
|
4702
|
+
*/
|
|
4677
4703
|
sendAppointmentCancelledEmail(data: AppointmentCancellationEmailData): Promise<any>;
|
|
4678
4704
|
/**
|
|
4679
4705
|
* Sends a reschedule proposal email to the patient
|
|
@@ -4697,6 +4723,12 @@ declare class NotificationsAdmin {
|
|
|
4697
4723
|
* Kreira novu notifikaciju
|
|
4698
4724
|
*/
|
|
4699
4725
|
createNotification(notification: Omit<Notification, "id">): Promise<string>;
|
|
4726
|
+
/**
|
|
4727
|
+
* Creates a notification and immediately attempts to send it.
|
|
4728
|
+
* If immediate send fails, the notification remains PENDING for cron pickup.
|
|
4729
|
+
* Returns the notification ID regardless of send success.
|
|
4730
|
+
*/
|
|
4731
|
+
createAndSendNotificationImmediately(notification: Omit<Notification, "id">): Promise<string>;
|
|
4700
4732
|
/**
|
|
4701
4733
|
* Priprema Expo poruku za slanje
|
|
4702
4734
|
*/
|
|
@@ -4730,6 +4762,15 @@ declare class NotificationsAdmin {
|
|
|
4730
4762
|
sendPaymentUpdatePush(appointment: Appointment, patientUserId: string, patientExpoTokens: string[]): Promise<string | null>;
|
|
4731
4763
|
sendReviewRequestPush(appointment: Appointment, patientUserId: string, patientExpoTokens: string[]): Promise<string | null>;
|
|
4732
4764
|
sendReviewAddedPush(appointment: Appointment, recipientUserId: string, recipientExpoTokens: string[], recipientRole: UserRole): Promise<string | null>;
|
|
4765
|
+
/**
|
|
4766
|
+
* Sends a reminder push notification for a pending reschedule request.
|
|
4767
|
+
* Used when a clinic has proposed a reschedule and the patient hasn't responded.
|
|
4768
|
+
* @param appointment The appointment with pending reschedule.
|
|
4769
|
+
* @param patientUserId The ID of the patient.
|
|
4770
|
+
* @param patientExpoTokens Array of Expo push tokens for the patient.
|
|
4771
|
+
* @param reminderCount Optional count of reminders already sent (for tracking).
|
|
4772
|
+
*/
|
|
4773
|
+
sendRescheduleReminderPush(appointment: Appointment, patientUserId: string, patientExpoTokens: string[], reminderCount?: number): Promise<string | null>;
|
|
4733
4774
|
}
|
|
4734
4775
|
|
|
4735
4776
|
/**
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -1850,6 +1850,9 @@ interface Appointment {
|
|
|
1850
1850
|
confirmationTime?: Timestamp | null;
|
|
1851
1851
|
cancellationTime?: Timestamp | null;
|
|
1852
1852
|
rescheduleTime?: Timestamp | null;
|
|
1853
|
+
/** Reschedule reminder tracking */
|
|
1854
|
+
rescheduleReminderSentAt?: Timestamp | null;
|
|
1855
|
+
rescheduleReminderCount?: number;
|
|
1853
1856
|
appointmentStartTime: Timestamp;
|
|
1854
1857
|
appointmentEndTime: Timestamp;
|
|
1855
1858
|
procedureActualStartTime?: Timestamp | null;
|
|
@@ -2943,6 +2946,7 @@ declare enum NotificationType {
|
|
|
2943
2946
|
APPOINTMENT_REMINDER = "appointmentReminder",// For upcoming appointments
|
|
2944
2947
|
APPOINTMENT_STATUS_CHANGE = "appointmentStatusChange",// Generic for status changes like confirmed, checked-in etc.
|
|
2945
2948
|
APPOINTMENT_RESCHEDULED_PROPOSAL = "appointmentRescheduledProposal",// When clinic proposes a new time
|
|
2949
|
+
APPOINTMENT_RESCHEDULED_REMINDER = "appointmentRescheduledReminder",// Reminder for pending reschedule request
|
|
2946
2950
|
APPOINTMENT_CANCELLED = "appointmentCancelled",// When an appointment is cancelled
|
|
2947
2951
|
PRE_REQUIREMENT_INSTRUCTION_DUE = "preRequirementInstructionDue",
|
|
2948
2952
|
POST_REQUIREMENT_INSTRUCTION_DUE = "postRequirementInstructionDue",
|
|
@@ -3078,6 +3082,16 @@ interface AppointmentRescheduledProposalNotification extends BaseNotification {
|
|
|
3078
3082
|
newProposedEndTime: Timestamp;
|
|
3079
3083
|
procedureName?: string;
|
|
3080
3084
|
}
|
|
3085
|
+
/**
|
|
3086
|
+
* Notification reminding the patient about a pending reschedule request they haven't responded to.
|
|
3087
|
+
* Example: "Reminder: You have a pending reschedule request for your [Procedure Name] appointment."
|
|
3088
|
+
*/
|
|
3089
|
+
interface AppointmentRescheduledReminderNotification extends BaseNotification {
|
|
3090
|
+
notificationType: NotificationType.APPOINTMENT_RESCHEDULED_REMINDER;
|
|
3091
|
+
appointmentId: string;
|
|
3092
|
+
procedureName?: string;
|
|
3093
|
+
reminderCount?: number;
|
|
3094
|
+
}
|
|
3081
3095
|
/**
|
|
3082
3096
|
* Notification informing about a cancelled appointment.
|
|
3083
3097
|
* Example: "Your appointment for [Procedure Name] on [Date] has been cancelled."
|
|
@@ -3153,7 +3167,7 @@ interface PaymentConfirmationNotification extends BaseNotification {
|
|
|
3153
3167
|
/**
|
|
3154
3168
|
* Unija svih tipova notifikacija
|
|
3155
3169
|
*/
|
|
3156
|
-
type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | ProcedureRecommendationNotification | GeneralMessageNotification | PaymentConfirmationNotification;
|
|
3170
|
+
type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentRescheduledReminderNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | ProcedureRecommendationNotification | GeneralMessageNotification | PaymentConfirmationNotification;
|
|
3157
3171
|
|
|
3158
3172
|
/**
|
|
3159
3173
|
* Minimal interface for the new mailgun.js client's messages API
|
|
@@ -4674,6 +4688,18 @@ declare class AppointmentMailingService extends BaseMailingService {
|
|
|
4674
4688
|
private getTimezoneDisplayName;
|
|
4675
4689
|
sendAppointmentConfirmedEmail(data: AppointmentConfirmationEmailData): Promise<any>;
|
|
4676
4690
|
sendAppointmentRequestedEmailToClinic(data: AppointmentRequestedEmailData): Promise<any>;
|
|
4691
|
+
/**
|
|
4692
|
+
* Gets a user-friendly display text for who cancelled the appointment
|
|
4693
|
+
* @param cancelledBy - The entity that cancelled the appointment
|
|
4694
|
+
* @param clinicName - The clinic name for context
|
|
4695
|
+
* @returns User-friendly cancellation source text
|
|
4696
|
+
*/
|
|
4697
|
+
private getCancelledByDisplayText;
|
|
4698
|
+
/**
|
|
4699
|
+
* Sends an appointment cancellation email to the recipient
|
|
4700
|
+
* @param data - Appointment cancellation email data
|
|
4701
|
+
* @returns Promise with the sending result
|
|
4702
|
+
*/
|
|
4677
4703
|
sendAppointmentCancelledEmail(data: AppointmentCancellationEmailData): Promise<any>;
|
|
4678
4704
|
/**
|
|
4679
4705
|
* Sends a reschedule proposal email to the patient
|
|
@@ -4697,6 +4723,12 @@ declare class NotificationsAdmin {
|
|
|
4697
4723
|
* Kreira novu notifikaciju
|
|
4698
4724
|
*/
|
|
4699
4725
|
createNotification(notification: Omit<Notification, "id">): Promise<string>;
|
|
4726
|
+
/**
|
|
4727
|
+
* Creates a notification and immediately attempts to send it.
|
|
4728
|
+
* If immediate send fails, the notification remains PENDING for cron pickup.
|
|
4729
|
+
* Returns the notification ID regardless of send success.
|
|
4730
|
+
*/
|
|
4731
|
+
createAndSendNotificationImmediately(notification: Omit<Notification, "id">): Promise<string>;
|
|
4700
4732
|
/**
|
|
4701
4733
|
* Priprema Expo poruku za slanje
|
|
4702
4734
|
*/
|
|
@@ -4730,6 +4762,15 @@ declare class NotificationsAdmin {
|
|
|
4730
4762
|
sendPaymentUpdatePush(appointment: Appointment, patientUserId: string, patientExpoTokens: string[]): Promise<string | null>;
|
|
4731
4763
|
sendReviewRequestPush(appointment: Appointment, patientUserId: string, patientExpoTokens: string[]): Promise<string | null>;
|
|
4732
4764
|
sendReviewAddedPush(appointment: Appointment, recipientUserId: string, recipientExpoTokens: string[], recipientRole: UserRole): Promise<string | null>;
|
|
4765
|
+
/**
|
|
4766
|
+
* Sends a reminder push notification for a pending reschedule request.
|
|
4767
|
+
* Used when a clinic has proposed a reschedule and the patient hasn't responded.
|
|
4768
|
+
* @param appointment The appointment with pending reschedule.
|
|
4769
|
+
* @param patientUserId The ID of the patient.
|
|
4770
|
+
* @param patientExpoTokens Array of Expo push tokens for the patient.
|
|
4771
|
+
* @param reminderCount Optional count of reminders already sent (for tracking).
|
|
4772
|
+
*/
|
|
4773
|
+
sendRescheduleReminderPush(appointment: Appointment, patientUserId: string, patientExpoTokens: string[], reminderCount?: number): Promise<string | null>;
|
|
4733
4774
|
}
|
|
4734
4775
|
|
|
4735
4776
|
/**
|