bcgov / bcgov/entity

Draft Handling for Entities

Open
#28,157 4 comments 0 reactions 2 assignees Assigned to @severinbeauvais View on GitHub
Entities Team P
Dominant language
JavaScript
Stars
23
Forks
62
Avg merge
24m
Merged PRs (30d)
1

Description

> _This issue was auto-created as part of the Zenhub sub-issues migration. The original entity was opened on 2024-04-23. For more details see [this post](https://changelog.zenhub.com/migration-of-epics-projects-to-sub-issues-313645?zenhub_entity_id=Z2lkOi8vcmFwdG9yL1plbmh1YkVwaWMvMjA4ODEw)._

Decision for whether or not to support multiple drafts - refer to the RAID ticket https://app.zenhub.com/workspaces/raid--work-space-617c3d4cef313f001d715a7c/issues/gh/bcgov-registries/raid/725

Principles we should follow:

• Consistency over convenience
• One source of truth
• Clear ownership and accountability
• Predictable behavior across UI and API

### Requirements:

**All the rules are applied to Corporations, SP/GPs and Coops.**

#### Single Active Draft:
- The system must allow only one active draft per business to prevent conflicting data and inconsistent business state
- Creating a new draft is blocked if an active draft already exists.
- Users must either submit or discard the existing draft before starting a new one.

#### Draft Ownership & Shared Access:
- Users authorized to access a company on an account (as determined by delegation policy) must have access to the companies drafts on that account
- A client may initiate a draft, and authorized staff may continue or complete it.

#### Edit Locking:
- Only one user may actively edit a draft at a time.
- If another user opens the draft, it should be read-only or prompt the user that the draft is locked. **Need to locate design ticket**
- The lock should release when the draft is saved, closed, or after inactivity timeout.

#### Action Restrictions While Draft Exists:
- Conflicting actions (e.g., updating company information, submitting other filings) must be restricted.
- Non-conflicting read-only actions may still be allowed.
- Once the draft is submitted or discarded, normal actions resume.
- Any action/job that makes the company historical should automatically delete the draft (Involuntary Dissolution)
- Draft actions matrix: https://docs.google.com/spreadsheets/d/1jmVVCbHkciocI6KxIoZ9DBHu8qVsjaE9nTuyRLcxpVE/edit?gid=0#gid=0

#### Validation & Consistency Enforcement:

Backend validation must ensure:
- Frontend and API actions follow the same draft rules.
- Invalid or conflicting operations return clear, actionable error messages.

API Behavior
API clients must:
- Receive consistent responses when drafts exist.
- Be prevented from performing conflicting actions via API.

Error responses must clearly indicate:

- A draft exists
- Which action is blocked
- What resolution is required

#### Drafts purging:

- No automatic purging is required at the point
- Dissolution job behavior - as above the dissolution job should continue to run and delete any existing drafts

https://docs.google.com/spreadsheets/d/19nay-EWDLzDHIaNphjc8Chz8gpn5egCCPFj9xrIWYvU/edit#gid=487882322

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.