Support decimal currency amounts (#74)
Reviewed-on: #74
This commit was merged in pull request #74.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user