Data and states
Which facts must remain consistent together?
A Boolean field such as `verified` loses the relationship between verification, purpose and validity. The relational model groups information around I-17 while storing verification attempts such as V-17, evidence such as N-17 and reasoned decisions such as D-17 separately. A request may exist temporarily without an attempt.
Starting point The interfaces distinguish task, attempt and decision; now their relationships and transitions are determined.
Assumptions for the example case
Example design: an operator, a verification provider and a specified purpose of use. Identity and other evidence shall be assessed separately. Login, sessions, and rights across multiple applications are not part of this case. Figures and target values are design assumptions; no real people are checked.
Connect request, attempt, evidence and decision
Test case I-17 · Relationships, cardinals and life cycles
- Aggregate root
- Dependent domain data
- Referenced person
I-17 is the leading parenthesis. An order can already exist before the first attempt; the result and the order state remain separate.
Permitted transitions
| Starting point | Triggers | Consequence |
|---|---|---|
| created → pending | First attempt durably created | Wait for evidence or a result. I-17 may remain in the created state without an attempt. |
| pending → needs_input | Request for additional evidence | Enable a targeted new capture attempt. |
| needs_input → pending | New capture completed | Assign the new attempt to the same order and wait for its result. |
| pending → needs_review | Contradiction or unclear proof | Assign a caseworker; do not confirm automatically. |
| pending / needs_review → completed | Reliable result and rule assessment | Complete order; save decision result `erfüllt` or `nicht erfüllt` separately. |
| created / pending / needs_input → expired | Processing period reached | Complete old order; expressly create a new one. |
created → pending
- Triggers
- First attempt durably created
- Consequence
- Wait for evidence or a result. I-17 may remain in the created state without an attempt.
pending → needs_input
- Triggers
- Request for additional evidence
- Consequence
- Enable a targeted new capture attempt.
needs_input → pending
- Triggers
- New capture completed
- Consequence
- Assign the new attempt to the same order and wait for its result.
pending → needs_review
- Triggers
- Contradiction or unclear proof
- Consequence
- Assign a caseworker; do not confirm automatically.
pending / needs_review → completed
- Triggers
- Reliable result and rule assessment
- Consequence
- Complete order; save decision result `erfüllt` or `nicht erfüllt` separately.
created / pending / needs_input → expired
- Triggers
- Processing period reached
- Consequence
- Complete old order; expressly create a new one.
Data rules
- One-off event effect
- A unique key protects E-17 in the inbox. The worker applies the event, decision result and update to the current I-17 in one atomic transaction. On failure, neither the decision nor the inbox completion takes effect.
- Validity is not a test status
- A completed order remains completed. D-17 carries the result `erfüllt` or `nicht erfüllt` as well as purpose and validity; a decision that satisfies the prerequisites can expire later or be revoked. During use, this status is re-evaluated.
- Late feedback
- An event for an old attempt must not overwrite a newer state. Uncertain ordering requires reconciliation with the provider.
Terms in this step
- Transaction
- Related data changes either take effect together or are rolled back together.
Try it yourself
Draw I-17, V-17, N-17 and D-17. Mark authoritative data, sensitive content, and atomic closure.
A hint for your attempt
Maintain the purpose and validity of the decision. A global verified flag loses this connection.
Compare with a possible solution
- Authoritative relationships
- I-17 connects P-17 and Z-3; V-17 documents provider interaction; N-17 refers to sensitive proof; D-17 stores result, reason and validity. The document images remain in the selected sequence at the verification service. Test: parallel incoming E-17 and status reading; both see either the old full state or the new full state.
- Atomic completion
- D-17 and the current status of I-17 are confirmed together or discarded together. The negative test breaks off between the two writes, after which no apparently completed job without D-17 must be visible.
Apply to your project
What relationships and state transitions does your system need to protect in a transaction?