Feat/controllers - refactor entire backend and new admin interface #75

Merged
KevinMidboe merged 117 commits from feat/controllers into master 2021-02-19 00:19:52 +00:00
KevinMidboe commented 2021-01-26 22:07:07 +00:00 (Migrated from github.com)

Description

Refactor all endpoints to reflect new vinlottis functionality. It has evolved to be much more focused around virtual lottery and wanted to update the backend to better handle speed, distinction of functionality and error handling. The main points here was to make the admin page better by implementing more complete CRUD endpoints. Changes reflected in more actions on the admin page. Administrators should have a easier time importing new wines, adding attendees, drawing winners and archiving a lottery.
The frontend updated to better use the new api and has had housekeeping to be more consistent with the intent of making the project easier to build off of by others. The Vue components use the new api to fetch and display data more efficiently, and has had the template and styling thinner.

Redesigned admin page

Backend:

  • Every express router endpoint interfaces with repositories through a controller ✔️
  • Interface more with vinmonopolet api. Search for wine by product id, store by name and get all stores.
  • Local error classes for better error handling from repositories and handling in request response from controller.
  • Lottery winners, pre-lottery wines, requested wines, previous lotteries & attendees all support at least get by id, get all, post, delete and delete all actions.

Frontend:

  • Data in each component tries to be more efficient from fetching to displaying.
  • Admin page has more tabs which have clear actions.
  • UI for update or delete: attendees, winners & wines, to fully use CRUD api.
  • More responsive grid elements for top winner & wine container. Some elements are hidden to always show fully filled rows of elements.
  • Draw winner and start sms prize distribution split into separate buttons.
  • Draw winner has animated buttons replacing background window.confirm dialog.
  • Separate buttons for drawing winner and starting sms prize distribution.
  • Updated all api calls to happen within the component, not external /api.js. Also use new backend refactor endpoints.

Images

Todo

  • don't like needing to pass isAdmin to repository function, should something like a request session handle to keep track of this throughout the request.
  • Save direction path in global js variable to not need to import path in every file.
  • winner by search query: check for illegal character use in query string.
## Description Refactor all endpoints to reflect new vinlottis functionality. It has evolved to be much more focused around virtual lottery and wanted to update the backend to better handle speed, distinction of functionality and error handling. The main points here was to make the admin page better by implementing more complete CRUD endpoints. Changes reflected in more actions on the admin page. Administrators should have a easier time importing new wines, adding attendees, drawing winners and archiving a lottery. The frontend updated to better use the new api and has had housekeeping to be more consistent with the intent of making the project easier to build off of by others. The Vue components use the new api to fetch and display data more efficiently, and has had the template and styling thinner. ## Redesigned admin page Backend: - Every express router endpoint interfaces with repositories through a controller ✔️ - Interface more with vinmonopolet api. Search for wine by product id, store by name and get all stores. - Local error classes for better error handling from repositories and handling in request response from controller. - Lottery winners, pre-lottery wines, requested wines, previous lotteries & attendees all support at least get by id, get all, post, delete and delete all actions. Frontend: - Data in each component tries to be more efficient from fetching to displaying. - Admin page has more tabs which have clear actions. - UI for update or delete: attendees, winners & wines, to fully use CRUD api. - More responsive grid elements for top winner & wine container. Some elements are hidden to always show fully filled rows of elements. - Draw winner and start sms prize distribution split into separate buttons. - Draw winner has animated buttons replacing background window.confirm dialog. - Separate buttons for drawing winner and starting sms prize distribution. - Updated all api calls to happen within the component, not external `/api.js`. Also use new backend refactor endpoints. ## Images ## Todo - don't like needing to pass isAdmin to repository function, should something like a request session handle to keep track of this throughout the request. - Save direction path in global js variable to not need to import path in every file. - winner by search query: check for illegal character use in query string.
Sign in to join this conversation.
No description provided.