Skip to main content

Document Management Architecture

Backend: com.axvero.ams.core.document/. GraphQL: documents.graphqls and documents-input.graphqls.

Core Entities

  • DocumentDefinition — a type of document (e.g. "Income Statement"); workspace-scoped; has defaultRequired, category, allowCustomDocuments; has a list of DocumentTemplate files
  • DocumentTemplate — an admin-uploaded template file attached to a DocumentDefinition; has fileUrl, fileType, fileName
  • ApplicationTemplate — application type template; has name, description, applicationType, allowCustomDocuments, active; contains ApplicationTemplateDocument entries
  • ApplicationTemplateDocument — join between ApplicationTemplate and DocumentDefinition; overrides required/optional per template; has sortOrder and instructions
  • ApplicationDocument — actual document on an application; has applicationId, optional documentDefinitionId (null = ad-hoc), status enum (PENDING, UPLOADED, APPROVED, REJECTED, NOT_APPLICABLE), reviewNote, uploadedByUserId

Permission Rules

  • Creating/updating DocumentDefinition and ApplicationTemplate: OWNER, ADMIN, or MANAGER
  • Viewing: any workspace role
  • Submitting ApplicationDocument: any authenticated user
  • Reviewing (reviewApplicationDocument): staff only
  • Listing (applicationDocuments): workspace role or client membership (hasUserAnyWorkspaceOrClientRole)