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

feat: new restaurants api #1393

Merged
merged 26 commits into from
Jan 2, 2025
Merged

feat: new restaurants api #1393

merged 26 commits into from
Jan 2, 2025

Conversation

HenriqueSFernandes
Copy link
Contributor

@HenriqueSFernandes HenriqueSFernandes commented Nov 18, 2024

WIP implementation of the new restaurants API.
It includes changes that will be undone before the merge, such as changing the provider to always fetch from the remote and debug print messages.
Currently, the meals page includes every establishment from SASUP, but it uses the menu from the old Excel file.

Closes #1360

Review checklist

  • Terms and conditions reflect the current change
  • Contains enough appropriate tests
  • If aimed at production, writes a new summary in whatsnew/whatsnew-pt-PT
  • Properly adds an entry in changelog.md with the change
  • If PR includes UI updates/additions, its description has screenshots
  • Behavior is as expected
  • Clean, well-structured code

@HenriqueSFernandes HenriqueSFernandes linked an issue Nov 18, 2024 that may be closed by this pull request
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 3.96040% with 97 lines in your changes missing coverage. Please review.

Project coverage is 12%. Comparing base (2ecb3f8) to head (e17b8d1).
Report is 10 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #1393   +/-   ##
=======================================
- Coverage       12%     12%   -0%     
=======================================
  Files          264     264           
  Lines         7242    7249    +7     
=======================================
  Hits           819     819           
- Misses        6423    6430    +7     

@HenriqueSFernandes
Copy link
Contributor Author

HenriqueSFernandes commented Nov 18, 2024

It seems to be working with the meals hardcoded (using week 40), but there is a problem with saving the meals in the local storage. From what I can see, that problem already existed before.

When calling db.saveIfPersistentSession(restaurants):

image

@HenriqueSFernandes HenriqueSFernandes changed the title Feat/new restaurants api feat: new restaurants api Nov 19, 2024
@HenriqueSFernandes
Copy link
Contributor Author

The new menu's API has been implemented.

Due to the current front-end implementation restrictions, the old Restaurant model was used, but the new UI will use the more complete Establishment model by @thePeras.

The loadFromStorage function in the restaurant_provider was changed so as not to cause a crash. The commented code should be reimplemented after issue #1370 is fixed.

Special thanks to @AugustoVSoares for the collaboration on this implementation.

@HenriqueSFernandes HenriqueSFernandes marked this pull request as ready for review December 1, 2024 22:41
@HenriqueSFernandes
Copy link
Contributor Author

The distinction between lunch and dinner is hard coded, so it always displays "Almoço / Jantar" regardless of the app's language setting.
I propose discussing in the next meeting whether this should be addressed now or postponed until the new UI is implemented. Personally, I suggest waiting for the new UI, as the fix would not be necessary.

@HenriqueSFernandes HenriqueSFernandes requested a review from a team December 1, 2024 22:52
@HenriqueSFernandes
Copy link
Contributor Author

As discussed in today's meeting, I added the English names for the meals

Feel free to suggest more changes.

Copy link
Member

@thePeras thePeras left a comment

Choose a reason for hiding this comment

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

Incredibly work!! It's so nice to see this finally in UNI.

After this detail, it's ready to 🛫

@thePeras thePeras requested a review from a team December 9, 2024 17:42
@HenriqueSFernandes
Copy link
Contributor Author

The translations were moved to the frontend, allowing real-time language updating.

Copy link
Member

@limwa limwa left a comment

Choose a reason for hiding this comment

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

Well done! I just have some small recommendations for the codebase.

@limwa
Copy link
Member

limwa commented Jan 1, 2025

LGTM 🚀 Please merge whenever you want!

Copy link
Collaborator

@DGoiana DGoiana left a comment

Choose a reason for hiding this comment

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

Incredible work here! A nice feature to start the new year 🚀

@DGoiana DGoiana merged commit 967097a into develop Jan 2, 2025
6 checks passed
@DGoiana DGoiana deleted the feat/new-restaurants-api branch January 2, 2025 18:22
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.

Remove fetch sheet code and implement new menu's api
4 participants