feat: payment methods
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m1s
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m1s
This commit is contained in:
parent
364f8dc682
commit
3de76916c9
15 changed files with 946 additions and 100 deletions
|
|
@ -10,15 +10,16 @@ const (
|
|||
)
|
||||
|
||||
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"`
|
||||
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"`
|
||||
PaymentMethodID *string `db:"payment_method_id"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
type ExpenseWithTags struct {
|
||||
|
|
@ -26,6 +27,12 @@ type ExpenseWithTags struct {
|
|||
Tags []*Tag
|
||||
}
|
||||
|
||||
type ExpenseWithTagsAndMethod struct {
|
||||
Expense
|
||||
Tags []*Tag
|
||||
PaymentMethod *PaymentMethod
|
||||
}
|
||||
|
||||
type ExpenseTag struct {
|
||||
ExpenseID string `db:"expense_id"`
|
||||
TagID string `db:"tag_id"`
|
||||
|
|
|
|||
21
internal/model/payment_method.go
Normal file
21
internal/model/payment_method.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type PaymentMethodType string
|
||||
|
||||
const (
|
||||
PaymentMethodTypeCredit PaymentMethodType = "credit"
|
||||
PaymentMethodTypeDebit PaymentMethodType = "debit"
|
||||
)
|
||||
|
||||
type PaymentMethod struct {
|
||||
ID string `db:"id"`
|
||||
SpaceID string `db:"space_id"`
|
||||
Name string `db:"name"`
|
||||
Type PaymentMethodType `db:"type"`
|
||||
LastFour *string `db:"last_four"`
|
||||
CreatedBy string `db:"created_by"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue