Skip to content

time#30

Merged
Sajjon merged 7 commits intomainfrom
time
Feb 21, 2026
Merged

time#30
Sajjon merged 7 commits intomainfrom
time

Conversation

@Sajjon
Copy link
Copy Markdown
Owner

@Sajjon Sajjon commented Feb 20, 2026

  • Complete overhaul of period/time management, reducing complexity by removing all generics and deleting many superfluous types.
  • Fix bug in logic calculating invoice number.

Copilot AI review requested due to automatic review settings February 20, 2026 12:29
@Sajjon Sajjon marked this pull request as draft February 20, 2026 12:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Period type parameter and IsPeriod trait, replacing with Date type
  • Fixed invoice number calculation logic by normalizing dates based on cadence
  • Introduced RelativeTime model for handling "current"/"last" period references
  • Updated all data structures to use Date instead 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
Copy link
Copy Markdown

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 95.91837% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.03%. Comparing base (bc90cad) to head (71e15e4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/core-invoice/src/logic/command/command.rs 78.26% 5 Missing ⚠️
...rates/core-invoice/src/logic/create_invoice_pdf.rs 16.66% 5 Missing ⚠️
...ce/src/models/data/submodels/proto_invoice_info.rs 60.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@Sajjon Sajjon marked this pull request as ready for review February 21, 2026 07:11
@Sajjon Sajjon requested a review from Copilot February 21, 2026 07:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@Sajjon Sajjon merged commit ec92464 into main Feb 21, 2026
11 checks passed
@Sajjon Sajjon deleted the time branch February 21, 2026 07:30
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