You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Managers should receive automated report digests (weekly asset summary, monthly depreciation report) without needing to log in to the platform. Users subscribe to a report schedule and receive it by email on the configured frequency.
Context
Depends on BE-40 (ScheduleModule), BE-07 (MailService), BE-51–53 (report data and export)
Report schedules are per-user — each user configures their own subscriptions
Acceptance Criteria
Create ReportSchedule entity: id, userId, reportType (enum: SUMMARY, WARRANTY_EXPIRING, MAINTENANCE_COSTS, DEPRECIATION), frequency (DAILY|WEEKLY|MONTHLY), format (PDF|EXCEL), isActive, lastSentAt, nextSendAt (computed from frequency), createdAt
POST /reports/schedules — creates a subscription and sets nextSendAt
GET /reports/schedules — current user's active schedules
PATCH /reports/schedules/:id — toggle active, change frequency or format
DELETE /reports/schedules/:id
Add daily cron in TasksService: find schedules where nextSendAt <= now and isActive = true; generate the report via ExportService, email as attachment, update lastSentAt and nextSendAt
Overview
Managers should receive automated report digests (weekly asset summary, monthly depreciation report) without needing to log in to the platform. Users subscribe to a report schedule and receive it by email on the configured frequency.
Context
Acceptance Criteria
ReportScheduleentity:id,userId,reportType(enum:SUMMARY,WARRANTY_EXPIRING,MAINTENANCE_COSTS,DEPRECIATION),frequency(DAILY|WEEKLY|MONTHLY),format(PDF|EXCEL),isActive,lastSentAt,nextSendAt(computed from frequency),createdAtPOST /reports/schedules— creates a subscription and setsnextSendAtGET /reports/schedules— current user's active schedulesPATCH /reports/schedules/:id— toggle active, change frequency or formatDELETE /reports/schedules/:idTasksService: find schedules wherenextSendAt <= nowandisActive = true; generate the report viaExportService, email as attachment, updatelastSentAtandnextSendAt