Skip to content

Documents Tool

The Documents tool provides secure storage for employee paperwork. Files are stored in Cloudflare R2 with metadata tracked in D1. Documents are associated with a person record and grouped by category.

  • Category-based organisation — Documents grouped by type (Employment Agreement, Superannuation, Visa, Certificate, Policy, Other)
  • File uploads — PDF, Word, Excel, and image files up to 10 MB
  • Expiry tracking — Optional expiry dates for visas and certificates with visual warnings
  • Hierarchical access — Executives see all, heads see subtree, managers see direct reports, leads/employees see own
  • Person selector — Executives, heads, and managers can switch between viewing their own and other people’s documents
  • Person detail sheet — Documents tab integrated into the People tool drawer
  • Download — Direct file download with correct content type
CategoryDescription
Employment AgreementEmployment contracts and variations
SuperannuationSuper choice forms and fund details
VisaWork visa documents with expiry tracking
CertificateCertifications (first aid, WWC, etc.) with expiry tracking
PolicySigned company policies
OtherAny other employment-related documents
Access LevelViewUpload/DeleteScope
ExecutiveYesYesAll people
HeadYesYesReporting subtree
ManagerYesYesDirect reports
LeadYesNoOwn only
EmployeeYesNoOwn only
ParameterTypeDescription
person_idstringPerson to view documents for (exec/head/manager only)
ColumnTypeDescription
idTEXT PKUUID
person_idTEXT FKReferences people(id), cascade delete
categoryTEXTDocument category
nameTEXTHuman-readable document name
file_keyTEXTR2 object key
file_nameTEXTOriginal filename
file_sizeINTEGERFile size in bytes
content_typeTEXTMIME type
expiry_dateTEXTOptional expiry date (YYYY-MM-DD)
uploaded_byTEXT FKReferences users(id)
created_atTEXTUpload timestamp
FilePurpose
src/routes/documents.tsxRoute definition with person_id search param
src/components/documents/documents-page.tsxMain page with person selector, grouped document list
src/components/documents/document-upload-dialog.tsxUpload dialog with category, name, expiry, file fields
src/hooks/use-documents.tsTanStack Query hooks for CRUD operations
worker/routes/documents.tsAPI endpoints with hierarchical permission scoping
  • E-signatures and document signing workflows
  • Compliance monitoring and automated expiry alerts
  • Recruitment and onboarding triggers that generate paperwork