Documentation
¶
Overview ¶
Package api handles routes and their associated handlers
Index ¶
- func SetupMux(cfg *APIConfig) *http.ServeMux
- type APIConfig
- type Account
- type Budget
- type BudgetMemberRole
- type BudgetMembership
- type Category
- type CategoryReport
- type DBConfig
- type Group
- type Meta
- type MonthReport
- type Payee
- type Transaction
- type TransactionDetail
- type TransactionSplit
- type UpsertTransactionRqSchema
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BudgetMemberRole ¶
type BudgetMemberRole int
const ( ADMIN BudgetMemberRole = iota MANAGER CONTRIBUTOR VIEWER )
func BMRFromString ¶
func BMRFromString(s string) (BudgetMemberRole, error)
func (BudgetMemberRole) String ¶
func (bmr BudgetMemberRole) String() string
type BudgetMembership ¶
type BudgetMembership struct {
BudgetID uuid.UUID `json:"budget_id"`
UserID uuid.UUID `json:"user_id"`
MemberRole BudgetMemberRole `json:"member_role"`
}
type CategoryReport ¶
type MonthReport ¶
type Transaction ¶
type Transaction struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
BudgetID uuid.UUID `json:"budget_id"`
LoggerID uuid.UUID `json:"logger_id"`
AccountID uuid.UUID `json:"account_id"`
TransactionType string `json:"transaction_type"`
TransactionDate time.Time `json:"transaction_date"`
PayeeID uuid.UUID `json:"payee_id"`
Notes string `json:"notes"`
Cleared bool `json:"is_cleared"`
}
type TransactionDetail ¶
type TransactionDetail struct {
ID uuid.UUID `json:"id"`
TransactionDate time.Time `json:"transaction_date"`
TransactionType string `json:"transaction_type"`
Notes string `json:"notes"`
PayeeName string `json:"payee_name"`
BudgetName string `json:"budget_name"`
AccountName string `json:"account_name"`
LoggerName string `json:"logger_name"`
TotalAmount int64 `json:"total_amount"`
Splits map[string]int64 `json:"splits"`
Cleared bool `json:"cleared"`
}
type TransactionSplit ¶
type UpsertTransactionRqSchema ¶
type UpsertTransactionRqSchema struct {
AccountName string `json:"account_name"`
TransferAccountName string `json:"transfer_account_name"`
// TransactionDate is a time string in the custom format "2006-01-02" (YYYY-MM-DD)
TransactionDate string `json:"transaction_date"`
PayeeName string `json:"payee_name"`
Notes string `json:"notes"`
Cleared bool `json:"is_cleared"`
/* Amounts associates category names with the amount spent from each.
If there is only one entry in Amounts, the transaction is not truly split.
Nonetheless, all transactions are associated with at least one txn split.
A 'txn split' reflects the sum of spending toward one particular category within the transaction.
*/
Amounts map[string]int64 `json:"amounts"`
}
UpsertTransactionRqSchema represents a raw POST or PUT payload sent by a client. It is validated through middleware before then being sent to the proper txn endpoint.
Source Files
¶
- api.go
- api_accounts.go
- api_assignments.go
- api_auth.go
- api_budgets.go
- api_categories.go
- api_config.go
- api_dev.go
- api_groups.go
- api_middleware.go
- api_payees.go
- api_state.go
- api_transactions_delete.go
- api_transactions_get.go
- api_transactions_log.go
- api_transactions_update.go
- api_users.go
- resp_helpers.go
- txn_helpers.go
- types.go
Click to show internal directories.
Click to hide internal directories.