Skip to content

Move more models into foundation#44

Merged
Sajjon merged 1 commit intomainfrom
move_more_models_to_foundation
Feb 26, 2026
Merged

Move more models into foundation#44
Sajjon merged 1 commit intomainfrom
move_more_models_to_foundation

Conversation

@Sajjon
Copy link
Copy Markdown
Owner

@Sajjon Sajjon commented Feb 26, 2026

No description provided.

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 refactors the codebase by moving several model types from the core-invoice crate into the foundation crate, making them more broadly accessible across the project.

Changes:

  • Moved core model types (CompanyInformation, HexColor, MonthHalf, PostalAddress, Rate, StreetAddress) from core-invoice to foundation
  • Added InvalidHexColor error variant to ModelError in the foundation crate
  • Updated import statements and type aliases across affected crates to reflect the new module locations

Reviewed changes

Copilot reviewed 14 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/foundation/src/models/model_error.rs Added InvalidHexColor error variant to support moved HexColor model
crates/foundation/src/models/mod.rs Added module declarations and public exports for newly moved models
crates/foundation/src/lib.rs Updated public API exports to include the moved model types
crates/foundation/src/models/snapshots/*.snap Added snapshot test files for MonthHalf display tests
crates/core-invoice/src/models/mod.rs Updated imports to reference moved models from foundation crate
crates/core-invoice/src/models/error.rs Added error conversion case for InvalidHexColor
crates/core-invoice/src/models/data/submodels/mod.rs Removed module declarations for moved models
crates/core-invoice/src/models/data/submodels/month_half.rs Updated imports to use foundation's ModelError instead of local Error
crates/core-invoice/src/models/data/submodels/hex_color.rs Updated imports and error types to use foundation's types
crates/core-invoice/src/models/data/submodels/snapshots/*.snap Removed snapshot test files (moved to foundation)
crates/cli/src/main.rs Updated imports and added type alias NamedInvoicePdf for clarity
crates/cli/src/dispatch_command.rs Updated function signatures to use NamedInvoicePdf type alias

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.84%. Comparing base (e5ebdb3) to head (25e49cf).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
crates/core-invoice/src/models/error.rs 0.00% 1 Missing ⚠️
crates/foundation/src/models/month_half.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
- Coverage   96.88%   96.84%   -0.05%     
==========================================
  Files         102      102              
  Lines        2217     2218       +1     
==========================================
  Hits         2148     2148              
- Misses         69       70       +1     

☔ 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.

@Sajjon Sajjon merged commit af22eba into main Feb 26, 2026
9 of 11 checks passed
@Sajjon Sajjon deleted the move_more_models_to_foundation branch February 26, 2026 10:13
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