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

refactor: opening hours #541

Merged
merged 3 commits into from
Nov 16, 2023
Merged

refactor: opening hours #541

merged 3 commits into from
Nov 16, 2023

Conversation

fremartini
Copy link
Member

@fremartini fremartini commented Nov 14, 2023

Fix opening hours to match the cafe

Uses the flutter-native TimeOfDay class, which has localized time formatting.
This has been extended with comparison methods <= and isInTimeslot.
Timeslot class simplifies with this change.

Simplify DateService to only contain one getter.

Make sure of fpdart's Option instead of null values. Use None for closed days.

Clean up tests, add more tests, and use NiceMocks for mocking.

@fremartini fremartini requested a review from a team November 14, 2023 18:09
@ghost
Copy link

ghost commented Nov 14, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@fremartini fremartini force-pushed the frem/update_opening_hours branch from e63c907 to 4b47b7b Compare November 14, 2023 18:10
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main-prerelease@57e5565). Click here to learn what that means.

❗ Current head 4b47b7b differs from pull request most recent head 539a8ea. Consider uploading reports for the commit 539a8ea to get more accurate results

Additional details and impacted files
@@                Coverage Diff                 @@
##             main-prerelease     #541   +/-   ##
==================================================
  Coverage                   ?   72.56%           
==================================================
  Files                      ?      130           
  Lines                      ?     1578           
  Branches                   ?        0           
==================================================
  Hits                       ?     1145           
  Misses                     ?      433           
  Partials                   ?        0           
Flag Coverage Δ
unittests 72.56% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

lib/core/external/date_service.dart Outdated Show resolved Hide resolved
lib/features/opening_hours/domain/entities/timeslot.dart Outdated Show resolved Hide resolved
lib/features/opening_hours/domain/entities/timeslot.dart Outdated Show resolved Hide resolved
Uses the flutter-native TimeOfDay class, which has localized time formatting.
This has been extended with comparison methods <= and isInTimeslot.
Timeslot class simplifies with this change.

Simplify DateService to only contain one getter.

Make sure of fpdart's Option instead of null values. Use None for closed days.

Clean up tests and use NiceMocks for mocking.
@marfavi marfavi changed the title Update opening hours refactor: opening hours Nov 16, 2023
@marfavi
Copy link
Member

marfavi commented Nov 16, 2023

Awaiting dev build to publish so we can smoke test. Otherwise looks OK

@marfavi marfavi changed the base branch from main to main-prerelease November 16, 2023 19:36
@marfavi marfavi merged commit 022bab0 into main-prerelease Nov 16, 2023
1 check passed
@marfavi marfavi deleted the frem/update_opening_hours branch November 16, 2023 19:38
marfavi added a commit that referenced this pull request Nov 16, 2023
Fix opening hours to match the cafe

Uses the flutter-native TimeOfDay class, which has localized time formatting.
This has been extended with comparison methods <= and isInTimeslot.
Timeslot class simplifies with this change.

Simplify DateService to only contain one getter.

Make sure of fpdart's Option instead of null values. Use None for closed days.

Clean up tests, add more tests, and use NiceMocks for mocking.
---------

Co-authored-by: Omid Marfavi <[email protected]>
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.

2 participants