Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint "ListMeals" #314

Closed
wants to merge 5 commits into from
Closed

Conversation

elli-hae
Copy link
Contributor

This should resolve #81:

  1. I fixed the downloadDailyDishes function in dish_name_download.go
  2. I fixed the existing ListDishes Endpoint and renamed it to ListMeals. However, if there isn't a reason I might be unaware of for the project to have the terms "meal" and "dish" describing (seemingly) the same thing, I think it would be better to choose one and stick with it for consistency.

On a sidenote, I find the CanteenDates struct (a list of dishes/meals on a given day) to have a confusing name.

Copy link
Collaborator

@tobiasjungmann tobiasjungmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great to get rid of the inconsistent naming and makes it more secure for cafeteria names! This can be merged, just to be sure: Why did you the dishtype in the query. As far as I understand, this results in different entries for the same dish if the type is changed. In my opinion it would be more consistent to only store the dish once and stick to the initial type instead of storing it again. An alternative would be to update the dishtype in the existing entry.

Copy link
Member

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, from my side this can basically be merged

Regarding the question from the readme:

However, if there isn't a reason I might be unaware of for the project to have the terms "meal" and "dish" describing (seemingly) the same thing, I think it would be better to choose one and stick with it for consistency.

The eat-api does also talk about dishes. I think this was a typo/mistake introduced in the issue which nobody caught 😅
image
(src: https://tum-dev.github.io/eat-api/docs/#/menu/get__canteen_id___year___week__json)

I have pulled the change @tobiasjungmann mentioned into #325, as that should come with a db-change to reflect this ^^

=> I am going to revert the naming dish->meal changes to this branch and this is good to go

server/backend/cafeteria.go Show resolved Hide resolved
server/backend/cron/dish_name_download.go Outdated Show resolved Hide resolved
server/api/tumdev/campus_backend.proto Outdated Show resolved Hide resolved
@CommanderStorm
Copy link
Member

I am going to merge this via #326, as I can't push commits to this branch

@elli-hae
Copy link
Contributor Author

This is great to get rid of the inconsistent naming and makes it more secure for cafeteria names! This can be merged, just to be sure: Why did you the dishtype in the query. As far as I understand, this results in different entries for the same dish if the type is changed. In my opinion it would be more consistent to only store the dish once and stick to the initial type instead of storing it again. An alternative would be to update the dishtype in the existing entry.

Hi, sorry for the late reply. It does indeed result in different entries for dishes by the same name and different types. The only example I found for this was the dish "Tagessuppe" which in the same cafeteria can be both "Studitopf" as well as "Beilage". As the previous (faulty) query selected for "CanteenDish", which is comprised of name and DishType, I decided to also query for the type (in case it might be relevant for prices, as "Studitopf" and "Beilage" have different prices). If the prices are unrelated it's definitely unnecessary though.

TLDR: I just tried to model it after CanteenDish, but it probably only affects one dish and even then is probably unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Endpoint "listMeals"
3 participants