Add next_due_date editing to admin task form

- Add NextDueDate field to UpdateTaskRequest DTO
- Add handler logic to process next_due_date updates
- Add next_due_date input field to task edit form
- Update TypeScript models with next_due_date field

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-08 17:23:30 -06:00
parent 5be18fa110
commit cb250f108b
4 changed files with 22 additions and 1 deletions

View File

@@ -135,6 +135,7 @@ type UpdateTaskRequest struct {
StatusID *uint `json:"status_id"`
FrequencyID *uint `json:"frequency_id"`
DueDate *string `json:"due_date"`
NextDueDate *string `json:"next_due_date"`
EstimatedCost *float64 `json:"estimated_cost"`
ActualCost *float64 `json:"actual_cost"`
ContractorID *uint `json:"contractor_id"`

View File

@@ -221,6 +221,13 @@ func (h *AdminTaskHandler) Update(c *gin.Context) {
updates["due_date"] = dueDate
}
}
if req.NextDueDate != nil {
if *req.NextDueDate == "" {
updates["next_due_date"] = nil
} else if nextDueDate, err := time.Parse("2006-01-02", *req.NextDueDate); err == nil {
updates["next_due_date"] = nextDueDate
}
}
if req.EstimatedCost != nil {
updates["estimated_cost"] = decimal.NewFromFloat(*req.EstimatedCost)
}