Leo Counter’s notification system keeps household members informed about upcoming financial obligations without requiring them to log in and check manually. Administrators configure one or more named email channels, assign subscriber users to those channels, and the scheduler takes care of firing alerts when fixed movements become due or pending payments are approaching their deadline. The entire notification configuration lives under Configuración (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/juanVillamilEchavarria/Leo_Counter-app/llms.txt
Use this file to discover all available pages before exploring further.
/configuracion) and is restricted to users with the admin role.
Notification Channels (CanalNotificacion)
A notification channel represents a named email delivery pipeline. Each channel has anactive flag that controls whether notifications actually get sent through it.
Currently, Leo Counter supports the Email channel type only, as defined by
CanalesNotificacionEnum::EMAIL = 'Email'. Additional channel types (e.g. SMS, webhook) can be added in future releases.Channel Routes
| Method | URI | Action |
|---|---|---|
| GET | /canal-notificaciones | List all channels |
| POST | /canal-notificaciones | Create a channel |
| PUT | /canal-notificaciones/{id} | Update a channel |
| DELETE | /canal-notificaciones/{id} | Delete a channel |
| PATCH | /canal-notificaciones/{id}/{attribute}/toggle | Toggle active flag (implemented) |
{attribute} is active. The ToggleCanalCommand is dispatched and the boolean is flipped. After the update Leo Counter redirects back to /configuracion.
Subscribers (SuscriptorNotificacion)
A subscriber pairs a user account with a notification channel. When a notification fires on a channel, every active and verified subscriber on that channel receives the email.verified_at field is null until the subscriber clicks the email verification link. Unverified subscribers do not receive notifications even if their active flag is true.
Creating a Subscriber
Subscribers are created by the admin using a form validated byStoreAndUpdateSuscriptorRequest:
StoreSuscriptorHandler dispatches an email verification message using SendEmailVerificationToSuscriptorStrategy. The email contains a signed URL that expires according to your application’s link expiry setting.
Subscriber Routes
Subscriber management is split across two controllers. The webSuscriptorController only provides the toggle endpoint. The API SuscriptorApiController provides the create, delete, and form-options endpoints consumed by the React front-end:
| Method | URI | Controller | Action |
|---|---|---|---|
| GET | /suscriptor-notificaciones | Web (resource index) | List all subscribers |
| PATCH | /suscriptor-notificaciones/{id}/{attribute}/toggle | Web SuscriptorController | Toggle active flag |
| POST | /api/notificacion/suscriptores | API SuscriptorApiController | Add a subscriber |
| DELETE | /api/notificacion/suscriptores/{id} | API SuscriptorApiController | Remove a subscriber |
| GET | /api/notificacion/suscriptores/form-options | API SuscriptorApiController | Subscriber form options |
Edit and update actions are intentionally excluded for subscribers. To change a subscriber’s channel, delete the existing subscription and create a new one. The
store and destroy actions that actually persist changes are handled by the API controller at /api/notificacion/suscriptores, not the web resource route.Email Verification
After an admin adds a subscriber, the user receives a verification email at their registered address. Clicking the link hits:signed middleware so it cannot be tampered with. The SuscriptorVerificationController dispatches VerifySuscriptorCommand, which sets verified_at to the current timestamp and renders a confirmation view.
Toggle Subscriber Active State
Admins can temporarily pause notifications for a specific subscriber without removing them:What Triggers Notifications
Notifications are fired by the daily financial tasks command, which processes two types of events:-
Fixed movements due — when a
MovimientoFijoreaches itsfecha_proximo(or is within thedias_avisowarning window),ProcessFinancialTaskForMovimientoFijoCommandis dispatched. Ifregistrar_automatico = true, Leo Counter automatically registers a spontaneous movement (RegisterMovimientoFromMovimientoFijoCommand) and advancesfecha_proximoto the next recurrence. Ifregistrar_automatico = false, it creates a pending movement (RegisterMovimientoPendienteFromMovimientoFijoCommand) instead. In both cases, subscribers on active channels receive a warning alert when thedias_avisothreshold is reached. -
Pending payments due or expired —
ProcessFinancialTasksForMovimientoPendienteCommandscans pending movements. Movements approachingfecha_programadawithin thedias_avisowindow trigger a warning notification (SendMessageToUsersWhenMovimientoPendienteWarningDayArrivedEventHandler). Movements whosefecha_programadahas passed without being marked done trigger an expiry alert (SendMessageToUsersWhenMovimientoPendienteExpiredEventHandler) and transition their status tovencido.
The Daily Scheduler Command
Notifications only fire if the scheduler container is running. In the Docker Compose development setup the scheduler service must be started explicitly. Verify it is up before testing notifications end-to-end.
Development Email Testing with Mailhog
During local development Leo Counter is pre-configured to route all outgoing email through Mailhog, an in-memory SMTP server that captures messages without sending them to real inboxes. Open the Mailhog web UI at:Setup Workflow
Create a notification channel
Log in as admin and navigate to Configuración. Under notification channels, click Create and enter a unique channel name (e.g. “Email Familia”). Toggle the channel to active once it is ready.
Add subscribers
Within the same configuration page, create a subscriber by selecting a Leo Counter user and linking them to the channel. Each user–channel pair is unique. The system immediately dispatches a verification email to the user.
Subscribers verify their email
Each subscriber receives an email with a signed verification link at
/suscriptores/verificar/{id}. Clicking the link sets verified_at and activates their subscription.Configure advance notice on movements
When creating fixed or pending movements, set
dias_aviso to a positive integer to receive a warning email that many days before the due date. For example, dias_aviso = 3 sends an alert three days ahead.