Audience: Engineers. What this answers: the entity model, the two workflows (template approval, employee completion), and how smart text and signatories fit.
Source:
DocumentService.cs(1,218),AdminDocumentsService.cs(317),Employee/DocumentsService.cs(106), theDocument*/SmartText/Signatoryentities (TenantDb),DocumentModel.cs, plus a live pass 2026-07-20.
CompanyId-scoped)DocumentTemplateType (Offer=1, Employee document=2, Company document=3)
└─< DocumentTemplate ──> DocumentTemplateStatus (In progress/Completed/Approved/Declined)
│ Contents, Alias, Url, FileDate, ReviewDate
│ IsDefault, IsForNewEmployees, IsForExistingEmployees, IsSignatureRequired
│ SignaturePersonId, Signature, SignatureDate ← the company's counter-signature
└─< EmployeeDocument ──> Person
Signature, ActionDate ← the employee's completion
SmartText Alias, Description, IsForOffer, IsForRequest,
IsForOnboardingNote, IsForAnniversary, IsForHiring
Signatory PersonId, IsPrimary, CompanyId
DocumentPolicy ──< DocumentPolicyItem IsEmployeeEnabled, PolicyTypeId → PolicyType
Read models: ViewDocumentTemplate, ViewEmployeeDocument, ViewSignatory, ViewDocumentPolicyItem.
DocumentTemplateTypeParams)| Const | Value | Int |
|---|---|---|
OFFER |
"Offer" | 1 |
EMPLOYEE_DOCUMENT |
"Employee document" | 2 |
COMPANY_DOCUMENT |
"Company document" | 3 |
Type 1 is consumed by Hiring via Offer.DocumentTemplateId. Type 3 is platform-issued, absent from the tenant's create flow (RFD-002).
DocumentTemplateStatuParams)In progress (1) → Completed (2) → Approved (3)
↘ Declined (4)
Driven by Admin/Documents/Approve and /Decline. A template must clear this before issue — the control that stops unreviewed legal text reaching staff.
Admin/Documents/Assign → creates EmployeeDocument (PersonId + DocumentTemplateId)
│
├── Employee/Documents/Sign → Signature + ActionDate
└── Employee/Documents/Acknowledge → ActionDate only
│
Admin/Documents/Recall → withdraws the assignment
Which action applies is governed by the template's IsSignatureRequired. Models: SignDocumentTemplateModel, AcknowledgeDocumentTemplateModel, NewDocumentTemplateAssignmentModel.
Two signatures, two meanings.
DocumentTemplate.Signatureis the company's counter-signature (withSignaturePersonId→ aSignatory).EmployeeDocument.Signatureis the employee's. Don't conflate them. (RFD-001)
SmartText carries five boolean context flags rather than a single category:
IsForOffer · IsForRequest · IsForOnboardingNote · IsForAnniversary · IsForHiring