Skip to content

Conversation

@hsaito
Copy link
Owner

@hsaito hsaito commented Sep 21, 2025

Add MyNumberValue type: enforce My Number format, API improvements, tests

Summary

This pull request introduces MyNumberValue, an immutable value object that validates and enforces the correct My Number format (including the check digit) at construction time. It also updates the API controller to provide endpoints that accept and return MyNumberValue, adds comprehensive unit tests, and updates the README with usage examples.

Changes

  • Add MyNumberValue struct to MyNumberNET (validation, parsing, formatting, conversions).
  • Update MyNumberController to provide endpoints that create/format/verify MyNumberValue.
  • Add unit tests MyNumberValueTests and update controller tests.
  • Update README.md with MyNumberValue usage examples.

Motivation

Using a strongly-typed, validated value object prevents invalid My Number data from propagating through the system and centralizes validation and formatting logic.

Testing

  • All unit tests pass locally: dotnet test (38 passing tests).
  • dotnet build succeeds locally.

Checklist

  • New tests added for MyNumberValue and controller changes.
  • README updated with examples.
  • Build passes locally.

Notes for reviewers

  • Focus on MyNumberNET/MyNumber.cs (new MyNumberValue struct) and MyNumberNET_ApiServer/Controllers/MyNumberController.cs.
  • Pay attention to ToString format options and conversion operators. Suggest changes if another representation or API surface is preferred.
  • If preferred, I can split this into smaller PRs (e.g., docs / tests / implementation).

If you'd like me to add reviewers, labels, or a milestone, tell me which and I'll add them.

@hsaito hsaito self-assigned this Sep 21, 2025
@hsaito hsaito merged commit 64add57 into master Sep 21, 2025
6 checks passed
@hsaito hsaito deleted the mynumber-object branch September 21, 2025 08:34
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