Todo Templates
Todo Templates
Todo Templates let admins define a library of default tasks that are automatically applied to every new tenancy. Each template can specify an assignee role, task type, priority, and a due-date offset relative to the tenancy start date.
Where to find it
Company Settings → Tenancy Settings → Todo Templates
Only users with the admin role can create, edit, archive, or delete templates.
Creating a template
- Open Company Settings → Tenancy Settings.
- Scroll to the Todo Templates section.
- Fill in the creation form:
| Field | Required | Description |
|---|---|---|
| Title | ✅ | Short label for the task |
| Description | ❌ | Optional longer explanation |
| Assigned To | ✅ | Agent, Tenant, or Landlord |
| Task Type | ✅ | Custom, Cost Breakdown Sign, Holding Deposit Pay, Tenancy Agreement Sign, or Compliance Doc |
| Priority | ✅ | Low, Normal, High, or Urgent |
| Due Offset (days) | ❌ | Days from the tenancy start date. Use 0 for the start date, positive values for after, negative values for before (e.g. -3 = 3 days before start). Leave blank for no due date. |
- Click Add (or press
Enterin the offset field) to save.
Viewing templates
Templates are split into two groups:
- Active Templates — currently enabled; applied to every new tenancy.
- Archived Templates — disabled; not applied to new tenancies but kept for reference.
Each template card displays colour-coded badges:
| Badge colour | Meaning |
|---|---|
| Blue | Assignee role |
| Purple | Task type (only shown when not custom) |
| Red / Orange / Grey | Priority (only shown when not normal) |
| Teal | Due-date offset in days |
Archiving, restoring, and deleting templates
| Action | When available | Effect |
|---|---|---|
| Archive | Template is active | Soft-deletes the template; it will no longer be applied to new tenancies |
| Restore | Template is archived | Re-activates the template |
| Delete | Template is archived | Permanently removes the template — this cannot be undone |
How templates are applied to tenancies
When a new tenancy is created, the todo.applyDefaultTemplates procedure:
- Fetches all active templates from the
todoTemplatestable. - Calculates each todo's due date:
tenancyStartDate + dueDateOffsetDays. - Creates a todo record for each template, setting
templateIdso you can trace which template it came from.
You can also supply an explicit tenancyStartDate when calling todo.applyDefaultTemplates to override the date stored on the tenancy record.
Traceability
Every auto-created todo stores the templateId it was generated from. This lets you audit which template produced which task and track changes over time.
Backward compatibility
The legacy companySettings.defaultTodoTemplates JSONB field is deprecated but remains functional. Existing data is not affected. New templates should be managed through the Todo Templates UI described above.
API reference (tRPC)
All procedures are in the todoTemplate router and require admin authentication.
todoTemplate.list
trpc.todoTemplate.list.useQuery({ includeInactive?: boolean })
// Returns: { items: TodoTemplate[] }
Pass includeInactive: true to include archived templates in the response.
todoTemplate.getById
trpc.todoTemplate.getById.useQuery({ id: string })
// Returns: TodoTemplate
todoTemplate.create
trpc.todoTemplate.create.useMutation()
// Input:
{
title: string;
description?: string;
assignedTo: "agent" | "tenant" | "landlord";
taskType: "custom" | "cost_breakdown_sign" | "holding_deposit_pay" | "tenancy_agreement_sign" | "compliance_doc";
priority: "low" | "normal" | "high" | "urgent";
dueDateOffsetDays?: number;
}
todoTemplate.update
trpc.todoTemplate.update.useMutation()
// Input: { id: string } & Partial<CreateInput>
todoTemplate.archive
trpc.todoTemplate.archive.useMutation()
// Input: { id: string }
todoTemplate.restore
trpc.todoTemplate.restore.useMutation()
// Input: { id: string }
todoTemplate.delete
trpc.todoTemplate.delete.useMutation()
// Input: { id: string }
// Note: template must be archived before it can be permanently deleted
todoTemplate.reorder
trpc.todoTemplate.reorder.useMutation()
// Input: { ids: string[] } — ordered array of template IDs