Documentation
¶
Index ¶
- type Account
- type AccountListResponse
- type AccountQueryFilter
- type AccountResponse
- type AccountV2
- type Allocation
- type AllocationListResponse
- type AllocationMode
- type AllocationQueryFilter
- type AllocationResponse
- type Budget
- type BudgetAllocationMode
- type BudgetListResponse
- type BudgetMonthResponse
- type BudgetQueryFilter
- type BudgetResponse
- type Category
- 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) CreateTransactionsV3(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) DeleteTransactionV3(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) GetTransactionV3(c *gin.Context)
- func (co Controller) GetTransactions(c *gin.Context)
- func (co Controller) GetTransactionsV3(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) OptionsTransactionDetailV3(c *gin.Context)
- func (co Controller) OptionsTransactionList(c *gin.Context)
- func (co Controller) OptionsTransactionsV2(c *gin.Context)
- func (co Controller) OptionsTransactionsV3(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) RegisterTransactionRoutesV3(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)
- func (co Controller) UpdateTransactionV3(c *gin.Context)
- type Envelope
- type EnvelopeListResponse
- type EnvelopeMonthResponse
- type EnvelopeQueryFilter
- type EnvelopeResponse
- type HealthResponse
- type ImportPreviewList
- type ImportPreviewQuery
- type ImportQuery
- type MatchRule
- type MatchRuleQueryFilter
- type MonthConfig
- type MonthConfigFilter
- type MonthConfigListResponse
- type MonthConfigQueryFilter
- type MonthConfigResponse
- type MonthResponse
- type Pagination
- type QueryMonth
- type RenameRuleListResponse
- type RenameRuleQueryFilter
- type RenameRuleResponse
- type ResponseMatchRule
- type ResponseTransactionV2
- type Transaction
- type TransactionCreateResponseV3
- type TransactionListResponse
- type TransactionListResponseV3
- type TransactionQueryFilterV1
- type TransactionQueryFilterV3
- type TransactionResponse
- type TransactionResponseV3
- type TransactionV2
- type TransactionV3
- type URIMonth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 Allocation ¶ added in v3.3.4
type Allocation struct {
models.Allocation
Links struct {
Self string `json:"self" example:"https://example.com/api/v1/allocations/902cd93c-3724-4e46-8540-d014131282fc"` // The allocation itself
} `json:"links" gorm:"-"`
}
type AllocationListResponse ¶
type AllocationListResponse struct {
Data []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 Allocation `json:"data"` // List of allocations
}
type Budget ¶ added in v3.3.4
type Budget struct {
models.Budget
Balance decimal.Decimal `json:"balance" gorm:"-" example:"3423.42"` // DEPRECATED. Will be removed in API v2, see https://github.com/envelope-zero/backend/issues/526.
Links struct {
Self string `json:"self" example:"https://example.com/api/v1/budgets/550dc009-cea6-4c12-b2a5-03446eb7b7cf"` // The budget itself
Accounts string `json:"accounts" example:"https://example.com/api/v1/accounts?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"` // Accounts for this budget
Categories string `json:"categories" example:"https://example.com/api/v1/categories?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"` // Categories for this budget
Envelopes string `json:"envelopes" example:"https://example.com/api/v1/envelopes?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"` // Envelopes for this budget
Transactions string `json:"transactions" example:"https://example.com/api/v1/transactions?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"` // Transactions for this budget
Month string `json:"month" example:"https://example.com/api/v1/budgets/550dc009-cea6-4c12-b2a5-03446eb7b7cf/YYYY-MM"` // This uses 'YYYY-MM' for clients to replace with the actual year and month.
GroupedMonth string `json:"groupedMonth" example:"https://example.com/api/v1/months?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf&month=YYYY-MM"` // This uses 'YYYY-MM' for clients to replace with the actual year and month.
MonthAllocations string `json:"monthAllocations" example:"https://example.com/api/v1/months?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf&month=YYYY-MM"` // This uses 'YYYY-MM' for clients to replace with the actual year and month.
} `json:"links" gorm:"-"`
}
Budget is the API v1 representation of a Budget.
type BudgetAllocationMode ¶
type BudgetAllocationMode struct {
Mode AllocationMode `json:"mode" example:"ALLOCATE_LAST_MONTH_SPEND"` // Mode to allocate budget with
}
type BudgetListResponse ¶
type BudgetListResponse struct {
Data []Budget `json:"data"` // List of budgets
}
type BudgetMonthResponse ¶
type BudgetMonthResponse struct {
Data models.BudgetMonth `json:"data"` // Data for the budget's month
}
type BudgetQueryFilter ¶
type BudgetResponse ¶
type BudgetResponse struct {
Data Budget `json:"data"` // Data for the budget
}
type Category ¶
type Category struct {
models.Category
Envelopes []Envelope `json:"envelopes"` // Envelopes for the category
Links struct {
Self string `json:"self" example:"https://example.com/api/v1/categories/3b1ea324-d438-4419-882a-2fc91d71772f"` // The category itself
Envelopes string `json:"envelopes" example:"https://example.com/api/v1/envelopes?category=3b1ea324-d438-4419-882a-2fc91d71772f"` // Envelopes for this category
} `json:"links"`
}
type CategoryListResponse ¶
type CategoryListResponse struct {
Data []Category `json:"data"` // List of categories
}
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 CategoryResponse struct {
Data Category `json:"data"` // Data for the category
}
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 {object} httperrors.HTTPError
@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 {object} httperrors.HTTPError
@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 {object} httperrors.HTTPError
@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 {object} httperrors.HTTPError
@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 {object} httperrors.HTTPError
@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 id 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/{id}/{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 {object} httperrors.HTTPError
@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 {object} httperrors.HTTPError
@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} httperrors.HTTPError
@Failure 404 {object} []ResponseTransactionV2
@Failure 500 {object} []ResponseTransactionV2
@Param transactions body []models.TransactionCreate true "Transactions"
@Router /v2/transactions [post]
@Deprecated true
func (Controller) CreateTransactionsV3 ¶ added in v3.6.0
func (co Controller) CreateTransactionsV3(c *gin.Context)
CreateTransactionsV3 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} TransactionCreateResponseV3
@Failure 400 {object} TransactionCreateResponseV3
@Failure 404 {object} TransactionCreateResponseV3
@Failure 500 {object} TransactionCreateResponseV3
@Param transactions body []models.TransactionCreate true "Transactions"
@Router /v3/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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/accounts/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/allocations/{id} [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 {object} httperrors.HTTPError
@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 id path string true "Budget ID formatted as string"
@Router /v1/budgets/{id}/{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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/budgets/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/categories/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/envelopes/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v2/match-rules/{id} [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
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID of the Envelope"
@Param month path string true "The month in YYYY-MM format"
@Router /v1/month-configs/{id}/{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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v2/rename-rules/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/transactions/{id} [delete]
@Deprecated true
func (Controller) DeleteTransactionV3 ¶ added in v3.8.0
func (co Controller) DeleteTransactionV3(c *gin.Context)
DeleteTransactionV3 deletes a specific transaction
@Summary Delete transaction
@Description Deletes a transaction
@Tags Transactions
@Success 204
@Failure 400 {object} httperrors.HTTPError
@Failure 404 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v3/transactions/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/accounts/{id} [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 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 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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/allocations/{id} [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 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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/budgets/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param month path string true "The month in YYYY-MM format"
@Router /v1/budgets/{id}/{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 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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/categories/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/envelopes/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param month path string true "The month in YYYY-MM format"
@Router /v1/envelopes/{id}/{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 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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v2/match-rules/{id} [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 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 {object} httperrors.HTTPError
@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
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID of the Envelope"
@Param month path string true "The month in YYYY-MM format"
@Router /v1/month-configs/{id}/{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 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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v2/rename-rules/{id} [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 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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/transactions/{id} [get]
@Deprecated true
func (Controller) GetTransactionV3 ¶ added in v3.7.0
func (co Controller) GetTransactionV3(c *gin.Context)
GetTransactionV3 returns a specific transaction
@Summary Get transaction
@Description Returns a specific transaction
@Tags Transactions
@Produce json
@Success 200 {object} TransactionResponseV3
@Failure 400 {object} TransactionResponseV3
@Failure 404 {object} TransactionResponseV3
@Failure 500 {object} TransactionResponseV3
@Param id path string true "ID formatted as string"
@Router /v3/transactions/{id} [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 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"
@Deprecated true
func (Controller) GetTransactionsV3 ¶ added in v3.5.0
func (co Controller) GetTransactionsV3(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} TransactionListResponseV3
@Failure 400 {object} TransactionListResponseV3
@Failure 500 {object} TransactionListResponseV3
@Router /v3/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 reconciledSource query bool false "Reconcilication state in source account"
@Param reconciledDestination query bool false "Reconcilication state in destination account"
@Param offset query uint false "The offset of the first Transaction returned. Defaults to 0."
@Param limit query int false " Maximum number of transactions to return. Defaults to 50.".
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 404 {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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/accounts/{id} [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 @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 @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
@Failure 400 {object} httperrors.HTTPError
@Failure 404 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/allocations/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/budgets/{id} [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 @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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param month path string true "The month in YYYY-MM format"
@Router /v1/budgets/{id}/{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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param month path string true "The month in YYYY-MM format"
@Router /v1/budgets/{id}/{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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/categories/{id} [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 @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
@Failure 400 {object} httperrors.HTTPError
@Failure 404 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/envelopes/{id} [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 @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 @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 @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
@Failure 400 {object} httperrors.HTTPError
@Failure 404 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v2/match-rules/{id} [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
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID of the Envelope"
@Param month path string true "The month in YYYY-MM format"
@Router /v1/month-configs/{id}/{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
@Failure 400 {object} httperrors.HTTPError
@Failure 404 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v2/rename-rules/{id} [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
@Failure 400 {object} httperrors.HTTPError
@Failure 404 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v1/transactions/{id} [options]
@Deprecated true
func (Controller) OptionsTransactionDetailV3 ¶ added in v3.7.0
func (co Controller) OptionsTransactionDetailV3(c *gin.Context)
OptionsTransactionDetailV3 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
@Failure 400 {object} httperrors.HTTPError
@Failure 404 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Router /v3/transactions/{id} [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] @Deprecated true
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] @Deprecated true
func (Controller) OptionsTransactionsV3 ¶ added in v3.5.0
func (co Controller) OptionsTransactionsV3(c *gin.Context)
OptionsTransactionsV3 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 /v3/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) RegisterTransactionRoutesV3 ¶ added in v3.5.0
func (co Controller) RegisterTransactionRoutesV3(r *gin.RouterGroup)
RegisterTransactionRoutesV3 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 {object} httperrors.HTTPError
@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. **Deprecated. Use POST /month endpoint with month and budgetId query parameters instead.**
@Tags Budgets
@Success 204
@Failure 400 {object} httperrors.HTTPError
@Failure 404 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param month path string true "The month in YYYY-MM format"
@Param id path string true "Budget ID formatted as string"
@Param mode body BudgetAllocationMode true "Budget"
@Router /v1/budgets/{id}/{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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param account body models.AccountCreate true "Account"
@Router /v1/accounts/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param allocation body models.AllocationCreate true "Allocation"
@Router /v1/allocations/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param budget body models.BudgetCreate true "Budget"
@Router /v1/budgets/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param category body models.CategoryCreate true "Category"
@Router /v1/categories/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param envelope body models.EnvelopeCreate true "Envelope"
@Router /v1/envelopes/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param matchRule body models.MatchRuleCreate true "MatchRule"
@Router /v2/match-rules/{id} [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 404 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id 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/{id}/{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 id path string true "ID formatted as string"
@Param renameRule body models.MatchRuleCreate true "RenameRule"
@Router /v2/rename-rules/{id} [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 {object} httperrors.HTTPError
@Failure 500 {object} httperrors.HTTPError
@Param id path string true "ID formatted as string"
@Param transaction body models.TransactionCreate true "Transaction"
@Router /v1/transactions/{id} [patch]
@Deprecated true
func (Controller) UpdateTransactionV3 ¶ added in v3.8.0
func (co Controller) UpdateTransactionV3(c *gin.Context)
UpdateTransactionV3 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} TransactionResponseV3
@Failure 400 {object} TransactionResponseV3
@Failure 404 {object} TransactionResponseV3
@Failure 500 {object} TransactionResponseV3
@Param id path string true "ID formatted as string"
@Param transaction body models.TransactionCreate true "Transaction"
@Router /v3/transactions/{id} [patch]
type Envelope ¶ added in v3.3.4
type Envelope struct {
models.Envelope
Links struct {
Self string `json:"self" example:"https://example.com/api/v1/envelopes/45b6b5b9-f746-4ae9-b77b-7688b91f8166"` // The envelope itself
Allocations string `json:"allocations" example:"https://example.com/api/v1/allocations?envelope=45b6b5b9-f746-4ae9-b77b-7688b91f8166"` // the envelope's allocations
Month string `json:"month" example:"https://example.com/api/v1/envelopes/45b6b5b9-f746-4ae9-b77b-7688b91f8166/YYYY-MM"` // Month information endpoint. This will always end in 'YYYY-MM' for clients to use replace with actual numbers.
Transactions string `json:"transactions" example:"https://example.com/api/v1/transactions?envelope=45b6b5b9-f746-4ae9-b77b-7688b91f8166"` // The envelope's transactions
} `json:"links"` // Links to related resources
}
type EnvelopeListResponse ¶
type EnvelopeListResponse struct {
Data []Envelope `json:"data"` // List of Envelopes
}
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 EnvelopeResponse struct {
Data Envelope `json:"data"` // Data for the Envelope
}
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 MonthConfig ¶ added in v3.3.4
type MonthConfig struct {
models.MonthConfig
Links struct {
Self string `json:"self" example:"https://example.com/api/v1/month-configs/61027ebb-ab75-4a49-9e23-a104ddd9ba6b/2017-10"` // The month config itself
Envelope string `json:"envelope" example:"https://example.com/api/v1/envelopes/61027ebb-ab75-4a49-9e23-a104ddd9ba6b"` // The envelope this config belongs to
} `json:"links"`
}
type MonthConfigListResponse ¶
type MonthConfigListResponse struct {
Data []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 MonthConfig `json:"data"` // Data for the month
}
type MonthResponse ¶
type Pagination ¶ added in v3.5.0
type Pagination struct {
Count int `json:"count" example:"25"` // The amount of records returned in this response
Offset uint `json:"offset" example:"50"` // The offset for the first record returned
Limit int `json:"limit" example:"25"` // The maximum amount of resources to return for this request
Total int64 `json:"total" example:"827"` // The total number of resources matching the query
}
Pagination contains information about the pagination for collection endpoint responses.
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 TransactionV2 `json:"data"` // This field contains the Transaction data
}
type Transaction ¶ added in v3.3.2
type Transaction struct {
models.Transaction
Links struct {
Self string `json:"self" example:"https://example.com/api/v1/transactions/d430d7c3-d14c-4712-9336-ee56965a6673"` // The transaction itself
} `json:"links"` // Links for the transaction
}
Transaction is the API v1 representation of a Transaction in EZ.
type TransactionCreateResponseV3 ¶ added in v3.6.0
type TransactionCreateResponseV3 struct {
Error *string `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
Data []TransactionResponseV3 `json:"data"` // List of created transactions
}
type TransactionListResponse ¶
type TransactionListResponse struct {
Data []Transaction `json:"data"` // List of transactions
}
type TransactionListResponseV3 ¶ added in v3.5.0
type TransactionListResponseV3 struct {
Data []TransactionV3 `json:"data"` // List of transactions
Error *string `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
Pagination *Pagination `json:"pagination"` // Pagination information
}
type TransactionQueryFilterV1 ¶ added in v3.5.0
type TransactionQueryFilterV1 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
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
Offset uint `form:"offset" filterField:"false"` // The offset of the first Transaction returned. Defaults to 0.
Limit int `form:"limit" filterField:"false"` // Maximum number of transactions to return. Defaults to 50.
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.
}
func (TransactionQueryFilterV1) ToCreateHandleErrors ¶ added in v3.5.0
func (f TransactionQueryFilterV1) ToCreateHandleErrors(c *gin.Context) (models.TransactionCreate, bool)
ToCreateHandleErrors parses the query string and returns a TransactionCreate struct for the database request.
This method is deprecated, use ToCreate() and handle errors in the calling method.
type TransactionQueryFilterV3 ¶ added in v3.5.0
type TransactionQueryFilterV3 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
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
Offset uint `form:"offset" filterField:"false"` // The offset of the first Transaction returned. Defaults to 0.
Limit int `form:"limit" filterField:"false"` // Maximum number of transactions to return. Defaults to 50.
}
func (TransactionQueryFilterV3) ToCreate ¶ added in v3.5.0
func (f TransactionQueryFilterV3) ToCreate() (models.TransactionCreate, httperrors.Error)
ToCreate parses the query string and returns a TransactionCreate struct for the database request. On error, it returns httperrors.ErrorStatus struct with.
type TransactionResponse ¶
type TransactionResponse struct {
Data Transaction `json:"data"` // Data for the transaction
}
type TransactionResponseV3 ¶ added in v3.6.0
type TransactionResponseV3 struct {
Error *string `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred for this transaction
Data *TransactionV3 `json:"data"` // The transaction data, if creation was successful
}
type TransactionV2 ¶ added in v3.3.2
type TransactionV2 struct {
models.Transaction
Links struct {
Self string `json:"self" example:"https://example.com/api/v2/transactions/d430d7c3-d14c-4712-9336-ee56965a6673"` // The transaction itself
} `json:"links"` // Links for the transaction
}
type TransactionV3 ¶ added in v3.5.0
type TransactionV3 struct {
models.Transaction
Links struct {
Self string `json:"self" example:"https://example.com/api/v3/transactions/d430d7c3-d14c-4712-9336-ee56965a6673"` // The transaction itself
} `json:"links"` // Links for the transaction
}
TransactionV3 is the representation of a Transaction in API v3.