Documents

Document templates and document requests for building renovations. Admins define reusable templates organized by labels and categories; document requests track which documents are needed for a specific project or building.

Source Files

LayerPath
Schemabackend/src/db/schema.ts
Request Routesbackend/src/routes/document-requests.ts
Template Routesbackend/src/routes/admin/document-templates.ts
Label Routesbackend/src/routes/admin/template-labels.ts
Request Servicebackend/src/services/document-request-service.ts
Template Servicebackend/src/services/document-template-service.ts

Database Tables

TablePurpose
documentRequestsTracks individual document needs per project (status, assignee, due date)
documentTemplatesReusable definitions of document types (name, description, requirements)
documentTemplateLabelsTags/labels for organizing templates
documentTemplateLabelCategoriesGroupings for labels (e.g., “Building Type”, “Funding Body”)

Key Concepts

  • Templates define what a document is (e.g., “Energy Certificate”, “Floor Plan”). Admins manage templates, labels, and categories via the admin panel.
  • Requests are instances tied to a project: “We need document X for project Y.” Each request tracks status, assignee, and fulfillment.
  • Labels & categories provide a two-level taxonomy so templates can be filtered and grouped in the UI.

Relationships

DocumentTemplate 1──* DocumentRequests
DocumentTemplate *──* DocumentTemplateLabels
DocumentTemplateLabel *──1 DocumentTemplateLabelCategory
DocumentRequest *──1 Project
DocumentRequest *──* Files (fulfillment uploads)

Workflow

  1. Admin creates templates and labels in the admin panel
  2. When a project starts, relevant document requests are created (manually or via Document Obtaining)
  3. Requests are assigned to team members or sent to customers via Portal
  4. Customers or staff upload Files to fulfill the request
  5. Fulfilled documents go through Document Review

Frontend

Document requests appear on the project detail page and inside the Document Obtaining dashboard. The admin template management lives at frontend/src/pages/admin/ alongside Forms and other configuration pages.

Document Obtaining | Document Review | Files | Portal | Forms | Projects | Buildings | Admin Dashboard | Service Layer Pattern