feat(schema): #48 monthly_budget em categories + category_id em achievements

- Migration 018: ADD COLUMN monthly_budget NUMERIC(12,2) em categories
- Migration 018: ADD COLUMN category_id INTEGER REFERENCES categories(id) ON DELETE CASCADE em achievements
- Remove conquistas hardcoded veleiro_under_500 e health_3months do banco
- Reset game state do profile_id=1
- Atualiza CategoryRepository, CategoryInput e Category model para incluir monthly_budget
This commit is contained in:
2026-05-28 23:26:39 -03:00
parent 85bb60ae5a
commit f60ca423d0
9 changed files with 79 additions and 48 deletions
+12 -10
View File
@@ -3,17 +3,19 @@ package model
import "time"
type Category struct {
ID int `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
IsDefault bool `json:"is_default"`
IsTax bool `json:"is_tax"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ID int `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
IsDefault bool `json:"is_default"`
IsTax bool `json:"is_tax"`
MonthlyBudget *float64 `json:"monthly_budget"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type CategoryInput struct {
Name string `json:"name"`
Color string `json:"color"`
IsTax bool `json:"is_tax"`
Name string `json:"name"`
Color string `json:"color"`
IsTax bool `json:"is_tax"`
MonthlyBudget *float64 `json:"monthly_budget"`
}
+14 -8
View File
@@ -41,14 +41,20 @@ type PlayerQuest struct {
}
type Achievement struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Icon string `json:"icon"`
XPReward int `json:"xp_reward"`
UnlockCondition string `json:"unlock_condition"`
Earned bool `json:"earned"`
EarnedAt string `json:"earned_at,omitempty"`
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Icon string `json:"icon"`
XPReward int `json:"xp_reward"`
UnlockCondition string `json:"unlock_condition"`
CategoryID *int `json:"category_id,omitempty"`
Earned bool `json:"earned"`
EarnedAt string `json:"earned_at,omitempty"`
}
type CategoryBudgetInfo struct {
CategoryID int
MonthlyBudget float64
}
type Cosmetic struct {