diff --git a/admin/src/app/(dashboard)/tasks/[id]/client.tsx b/admin/src/app/(dashboard)/tasks/[id]/client.tsx index edb01c8..9ef0a15 100644 --- a/admin/src/app/(dashboard)/tasks/[id]/client.tsx +++ b/admin/src/app/(dashboard)/tasks/[id]/client.tsx @@ -124,6 +124,14 @@ export function TaskDetailClient() {
Due Date
{task.due_date ? new Date(task.due_date).toLocaleDateString() : '-'}
+
+
Next Due Date
+
{task.next_due_date ? new Date(task.next_due_date).toLocaleDateString() : '-'}
+
+
+
Frequency
+
{task.frequency_name || '-'}
+
diff --git a/admin/src/app/(dashboard)/tasks/page.tsx b/admin/src/app/(dashboard)/tasks/page.tsx index 77022e1..73275fb 100644 --- a/admin/src/app/(dashboard)/tasks/page.tsx +++ b/admin/src/app/(dashboard)/tasks/page.tsx @@ -67,6 +67,11 @@ const columns: ColumnDef[] = [ header: 'Due Date', cell: ({ row }) => row.original.due_date ? new Date(row.original.due_date).toLocaleDateString() : '-', }, + { + accessorKey: 'next_due_date', + header: 'Next Due', + cell: ({ row }) => row.original.next_due_date ? new Date(row.original.next_due_date).toLocaleDateString() : '-', + }, { accessorKey: 'is_cancelled', header: 'State', diff --git a/admin/src/types/models.ts b/admin/src/types/models.ts index 46b16bd..ae1b6ab 100644 --- a/admin/src/types/models.ts +++ b/admin/src/types/models.ts @@ -191,6 +191,7 @@ export interface Task { frequency_id?: number; frequency_name?: string; due_date?: string; + next_due_date?: string; estimated_cost?: number; actual_cost?: number; contractor_id?: number; diff --git a/internal/admin/dto/responses.go b/internal/admin/dto/responses.go index 06a9a63..76eab24 100644 --- a/internal/admin/dto/responses.go +++ b/internal/admin/dto/responses.go @@ -131,6 +131,7 @@ type TaskResponse struct { FrequencyID *uint `json:"frequency_id,omitempty"` FrequencyName *string `json:"frequency_name,omitempty"` DueDate *string `json:"due_date,omitempty"` + NextDueDate *string `json:"next_due_date,omitempty"` EstimatedCost *float64 `json:"estimated_cost,omitempty"` ActualCost *float64 `json:"actual_cost,omitempty"` ContractorID *uint `json:"contractor_id,omitempty"` diff --git a/internal/admin/handlers/task_handler.go b/internal/admin/handlers/task_handler.go index 5c349ee..f5a9267 100644 --- a/internal/admin/handlers/task_handler.go +++ b/internal/admin/handlers/task_handler.go @@ -404,6 +404,10 @@ func (h *AdminTaskHandler) toTaskResponse(task *models.Task) dto.TaskResponse { dueDate := task.DueDate.Format("2006-01-02") response.DueDate = &dueDate } + if task.NextDueDate != nil { + nextDueDate := task.NextDueDate.Format("2006-01-02") + response.NextDueDate = &nextDueDate + } if task.EstimatedCost != nil { cost, _ := task.EstimatedCost.Float64() response.EstimatedCost = &cost