2025-05-13 13:52:10 +02:00

58 lines
1.1 KiB
Go

package main
type User struct {
ID int `json:"id"`
Name string `json:"name"`
}
type UserWithAllowance struct {
ID int `json:"id"`
Name string `json:"name"`
Allowance int `json:"allowance"`
}
type Allowance struct {
Allowance int `json:"allowance"`
Goals []Goal `json:"goals"`
}
type PostAllowance struct {
Allowance int `json:"allowance"`
}
// Task represents a task in the system.
type Task struct {
ID int `json:"id"`
Name string `json:"name"`
Reward int `json:"reward"`
Assigned *int `json:"assigned"` // Pointer to allow null
}
type Goal struct {
ID int `json:"id"`
Name string `json:"name"`
Target int `json:"target"`
Progress int `json:"progress"`
Weight int `json:"weight"`
}
type CreateGoalRequest struct {
Name string `json:"name"`
Target int `json:"target"`
Weight int `json:"weight"`
}
type CreateGoalResponse struct {
ID int `json:"id"`
}
type CreateTaskRequest struct {
Name string `json:"name" binding:"required"`
Reward int `json:"reward"`
Assigned *int `json:"assigned"`
}
type CreateTaskResponse struct {
ID int `json:"id"`
}