Documentation
¶
Index ¶
- Constants
- func FormatDecimal(d decimal.Decimal) string
- func FormatMoney(d decimal.Decimal) string
- type AccountTransfer
- type AccountTransferWithAccount
- type Budget
- type BudgetPeriod
- type BudgetStatus
- type BudgetWithSpent
- type DailySpending
- type Expense
- type ExpenseItem
- type ExpenseTag
- type ExpenseType
- type ExpenseWithTags
- type ExpenseWithTagsAndMethod
- type File
- type Frequency
- type FundingSourceType
- type InvitationStatus
- type ListCardData
- type ListItem
- type ListWithUncheckedItems
- type Loan
- type LoanWithPaymentSummary
- type MoneyAccount
- type MoneyAccountWithBalance
- type MonthlySpending
- type PaymentMethod
- type PaymentMethodExpenseSummary
- type PaymentMethodType
- type Profile
- type Receipt
- type ReceiptFundingSource
- type ReceiptFundingSourceWithAccount
- type ReceiptWithSources
- type ReceiptWithSourcesAndAccounts
- type RecurringExpense
- type RecurringExpenseWithTags
- type RecurringExpenseWithTagsAndMethod
- type RecurringReceipt
- type RecurringReceiptSource
- type RecurringReceiptWithLoan
- type RecurringReceiptWithSources
- type Role
- type ShoppingList
- type Space
- type SpaceInvitation
- type SpaceMember
- type SpaceMemberWithProfile
- type SpendingReport
- type Tag
- type TagExpenseSummary
- type Token
- type TransferDirection
- type User
Constants ¶
View Source
const ( TokenTypeEmailVerify = "email_verify" TokenTypePasswordReset = "password_reset" TokenTypeEmailChange = "email_change" TokenTypeMagicLink = "magic_link" )
View Source
const (
FileTypeAvatar = "avatar"
)
Variables ¶
This section is empty.
Functions ¶
func FormatDecimal ¶ added in v1.11.2
FormatDecimal formats a decimal for form input values like "12.50"
func FormatMoney ¶ added in v1.11.2
FormatMoney formats a decimal as a dollar string like "$12.50"
Types ¶
type AccountTransfer ¶ added in v1.2.0
type AccountTransfer struct {
ID string `db:"id"`
AccountID string `db:"account_id"`
Amount decimal.Decimal `db:"amount"`
AmountCents int `db:"amount_cents"` // deprecated: kept for SELECT * compatibility
Direction TransferDirection `db:"direction"`
Note string `db:"note"`
RecurringDepositID *string `db:"recurring_deposit_id"`
CreatedBy string `db:"created_by"`
CreatedAt time.Time `db:"created_at"`
}
type AccountTransferWithAccount ¶ added in v1.8.0
type AccountTransferWithAccount struct {
AccountTransfer
AccountName string `db:"account_name"`
}
type Budget ¶ added in v1.4.0
type Budget struct {
ID string `db:"id"`
SpaceID string `db:"space_id"`
Amount decimal.Decimal `db:"amount"`
AmountCents int `db:"amount_cents"` // deprecated: kept for SELECT * compatibility
Period BudgetPeriod `db:"period"`
StartDate time.Time `db:"start_date"`
EndDate *time.Time `db:"end_date"`
IsActive bool `db:"is_active"`
CreatedBy string `db:"created_by"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type BudgetPeriod ¶ added in v1.4.0
type BudgetPeriod string
const ( BudgetPeriodWeekly BudgetPeriod = "weekly" BudgetPeriodMonthly BudgetPeriod = "monthly" BudgetPeriodYearly BudgetPeriod = "yearly" )
type BudgetStatus ¶ added in v1.4.0
type BudgetStatus string
const ( BudgetStatusOnTrack BudgetStatus = "on_track" BudgetStatusWarning BudgetStatus = "warning" BudgetStatusOver BudgetStatus = "over" )
type BudgetWithSpent ¶ added in v1.4.0
type BudgetWithSpent struct {
Budget
Tags []*Tag
Spent decimal.Decimal
Percentage float64
Status BudgetStatus
}
func (*BudgetWithSpent) TagNames ¶ added in v1.7.0
func (b *BudgetWithSpent) TagNames() string
type DailySpending ¶ added in v1.4.0
type Expense ¶
type Expense struct {
ID string `db:"id"`
SpaceID string `db:"space_id"`
CreatedBy string `db:"created_by"`
Description string `db:"description"`
Amount decimal.Decimal `db:"amount"`
AmountCents int `db:"amount_cents"` // deprecated: kept for SELECT * compatibility
Type ExpenseType `db:"type"`
Date time.Time `db:"date"`
PaymentMethodID *string `db:"payment_method_id"`
RecurringExpenseID *string `db:"recurring_expense_id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type ExpenseItem ¶
type ExpenseTag ¶
type ExpenseType ¶
type ExpenseType string
const ( ExpenseTypeExpense ExpenseType = "expense" ExpenseTypeTopup ExpenseType = "topup" )
type ExpenseWithTags ¶
type ExpenseWithTagsAndMethod ¶ added in v1.3.0
type ExpenseWithTagsAndMethod struct {
Expense
Tags []*Tag
PaymentMethod *PaymentMethod
}
type File ¶
type File struct {
ID string `db:"id"`
UserID string `db:"user_id"` // Who owns/created this file
OwnerType string `db:"owner_type"` // "user", "profile", etc. - the entity that owns the file
OwnerID string `db:"owner_id"` // Polymorphic FK
Type string `db:"type"`
Filename string `db:"filename"`
OriginalName string `db:"original_name"`
MimeType string `db:"mime_type"`
Size int64 `db:"size"`
StoragePath string `db:"storage_path"`
CreatedAt time.Time `db:"created_at"`
}
type FundingSourceType ¶ added in v1.11.0
type FundingSourceType string
const ( FundingSourceBalance FundingSourceType = "balance" FundingSourceAccount FundingSourceType = "account" )
type InvitationStatus ¶
type InvitationStatus string
const ( InvitationStatusPending InvitationStatus = "pending" InvitationStatusAccepted InvitationStatus = "accepted" InvitationStatusExpired InvitationStatus = "expired" )
type ListCardData ¶
type ListCardData struct {
List *ShoppingList
Items []*ListItem
CurrentPage int
TotalPages int
}
type ListWithUncheckedItems ¶
type ListWithUncheckedItems struct {
List *ShoppingList
Items []*ListItem
}
type Loan ¶ added in v1.11.0
type Loan struct {
ID string `db:"id"`
SpaceID string `db:"space_id"`
Name string `db:"name"`
Description string `db:"description"`
OriginalAmount decimal.Decimal `db:"original_amount"`
OriginalAmountCents int `db:"original_amount_cents"` // deprecated: kept for SELECT * compatibility
InterestRateBps int `db:"interest_rate_bps"`
StartDate time.Time `db:"start_date"`
EndDate *time.Time `db:"end_date"`
IsPaidOff bool `db:"is_paid_off"`
CreatedBy string `db:"created_by"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type LoanWithPaymentSummary ¶ added in v1.11.0
type MoneyAccount ¶ added in v1.2.0
type MoneyAccountWithBalance ¶ added in v1.2.0
type MoneyAccountWithBalance struct {
MoneyAccount
Balance decimal.Decimal
}
type MonthlySpending ¶ added in v1.4.0
type PaymentMethod ¶ added in v1.3.0
type PaymentMethodExpenseSummary ¶ added in v1.13.0
type PaymentMethodType ¶ added in v1.3.0
type PaymentMethodType string
const ( PaymentMethodTypeCredit PaymentMethodType = "credit" PaymentMethodTypeDebit PaymentMethodType = "debit" )
type Profile ¶
type Receipt ¶ added in v1.11.0
type Receipt struct {
ID string `db:"id"`
LoanID string `db:"loan_id"`
SpaceID string `db:"space_id"`
Description string `db:"description"`
TotalAmount decimal.Decimal `db:"total_amount"`
TotalAmountCents int `db:"total_amount_cents"` // deprecated: kept for SELECT * compatibility
Date time.Time `db:"date"`
RecurringReceiptID *string `db:"recurring_receipt_id"`
CreatedBy string `db:"created_by"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type ReceiptFundingSource ¶ added in v1.11.0
type ReceiptFundingSource struct {
ID string `db:"id"`
ReceiptID string `db:"receipt_id"`
SourceType FundingSourceType `db:"source_type"`
AccountID *string `db:"account_id"`
Amount decimal.Decimal `db:"amount"`
AmountCents int `db:"amount_cents"` // deprecated: kept for SELECT * compatibility
LinkedExpenseID *string `db:"linked_expense_id"`
LinkedTransferID *string `db:"linked_transfer_id"`
}
type ReceiptFundingSourceWithAccount ¶ added in v1.11.0
type ReceiptFundingSourceWithAccount struct {
ReceiptFundingSource
AccountName string
}
type ReceiptWithSources ¶ added in v1.11.0
type ReceiptWithSources struct {
Receipt
Sources []ReceiptFundingSource
}
type ReceiptWithSourcesAndAccounts ¶ added in v1.11.0
type ReceiptWithSourcesAndAccounts struct {
Receipt
Sources []ReceiptFundingSourceWithAccount
}
type RecurringExpense ¶ added in v1.4.0
type RecurringExpense struct {
ID string `db:"id"`
SpaceID string `db:"space_id"`
CreatedBy string `db:"created_by"`
Description string `db:"description"`
Amount decimal.Decimal `db:"amount"`
AmountCents int `db:"amount_cents"` // deprecated: kept for SELECT * compatibility
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 ¶ added in v1.4.0
type RecurringExpenseWithTags struct {
RecurringExpense
Tags []*Tag
}
type RecurringExpenseWithTagsAndMethod ¶ added in v1.4.0
type RecurringExpenseWithTagsAndMethod struct {
RecurringExpense
Tags []*Tag
PaymentMethod *PaymentMethod
}
type RecurringReceipt ¶ added in v1.11.0
type RecurringReceipt struct {
ID string `db:"id"`
LoanID string `db:"loan_id"`
SpaceID string `db:"space_id"`
Description string `db:"description"`
TotalAmount decimal.Decimal `db:"total_amount"`
TotalAmountCents int `db:"total_amount_cents"` // deprecated: kept for SELECT * compatibility
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"`
CreatedBy string `db:"created_by"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type RecurringReceiptSource ¶ added in v1.11.0
type RecurringReceiptSource struct {
ID string `db:"id"`
RecurringReceiptID string `db:"recurring_receipt_id"`
SourceType FundingSourceType `db:"source_type"`
AccountID *string `db:"account_id"`
Amount decimal.Decimal `db:"amount"`
AmountCents int `db:"amount_cents"` // deprecated: kept for SELECT * compatibility
}
type RecurringReceiptWithLoan ¶ added in v1.11.0
type RecurringReceiptWithLoan struct {
RecurringReceipt
LoanName string
Sources []RecurringReceiptSource
}
type RecurringReceiptWithSources ¶ added in v1.11.0
type RecurringReceiptWithSources struct {
RecurringReceipt
Sources []RecurringReceiptSource
}
type ShoppingList ¶
type Space ¶
type SpaceInvitation ¶
type SpaceInvitation struct {
Token string `db:"token"`
SpaceID string `db:"space_id"`
InviterID string `db:"inviter_id"`
Email string `db:"email"`
Status InvitationStatus `db:"status"`
ExpiresAt time.Time `db:"expires_at"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type SpaceMember ¶
type SpaceMemberWithProfile ¶
type SpendingReport ¶ added in v1.4.0
type SpendingReport struct {
ByTag []*TagExpenseSummary
ByPaymentMethod []*PaymentMethodExpenseSummary
DailySpending []*DailySpending
MonthlySpending []*MonthlySpending
TopExpenses []*ExpenseWithTagsAndMethod
TotalIncome decimal.Decimal
TotalExpenses decimal.Decimal
NetBalance decimal.Decimal
}
type TagExpenseSummary ¶
type Token ¶
type TransferDirection ¶ added in v1.2.0
type TransferDirection string
const ( TransferDirectionDeposit TransferDirection = "deposit" TransferDirectionWithdrawal TransferDirection = "withdrawal" )
type User ¶
type User struct {
ID string `db:"id"`
Email string `db:"email"`
// Allow null for passwordless users
PasswordHash *string `db:"password_hash"`
PendingEmail *string `db:"pending_email"`
EmailVerifiedAt *time.Time `db:"email_verified_at"`
CreatedAt time.Time `db:"created_at"`
}
func (*User) HasPassword ¶
Click to show internal directories.
Click to hide internal directories.