We would like a full report of all revenue, sorted by week (the database can do this for you!). The dates you get back from PostgreSQL will represent the first day of the week
The URI should follow this pattern: GET /api/v1/revenue/weekly
Example JSON response for GET /api/v1/revenue/weekly
{
"data": [
{
"id": null,
"type": "weekly_revenue",
"attributes": {
"week": "2012-03-05",
"revenue": 14981117.170000013
}
},
{
"id": null,
"type": "weekly_revenue",
"attributes": {
"week": "2012-03-12",
"revenue": 18778641.380000062
}
},
{
"id": null,
"type": "weekly_revenue",
"attributes": {
"week": "2012-03-19",
"revenue": 19106531.87999994
}
},
{
"id": null,
"type": "weekly_revenue",
"attributes": {
"week": "2012-03-26",
"revenue": 4627284.439999996
}
}
]
}
We would like a full report of all revenue, sorted by week (the database can do this for you!). The dates you get back from PostgreSQL will represent the first day of the week
The URI should follow this pattern: GET /api/v1/revenue/weekly
Example JSON response for GET /api/v1/revenue/weekly
{
"data": [
{
"id": null,
"type": "weekly_revenue",
"attributes": {
"week": "2012-03-05",
"revenue": 14981117.170000013
}
},
{
"id": null,
"type": "weekly_revenue",
"attributes": {
"week": "2012-03-12",
"revenue": 18778641.380000062
}
},
{
"id": null,
"type": "weekly_revenue",
"attributes": {
"week": "2012-03-19",
"revenue": 19106531.87999994
}
},
{
"id": null,
"type": "weekly_revenue",
"attributes": {
"week": "2012-03-26",
"revenue": 4627284.439999996
}
}
]
}