Skip to content

feat(verify): return explicit 'unregistered' state for unknown batches - #1

Merged
Praizfotos merged 1 commit into
Praizfotos:mainfrom
Praisefotos1:feat/unregistered-state
Aug 13, 2026
Merged

feat(verify): return explicit 'unregistered' state for unknown batches#1
Praizfotos merged 1 commit into
Praizfotos:mainfrom
Praisefotos1:feat/unregistered-state

Conversation

@Praisefotos1

Copy link
Copy Markdown
Contributor

What

Consumers scanning a batch ID that no manufacturer has registered now receive a clear unregistered verification outcome instead of a generic not-found.

Changes

  • Contract: new VerificationResult::Unregistered variant; verify_serial returns it when the batch ID does not exist.
  • Backend: decoding/serialization for unregistered, DB fallback returns it, and analytics counts it as non-genuine. Tests updated (28 passing).
  • Frontend: verify result panel shows Unregistered batch with an explanatory message.

Test plan

  • cargo test (21) + cargo clippy --lib --tests -- -D warnings
  • Backend typecheck / lint / test (28) / build
  • Frontend typecheck / lint / build

Consumers scanning a batch id no manufacturer has registered now get a
clear 'unregistered' outcome instead of a generic not-found. Covers the
contract (VerificationResult::Unregistered), backend decoding/serialization
and fallback, analytics counts, and the frontend result panel.
@Praizfotos
Praizfotos merged commit 46e11b4 into Praizfotos:main Aug 13, 2026
3 checks passed
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