Skip to content

Conversation

@ArtroxGabriel
Copy link
Owner

Records implements IParsable for parsing from comma-separated strings and validation in constructors

@ArtroxGabriel ArtroxGabriel requested a review from Copilot June 5, 2025 22:32

This comment was marked as outdated.

@ArtroxGabriel ArtroxGabriel force-pushed the feature/entities-models branch from 1f5db6d to a235af7 Compare June 5, 2025 22:45
@ArtroxGabriel ArtroxGabriel requested a review from Copilot June 5, 2025 22:45

This comment was marked as outdated.

@ArtroxGabriel ArtroxGabriel force-pushed the feature/entities-models branch from a235af7 to 618ab6f Compare June 5, 2025 22:47
@ArtroxGabriel ArtroxGabriel requested a review from Copilot June 5, 2025 22:47
Copy link

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 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; }

@ArtroxGabriel ArtroxGabriel merged commit e3a3708 into main Jun 5, 2025
2 checks passed
@ArtroxGabriel ArtroxGabriel deleted the feature/entities-models branch June 5, 2025 22:49
@github-actions
Copy link

github-actions bot commented Jun 7, 2025

🎉 This PR is included in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants