Skip to content

Synchronize organization verification status transitions with audit and workflow state #142

Description

@grantfox-oss

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

  • Approval, rejection, and suspension transitions create consistent workflow records.
  • The organization record and verification event log remain aligned after each transition.
  • Unit tests cover success and conflicting transition cases.

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions