feat: recurring expenses and reports
This commit is contained in:
parent
cda4f61939
commit
9e6ff67a87
23 changed files with 2943 additions and 56 deletions
41
internal/model/recurring_expense.go
Normal file
41
internal/model/recurring_expense.go
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Frequency string
|
||||
|
||||
const (
|
||||
FrequencyDaily Frequency = "daily"
|
||||
FrequencyWeekly Frequency = "weekly"
|
||||
FrequencyBiweekly Frequency = "biweekly"
|
||||
FrequencyMonthly Frequency = "monthly"
|
||||
FrequencyYearly Frequency = "yearly"
|
||||
)
|
||||
|
||||
type RecurringExpense 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"`
|
||||
PaymentMethodID *string `db:"payment_method_id"`
|
||||
Frequency Frequency `db:"frequency"`
|
||||
StartDate time.Time `db:"start_date"`
|
||||
EndDate *time.Time `db:"end_date"`
|
||||
NextOccurrence time.Time `db:"next_occurrence"`
|
||||
IsActive bool `db:"is_active"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
type RecurringExpenseWithTags struct {
|
||||
RecurringExpense
|
||||
Tags []*Tag
|
||||
}
|
||||
|
||||
type RecurringExpenseWithTagsAndMethod struct {
|
||||
RecurringExpense
|
||||
Tags []*Tag
|
||||
PaymentMethod *PaymentMethod
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue