Commit Graph

12 Commits

Author SHA1 Message Date
6d5f0e824f Lottery wine functions & controller.
Split all wine/prelottrey wines into separate controller.
Now also have endpoints for deleting or updating single wine by id.
2021-01-24 12:12:52 +01:00
4d822ccb64 Isolated lottery attendee functs to it's own file. 2021-01-24 11:10:49 +01:00
7aa5f7e9ce Add, update and delete attendees to lottery. 2021-01-24 11:02:04 +01:00
18d8c2c7ca Lottery, get/delete attendees.
Changed so get attendees no longer is done in two endpoints, now we use
req.isAuthenticated() to check if we want to return full or minimal json
data about each attendee.
2021-01-24 10:14:00 +01:00
edc4d26647 User logout can happen in controller. 2021-01-24 10:08:39 +01:00
e07e6ae09a Winner controller, winners by date, color or name.
Winner controller replaces a lot of what happens in retrieve did for
aggregating when and what had been won. Now this is more clearly defined
in winner.js.
Also leverage mongo's query more than sorting and aggregating data like
previous implementation where a lot happened in js.
2021-01-24 10:05:00 +01:00
e9ece6963e /by-color endpoint for sort all winners by color.
Can also include query parameter includeWines for resolved wine
references.
2021-01-17 17:26:37 +01:00
53780878af Renamed to winners. Winners gets controller setup.
Rewrote everything that happened in history to better take advantage of
monogdb instead of doing everything in js.

Our endpoints become:
 - /winners - getAll w/ includeWines and sort query params.
 - /winners/latest - latest winners grouped w/ includeWines query
 params.
 - /winners/by-date - all winners grouped by date w/ includeWines and
 sort.
 - /winners/by-date/:date - get winners per epoch or string date.
 - /winners/by-name/:name - get winner by name parameter w/ sort for
 wins direction.
2021-01-17 16:55:57 +01:00
5e06a3fc28 ChatHistory behaved like controller already, renamed. 2021-01-16 14:23:02 +01:00
54c6c0eb97 History actions now have a controller setup. 2021-01-16 12:33:56 +01:00
e754f0a909 Wine ctrl for search wineinfo by query, ean or id. 2021-01-15 19:17:12 +01:00
4043954f95 Split request into controller and repo.
Also try returning better error message on exceptions and check for
errors in payload to return well-defined errors.
2021-01-11 20:52:22 +01:00