Documentation ¶
Index ¶
- func TryDBConnect(e error) error
- type Account
- type AccountListResponse
- type AccountQueryFilter
- type AccountResponse
- type AccountV2
- type AllocationListResponse
- type AllocationMode
- type AllocationQueryFilter
- type AllocationResponse
- type BudgetAllocationMode
- type BudgetListResponse
- type BudgetMonthResponse
- type BudgetQueryFilter
- type BudgetResponse
- type CategoryListResponse
- type CategoryQueryFilter
- type CategoryResponse
- type Controller
- func (co Controller) CreateAccount(c *gin.Context)
- func (co Controller) CreateAllocation(c *gin.Context)
- func (co Controller) CreateBudget(c *gin.Context)
- func (co Controller) CreateCategory(c *gin.Context)
- func (co Controller) CreateEnvelope(c *gin.Context)
- func (co Controller) CreateMatchRules(c *gin.Context)
- func (co Controller) CreateMonthConfig(c *gin.Context)
- func (co Controller) CreateRenameRules(c *gin.Context)
- func (co Controller) CreateTransaction(c *gin.Context)
- func (co Controller) CreateTransactionsV2(c *gin.Context)
- func (co Controller) DeleteAccount(c *gin.Context)
- func (co Controller) DeleteAll(c *gin.Context)
- func (co Controller) DeleteAllocation(c *gin.Context)
- func (co Controller) DeleteAllocations(c *gin.Context)
- func (co Controller) DeleteAllocationsMonth(c *gin.Context)
- func (co Controller) DeleteBudget(c *gin.Context)
- func (co Controller) DeleteCategory(c *gin.Context)
- func (co Controller) DeleteEnvelope(c *gin.Context)
- func (co Controller) DeleteMatchRule(c *gin.Context)
- func (co Controller) DeleteMonthConfig(c *gin.Context)
- func (co Controller) DeleteRenameRule(c *gin.Context)
- func (co Controller) DeleteTransaction(c *gin.Context)
- func (co Controller) GetAccount(c *gin.Context)
- func (co Controller) GetAccounts(c *gin.Context)
- func (co Controller) GetAccountsV2(c *gin.Context)
- func (co Controller) GetAllocation(c *gin.Context)
- func (co Controller) GetAllocations(c *gin.Context)
- func (co Controller) GetBudget(c *gin.Context)
- func (co Controller) GetBudgetMonth(c *gin.Context)
- func (co Controller) GetBudgets(c *gin.Context)
- func (co Controller) GetCategories(c *gin.Context)
- func (co Controller) GetCategory(c *gin.Context)
- func (co Controller) GetEnvelope(c *gin.Context)
- func (co Controller) GetEnvelopeMonth(c *gin.Context)
- func (co Controller) GetEnvelopes(c *gin.Context)
- func (co Controller) GetHealthz(c *gin.Context)
- func (co Controller) GetMatchRule(c *gin.Context)
- func (co Controller) GetMatchRules(c *gin.Context)
- func (co Controller) GetMonth(c *gin.Context)
- func (co Controller) GetMonthConfig(c *gin.Context)
- func (co Controller) GetMonthConfigs(c *gin.Context)
- func (co Controller) GetRenameRule(c *gin.Context)
- func (co Controller) GetRenameRules(c *gin.Context)
- func (co Controller) GetTransaction(c *gin.Context)
- func (co Controller) GetTransactions(c *gin.Context)
- func (co Controller) Import(c *gin.Context)
- func (co Controller) ImportYnab4(c *gin.Context)
- func (co Controller) ImportYnabImportPreview(c *gin.Context)
- func (co Controller) OptionsAccountDetail(c *gin.Context)
- func (co Controller) OptionsAccountList(c *gin.Context)
- func (co Controller) OptionsAccountListV2(c *gin.Context)
- func (co Controller) OptionsAllocationDetail(c *gin.Context)
- func (co Controller) OptionsAllocationList(c *gin.Context)
- func (co Controller) OptionsBudgetDetail(c *gin.Context)
- func (co Controller) OptionsBudgetList(c *gin.Context)
- func (co Controller) OptionsBudgetMonth(c *gin.Context)
- func (co Controller) OptionsBudgetMonthAllocations(c *gin.Context)
- func (co Controller) OptionsCategoryDetail(c *gin.Context)
- func (co Controller) OptionsCategoryList(c *gin.Context)
- func (co Controller) OptionsEnvelopeDetail(c *gin.Context)
- func (co Controller) OptionsEnvelopeList(c *gin.Context)
- func (co Controller) OptionsHealthz(c *gin.Context)
- func (co Controller) OptionsImport(c *gin.Context)
- func (co Controller) OptionsImportYnab4(c *gin.Context)
- func (co Controller) OptionsImportYnabImportPreview(c *gin.Context)
- func (co Controller) OptionsMatchRuleDetail(c *gin.Context)
- func (co Controller) OptionsMatchRuleList(c *gin.Context)
- func (co Controller) OptionsMonth(c *gin.Context)
- func (co Controller) OptionsMonthConfigDetail(c *gin.Context)
- func (co Controller) OptionsMonthConfigList(c *gin.Context)
- func (co Controller) OptionsRenameRuleDetail(c *gin.Context)
- func (co Controller) OptionsRenameRuleList(c *gin.Context)
- func (co Controller) OptionsTransactionDetail(c *gin.Context)
- func (co Controller) OptionsTransactionList(c *gin.Context)
- func (co Controller) OptionsTransactionsV2(c *gin.Context)
- func (co Controller) RegisterAccountRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterAccountRoutesV2(r *gin.RouterGroup)
- func (co Controller) RegisterAllocationRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterBudgetRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterCategoryRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterEnvelopeRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterHealthzRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterImportRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterMatchRuleRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterMonthConfigRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterMonthRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterRenameRuleRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterTransactionRoutes(r *gin.RouterGroup)
- func (co Controller) RegisterTransactionRoutesV2(r *gin.RouterGroup)
- func (co Controller) SetAllocations(c *gin.Context)
- func (co Controller) SetAllocationsMonth(c *gin.Context)
- func (co Controller) UpdateAccount(c *gin.Context)
- func (co Controller) UpdateAllocation(c *gin.Context)
- func (co Controller) UpdateBudget(c *gin.Context)
- func (co Controller) UpdateCategory(c *gin.Context)
- func (co Controller) UpdateEnvelope(c *gin.Context)
- func (co Controller) UpdateMatchRule(c *gin.Context)
- func (co Controller) UpdateMonthConfig(c *gin.Context)
- func (co Controller) UpdateRenameRule(c *gin.Context)
- func (co Controller) UpdateTransaction(c *gin.Context)
- type EnvelopeListResponse
- type EnvelopeMonthResponse
- type EnvelopeQueryFilter
- type EnvelopeResponse
- type HealthResponse
- type ImportPreviewList
- type ImportPreviewQuery
- type ImportQuery
- type MatchRuleQueryFilter
- type MonthConfigFilter
- type MonthConfigListResponse
- type MonthConfigQueryFilter
- type MonthConfigResponse
- type MonthResponse
- type QueryMonth
- type RenameRuleListResponse
- type RenameRuleQueryFilter
- type RenameRuleResponse
- type ResponseMatchRule
- type ResponseTransactionV2
- type TransactionListResponse
- type TransactionQueryFilter
- type TransactionResponse
- type URIMonth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TryDBConnect ¶
TryDBConnect checks the database error to decide if a reconnection attempt makes sense and executes the reconnection. It returns nil for success and an error if reconnecting the database is not possible or not a sensible decision
In cases where the database file might have been deleted, we err on the side of caution and do *not* reconnect the database so that we do not have two states that need to be merged manually by the user afterwards
TODO: Actually implement the reconnection logic. This is not yet done as we currently do not store.
Types ¶
type Account ¶
type Account struct { models.Account Balance decimal.Decimal `json:"balance" example:"2735.17"` // Balance of the account, including all transactions referencing it ReconciledBalance decimal.Decimal `json:"reconciledBalance" example:"2539.57"` // Balance of the account, including all reconciled transactions referencing it RecentEnvelopes []models.Envelope `json:"recentEnvelopes"` // Envelopes recently used with this account Links struct { Self string `json:"self" example:"https://example.com/api/v1/accounts/af892e10-7e0a-4fb8-b1bc-4b6d88401ed2"` // The account itself Transactions string `json:"transactions" example:"https://example.com/api/v1/transactions?account=af892e10-7e0a-4fb8-b1bc-4b6d88401ed2"` // Transactions referencing the account } `json:"links"` }
Account is the API v1 representation of an Account in EZ.
type AccountListResponse ¶
type AccountListResponse struct {
Data []Account `json:"data"` // List of accounts
}
type AccountQueryFilter ¶
type AccountQueryFilter struct { Name string `form:"name" filterField:"false"` // Fuzzy filter for the account name Note string `form:"note" filterField:"false"` // Fuzzy filter for the note BudgetID string `form:"budget"` // By budget ID OnBudget bool `form:"onBudget"` // Is the account on-budget? External bool `form:"external"` // Is the account external? Hidden bool `form:"hidden"` // Is the account hidden? Search string `form:"search" filterField:"false"` // By string in name or note }
func (AccountQueryFilter) ToCreate ¶
func (f AccountQueryFilter) ToCreate(c *gin.Context) (models.AccountCreate, bool)
type AccountResponse ¶
type AccountResponse struct {
Data Account `json:"data"` // Data for the account
}
type AccountV2 ¶ added in v3.2.4
type AccountV2 struct { models.Account Balance decimal.Decimal `json:"balance" example:"2735.17"` // Balance of the account, including all transactions referencing it ReconciledBalance decimal.Decimal `json:"reconciledBalance" example:"2539.57"` // Balance of the account, including all reconciled transactions referencing it RecentEnvelopes []*uuid.UUID `json:"recentEnvelopes"` // Envelopes recently used with this account Links struct { Self string `json:"self" example:"https://example.com/api/v2/accounts/af892e10-7e0a-4fb8-b1bc-4b6d88401ed2"` // The account itself Transactions string `json:"transactions" example:"https://example.com/api/v2/transactions?account=af892e10-7e0a-4fb8-b1bc-4b6d88401ed2"` // Transactions referencing the account } `json:"links"` }
AccountV2 is the API v2 representation of an Account in EZ.
type AllocationListResponse ¶
type AllocationListResponse struct {
Data []models.Allocation `json:"data"` // Data for the allocation
}
type AllocationMode ¶
type AllocationMode string
swagger:enum AllocationMode
const ( AllocateLastMonthBudget AllocationMode = "ALLOCATE_LAST_MONTH_BUDGET" AllocateLastMonthSpend AllocationMode = "ALLOCATE_LAST_MONTH_SPEND" )
type AllocationQueryFilter ¶
type AllocationQueryFilter struct { Month string `form:"month"` // By month Amount decimal.Decimal `form:"amount"` // By exact amount EnvelopeID string `form:"envelope"` // By the Envelope ID }
func (AllocationQueryFilter) Parse ¶
func (f AllocationQueryFilter) Parse(c *gin.Context) (models.AllocationCreate, bool)
type AllocationResponse ¶
type AllocationResponse struct {
Data models.Allocation `json:"data"` // List of allocations
}
type BudgetAllocationMode ¶
type BudgetAllocationMode struct {
Mode AllocationMode `json:"mode" example:"ALLOCATE_LAST_MONTH_SPEND"` // Mode to allocate budget with
}
type BudgetListResponse ¶
type BudgetMonthResponse ¶
type BudgetMonthResponse struct {
Data models.BudgetMonth `json:"data"` // Data for the budget's month
}
type BudgetQueryFilter ¶
type BudgetResponse ¶
type CategoryListResponse ¶
type CategoryQueryFilter ¶
type CategoryQueryFilter struct { Name string `form:"name" filterField:"false"` // By name BudgetID string `form:"budget"` // By ID of the budget Note string `form:"note" filterField:"false"` // By note Hidden bool `form:"hidden"` // Is the category archived? Search string `form:"search" filterField:"false"` // By string in name or note }
func (CategoryQueryFilter) ToCreate ¶
func (f CategoryQueryFilter) ToCreate(c *gin.Context) (models.CategoryCreate, bool)
type CategoryResponse ¶
type Controller ¶
func (Controller) CreateAccount ¶
func (co Controller) CreateAccount(c *gin.Context)
CreateAccount creates a new account
@Summary Create account @Description Creates a new account @Tags Accounts @Produce json @Success 201 {object} AccountResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param account body models.AccountCreate true "Account" @Router /v1/accounts [post]
func (Controller) CreateAllocation ¶
func (co Controller) CreateAllocation(c *gin.Context)
CreateAllocation creates a new allocation
@Summary Create allocations @Description Create a new allocation of funds to an envelope for a specific month @Tags Allocations @Produce json @Success 201 {object} AllocationResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param allocation body models.AllocationCreate true "Allocation" @Router /v1/allocations [post]
func (Controller) CreateBudget ¶
func (co Controller) CreateBudget(c *gin.Context)
CreateBudget creates a new budget
@Summary Create budget @Description Creates a new budget @Tags Budgets @Accept json @Produce json @Success 201 {object} BudgetResponse @Failure 400 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param budget body models.BudgetCreate true "Budget" @Router /v1/budgets [post]
func (Controller) CreateCategory ¶
func (co Controller) CreateCategory(c *gin.Context)
CreateCategory creates a new category
@Summary Create category @Description Creates a new category @Tags Categories @Produce json @Success 201 {object} CategoryResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param category body models.CategoryCreate true "Category" @Router /v1/categories [post]
func (Controller) CreateEnvelope ¶
func (co Controller) CreateEnvelope(c *gin.Context)
CreateEnvelope creates a new envelope
@Summary Create envelope @Description Creates a new envelope @Tags Envelopes @Produce json @Success 201 {object} EnvelopeResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param envelope body models.EnvelopeCreate true "Envelope" @Router /v1/envelopes [post]
func (Controller) CreateMatchRules ¶ added in v3.1.2
func (co Controller) CreateMatchRules(c *gin.Context)
CreateMatchRulesV2 creates matchRules
@Summary Create matchRules @Description Creates matchRules from the list of submitted matchRule data. The response code is the highest response code number that a single matchRule creation would have caused. If it is not equal to 201, at least one matchRule has an error. @Tags MatchRules @Produce json @Success 201 {object} []ResponseMatchRule @Failure 400 {object} []ResponseMatchRule @Failure 404 @Failure 500 {object} []ResponseMatchRule @Param matchRules body []models.MatchRuleCreate true "MatchRules" @Router /v2/match-rules [post]
func (Controller) CreateMonthConfig ¶
func (co Controller) CreateMonthConfig(c *gin.Context)
CreateMonthConfig creates a new month config
@Summary Create MonthConfig @Description Creates a new MonthConfig @Tags MonthConfigs @Produce json @Success 201 {object} MonthConfigResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param envelopeId path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Param monthConfig body models.MonthConfigCreate true "MonthConfig" @Router /v1/month-configs/{envelopeId}/{month} [post]
func (Controller) CreateRenameRules ¶
func (co Controller) CreateRenameRules(c *gin.Context)
CreateRenameRulesV2 creates renameRules
@Summary Create renameRules @Description Creates renameRules from the list of submitted renameRule data. The response code is the highest response code number that a single renameRule creation would have caused. If it is not equal to 201, at least one renameRule has an error. @Tags RenameRules @Produce json @Success 201 {object} []ResponseMatchRule @Failure 400 {object} []ResponseMatchRule @Failure 404 @Failure 500 {object} []ResponseMatchRule @Param renameRules body []models.MatchRuleCreate true "RenameRules" @Router /v2/rename-rules [post] @Deprecated true
func (Controller) CreateTransaction ¶
func (co Controller) CreateTransaction(c *gin.Context)
CreateTransaction creates a new transaction
@Summary Create transaction @Description Creates a new transaction @Tags Transactions @Produce json @Success 201 {object} TransactionResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param transaction body models.TransactionCreate true "Transaction" @Router /v1/transactions [post] @Deprecated true
func (Controller) CreateTransactionsV2 ¶
func (co Controller) CreateTransactionsV2(c *gin.Context)
CreateTransactionsV2 creates transactions
@Summary Create transactions @Description Creates transactions from the list of submitted transaction data. The response code is the highest response code number that a single transaction creation would have caused. If it is not equal to 201, at least one transaction has an error. @Tags Transactions @Produce json @Success 201 {object} []ResponseTransactionV2 @Failure 400 {object} []ResponseTransactionV2 @Failure 404 @Failure 500 {object} []ResponseTransactionV2 @Param transactions body []models.TransactionCreate true "Transactions" @Router /v2/transactions [post]
func (Controller) DeleteAccount ¶
func (co Controller) DeleteAccount(c *gin.Context)
DeleteAccount deletes an account
@Summary Delete account @Description Deletes an account @Tags Accounts @Produce json @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param accountId path string true "ID formatted as string" @Router /v1/accounts/{accountId} [delete]
func (Controller) DeleteAll ¶
func (co Controller) DeleteAll(c *gin.Context)
DeleteAll permanently deletes all resources in the database
@Summary Delete everything @Description Permanently deletes all resources @Tags v1 @Success 204 @Failure 500 {object} httperrors.HTTPError @Router /v1 [delete]
func (Controller) DeleteAllocation ¶
func (co Controller) DeleteAllocation(c *gin.Context)
DeleteAllocation deletes an allocation
@Summary Delete allocation @Description Deletes an allocation @Tags Allocations @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param allocationId path string true "ID formatted as string" @Router /v1/allocations/{allocationId} [delete]
func (Controller) DeleteAllocations ¶
func (co Controller) DeleteAllocations(c *gin.Context)
DeleteAllocations deletes all allocations for a month
@Summary Delete allocations for a month @Description Deletes all allocation for the specified month @Tags Months @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param budget query string true "ID formatted as string" @Param month query string true "The month in YYYY-MM format" @Router /v1/months [delete]
func (Controller) DeleteAllocationsMonth ¶
func (co Controller) DeleteAllocationsMonth(c *gin.Context)
DeleteAllocationsMonth deletes all allocations for a specific month
@Summary Delete allocations for a month @Description Deletes all allocation for the specified month. **Use DELETE /month endpoint with month and budgetId query parameters instead.** @Tags Budgets @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param month path string true "The month in YYYY-MM format" @Param budgetId path string true "Budget ID formatted as string" @Router /v1/budgets/{budgetId}/{month}/allocations [delete] @Deprecated true
func (Controller) DeleteBudget ¶
func (co Controller) DeleteBudget(c *gin.Context)
Do stuff
@Summary Delete budget @Description Deletes a budget @Tags Budgets @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param budgetId path string true "ID formatted as string" @Router /v1/budgets/{budgetId} [delete]
func (Controller) DeleteCategory ¶
func (co Controller) DeleteCategory(c *gin.Context)
DeleteCategory deletes a specific category
@Summary Delete category @Description Deletes a category @Tags Categories @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param categoryId path string true "ID formatted as string" @Router /v1/categories/{categoryId} [delete]
func (Controller) DeleteEnvelope ¶
func (co Controller) DeleteEnvelope(c *gin.Context)
DeleteEnvelope deletes an envelope
@Summary Delete envelope @Description Deletes an envelope @Tags Envelopes @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param envelopeId path string true "ID formatted as string" @Router /v1/envelopes/{envelopeId} [delete]
func (Controller) DeleteMatchRule ¶ added in v3.1.2
func (co Controller) DeleteMatchRule(c *gin.Context)
DeleteMatchRule deletes an matchRule
@Summary Delete matchRule @Description Deletes an matchRule @Tags MatchRules @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param matchRuleId path string true "ID formatted as string" @Router /v2/match-rules/{matchRuleId} [delete]
func (Controller) DeleteMonthConfig ¶
func (co Controller) DeleteMonthConfig(c *gin.Context)
DeleteMonthConfig deletes configuration data for a specific envelope and month
@Summary Delete MonthConfig @Description Deletes configuration settings for a specific month @Tags MonthConfigs @Produce json @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Param envelopeId path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Router /v1/month-configs/{envelopeId}/{month} [delete]
func (Controller) DeleteRenameRule ¶
func (co Controller) DeleteRenameRule(c *gin.Context)
DeleteRenameRule deletes an renameRule
@Summary Delete renameRule @Description Deletes an renameRule @Tags RenameRules @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param renameRuleId path string true "ID formatted as string" @Router /v2/rename-rules/{renameRuleId} [delete] @Deprecated true
func (Controller) DeleteTransaction ¶
func (co Controller) DeleteTransaction(c *gin.Context)
DeleteTransaction deletes a specific transaction
@Summary Delete transaction @Description Deletes a transaction @Tags Transactions @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param transactionId path string true "ID formatted as string" @Router /v1/transactions/{transactionId} [delete]
func (Controller) GetAccount ¶
func (co Controller) GetAccount(c *gin.Context)
GetAccount returns data for a specific account
@Summary Get account @Description Returns a specific account @Tags Accounts @Produce json @Success 200 {object} AccountResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param accountId path string true "ID formatted as string" @Router /v1/accounts/{accountId} [get]
func (Controller) GetAccounts ¶
func (co Controller) GetAccounts(c *gin.Context)
GetAccounts returns a list of all accounts matching the filter parameters
@Summary List accounts @Description Returns a list of accounts @Tags Accounts @Produce json @Success 200 {object} AccountListResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Router /v1/accounts [get] @Param name query string false "Filter by name" @Param note query string false "Filter by note" @Param budget query string false "Filter by budget ID" @Param onBudget query bool false "Is the account on-budget?" @Param external query bool false "Is the account external?" @Param hidden query bool false "Is the account hidden?" @Param search query string false "Search for this text in name and note" @Deprecated true
func (Controller) GetAccountsV2 ¶ added in v3.2.0
func (co Controller) GetAccountsV2(c *gin.Context)
GetAccounts returns a list of all accounts matching the filter parameters
@Summary List accounts @Description Returns a list of accounts @Tags Accounts @Produce json @Success 200 {object} AccountListResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Router /v2/accounts [get] @Param name query string false "Filter by name" @Param note query string false "Filter by note" @Param budget query string false "Filter by budget ID" @Param onBudget query bool false "Is the account on-budget?" @Param external query bool false "Is the account external?" @Param hidden query bool false "Is the account hidden?" @Param search query string false "Search for this text in name and note"
func (Controller) GetAllocation ¶
func (co Controller) GetAllocation(c *gin.Context)
GetAllocation returns data about a specific allocation
@Summary Get allocation @Description Returns a specific allocation @Tags Allocations @Produce json @Success 200 {object} AllocationResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param allocationId path string true "ID formatted as string" @Router /v1/allocations/{allocationId} [get]
func (Controller) GetAllocations ¶
func (co Controller) GetAllocations(c *gin.Context)
GetAllocations returns a list of allocations matching the search parameters
@Summary Get allocations @Description Returns a list of allocations @Tags Allocations @Produce json @Success 200 {object} AllocationListResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Router /v1/allocations [get] @Param month query string false "Filter by month" @Param amount query string false "Filter by amount" @Param envelope query string false "Filter by envelope ID"
func (Controller) GetBudget ¶
func (co Controller) GetBudget(c *gin.Context)
GetBudget returns data for a single budget
@Summary Get budget @Description Returns a specific budget @Tags Budgets @Produce json @Success 200 {object} BudgetResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param budgetId path string true "ID formatted as string" @Router /v1/budgets/{budgetId} [get]
func (Controller) GetBudgetMonth ¶
func (co Controller) GetBudgetMonth(c *gin.Context)
GetBudgetMonth returns data for a month for a specific budget
@Summary Get Budget month data @Description Returns data about a budget for a for a specific month. **Use GET /month endpoint with month and budgetId query parameters instead.** @Tags Budgets @Produce json @Success 200 {object} BudgetMonthResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param budgetId path string true "ID formatted as string" @Param month path string true "The month in YYYY-MM format" @Router /v1/budgets/{budgetId}/{month} [get] @Deprecated true
func (Controller) GetBudgets ¶
func (co Controller) GetBudgets(c *gin.Context)
GetBudgets returns data for all budgets filtered by the query parameters
@Summary List budgets @Description Returns a list of budgets @Tags Budgets @Produce json @Success 200 {object} BudgetListResponse @Failure 500 {object} httperrors.HTTPError @Router /v1/budgets [get] @Param name query string false "Filter by name" @Param note query string false "Filter by note" @Param currency query string false "Filter by currency" @Param search query string false "Search for this text in name and note"
func (Controller) GetCategories ¶
func (co Controller) GetCategories(c *gin.Context)
GetCategories returns a list of categories filtered by the query parameters
@Summary Get categories @Description Returns a list of categories @Tags Categories @Produce json @Success 200 {object} CategoryListResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Router /v1/categories [get] @Param name query string false "Filter by name" @Param note query string false "Filter by note" @Param budget query string false "Filter by budget ID" @Param hidden query bool false "Is the category hidden?" @Param search query string false "Search for this text in name and note"
func (Controller) GetCategory ¶
func (co Controller) GetCategory(c *gin.Context)
GetCategory returns data for a specific category
@Summary Get category @Description Returns a specific category @Tags Categories @Produce json @Success 200 {object} CategoryResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param categoryId path string true "ID formatted as string" @Router /v1/categories/{categoryId} [get]
func (Controller) GetEnvelope ¶
func (co Controller) GetEnvelope(c *gin.Context)
GetEnvelope returns data about a specific envelope
@Summary Get envelope @Description Returns a specific envelope @Tags Envelopes @Produce json @Success 200 {object} EnvelopeResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param envelopeId path string true "ID formatted as string" @Router /v1/envelopes/{envelopeId} [get]
func (Controller) GetEnvelopeMonth ¶
func (co Controller) GetEnvelopeMonth(c *gin.Context)
GetEnvelopeMonth returns month data for a specific envelope
@Summary Get Envelope month data @Description Returns data about an envelope for a for a specific month. **Use GET /month endpoint with month and budgetId query parameters instead.** @Tags Envelopes @Produce json @Success 200 {object} EnvelopeMonthResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param envelopeId path string true "ID formatted as string" @Param month path string true "The month in YYYY-MM format" @Router /v1/envelopes/{envelopeId}/{month} [get] @Deprecated true
func (Controller) GetEnvelopes ¶
func (co Controller) GetEnvelopes(c *gin.Context)
GetEnvelopes returns a list of envelopes filtered by the query parameters
@Summary Get envelopes @Description Returns a list of envelopes @Tags Envelopes @Produce json @Success 200 {object} EnvelopeListResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Router /v1/envelopes [get] @Param name query string false "Filter by name" @Param note query string false "Filter by note" @Param category query string false "Filter by category ID" @Param hidden query bool false "Is the envelope hidden?" @Param search query string false "Search for this text in name and note"
func (Controller) GetHealthz ¶ added in v3.3.0
func (co Controller) GetHealthz(c *gin.Context)
GetHealthz returns data about the application health
@Summary Get health @Description Returns the application health and, if not healthy, an error @Tags General @Produce json @Success 204 @Failure 500 {object} httperrors.HTTPError @Router /healthz [get]
func (Controller) GetMatchRule ¶ added in v3.1.2
func (co Controller) GetMatchRule(c *gin.Context)
GetMatchRule returns data about a specific matchRule
@Summary Get matchRule @Description Returns a specific matchRule @Tags MatchRules @Produce json @Success 200 {object} models.MatchRule @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param matchRuleId path string true "ID formatted as string" @Router /v2/match-rules/{matchRuleId} [get]
func (Controller) GetMatchRules ¶ added in v3.1.2
func (co Controller) GetMatchRules(c *gin.Context)
GetMatchRules returns a list of matchRules matching the search parameters
@Summary Get matchRules @Description Returns a list of matchRules @Tags MatchRules @Produce json @Success 200 {object} []models.MatchRule @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param priority query uint false "Filter by priority" @Param match query string false "Filter by match" @Param account query string false "Filter by account ID" @Router /v2/match-rules [get]
func (Controller) GetMonth ¶
func (co Controller) GetMonth(c *gin.Context)
GetMonth returns data for a specific budget and month
@Summary Get data about a month @Description Returns data about a specific month. @Tags Months @Produce json @Success 200 {object} MonthResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param budget query string true "ID formatted as string" @Param month query string true "The month in YYYY-MM format" @Router /v1/months [get]
func (Controller) GetMonthConfig ¶
func (co Controller) GetMonthConfig(c *gin.Context)
GetMonthConfig returns config for a specific envelope and month
@Summary Get MonthConfig @Description Returns configuration for a specific month @Tags MonthConfigs @Produce json @Success 200 {object} MonthConfigResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Param envelopeId path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Router /v1/month-configs/{envelopeId}/{month} [get]
func (Controller) GetMonthConfigs ¶
func (co Controller) GetMonthConfigs(c *gin.Context)
GetMonthConfigs returns all month configs filtered by the query parameters
@Summary List MonthConfigs @Description Returns a list of MonthConfigs @Tags MonthConfigs @Produce json @Success 200 {object} MonthConfigListResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param envelope query string false "Filter by name" @Param month query string false "Filter by month" @Router /v1/month-configs [get]
func (Controller) GetRenameRule ¶
func (co Controller) GetRenameRule(c *gin.Context)
GetRenameRule returns data about a specific renameRule
@Summary Get renameRule @Description Returns a specific renameRule @Tags RenameRules @Produce json @Success 200 {object} RenameRuleResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param renameRuleId path string true "ID formatted as string" @Router /v2/rename-rules/{renameRuleId} [get] @Deprecated true
func (Controller) GetRenameRules ¶
func (co Controller) GetRenameRules(c *gin.Context)
GetRenameRules returns a list of renameRules matching the search parameters
@Summary Get renameRules @Description Returns a list of renameRules @Tags RenameRules @Produce json @Success 200 {object} RenameRuleListResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param priority query uint false "Filter by priority" @Param match query string false "Filter by match" @Param account query string false "Filter by account ID" @Router /v2/rename-rules [get] @Deprecated true
func (Controller) GetTransaction ¶
func (co Controller) GetTransaction(c *gin.Context)
GetTransaction returns a specific transaction
@Summary Get transaction @Description Returns a specific transaction @Tags Transactions @Produce json @Success 200 {object} TransactionResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param transactionId path string true "ID formatted as string" @Router /v1/transactions/{transactionId} [get]
func (Controller) GetTransactions ¶
func (co Controller) GetTransactions(c *gin.Context)
GetTransactions returns transactions filtered by the query parameters
@Summary Get transactions @Description Returns a list of transactions @Tags Transactions @Produce json @Success 200 {object} TransactionListResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Router /v1/transactions [get] @Param date query string false "Date of the transaction. Ignores exact time, matches on the day of the RFC3339 timestamp provided." @Param fromDate query string false "Transactions at and after this date. Ignores exact time, matches on the day of the RFC3339 timestamp provided." @Param untilDate query string false "Transactions before and at this date. Ignores exact time, matches on the day of the RFC3339 timestamp provided." @Param amount query string false "Filter by amount" @Param amountLessOrEqual query string false "Amount less than or equal to this" @Param amountMoreOrEqual query string false "Amount more than or equal to this" @Param note query string false "Filter by note" @Param budget query string false "Filter by budget ID" @Param account query string false "Filter by ID of associated account, regardeless of source or destination" @Param source query string false "Filter by source account ID" @Param destination query string false "Filter by destination account ID" @Param envelope query string false "Filter by envelope ID" @Param reconciled query bool false "DEPRECATED. Filter by reconcilication state" @Param reconciledSource query bool false "Reconcilication state in source account" @Param reconciledDestination query bool false "Reconcilication state in destination account"
func (Controller) Import ¶
func (co Controller) Import(c *gin.Context)
Import imports a YNAB 4 budget
@Summary Import @Description Imports budgets from YNAB 4. **Please use /v1/import/ynab4, which works exactly the same.** @Tags Import @Accept multipart/form-data @Produce json @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param file formData file true "File to import" @Param budgetName query string false "Name of the Budget to create" @Router /v1/import [post] @Deprecated true
func (Controller) ImportYnab4 ¶
func (co Controller) ImportYnab4(c *gin.Context)
ImportYnab4 imports a YNAB 4 budget
@Summary Import YNAB 4 budget @Description Imports budgets from YNAB 4 @Tags Import @Accept multipart/form-data @Produce json @Success 201 {object} BudgetResponse @Failure 400 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param file formData file true "File to import" @Param budgetName query string false "Name of the Budget to create" @Router /v1/import/ynab4 [post]
func (Controller) ImportYnabImportPreview ¶
func (co Controller) ImportYnabImportPreview(c *gin.Context)
ImportYnabImportPreview parses a YNAB import format CSV and returns a preview of transactions to be imported into Envelope Zero.
@Summary Transaction Import Preview @Description Returns a preview of transactions to be imported after parsing a YNAB Import format csv file @Tags Import @Accept multipart/form-data @Produce json @Success 200 {object} ImportPreviewList @Failure 400 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param file formData file true "File to import" @Param accountId query string false "ID of the account to import transactions for" @Router /v1/import/ynab-import-preview [post]
func (Controller) OptionsAccountDetail ¶
func (co Controller) OptionsAccountDetail(c *gin.Context)
OptionsAccountDetail returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Accounts @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Param accountId path string true "ID formatted as string" @Router /v1/accounts/{accountId} [options]
func (Controller) OptionsAccountList ¶
func (co Controller) OptionsAccountList(c *gin.Context)
OptionsAccountList returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Accounts @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Router /v1/accounts [options]
func (Controller) OptionsAccountListV2 ¶ added in v3.2.0
func (co Controller) OptionsAccountListV2(c *gin.Context)
OptionsAccountList returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Accounts @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Router /v2/accounts [options]
func (Controller) OptionsAllocationDetail ¶
func (co Controller) OptionsAllocationDetail(c *gin.Context)
OptionsAllocationDetail returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Allocations @Success 204 @Param allocationId path string true "ID formatted as string" @Router /v1/allocations/{allocationId} [options]
func (Controller) OptionsAllocationList ¶
func (co Controller) OptionsAllocationList(c *gin.Context)
OptionsAllocationList returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Allocations @Success 204 @Router /v1/allocations [options]
func (Controller) OptionsBudgetDetail ¶
func (co Controller) OptionsBudgetDetail(c *gin.Context)
OptionsBudgetDetail returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Budgets @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param budgetId path string true "ID formatted as string" @Router /v1/budgets/{budgetId} [options]
func (Controller) OptionsBudgetList ¶
func (co Controller) OptionsBudgetList(c *gin.Context)
OptionsBudgetList returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Budgets @Success 204 @Failure 500 {object} httperrors.HTTPError @Router /v1/budgets [options]
func (Controller) OptionsBudgetMonth ¶
func (co Controller) OptionsBudgetMonth(c *gin.Context)
OptionsBudgetMonth returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs. **Use OPTIONS /month endpoint with month and budgetId query parameters instead.** @Tags Budgets @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param budgetId path string true "ID formatted as string" @Param month path string true "The month in YYYY-MM format" @Router /v1/budgets/{budgetId}/{month} [options] @Deprecated true
func (Controller) OptionsBudgetMonthAllocations ¶
func (co Controller) OptionsBudgetMonthAllocations(c *gin.Context)
OptionsBudgetMonthAllocations returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs. **Use OPTIONS /month endpoint with month and budgetId query parameters instead.** @Tags Budgets @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param budgetId path string true "ID formatted as string" @Param month path string true "The month in YYYY-MM format" @Router /v1/budgets/{budgetId}/{month}/allocations [options] @Deprecated true
func (Controller) OptionsCategoryDetail ¶
func (co Controller) OptionsCategoryDetail(c *gin.Context)
OptionsCategoryDetail returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Categories @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Param categoryId path string true "ID formatted as string" @Router /v1/categories/{categoryId} [options]
func (Controller) OptionsCategoryList ¶
func (co Controller) OptionsCategoryList(c *gin.Context)
OptionsCategoryList returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Categories @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Router /v1/categories [options]
func (Controller) OptionsEnvelopeDetail ¶
func (co Controller) OptionsEnvelopeDetail(c *gin.Context)
OptionsEnvelopeDetail returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Envelopes @Success 204 @Param envelopeId path string true "ID formatted as string" @Router /v1/envelopes/{envelopeId} [options]
func (Controller) OptionsEnvelopeList ¶
func (co Controller) OptionsEnvelopeList(c *gin.Context)
OptionsEnvelopeList returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Envelopes @Success 204 @Router /v1/envelopes [options]
func (Controller) OptionsHealthz ¶ added in v3.3.0
func (co Controller) OptionsHealthz(c *gin.Context)
OptionsHealthz returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags General @Success 204 @Router /healthz [options]
func (Controller) OptionsImport ¶
func (co Controller) OptionsImport(c *gin.Context)
OptionsImport returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs. **Please use /v1/import/ynab4, which works exactly the same.** @Tags Import @Success 204 @Failure 500 {object} httperrors.HTTPError @Router /v1/import [options] @Deprecated true
func (Controller) OptionsImportYnab4 ¶
func (co Controller) OptionsImportYnab4(c *gin.Context)
OptionsImportYnab4 returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Import @Success 204 @Failure 500 {object} httperrors.HTTPError @Router /v1/import/ynab4 [options]
func (Controller) OptionsImportYnabImportPreview ¶
func (co Controller) OptionsImportYnabImportPreview(c *gin.Context)
OptionsImportYnab4 returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Import @Success 204 @Failure 500 {object} httperrors.HTTPError @Router /v1/import/ynab-import-preview [options]
func (Controller) OptionsMatchRuleDetail ¶ added in v3.1.2
func (co Controller) OptionsMatchRuleDetail(c *gin.Context)
OptionsMatchRuleDetail returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags MatchRules @Success 204 @Param matchRuleId path string true "ID formatted as string" @Router /v2/match-rules/{matchRuleId} [options]
func (Controller) OptionsMatchRuleList ¶ added in v3.1.2
func (co Controller) OptionsMatchRuleList(c *gin.Context)
OptionsMatchRuleList returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags MatchRules @Success 204 @Router /v2/match-rules [options]
func (Controller) OptionsMonth ¶
func (co Controller) OptionsMonth(c *gin.Context)
OptionsMonth returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs. @Tags Months @Success 204 @Router /v1/months [options]
func (Controller) OptionsMonthConfigDetail ¶
func (co Controller) OptionsMonthConfigDetail(c *gin.Context)
OptionsMonthConfigDetail returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags MonthConfigs @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Param envelopeId path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Router /v1/month-configs/{envelopeId}/{month} [options]
func (Controller) OptionsMonthConfigList ¶
func (co Controller) OptionsMonthConfigList(c *gin.Context)
OptionsMonthConfigList returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs. @Tags MonthConfigs @Success 204 @Router /v1/month-configs [options]
func (Controller) OptionsRenameRuleDetail ¶
func (co Controller) OptionsRenameRuleDetail(c *gin.Context)
OptionsRenameRuleDetail returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags RenameRules @Success 204 @Param renameRuleId path string true "ID formatted as string" @Router /v2/rename-rules/{renameRuleId} [options] @Deprecated true
func (Controller) OptionsRenameRuleList ¶
func (co Controller) OptionsRenameRuleList(c *gin.Context)
OptionsRenameRuleList returns the allowed HTTP verbs
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags RenameRules @Success 204 @Router /v2/rename-rules [options] @Deprecated true
func (Controller) OptionsTransactionDetail ¶
func (co Controller) OptionsTransactionDetail(c *gin.Context)
OptionsTransactionDetail returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Transactions @Success 204 @Param transactionId path string true "ID formatted as string" @Router /v1/transactions/{transactionId} [options]
func (Controller) OptionsTransactionList ¶
func (co Controller) OptionsTransactionList(c *gin.Context)
OptionsTransactionList returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Transactions @Success 204 @Router /v1/transactions [options]
func (Controller) OptionsTransactionsV2 ¶
func (co Controller) OptionsTransactionsV2(c *gin.Context)
OptionsTransactionsV2 returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Transactions @Success 204 @Router /v2/transactions [options]
func (Controller) RegisterAccountRoutes ¶
func (co Controller) RegisterAccountRoutes(r *gin.RouterGroup)
RegisterAccountRoutes registers the routes for accounts with the RouterGroup that is passed.
func (Controller) RegisterAccountRoutesV2 ¶ added in v3.2.0
func (co Controller) RegisterAccountRoutesV2(r *gin.RouterGroup)
RegisterAccountRoutes registers the routes for accounts with the RouterGroup that is passed.
func (Controller) RegisterAllocationRoutes ¶
func (co Controller) RegisterAllocationRoutes(r *gin.RouterGroup)
RegisterAllocationRoutes registers the routes for allocations with the RouterGroup that is passed.
func (Controller) RegisterBudgetRoutes ¶
func (co Controller) RegisterBudgetRoutes(r *gin.RouterGroup)
RegisterBudgetRoutes registers the routes for budgets with the RouterGroup that is passed.
func (Controller) RegisterCategoryRoutes ¶
func (co Controller) RegisterCategoryRoutes(r *gin.RouterGroup)
RegisterCategoryRoutes registers the routes for categories with the RouterGroup that is passed.
func (Controller) RegisterEnvelopeRoutes ¶
func (co Controller) RegisterEnvelopeRoutes(r *gin.RouterGroup)
RegisterEnvelopeRoutes registers the routes for envelopes with the RouterGroup that is passed.
func (Controller) RegisterHealthzRoutes ¶ added in v3.3.0
func (co Controller) RegisterHealthzRoutes(r *gin.RouterGroup)
RegisterHealthzRoutes registers the routes for the healthz endpoint.
func (Controller) RegisterImportRoutes ¶
func (co Controller) RegisterImportRoutes(r *gin.RouterGroup)
RegisterImportRoutes registers the routes for imports.
func (Controller) RegisterMatchRuleRoutes ¶ added in v3.1.2
func (co Controller) RegisterMatchRuleRoutes(r *gin.RouterGroup)
RegisterMatchRuleRoutes registers the routes for matchRules with the RouterGroup that is passed.
func (Controller) RegisterMonthConfigRoutes ¶
func (co Controller) RegisterMonthConfigRoutes(r *gin.RouterGroup)
RegisterMonthConfigRoutes registers the routes for transactions with the RouterGroup that is passed.
func (Controller) RegisterMonthRoutes ¶
func (co Controller) RegisterMonthRoutes(r *gin.RouterGroup)
RegisterMonthRoutes registers the routes for months with the RouterGroup that is passed.
func (Controller) RegisterRenameRuleRoutes ¶
func (co Controller) RegisterRenameRuleRoutes(r *gin.RouterGroup)
RegisterRenameRuleRoutes registers the routes for renameRules with the RouterGroup that is passed.
func (Controller) RegisterTransactionRoutes ¶
func (co Controller) RegisterTransactionRoutes(r *gin.RouterGroup)
RegisterTransactionRoutes registers the routes for transactions with the RouterGroup that is passed.
func (Controller) RegisterTransactionRoutesV2 ¶
func (co Controller) RegisterTransactionRoutesV2(r *gin.RouterGroup)
RegisterTransactionRoutesV2 registers the routes for transactions with the RouterGroup that is passed.
func (Controller) SetAllocations ¶
func (co Controller) SetAllocations(c *gin.Context)
SetAllocations sets all allocations for a month
@Summary Set allocations for a month @Description Sets allocations for a month for all envelopes that do not have an allocation yet @Tags Months @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param budget query string true "ID formatted as string" @Param month query string true "The month in YYYY-MM format" @Param mode body BudgetAllocationMode true "Budget" @Router /v1/months [post]
func (Controller) SetAllocationsMonth ¶
func (co Controller) SetAllocationsMonth(c *gin.Context)
SetAllocationsMonth sets all allocations for a specific month
@Summary Set allocations for a month @Description Sets allocations for a month for all envelopes that do not have an allocation yet. **Use POST /month endpoint with month and budgetId query parameters instead.** @Tags Budgets @Success 204 @Failure 400 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param month path string true "The month in YYYY-MM format" @Param budgetId path string true "Budget ID formatted as string" @Param mode body BudgetAllocationMode true "Budget" @Router /v1/budgets/{budgetId}/{month}/allocations [post] @Deprecated true
func (Controller) UpdateAccount ¶
func (co Controller) UpdateAccount(c *gin.Context)
UpdateAccount updates data for a specific account
@Summary Update account @Description Updates an account. Only values to be updated need to be specified. @Tags Accounts @Produce json @Success 200 {object} AccountResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param accountId path string true "ID formatted as string" @Param account body models.AccountCreate true "Account" @Router /v1/accounts/{accountId} [patch]
func (Controller) UpdateAllocation ¶
func (co Controller) UpdateAllocation(c *gin.Context)
UpdateAllocation updates allocation data
@Summary Update allocation @Description Update an allocation. Only values to be updated need to be specified. @Tags Allocations @Accept json @Produce json @Success 200 {object} AllocationResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param allocationId path string true "ID formatted as string" @Param allocation body models.AllocationCreate true "Allocation" @Router /v1/allocations/{allocationId} [patch]
func (Controller) UpdateBudget ¶
func (co Controller) UpdateBudget(c *gin.Context)
UpdateBudget updates data for a budget
@Summary Update budget @Description Update an existing budget. Only values to be updated need to be specified. @Tags Budgets @Accept json @Produce json @Success 200 {object} BudgetResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param budgetId path string true "ID formatted as string" @Param budget body models.BudgetCreate true "Budget" @Router /v1/budgets/{budgetId} [patch]
func (Controller) UpdateCategory ¶
func (co Controller) UpdateCategory(c *gin.Context)
UpdateCategory updates data for a specific category
@Summary Update category @Description Update an existing category. Only values to be updated need to be specified. @Tags Categories @Accept json @Produce json @Success 200 {object} CategoryResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param categoryId path string true "ID formatted as string" @Param category body models.CategoryCreate true "Category" @Router /v1/categories/{categoryId} [patch]
func (Controller) UpdateEnvelope ¶
func (co Controller) UpdateEnvelope(c *gin.Context)
UpdateEnvelope updates data for an envelope
@Summary Update envelope @Description Updates an existing envelope. Only values to be updated need to be specified. @Tags Envelopes @Accept json @Produce json @Success 200 {object} EnvelopeResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param envelopeId path string true "ID formatted as string" @Param envelope body models.EnvelopeCreate true "Envelope" @Router /v1/envelopes/{envelopeId} [patch]
func (Controller) UpdateMatchRule ¶ added in v3.1.2
func (co Controller) UpdateMatchRule(c *gin.Context)
UpdateMatchRule updates matchRule data
@Summary Update matchRule @Description Update an matchRule. Only values to be updated need to be specified. @Tags MatchRules @Accept json @Produce json @Success 200 {object} models.MatchRule @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param matchRuleId path string true "ID formatted as string" @Param matchRule body models.MatchRuleCreate true "MatchRule" @Router /v2/match-rules/{matchRuleId} [patch]
func (Controller) UpdateMonthConfig ¶
func (co Controller) UpdateMonthConfig(c *gin.Context)
UpdateMonthConfig updates configuration data for a specific envelope and month
@Summary Update MonthConfig @Description Changes settings of an existing MonthConfig @Tags MonthConfigs @Produce json @Success 201 {object} MonthConfigResponse @Failure 400 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param envelopeId path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Param monthConfig body models.MonthConfigCreate true "MonthConfig" @Router /v1/month-configs/{envelopeId}/{month} [patch]
func (Controller) UpdateRenameRule ¶
func (co Controller) UpdateRenameRule(c *gin.Context)
UpdateRenameRule updates renameRule data
@Summary Update renameRule @Description Update an renameRule. Only values to be updated need to be specified. @Tags RenameRules @Accept json @Produce json @Success 200 {object} RenameRuleResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param renameRuleId path string true "ID formatted as string" @Param renameRule body models.MatchRuleCreate true "RenameRule" @Router /v2/rename-rules/{renameRuleId} [patch] @Deprecated true
func (Controller) UpdateTransaction ¶
func (co Controller) UpdateTransaction(c *gin.Context)
UpdateTransaction updates a specific transaction
@Summary Update transaction @Description Updates an existing transaction. Only values to be updated need to be specified. @Tags Transactions @Accept json @Produce json @Success 200 {object} TransactionResponse @Failure 400 {object} httperrors.HTTPError @Failure 404 @Failure 500 {object} httperrors.HTTPError @Param transactionId path string true "ID formatted as string" @Param transaction body models.TransactionCreate true "Transaction" @Router /v1/transactions/{transactionId} [patch]
type EnvelopeListResponse ¶
type EnvelopeMonthResponse ¶
type EnvelopeMonthResponse struct {
Data models.EnvelopeMonth `json:"data"` // Data for the month for the envelope
}
type EnvelopeQueryFilter ¶
type EnvelopeQueryFilter struct { Name string `form:"name" filterField:"false"` // By name CategoryID string `form:"category"` // By the ID of the category Note string `form:"note" filterField:"false"` // By the note Hidden bool `form:"hidden"` // Is the envelope archived? Search string `form:"search" filterField:"false"` // By string in name or note }
func (EnvelopeQueryFilter) ToCreate ¶
func (f EnvelopeQueryFilter) ToCreate(c *gin.Context) (models.EnvelopeCreate, bool)
type EnvelopeResponse ¶
type HealthResponse ¶ added in v3.3.0
type HealthResponse struct {
Error error `json:"error" example:"The database cannot be accessed"`
}
type ImportPreviewList ¶
type ImportPreviewList struct {
Data []importer.TransactionPreview `json:"data"` // List of transaction previews
}
type ImportPreviewQuery ¶
type ImportPreviewQuery struct {
AccountID string `form:"accountId" binding:"required"` // ID of the account to import the transactions for
}
type ImportQuery ¶
type ImportQuery struct {
BudgetName string `form:"budgetName" binding:"required"` // Name for the new budget
}
type MatchRuleQueryFilter ¶ added in v3.1.2
type MatchRuleQueryFilter struct { Priority uint `form:"month"` // By priority Match string `form:"match"` // By match AccountID string `form:"account"` // By ID of the account they map to }
func (MatchRuleQueryFilter) Parse ¶ added in v3.1.2
func (f MatchRuleQueryFilter) Parse(c *gin.Context) (models.MatchRuleCreate, bool)
type MonthConfigListResponse ¶
type MonthConfigListResponse struct {
Data []models.MonthConfig `json:"data"` // List of month configs
}
type MonthConfigQueryFilter ¶
type MonthConfigQueryFilter struct { EnvelopeID string `form:"envelope"` // By ID of the envelope Month string `form:"month"` // By month }
func (MonthConfigQueryFilter) Parse ¶
func (m MonthConfigQueryFilter) Parse(c *gin.Context) (MonthConfigFilter, bool)
type MonthConfigResponse ¶
type MonthConfigResponse struct {
Data models.MonthConfig `json:"data"` // Data for the month
}
type MonthResponse ¶
type QueryMonth ¶
type RenameRuleListResponse ¶
type RenameRuleQueryFilter ¶
type RenameRuleQueryFilter struct { Priority uint `form:"month"` // By priority Match string `form:"match"` // By match AccountID string `form:"account"` // By ID of the account they map to }
func (RenameRuleQueryFilter) Parse ¶
func (f RenameRuleQueryFilter) Parse(c *gin.Context) (models.MatchRuleCreate, bool)
type RenameRuleResponse ¶
type ResponseMatchRule ¶ added in v3.1.2
type ResponseTransactionV2 ¶
type ResponseTransactionV2 struct { Error string `json:"error" example:"A human readable error message"` // This field contains a human readable error message Data models.Transaction `json:"data"` // This field contains the transaction data }
type TransactionListResponse ¶
type TransactionListResponse struct {
Data []models.Transaction `json:"data"` // List of transactions
}
type TransactionQueryFilter ¶
type TransactionQueryFilter struct { Date time.Time `form:"date" filterField:"false"` // Exact date. Time is ignored. FromDate time.Time `form:"fromDate" filterField:"false"` // From this date. Time is ignored. UntilDate time.Time `form:"untilDate" filterField:"false"` // Until this date. Time is ignored. Amount decimal.Decimal `form:"amount"` // Exact amount AmountLessOrEqual decimal.Decimal `form:"amountLessOrEqual" filterField:"false"` // Amount less than or equal to this AmountMoreOrEqual decimal.Decimal `form:"amountMoreOrEqual" filterField:"false"` // Amount more than or equal to this Note string `form:"note" filterField:"false"` // Note contains this string BudgetID string `form:"budget"` // ID of the budget SourceAccountID string `form:"source"` // ID of the source account DestinationAccountID string `form:"destination"` // ID of the destination account EnvelopeID string `form:"envelope"` // ID of the envelope Reconciled bool `form:"reconciled"` // DEPRECATED. Do not use, this field does not work as intended. See https://github.com/envelope-zero/backend/issues/528. Use reconciledSource and reconciledDestination instead. ReconciledSource bool `form:"reconciledSource"` // Is the transaction reconciled in the source account? ReconciledDestination bool `form:"reconciledDestination"` // Is the transaction reconciled in the destination account? AccountID string `form:"account" filterField:"false"` // ID of either source or destination account }
func (TransactionQueryFilter) ToCreate ¶
func (f TransactionQueryFilter) ToCreate(c *gin.Context) (models.TransactionCreate, bool)
type TransactionResponse ¶
type TransactionResponse struct {
Data models.Transaction `json:"data"` // Data for the transaction
}