Implement TaskUpdateParams builder
- TaskUpdateParams struct with fluent setter methods - NewTaskUpdate() constructor - Setters: SetTitle, SetDescription, SetColor, SetOwner, SetCategory, SetPriority, SetScore, SetDueDate, SetStartDate, SetReference, SetTags - Clear methods: ClearDueDate, ClearStartDate, ClearOwner, ClearCategory - Only set fields are included in update request (partial updates) - Client.UpdateTaskFromParams for fluent task updates - Comprehensive test coverage
This commit is contained in:
parent
28e517289a
commit
0c5b7fd6e9
4 changed files with 451 additions and 1 deletions
7
tasks.go
7
tasks.go
|
|
@ -67,6 +67,13 @@ func (c *Client) UpdateTask(ctx context.Context, req UpdateTaskRequest) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// UpdateTaskFromParams updates an existing task using TaskUpdateParams.
|
||||
// This provides a fluent interface for task updates.
|
||||
func (c *Client) UpdateTaskFromParams(ctx context.Context, taskID int, params *TaskUpdateParams) error {
|
||||
req := params.toUpdateTaskRequest(taskID)
|
||||
return c.UpdateTask(ctx, req)
|
||||
}
|
||||
|
||||
// CloseTask closes a task (sets it to inactive).
|
||||
// Returns ErrTaskClosed if the task is already closed.
|
||||
func (c *Client) CloseTask(ctx context.Context, taskID int) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue