Skip to content

Add Restauration Calculation and Display

Émilien FIEU requested to merge Tructruc00/FlOpEDT:vue-vite into vue-vite

Merge request checklist

Please check if your Merge Request (MR) fulfills the following requirements:

  • We added our names in the AUTHORS.md file
  • We added some insights in the CHANGELOG.md file
  • New needed python modules have been added to requirements.txt, if any
  • Tests for the changes have been added (for bug fixes / features)
  • The CI is still successful
  • Docs have been reviewed and added / updated if needed (for bug fixes / features). The wiki page of FlOpEDT may be merge requested as in https://stackoverflow.com/a/38537453
  • No additional printing (neither in django (print) or in javascript (console.log))

New dependencies

Have new dependencies been added?

  • Back-end
    • Yes
    • No
  • Front-end
    • Yes
    • No

Merge request type

Please check the type of change your MR introduces:

  • Bugfix
  • Feature
  • Upgrade from v0 to v1
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation contents changes
  • Other (please describe):

What’s new

  • Added 3 endpoints
    • /api/v1/restauration/weeks
      • GET : Respond with the lunch counts for the current week and all following weeks
    • /api/v1/restauration/settings
      • GET : Respond with the lunch calculation parameters
      • PUT : Edit the lunch calculation parameters
    • /restauration/generate
      • GET : Start the lunch calculation for all Scheduled Course in the database, respond with for each day the count of student that have a course only on the last slot of the morning, the ones that have only on the first slot of the morning, the ones that have a course on the last slot of the morning and on the first slot of the afternoon, the estimated lunch count for the day.
  • Added 3 components
    • Restauration : show the lunch counts for the current week and all following weeks
      • Created a story with 3 use cases
    • RestaurationSettings : show and edit the lunch calcalation parameters
    • Semaine : component tha represent the lunch count for each doy of the week
  • Added 2 models
    • LunchDay
    • LunchSettings

Does this introduce a breaking change?

  • Yes
  • No

Does this introduce a new migration in the database ?

  • Yes
  • No

Other information

What still need to be done

  • Execute the calculation when a modification is made
  • Only calculate for the modified days
  • Maybe remove the api endpoint for the lunch calculation because it will be done automatically

Screenshots

Restauration

Capture_d_écran_du_2024-05-31_12-32-58

RestaurationSettings

Capture_d_écran_du_2024-05-31_12-32-45

Merge request reports