Context
The organization verification flow spans organization records, verification events, and related services. The current implementation appears to update organization verification state in one place while the supporting workflow history and downstream behavior are not always kept in sync.
Problem statement
Ensure organization verification status changes are recorded consistently and that the organization entity and verification event history remain aligned after approval, rejection, suspension, or re-verification flows.
Current behavior
- Organization verification data is stored across the organization model and the verification event model in prisma/schema.prisma.
- The service layer updates the organization status and verification flags, but the workflow history and related state transitions are not fully enforced in a single transactional path.
Required behavior
- A verification status transition should create or update the related workflow history in a consistent way.
- The organization record should reflect the same final verification state as the workflow event trail.
- Repeated or conflicting updates should not leave the organization in an inconsistent state.
Constraints
- The change should preserve the existing organization verification API flow.
- The fix should remain compatible with the current Prisma schema and service layer.
Acceptance criteria
Out of scope
- Rebuilding the verification UI or introducing a new workflow engine.
- Changing the organization data model beyond what is necessary for consistency.
Hints and references
- Review the organization verification event models and the service methods that mutate organization status.
Context
The organization verification flow spans organization records, verification events, and related services. The current implementation appears to update organization verification state in one place while the supporting workflow history and downstream behavior are not always kept in sync.
Problem statement
Ensure organization verification status changes are recorded consistently and that the organization entity and verification event history remain aligned after approval, rejection, suspension, or re-verification flows.
Current behavior
Required behavior
Constraints
Acceptance criteria
Out of scope
Hints and references