Add next_due_date to admin task views
Display next_due_date field in task list table and task detail page so admins can see the effective date used for overdue calculations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -124,6 +124,14 @@ export function TaskDetailClient() {
|
||||
<div className="text-sm font-medium text-muted-foreground">Due Date</div>
|
||||
<div>{task.due_date ? new Date(task.due_date).toLocaleDateString() : '-'}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-sm font-medium text-muted-foreground">Next Due Date</div>
|
||||
<div>{task.next_due_date ? new Date(task.next_due_date).toLocaleDateString() : '-'}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-sm font-medium text-muted-foreground">Frequency</div>
|
||||
<div>{task.frequency_name || '-'}</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -67,6 +67,11 @@ const columns: ColumnDef<Task>[] = [
|
||||
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',
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user