Add userbudget

This commit is contained in:
Jan Bader 2016-12-20 21:17:11 +01:00
parent 07d5816251
commit 57a69c448d
3 changed files with 15 additions and 0 deletions

View File

@ -11,7 +11,14 @@ type Budget struct {
LastModification time.Time LastModification time.Time
} }
// UserBudget represents the relation between users and budgets
type UserBudget struct {
UserID string `sql:",pk"`
BudgetID string `sql:",pk"`
}
// BudgetService provides Methods for CRUD of Budgets // BudgetService provides Methods for CRUD of Budgets
type BudgetService interface { type BudgetService interface {
Budget(id string) (Budget, error) Budget(id string) (Budget, error)
BudgetsForUser(user User) ([]Budget, error)
} }

View File

@ -11,3 +11,7 @@ func (s *Repository) Budget(id string) (*budgeteer.Budget, error) {
} }
return b, nil return b, nil
} }
func (s *Repository) BudgetsForUser(user budgeteer.User) ([]budgeteer.Budget, error) {
}

View File

@ -0,0 +1,4 @@
CREATE TABLE user_budgets (
user_id char(26),
budget_id char(26)
);