#964-Implement-Meue-Service #1076

Open
c24elipe wants to merge 39 commits from #964-Implement-Meue-Service into team_2_week_7
Collaborator

Developed on

This has been developed using JetBrains Rider and dotnet 10, on Arch Linux.

What's been done?

This is an implementation of the menu service.
Its goal is to read data from the restaurant "Götasalen"'s public ICS calendar.
The data then gets saved in memory and in the database to ping the restaurants endpoint and then the database as little as possible.

APi endpoints added:

  • "/": health check
  • "/today": get today's menu.
  • "/today/{category}": gets a specific category of today's food.
  • "/week": get the current week's menu.
  • "/week/{category}": gets a specific category of weekly food.
  • "/categories": Get all categories found.

What files have been created (A super quick overview)

  • DockerCompose/compose.yaml

    • I added the correct time zone to the database and menuService to allow correct time conversions.
    • Added menu service container.
  • DockerCompose/init_sql/04-menu.sql

    • I added a new database, two tables (menu_entries and menu_categories)
  • entryPoint/nginx.conf

    • Added menu service to the entrypoint under "api/menu/."
  • All scripts/*:

    • Added menu service to be built and used.
  • service/menuService/menuService/DatabaseLogic/CacheLogic.cs

    • This script contains the main logic for cashing in the in-memory and database storage used.
  • service/menuService/menuService/DatabaseLogic/DatabaseQueries.cs:

    • This script handles the database interactions (save and read menus and categories)
  • service/menuService/menuService/Endpoints/MenuEndpoints.cs

    • Handles the endpoints for the users. Note that no saving should be here since the internal system handles it.
  • service/menuService/menuService/Modals/Request/MenuEntry.cs

    • Is meant to be the main response and data received from the database.
  • service/menuService/menuService/Services/MenuService.cs

    • This is the service (glue) of this application. However, it works more like a patchboard here since it just connects other classes' methods mostly
  • service/menuService/menuService/Util/Ics/IcsFetcher.cs

    • Handles the fetching of the ICS schedule file from the restaurant.
  • service/menuService/menuService/Util/Ics/IcsParser.cs

    • Is the parser for the ics file to ParseResult objects that the rest of the program can use.
  • service/menuService/menuService/Util/Ics/ParseResult.cs

    • A record that the ICS data gets parsed to.
  • service/menuService/menuService/Util/Menu/MenuFilters.cs

    • General help functions that help the program get the current week and or the categories.
  • service/menuService/menuService.Tests/*":

    • Added tests for some of the more important logic parts of the main application.

Issues

Main issue: #964
Testing: #1016 (Very lightly done)

## Developed on This has been developed using JetBrains Rider and dotnet 10, on Arch Linux. ## What's been done? This is an implementation of the menu service. Its goal is to read data from the restaurant "Götasalen"'s public ICS calendar. The data then gets saved in memory and in the database to ping the restaurants endpoint and then the database as little as possible. APi endpoints added: * "**/**": health check * "**/today**": get today's menu. * "**/today/{category}**": gets a specific category of today's food. * "**/week**": get the current week's menu. * "**/week/{category}**": gets a specific category of weekly food. * "**/categories**": Get all categories found. ## What files have been created (A super quick overview) * **DockerCompose/compose.yaml** * I added the correct time zone to the database and menuService to allow correct time conversions. * Added menu service container. * **DockerCompose/init_sql/04-menu.sql** * I added a new database, two tables (menu_entries and menu_categories) * **entryPoint/nginx.conf** * Added menu service to the entrypoint under "**api/menu/**." * All scripts/*: * Added menu service to be built and used. * **service/menuService/menuService/DatabaseLogic/CacheLogic.cs** * This script contains the main logic for cashing in the in-memory and database storage used. * **service/menuService/menuService/DatabaseLogic/DatabaseQueries.cs**: * This script handles the database interactions (save and read menus and categories) * **service/menuService/menuService/Endpoints/MenuEndpoints.cs** * Handles the endpoints for the users. Note that no saving should be here since the internal system handles it. * **service/menuService/menuService/Modals/Request/MenuEntry.cs** * Is meant to be the main response and data received from the database. * **service/menuService/menuService/Services/MenuService.cs** * This is the service (glue) of this application. However, it works more like a patchboard here since it just connects other classes' methods mostly * **service/menuService/menuService/Util/Ics/IcsFetcher.cs** * Handles the fetching of the ICS schedule file from the restaurant. * **service/menuService/menuService/Util/Ics/IcsParser.cs** * Is the parser for the ics file to ParseResult objects that the rest of the program can use. * **service/menuService/menuService/Util/Ics/ParseResult.cs** * A record that the ICS data gets parsed to. * **service/menuService/menuService/Util/Menu/MenuFilters.cs** * General help functions that help the program get the current week and or the categories. * **service/menuService/menuService.Tests/***": * Added tests for some of the more important logic parts of the main application. ## Issues Main issue: #964 Testing: #1016 (Very lightly done)
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin #964-Implement-Meue-Service:#964-Implement-Meue-Service
git switch #964-Implement-Meue-Service

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch team_2_week_7
git merge --no-ff #964-Implement-Meue-Service
git switch #964-Implement-Meue-Service
git rebase team_2_week_7
git switch team_2_week_7
git merge --ff-only #964-Implement-Meue-Service
git switch #964-Implement-Meue-Service
git rebase team_2_week_7
git switch team_2_week_7
git merge --no-ff #964-Implement-Meue-Service
git switch team_2_week_7
git merge --squash #964-Implement-Meue-Service
git switch team_2_week_7
git merge --ff-only #964-Implement-Meue-Service
git switch team_2_week_7
git merge #964-Implement-Meue-Service
git push origin team_2_week_7
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K!1076
No description provided.