Voile.Notifications.LoanReminderNotifier (Voile v0.1.31)

Copy Markdown View Source

Handles broadcasting and subscribing to loan due date reminder notifications. Members get notified via PubSub when they have loans due soon.

This module handles real-time notifications for logged-in users. Email notifications are handled separately by LoanReminderEmail.

Summary

Functions

Broadcasts a loan reminder notification to a specific member. This is used for real-time notifications when the member is logged in.

Broadcasts an overdue notification to a specific member.

Subscribe to loan reminder notifications for a specific member. Should be called when a member logs in or opens a LiveView.

Unsubscribe from loan reminder notifications for a specific member.

Functions

broadcast_loan_reminder(transaction, days_until_due)

Broadcasts a loan reminder notification to a specific member. This is used for real-time notifications when the member is logged in.

Parameters

  • transaction: The transaction that's due soon
  • days_until_due: Number of days until the due date (can be negative for overdue)

broadcast_overdue_notification(transaction, days_overdue)

Broadcasts an overdue notification to a specific member.

subscribe_to_member_notifications(member_id)

Subscribe to loan reminder notifications for a specific member. Should be called when a member logs in or opens a LiveView.

unsubscribe_from_member_notifications(member_id)

Unsubscribe from loan reminder notifications for a specific member.