E1-F5: OIB Checksum Validation Service¶
Epic: E1: User & Profile Management
Size: S (Small)
Problem / Outcome¶
All OIB entries must be validated using Croatian checksum algorithm.
Scope¶
In-Scope:
- Utility function/service for OIB checksum validation
- 11-digit format check
Out-of-Scope:
- OIB lookup against government database
Acceptance Criteria¶
- AC1: Given valid OIB with correct checksum, when validated, then return true
- AC2: Given OIB with invalid checksum, when validated, then return false with error message
- AC3: Given OIB with wrong length, when validated, then return false with "Must be 11 digits"
Technical Details¶
OIB uses ISO 7064, MOD 11-10 checksum algorithm:
- Start with initial value 10
- For each of the first 10 digits:
- Add digit to current value
- Take modulo 10 (if result is 0, use 10)
- Multiply by 2
- Take modulo 11
- The 11th digit should equal 11 minus the final value (mod 10)
Data Model Impact¶
None (utility service)
Permissions/Roles¶
- Internal service
How to Verify¶
npm test -- --grep "OIB validation"
Expected: Known valid OIBs pass, invalid OIBs fail.
Dependencies¶
- None
Implementation Tasks¶
Last Updated: January 2026