Problem
The package.json includes bullmq and ioredis but they are not wired up anywhere in the codebase. One of the most important features for cooperative groups is automated reminders when a member's monthly contribution is due — currently there is no scheduler at all.
Task
Implement a contribution reminder system:
- Create src/modules/notifications/reminder.queue.ts
Set up a BullMQ queue called contribution-reminders.
- Create src/modules/notifications/reminder.processor.ts
A BullMQ worker that:
Receives job payload: { groupId, memberAddress, period, dueDate }
Calls NotificationsService.create(memberAddress, 'contribution_due', ...)
(Optional) Sends email if member has email on file (stub it with a TODO comment)
- Schedule reminder jobs
In a @Cron(CronExpression.EVERY_DAY_AT_9AM) job:
- For each active group, check its contribution_period_days from governance rules
- For each member not yet contributed in current period
- Enqueue a reminder job 3 days before contribution is due
- Redis config
Add Redis connection to AppModule using BullModule.forRoot().
Acceptance Criteria
- BullMQ queue and processor implemented
- Daily cron job enqueues reminders for due-soon members
- Notification record created in DB when job runs
- Redis connection configurable via REDIS_URL env var
- Queue can be monitored (add bull-board or log queue stats)
- Unit test: mock queue, verify jobs enqueued correctly
Problem
The package.json includes bullmq and ioredis but they are not wired up anywhere in the codebase. One of the most important features for cooperative groups is automated reminders when a member's monthly contribution is due — currently there is no scheduler at all.
Task
Implement a contribution reminder system:
Set up a BullMQ queue called contribution-reminders.
A BullMQ worker that:
Receives job payload: { groupId, memberAddress, period, dueDate }
Calls NotificationsService.create(memberAddress, 'contribution_due', ...)
(Optional) Sends email if member has email on file (stub it with a TODO comment)
In a @Cron(CronExpression.EVERY_DAY_AT_9AM) job:
Add Redis connection to AppModule using BullModule.forRoot().
Acceptance Criteria