generated from john/python-template
4.8 KiB
4.8 KiB
Document Acceptance Criteria
Purpose: Define implementation-ready acceptance criteria for Document Read, Update, and Delete workflows.
Companion documents:
- docs/ui/entities/document/user-journey.md
- docs/ui/entities/document/schema-mapping.md
Scope
This checklist covers:
- Read flow
- Update flow
- Delete flow
This checklist does not cover:
- Source upload workflow details
- Job execution internals
- Revision editor behavior
Read Acceptance Criteria
RD-1 Document detail retrieval
- Given a valid Document id
- When the user opens the Document detail page
- Then the system displays Document metadata for that record only
RD-2 Metadata visibility
- The page shows name, document_type, document_date, document_date_raw, location_created, notes, archive_identifier
- created_at and updated_at are displayed as system-managed, read-only values
RD-3 Related people section
- Given zero linked people
- Then the page shows a no linked people yet empty state
- Given one linked person
- Then the page shows that linked person
RD-4 Sources section empty state
- The page shows a Sources action for the current Document
- The page shows a primary + Add Source action that opens job-create flow for this Document
- The action routes to a document-scoped Sources view
RD-5 Jobs section empty state
- The page shows a Jobs action for the current Document
- The page shows a primary + Add Job action for the current Document
- The action routes to a document-scoped Jobs view
RD-6 Filtered navigation readiness
- The detail page provides links or actions that can route to document-scoped Sources and Jobs views
- Target views are filtered to the current Document id
RD-7 Failure state
- Given a nonexistent Document id
- Then the UI shows a clear not found state without crashing
Update Acceptance Criteria
UP-1 Edit entry
- Given a loaded Document detail page
- When the user chooses Edit document
- Then editable controls are shown for allowed fields only, including the author relationship selector
- The author selector includes No author, existing Person options, and a Create new item option
- Selecting Create new item routes to Person create
UP-2 Editable fields
- Editable: name, document_type, document_date, document_date_raw, location_created, notes, archive_identifier
- Not editable: id, created_at, updated_at
- The edit flow may also change the associated author Person link
UP-3 Required validation
- name is required
- document_type is required
- Save is blocked with inline feedback when either required field is missing
UP-4 Date handling rule
- document_date only is allowed
- document_date_raw only is allowed
- both fields together are allowed
- if both are present, document_date is treated as canonical exact date and document_date_raw is retained as descriptive context
UP-5 Successful save
- Given valid input
- When the user saves
- Then changes persist
- Then success feedback is shown
- Then the user remains on Document detail with refreshed values
- Then updated_at reflects update policy
UP-6 Save failure
- Given backend failure during save
- Then clear error feedback is shown
- Then the user-entered values remain available for retry where possible
- Then no false success feedback is shown
Delete Acceptance Criteria
DL-1 Delete entry and confirmation
- Given a Document detail page
- When the user chooses Delete document
- Then a confirmation dialog appears with permanent-action wording
DL-2 Dependency guardrails
- Delete is allowed only when the Document has no related Source records and no related Job records
- Delete is blocked when at least one related Source or Job exists
DL-3 Blocked delete behavior
- When blocked
- Then the UI explains why deletion is blocked
- Then the UI identifies dependency categories present: Sources, Jobs, or both
- Then the UI provides navigation to dependency cleanup paths
DL-4 Successful delete
- Given no blocking dependencies
- When the user confirms delete
- Then the Document is removed
- Then success feedback is shown
- Then the user is returned to the Document list page
DL-5 Delete failure
- Given backend failure during delete
- Then a clear error message is shown
- Then the user remains on Document detail with retry path
Cross-Criteria Quality Gates
QG-1 Separation of intent and implementation
- UX intent remains in user-journey.md
- Current versus target implementation mapping remains in schema-mapping.md
QG-2 Traceability
- Each accepted behavior maps to at least one future UI action or service call path
- No acceptance criterion contradicts the current deferred-item policy
QG-3 First-release constraints
- Linked person during create remains optional
- Recipient and multi-person expansion remain deferred