add expenses management
This commit is contained in:
parent
b7905ddded
commit
f8ddf152e4
16 changed files with 611 additions and 29 deletions
39
internal/model/expense.go
Normal file
39
internal/model/expense.go
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type ExpenseType string
|
||||
|
||||
const (
|
||||
ExpenseTypeExpense ExpenseType = "expense"
|
||||
ExpenseTypeTopup ExpenseType = "topup"
|
||||
)
|
||||
|
||||
type Expense struct {
|
||||
ID string `db:"id"`
|
||||
SpaceID string `db:"space_id"`
|
||||
CreatedBy string `db:"created_by"`
|
||||
Description string `db:"description"`
|
||||
AmountCents int `db:"amount_cents"`
|
||||
Type ExpenseType `db:"type"`
|
||||
Date time.Time `db:"date"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
type ExpenseTag struct {
|
||||
ExpenseID string `db:"expense_id"`
|
||||
TagID string `db:"tag_id"`
|
||||
}
|
||||
|
||||
type ExpenseItem struct {
|
||||
ExpenseID string `db:"expense_id"`
|
||||
ItemID string `db:"item_id"`
|
||||
}
|
||||
|
||||
type TagExpenseSummary struct {
|
||||
TagID string `db:"tag_id"`
|
||||
TagName string `db:"tag_name"`
|
||||
TagColor string `db:"tag_color"`
|
||||
TotalAmount int `db:"total_amount"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue