feat(models): create records for entities-models#1
Merged
Conversation
1f5db6d to
a235af7
Compare
a235af7 to
618ab6f
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces records for various domain entities (Wine, Grape, Country) and leverages a new CsvParser utility to centralize CSV parsing and validation for these entities. Key changes include:
- Creation of a CsvParser helper class for splitting and validating CSV strings.
- Updating the Parse methods in WineRecord, GrapeRecord, and CountryRecord to use CsvParser.
- Refactoring record properties to use init-only setters for improved immutability.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| SubMerge/Parsers/CsvParser.cs | New CSV parsing utility for splitting and validating input |
| SubMerge/Models/WineRecord.cs | Updates Parse method to use CsvParser and modifies error message wording |
| SubMerge/Models/GrapeRecord.cs | Updates Parse method to use CsvParser and refactors properties to init-only setters |
| SubMerge/Models/CountryRecord.cs | Updates Parse method to use CsvParser and refactors properties to init-only setters |
Comments suppressed due to low confidence (2)
SubMerge/Parsers/CsvParser.cs:9
- [nitpick] Consider renaming parameter 'n' to 'expectedPartCount' (or a similar descriptive name) to improve clarity and maintain consistency in naming across the codebase.
/// <param name="n">The total N of expected parts of csv</param>
SubMerge/Models/GrapeRecord.cs:22
- [nitpick] For consistency with other model records (e.g., WineRecord and CountryRecord), consider renaming 'GrapeID' to 'GrapeId' to use a uniform identifier casing.
public int GrapeID { get; init; }
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Records implements IParsable for parsing from comma-separated strings and validation in constructors