Skip to content

Add NonNegativeDecimal (primitives) #71

Description

@vhrcgcom

Description

Implement NonNegativeDecimal as a ValueObject in the primitives module.

Spec: Decimal >= 0

Implementation checklist

  • Create src/primitives/nonnegativedecimal.rs
  • Implement ValueObject trait
  • Add #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
  • Export from src/primitives/mod.rs and prelude
  • Unit tests: valid input · empty input · invalid format · normalisation
  • Doc comment with # Example block
  • Update status in ROADMAP.md from ⬜ to ✅

Implementation detail

Input / Output

Type Alias
Input rust_decimal::Decimal NonNegativeDecimalInput
Output rust_decimal::Decimal NonNegativeDecimalOutput

Normalization

None.

Validation

  • Must be >= Decimal::ZERO.

Notes

Requires rust_decimal as an optional dependency. Add it to the primitives feature flag.

Extra methods

None beyond the trait.

References

Activity

  1. changed the title [-]feat(primitives): NonNegativeDecimal[/-] [+]Add NonNegativeDecimal (primitives)[/+] on Apr 17, 2026
  2. linked a pull request that will close this issueAdd primitives module (v0.3.0) #84on Apr 20, 2026
  3. added a commit that references this issue on Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions