From ee7a8e24da1dfc959d78236a63ee65acc4be45e4 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sat, 20 Jul 2024 03:42:38 -0400 Subject: Update ChoreHistory model to include updatedAt field, Support history modification --- internal/chore/model/model.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/chore/model') diff --git a/internal/chore/model/model.go b/internal/chore/model/model.go index c9cf28c..38d8354 100644 --- a/internal/chore/model/model.go +++ b/internal/chore/model/model.go @@ -36,11 +36,12 @@ type ChoreAssignees struct { type ChoreHistory struct { ID int `json:"id" gorm:"primary_key"` // Unique identifier ChoreID int `json:"choreId" gorm:"column:chore_id"` // The chore this history is for - CompletedAt time.Time `json:"completedAt" gorm:"column:completed_at"` // When the chore was completed + CompletedAt *time.Time `json:"completedAt" gorm:"column:completed_at"` // When the chore was completed CompletedBy int `json:"completedBy" gorm:"column:completed_by"` // Who completed the chore AssignedTo int `json:"assignedTo" gorm:"column:assigned_to"` // Who the chore was assigned to Note *string `json:"notes" gorm:"column:notes"` // Notes about the chore DueDate *time.Time `json:"dueDate" gorm:"column:due_date"` // When the chore was due + UpdatedAt *time.Time `json:"updatedAt" gorm:"column:updated_at"` // When the record was last updated } type FrequencyMetadata struct { -- cgit