Conversation
There was a problem hiding this comment.
Pull request overview
This PR significantly refactors the invoice system's time/period handling by removing generic period types (YearAndMonth, YearMonthAndFortnight, IsPeriod trait) and unifying everything around the Date type with cadence-aware logic. This simplification fixes a bug in invoice number calculation logic and makes the codebase more maintainable.
Changes:
- Removed generic
Periodtype parameter andIsPeriodtrait, replacing withDatetype - Fixed invoice number calculation logic by normalizing dates based on cadence
- Introduced
RelativeTimemodel for handling "current"/"last" period references - Updated all data structures to use
Dateinstead of period types
Reviewed changes
Copilot reviewed 45 out of 47 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/core-invoice/src/models/year_and_month.rs |
Deleted - period type no longer needed |
crates/core-invoice/src/models/data/submodels/year_month_and_fortnight.rs |
Deleted - period type no longer needed |
crates/core-invoice/src/models/data/submodels/is_period.rs |
Deleted - trait no longer needed |
crates/core-invoice/src/models/date.rs |
Enhanced with period-end logic and parsing support |
crates/core-invoice/src/models/valid_input.rs |
Changed from period: YearMonthAndFortnight to date: Date |
crates/core-invoice/src/models/data/data.rs |
Removed generic Period parameter, simplified invoice number calculation |
crates/core-invoice/src/logic/calendar_logic.rs |
Major refactoring to date-based period logic with cadence normalization |
crates/core-invoice/src/models/relative_time.rs |
New model for relative time references (current/last period) |
| Test files | Updated to use new Date-based API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #30 +/- ##
==========================================
+ Coverage 94.88% 95.03% +0.15%
==========================================
Files 103 101 -2
Lines 2248 2176 -72
==========================================
- Hits 2133 2068 -65
+ Misses 115 108 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 45 out of 47 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 51 out of 53 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.