package main import "time" type User struct { ID int `json:"id"` Name string `json:"name"` } type UserWithAllowance struct { ID int `json:"id"` Name string `json:"name"` Allowance float64 `json:"allowance"` } type History struct { Allowance float64 `json:"allowance"` Timestamp time.Time `json:"timestamp"` Description string `json:"description"` } type PostHistory struct { Allowance float64 `json:"allowance"` Description string `json:"description"` } // Task represents a task in the system. type Task struct { ID int `json:"id"` Name string `json:"name"` Reward float64 `json:"reward"` Assigned *int `json:"assigned"` Schedule *string `json:"schedule"` } type Allowance struct { ID int `json:"id"` Name string `json:"name"` Target float64 `json:"target"` Progress float64 `json:"progress"` Weight float64 `json:"weight"` Colour string `json:"colour"` } type CreateAllowanceRequest struct { Name string `json:"name"` Target float64 `json:"target"` Weight float64 `json:"weight"` Colour string `json:"colour"` } type UpdateAllowanceRequest struct { Name string `json:"name"` Target float64 `json:"target"` Weight float64 `json:"weight"` Colour string `json:"colour"` } type BulkUpdateAllowanceRequest struct { ID int `json:"id"` Weight float64 `json:"weight"` } type CreateGoalResponse struct { ID int `json:"id"` } type CreateTaskRequest struct { Name string `json:"name" binding:"required"` Reward float64 `json:"reward"` Assigned *int `json:"assigned"` Schedule *string `json:"schedule"` } type CreateTaskResponse struct { ID int `json:"id"` } type AddAllowanceAmountRequest struct { Amount float64 `json:"amount"` Description string `json:"description"` } type TransferRequest struct { From int `json:"from"` To int `json:"to"` Amount float64 `json:"amount"` } type ExportUser struct { ID int `json:"id"` Name string `json:"name"` Balance int64 `json:"balance"` Weight float64 `json:"weight"` } type ExportAllowance struct { ID int `json:"id"` UserID int `json:"userId"` Name string `json:"name"` Target int64 `json:"target"` Balance int64 `json:"balance"` Weight float64 `json:"weight"` Colour *int `json:"colour"` } type ExportHistory struct { ID int `json:"id"` UserID int `json:"userId"` Timestamp int64 `json:"timestamp"` Amount int64 `json:"amount"` Description string `json:"description"` } type ExportTask struct { ID int `json:"id"` Name string `json:"name"` Reward int64 `json:"reward"` Assigned *int `json:"assigned"` Schedule *string `json:"schedule"` Completed *int64 `json:"completed"` NextRun *int64 `json:"nextRun"` } type ExportData struct { Users []ExportUser `json:"users"` Allowances []ExportAllowance `json:"allowances"` History []ExportHistory `json:"history"` Tasks []ExportTask `json:"tasks"` }