-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/transformation #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add clearer error messages when domain primitive types are not declared as class or struct based on the underlying type. - Remove unused commented code in Executor.cs. - Add new diagnostic helpers for better clarity and maintainability.
- Introduced Transform method support in domain primitives. - Added unit tests for Transform behavior. - Updated README with usage instructions. - Bumped version to 6.0.0 and updated dependencies. - Minor generator and Swagger improvements.
There was a problem hiding this 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 support for an optional Transform
method on domain primitives, enabling preprocessing of input values before validation and instantiation. It adds generator logic to detect and invoke Transform
, updates tests, diagnostics, and documentation accordingly.
- Add
UseTransformMethod
flag and detection inExecutor
- Modify code generation to call
Transform
in constructors andTryCreate
- Update tests, docs, diagnostics, and version bumps
Reviewed Changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
tests/.../DomainPrimitiveGeneratorTest.cs | New test for verifying transformer call count when Transform is defined |
tests/.../AltaSoft.DomainPrimitives.Generator.Tests.csproj | Bump test dependencies to latest versions |
src/.../Generator/Models/GeneratorData.cs | Added UseTransformMethod property |
src/.../Generator/Helpers/MethodGeneratorHelper.cs | Inject Transform call before validation in generated methods |
src/.../Generator/Executor.cs | Detect Transform method, set flag, enforce class/struct constraints |
src/.../Generator/Helpers/DiagnosticHelper.cs | New diagnostics for invalid type kinds, remove commented code |
src/.../AltaSoft.DomainPrimitives.Generator.csproj | Bump generator dependencies |
src/.../XmlDataTypes/AsciiString.cs | Minor formatting |
src/.../XmlDataTypes/AltaSoft.DomainPrimitives.XmlDataTypes.csproj | Bump SwaggerGen version |
README.md | Add Transform Method documentation section |
Directory.Build.props | Version bumped to 6.0.0 |
AltaSoft.DomainPrimitives.sln | Add AltaSoft.DomainPrimitives.UnitTests project |
src/AltaSoft.DomainPrimitives.Generator/Helpers/DiagnosticHelper.cs
Outdated
Show resolved
Hide resolved
@@ -14,6 +14,7 @@ | |||
- [Installation](#installation) | |||
- [Creating your Domain type](#creating-your-domain-type) | |||
- [Json Conversion](#json-conversion) | |||
- [Transform Method](#transform-method) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The link target #transform-method
may not match the generated heading ID that includes an emoji (#🔄-transform-method
). Update either the link or heading text to ensure correct navigation.
Copilot uses AI. Check for mistakes.
src/AltaSoft.DomainPrimitives.Generator/Models/GeneratorData.cs
Outdated
Show resolved
Hide resolved
…er.cs Duplicated Id of diagnostics Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
No description provided.