mirror of
https://github.com/gabehf/BudgetBuddy.git
synced 2026-03-07 21:48:14 -08:00
api for initial widgets
This commit is contained in:
parent
36f751a69f
commit
4aa8a2f822
14 changed files with 864 additions and 11 deletions
33
db/schemas.go
Normal file
33
db/schemas.go
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package db
|
||||
|
||||
import (
|
||||
"github.com/jacobmveber-01839764/BudgetBuddy/money"
|
||||
)
|
||||
|
||||
type UserSchema struct {
|
||||
Name string `json:"name" bson:"name"`
|
||||
Email string `json:"email" bson:"email"`
|
||||
Password string `json:"password" bson:"password"`
|
||||
Session string `json:"session" bson:"session"`
|
||||
Balance money.Money `json:"balance" bson:"balance"`
|
||||
Budget money.Money `json:"budget" bson:"budget"`
|
||||
Categories map[string]money.Money `json:"categories" bson:"categories"`
|
||||
Expenses []Transaction `json:"expenses" bson:"expenses"`
|
||||
Income []Transaction `json:"income" bson:"income"`
|
||||
RecurringExpenses []RecurringTransaction `json:"recurring_expenses" bson:"recurring_expenses"`
|
||||
RecurringIncome []RecurringTransaction `json:"recurring_income" bson:"recurring_income"`
|
||||
}
|
||||
|
||||
type Transaction struct {
|
||||
Timestamp int64 `json:"timestamp" bson:"timestamp"`
|
||||
Category string `json:"category" bson:"category"`
|
||||
Amount money.Money `json:"amount" bson:"amount"`
|
||||
Type string `json:"type" bson:"type"`
|
||||
}
|
||||
|
||||
type RecurringTransaction struct {
|
||||
Transaction `json:"transaction" bson:"transaction"`
|
||||
Period int `json:"period" bson:"period"` // in days
|
||||
Since int64 `json:"since" bson:"since"` // unix timestamp
|
||||
Until int64 `json:"until" bson:"until"` // 0 for no end date
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue