---
# System prepended metadata

title: Reporting Module

---

# Reporting Module

## Story 

* As an admin, I should be able to schedule reports to be sent to certain email addresses. I should be able to select what report and intervals at which it is sent.
* As a user, I should be able to view a history of all reports generated in the last month and download them. 
* As a user, I should be able to run a report at will.
* As a user, I should recieve all report emails wit:
    * a `+` tag in the address. 
    * the report name in the subject.

## Tables 

### ReportSchedule

Report configuration defines the schedule, entity, method used to generate reports, and the recipients it is to be sent to. 

#### fields

* `t.string 'name', null: false`
* `t.string 'email_recipients', array: true, default: []`
* `t.string 'bcc_recipients', array: true, default: []`
* `t.string 'cron', null: false, default: '45 07 * * *'`
* `t.string 'report_classname'`
* `t.timestamps`

### Report

A report is a single report generated by a report configuratin.

* `t.string 'csv_file'`
* `t.bigint 'report_schedule_id'`
* `t.timestamps`

