Skip to content

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

Merged
merged 4 commits into from
May 19, 2025
Merged

Feature/transformation #21

merged 4 commits into from
May 19, 2025

Conversation

temonk
Copy link
Contributor

@temonk temonk commented May 19, 2025

No description provided.

- 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.
Copy link
Contributor

@Copilot 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 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 in Executor
  • Modify code generation to call Transform in constructors and TryCreate
  • 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

@@ -14,6 +14,7 @@
- [Installation](#installation)
- [Creating your Domain type](#creating-your-domain-type)
- [Json Conversion](#json-conversion)
- [Transform Method](#transform-method)
Copy link
Preview

Copilot AI May 19, 2025

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.

…er.cs


Duplicated Id of diagnostics

Co-authored-by: Copilot <[email protected]>
@altasoft altasoft deleted a comment from Copilot AI May 19, 2025
@GregoryNikolaishvili GregoryNikolaishvili merged commit 7208d92 into main May 19, 2025
1 check passed
@altasoft altasoft deleted a comment from Copilot AI May 19, 2025
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