Skip to main content

Documents Center (Per Profile)

The Documents Center is the per-profile document viewer. It displays uploaded documents for a profile, allows switching between documents, toggling archived documents, and uploading new documents.

Route​

  • Active documents: /profile/:profileID/document/:docID
  • Archived documents: same route with query ?archived=true

Header Actions​

ButtonBehavior
Archived DocumentsFetches archived documents and navigates to the first archived document with ?archived=true query.
View DocumentsFetches active documents and navigates to the first active document, removing the archived query.
UploadOpens the upload dialog to add a document to the profile.

The toggle label switches between Archived Documents and View Documents depending on the current archived query state.

Document List​

  • Displayed as a vertical tab list on the left side.
  • Documents are sorted by step.sort_order ascending.
  • Each item shows the document type name and a status indicator:
    • Spinning indicator (orange): document is still processing (approved == null).
    • Check icon: document approved (approved == true).
    • Rejected icon: document rejected (approved == false).

Empty State​

When no documents exist for the current view:

  • Active view: displays an article icon with "No documents found".
  • Archived view: displays an inventory icon with "No archived docs".

Loading State​

During the initial data fetch, a skeleton layout is shown in place of the document list and content area.

Viewing a Document​

Clicking a document in the list opens it in the main content area and updates the :docID route parameter.

When a document is selected, the content area can show up to three sections:

  1. Document Viewer — a preview of the selected document.
  2. Validation Tabs — automated checks run on the document (e.g. authenticity, liveness). Not shown for invalid document types.
  3. Extracted Data — fields read from the document by AI (e.g. name, date of birth, ID number). Shown when the system was able to extract information from the document.

Validation Tabs​

Validation tabs display checks performed for the selected document. Tabs vary by document type and configuration.

Upload​

Clicking Upload opens the upload dialog. On confirmation:

  • If the submitted document includes a file field, dispatches customer/uploadDocumentBsElPs.
  • Otherwise, dispatches customer/uploadDocument.

After a successful upload, the document list refreshes automatically.

Archived Documents Toggle​

  • Archived Documents: fetches archived documents (archived: true) and navigates to the first archived document with ?archived=true in the query.
  • View Documents: fetches active documents (forced refresh) and navigates to the first active document, removing the archived query.

Permissions​

  • The view_private_schema permission is read from auth info and available to the page, but does not gate document visibility in the current template.
  • Upload availability may be restricted by company configuration or user role.