feat: create accounts to partition money
This commit is contained in:
parent
fb1a038821
commit
d6f6790c4d
11 changed files with 1026 additions and 4 deletions
34
internal/model/money_account.go
Normal file
34
internal/model/money_account.go
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type TransferDirection string
|
||||
|
||||
const (
|
||||
TransferDirectionDeposit TransferDirection = "deposit"
|
||||
TransferDirectionWithdrawal TransferDirection = "withdrawal"
|
||||
)
|
||||
|
||||
type MoneyAccount struct {
|
||||
ID string `db:"id"`
|
||||
SpaceID string `db:"space_id"`
|
||||
Name string `db:"name"`
|
||||
CreatedBy string `db:"created_by"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
type AccountTransfer struct {
|
||||
ID string `db:"id"`
|
||||
AccountID string `db:"account_id"`
|
||||
AmountCents int `db:"amount_cents"`
|
||||
Direction TransferDirection `db:"direction"`
|
||||
Note string `db:"note"`
|
||||
CreatedBy string `db:"created_by"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
||||
|
||||
type MoneyAccountWithBalance struct {
|
||||
MoneyAccount
|
||||
BalanceCents int
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue