Skip to content

Add PhoneNumber (contact) and refactor ValueObject trait#79

Merged
vhrcgcom merged 5 commits intomainfrom
feat/2-contact-phone-number
Apr 17, 2026
Merged

Add PhoneNumber (contact) and refactor ValueObject trait#79
vhrcgcom merged 5 commits intomainfrom
feat/2-contact-phone-number

Conversation

@vhrcgcom
Copy link
Copy Markdown
Collaborator

Summary

Adds PhoneNumber composite value object — constructed from CountryCode + local number, stored and
returned as canonical E.164 (e.g. +420123456789). Includes ITU calling code lookup for all 249 ISO
3166-1 countries.

Also refactors ValueObject trait to support composites: Raw split into Input (what new()
accepts) and Output (what value() returns). Simple types use identical type aliases; composites can
differ.

Closes #2

Type of change

  • Bug fix
  • New value object / feature
  • Documentation
  • Refactor / internal improvement
  • CI / tooling

Checklist

  • cargo fmt — code is formatted
  • cargo clippy --features full,serde -- -Dclippy::all — no warnings
  • cargo test --features full,serde — all tests pass
  • New public API has doc comments with an # Example block
  • New value objects have tests for: valid input, empty input, invalid format, normalisation
  • README feature table updated (if a new feature was added)

Václav Hrach added 5 commits April 17, 2026 21:10
- Refactor ValueObject trait: rename Raw to Input, add Output type
- Add EmailAddressInput/Output and CountryCodeInput/Output type aliases
- Add EmailAddress::domain() and EmailAddress::local_part() accessors
- Add PhoneNumber composite value object (CountryCode + local number → E.164)

Closes #2
@vhrcgcom vhrcgcom merged commit d0572b5 into main Apr 17, 2026
14 checks passed
@vhrcgcom vhrcgcom deleted the feat/2-contact-phone-number branch April 17, 2026 19:23
vhrcgcom added a commit that referenced this pull request Apr 21, 2026
Add PhoneNumber (contact) and refactor ValueObject trait
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.

Add PhoneNumber (contact)

1 participant