# Overview.Admin

## What it does

Document Lifecycle keeps an installation-wide register of controlled documents such as policies and procedures. Each publication stores a version label, publication time, actor, content hash, and content snapshot. Acceptances are tied to the exact published version and hash, so later publications do not rewrite earlier evidence.

## Setup and access

Install Publishing Studio first, install Document Lifecycle, and run its migrations. The package extends the existing `legal_acceptances` table as well as creating document and publication tables; Diagnostics reports missing tables, columns, or model registrations.

Open **Workflow > Controlled documents**. Access uses the generated Document permissions, while global administrators bypass those checks. Documents have no Site field and the resource is not site-scoped, so anyone who can view documents can see the installation-wide register and its publication and acceptance evidence.

## Register and publish a document

Create a document with a stable Key and Title. The key cannot be changed after creation. Review due and Expires at are operational dates; neither changes the stored publication evidence.

Use **Publish version** to enter the controlled text, an optional version label, and an optional note. Leaving the version blank creates a timestamp-based label. Publishing changes the document to Active and stores the content snapshot in publication metadata together with its SHA-256 hash. Publication rows are immutable: publishing the same version label and identical content returns the existing publication, while reusing that label for different content fails and leaves the original unchanged. Use a new version label for every content change.

When a registered document is linked to a Publishing Studio draftable record, a matching published revision also creates a document publication automatically. Its version is labelled from the Publishing Studio revision. This bridge does not register arbitrary content as a controlled document; the document relationship must already exist.

## Record and export acceptance evidence

**Record acceptance** records the signed-in administrator against the latest publication. It is unavailable until at least one version exists. The record includes the version and document hash, context and optional note, acceptance time, and hashes of the request IP address and user agent. It does not store those two request values in plaintext. Keep the application key stable because it contributes to those hashes.

Open a document's **Acceptances** relation to:

- export acceptance evidence for all versions or one selected publication as CSV;
- export the outstanding-acceptance report as CSV; or
- download an individual acceptance certificate as JSON.

Treat these downloads as sensitive audit records. The package has no public acceptance route. If Customer Portal is installed, an authenticated portal account can see up to its ten latest matching acceptances as self-service history; that feed exposes document key/version metadata, not the stored content snapshot or a certificate download.

## Review, expiry, archive, and restore

Review due is an informational date shown in the document list. The package does not notify reviewers, create review tasks, or archive a document when that date passes.

Expires at is enforced by `capell:document-lifecycle:archive-expired`. The package schedules that command daily with overlap protection and single-server locking, so keep Laravel's scheduler running and configure a shared scheduler lock store in a multi-server deployment. The command archives only Active documents whose expiry time has passed. It does not delete publications or acceptances.

You can archive a document manually. Restoring an archived document returns it to Active when it has a publication, or Draft when it does not. Publishing an archived document from the domain integration also activates it; use permissions and operational review rather than treating Archived as an immutable lock.

## Data and retention boundaries

Publication metadata contains the full text or JSON snapshot in plaintext; its hash is evidence of content integrity, not encryption. Acceptance context, notes, actor/subject identifiers, and timestamps are also plaintext, while document, IP, user-agent, and legal-bundle hashes are one-way values. Protect database access, backups, CSV files, and certificates accordingly.

The package does not register a Privacy Center exporter or eraser and has no age-based pruning. Archiving a document retains all versions and acceptances. Apply any legal retention or erasure process through a controlled integration that preserves evidence you are required to keep.