Support decimal currency amounts (#74)

Reviewed-on: #74
This commit was merged in pull request #74.
This commit is contained in:
2025-05-24 06:28:07 +02:00
parent 426e456ba7
commit f8d1f195de
4 changed files with 57 additions and 35 deletions

View File

@@ -8,45 +8,45 @@ type User struct {
}
type UserWithAllowance struct {
ID int `json:"id"`
Name string `json:"name"`
Allowance int `json:"allowance"`
ID int `json:"id"`
Name string `json:"name"`
Allowance float64 `json:"allowance"`
}
type History struct {
Allowance int `json:"allowance"`
Allowance float64 `json:"allowance"`
Timestamp time.Time `json:"timestamp"`
}
type PostHistory struct {
Allowance int `json:"allowance"`
Allowance float64 `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
ID int `json:"id"`
Name string `json:"name"`
Reward float64 `json:"reward"`
Assigned *int `json:"assigned"` // Pointer to allow null
}
type Allowance struct {
ID int `json:"id"`
Name string `json:"name"`
Target int `json:"target"`
Progress int `json:"progress"`
Target float64 `json:"target"`
Progress float64 `json:"progress"`
Weight float64 `json:"weight"`
}
type CreateAllowanceRequest struct {
Name string `json:"name"`
Target int `json:"target"`
Target float64 `json:"target"`
Weight float64 `json:"weight"`
}
type UpdateAllowanceRequest struct {
Name string `json:"name"`
Target int `json:"target"`
Target float64 `json:"target"`
Weight float64 `json:"weight"`
}
@@ -60,9 +60,9 @@ type CreateGoalResponse struct {
}
type CreateTaskRequest struct {
Name string `json:"name" binding:"required"`
Reward int `json:"reward"`
Assigned *int `json:"assigned"`
Name string `json:"name" binding:"required"`
Reward float64 `json:"reward"`
Assigned *int `json:"assigned"`
}
type CreateTaskResponse struct {