v4

package
v5.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(c *gin.Context)

@Summary Delete everything @Description Permanently deletes all resources @Tags v4 @Success 204 @Failure 400 {object} httpError @Failure 500 {object} httpError @Param confirm query string false "Confirmation to delete all resources. Must have the value 'yes-please-delete-everything'" @Router /v4 [delete]

func CreateAccounts

func CreateAccounts(c *gin.Context)

@Summary Creates accounts @Description Creates new accounts @Tags Accounts @Produce json @Success 201 {object} AccountCreateResponse @Failure 400 {object} AccountCreateResponse @Failure 404 {object} AccountCreateResponse @Failure 500 {object} AccountCreateResponse @Param accounts body []AccountEditable true "Accounts" @Router /v4/accounts [post]

func CreateBudgets

func CreateBudgets(c *gin.Context)

@Summary Create budget @Description Creates a new budget @Tags Budgets @Accept json @Produce json @Success 201 {object} BudgetCreateResponse @Failure 400 {object} BudgetCreateResponse @Failure 500 {object} BudgetCreateResponse @Param budget body []BudgetEditable true "Budget" @Router /v4/budgets [post]

func CreateCategories

func CreateCategories(c *gin.Context)

@Summary Create category @Description Creates a new category @Tags Categories @Produce json @Success 201 {object} CategoryCreateResponse @Failure 400 {object} CategoryCreateResponse @Failure 404 {object} CategoryCreateResponse @Failure 500 {object} CategoryCreateResponse @Param categories body []CategoryEditable true "Categories" @Router /v4/categories [post]

func CreateEnvelopes

func CreateEnvelopes(c *gin.Context)

@Summary Create envelope @Description Creates a new envelope @Tags Envelopes @Produce json @Success 201 {object} EnvelopeCreateResponse @Failure 400 {object} EnvelopeCreateResponse @Failure 404 {object} EnvelopeCreateResponse @Failure 500 {object} EnvelopeCreateResponse @Param envelope body []v4.EnvelopeEditable true "Envelopes" @Router /v4/envelopes [post]

func CreateGoals

func CreateGoals(c *gin.Context)

@Summary Create goals @Description Creates new goals @Tags Goals @Produce json @Success 201 {object} GoalCreateResponse @Failure 400 {object} GoalCreateResponse @Failure 404 {object} GoalCreateResponse @Failure 500 {object} GoalCreateResponse @Param goals body []GoalEditable true "Goals" @Router /v4/goals [post]

func CreateMatchRules

func CreateMatchRules(c *gin.Context)

@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} MatchRuleCreateResponse @Failure 400 {object} MatchRuleCreateResponse @Failure 404 {object} MatchRuleCreateResponse @Failure 500 {object} MatchRuleCreateResponse @Param matchRules body []MatchRuleEditable true "MatchRules" @Router /v4/match-rules [post]

func CreateTransactions

func CreateTransactions(c *gin.Context)

@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} TransactionCreateResponse @Failure 400 {object} TransactionCreateResponse @Failure 404 {object} TransactionCreateResponse @Failure 500 {object} TransactionCreateResponse @Param transactions body []TransactionEditable true "Transactions" @Router /v4/transactions [post]

func DeleteAccount

func DeleteAccount(c *gin.Context)

@Summary Delete account @Description Deletes an account @Tags Accounts @Produce json @Success 204 @Failure 400 {object} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/accounts/{id} [delete]

func DeleteAllocations

func DeleteAllocations(c *gin.Context)

@Summary Delete allocations for a month @Description Deletes all allocation for the specified month @Tags Months @Success 204 @Failure 400 {object} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param budget query string true "ID formatted as string" @Param month query string true "The month in YYYY-MM format" @Router /v4/months [delete]

func DeleteBudget

func DeleteBudget(c *gin.Context)

@Summary Delete budget @Description Deletes a budget @Tags Budgets @Success 204 @Failure 400 {object} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/budgets/{id} [delete]

func DeleteCategory

func DeleteCategory(c *gin.Context)

@Summary Delete category @Description Deletes a category @Tags Categories @Success 204 @Failure 400 {object} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/categories/{id} [delete]

func DeleteEnvelope

func DeleteEnvelope(c *gin.Context)

@Summary Delete envelope @Description Deletes an envelope @Tags Envelopes @Success 204 @Failure 400 {object} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/envelopes/{id} [delete]

func DeleteGoal

func DeleteGoal(c *gin.Context)

@Summary Delete goal @Description Deletes a goal @Tags Goals @Success 204 @Failure 400 {object} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/goals/{id} [delete]

func DeleteMatchRule

func DeleteMatchRule(c *gin.Context)

@Summary Delete matchRule @Description Deletes an matchRule @Tags MatchRules @Success 204 @Failure 400 {object} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/match-rules/{id} [delete]

func DeleteTransaction

func DeleteTransaction(c *gin.Context)

@Summary Delete transaction @Description Deletes a transaction @Tags Transactions @Success 204 @Failure 400 {object} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/transactions/{id} [delete]

func Get

func Get(c *gin.Context)

Get returns the link list for v4

@Summary		v4 API
@Description	Returns general information about the v4 API
@Tags			v4
@Success		200	{object}	Response
@Router			/v4 [get]

func GetAccount

func GetAccount(c *gin.Context)

@Summary Get account @Description Returns a specific account @Tags Accounts @Produce json @Success 200 {object} AccountResponse @Failure 400 {object} AccountResponse @Failure 404 {object} AccountResponse @Failure 500 {object} AccountResponse @Param id path string true "ID formatted as string" @Router /v4/accounts/{id} [get]

func GetAccountData

func GetAccountData(c *gin.Context)

@Summary Get Account data @Description Returns calculated data for the account, e.g. balances @Tags Accounts @Produce json @Success 200 {object} AccountComputedDataResponse @Failure 400 {object} AccountComputedDataResponse @Failure 404 {object} AccountComputedDataResponse @Failure 500 {object} AccountComputedDataResponse @Param request body AccountComputedRequest true "Time and IDs of requested accounts" @Router /v4/accounts/computed [post]

func GetAccountRecentEnvelopes

func GetAccountRecentEnvelopes(c *gin.Context)

@Summary Get recent envelopes @Description Returns a list of objects representing recent envelopes @Tags Accounts @Produce json @Success 200 {object} RecentEnvelopesResponse @Failure 400 {object} RecentEnvelopesResponse @Failure 404 {object} RecentEnvelopesResponse @Failure 500 {object} RecentEnvelopesResponse @Param id path string true "ID formatted as string" @Router /v4/accounts/{id}/recent-envelopes [get]

func GetAccounts

func GetAccounts(c *gin.Context)

@Summary List accounts @Description Returns a list of accounts @Tags Accounts @Produce json @Success 200 {object} AccountListResponse @Failure 400 {object} AccountListResponse @Failure 500 {object} AccountListResponse @Router /v4/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 archived query bool false "Is the account archived?" @Param search query string false "Search for this text in name and note" @Param offset query uint false "The offset of the first Account returned. Defaults to 0." @Param limit query int false "Maximum number of Accounts to return. Defaults to 50."

func GetBudget

func GetBudget(c *gin.Context)

@Summary Get budget @Description Returns a specific budget @Tags Budgets @Produce json @Success 200 {object} BudgetResponse @Failure 400 {object} BudgetResponse @Failure 404 {object} BudgetResponse @Failure 500 {object} BudgetResponse @Param id path string true "ID formatted as string" @Router /v4/budgets/{id} [get]

func GetBudgets

func GetBudgets(c *gin.Context)

@Summary List budgets @Description Returns a list of budgets @Tags Budgets @Produce json @Success 200 {object} BudgetListResponse @Failure 500 {object} BudgetListResponse @Router /v4/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" @Param offset query uint false "The offset of the first Budget returned. Defaults to 0." @Param limit query int false "Maximum number of Budgets to return. Defaults to 50."

func GetCategories

func GetCategories(c *gin.Context)

@Summary Get categories @Description Returns a list of categories @Tags Categories @Produce json @Success 200 {object} CategoryListResponse @Failure 400 {object} CategoryListResponse @Failure 500 {object} CategoryListResponse @Router /v4/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 archived query bool false "Is the category archived?" @Param search query string false "Search for this text in name and note" @Param offset query uint false "The offset of the first Category returned. Defaults to 0." @Param limit query int false "Maximum number of Categories to return. Defaults to 50."

func GetCategory

func GetCategory(c *gin.Context)

@Summary Get category @Description Returns a specific category @Tags Categories @Produce json @Success 200 {object} CategoryResponse @Failure 400 {object} CategoryResponse @Failure 404 {object} CategoryResponse @Failure 500 {object} CategoryResponse @Param id path string true "ID formatted as string" @Router /v4/categories/{id} [get]

func GetEnvelope

func GetEnvelope(c *gin.Context)

@Summary Get Envelope @Description Returns a specific Envelope @Tags Envelopes @Produce json @Success 200 {object} EnvelopeResponse @Failure 400 {object} EnvelopeResponse @Failure 404 {object} EnvelopeResponse @Failure 500 {object} EnvelopeResponse @Param id path string true "ID formatted as string" @Router /v4/envelopes/{id} [get]

func GetEnvelopes

func GetEnvelopes(c *gin.Context)

@Summary Get envelopes @Description Returns a list of envelopes @Tags Envelopes @Produce json @Success 200 {object} EnvelopeListResponse @Failure 400 {object} EnvelopeListResponse @Failure 500 {object} EnvelopeListResponse @Router /v4/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 archived query bool false "Is the envelope archived?" @Param search query string false "Search for this text in name and note" @Param offset query uint false "The offset of the first Envelope returned. Defaults to 0." @Param limit query int false "Maximum number of Envelopes to return. Defaults to 50."

func GetExport added in v5.3.0

func GetExport(c *gin.Context)

@Summary Export @Description Exports all resources for the instance @Tags Export @Produce json @Success 200 {object} ExportResponse @Failure 500 {object} ExportResponse @Router /v4/export [get]

func GetGoal

func GetGoal(c *gin.Context)

@Summary Get goal @Description Returns a specific goal @Tags Goals @Produce json @Success 200 {object} GoalResponse @Failure 400 {object} GoalResponse @Failure 404 {object} GoalResponse @Failure 500 {object} GoalResponse @Param id path string true "ID formatted as string" @Router /v4/goals/{id} [get]

func GetGoals

func GetGoals(c *gin.Context)

@Summary Get goals @Description Returns a list of goals @Tags Goals @Produce json @Success 200 {object} GoalListResponse @Failure 400 {object} GoalListResponse @Failure 500 {object} GoalListResponse @Router /v4/goals [get] @Param name query string false "Filter by name" @Param note query string false "Filter by note" @Param search query string false "Search for this text in name and note" @Param archived query bool false "Is the goal archived?" @Param envelope query string false "Filter by envelope ID" @Param month query string false "Month of the goal. Ignores exact time, matches on the month of the RFC3339 timestamp provided." @Param fromMonth query string false "Goals for this and later months. Ignores exact time, matches on the month of the RFC3339 timestamp provided." @Param untilMonth query string false "Goals for this and earlier months. Ignores exact time, matches on the month 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 offset query uint false "The offset of the first goal returned. Defaults to 0." @Param limit query int false "Maximum number of goal to return. Defaults to 50."

func GetImport

func GetImport(c *gin.Context)

@Summary Import API overview @Description Returns general information about the v4 API @Tags Import @Success 200 {object} ImportResponse @Router /v4/import [get]

func GetMatchRule

func GetMatchRule(c *gin.Context)

@Summary Get matchRule @Description Returns a specific matchRule @Tags MatchRules @Produce json @Success 200 {object} MatchRuleResponse @Failure 400 {object} MatchRuleResponse @Failure 404 {object} MatchRuleResponse @Failure 500 {object} MatchRuleResponse @Param id path string true "ID formatted as string" @Router /v4/match-rules/{id} [get]

func GetMatchRules

func GetMatchRules(c *gin.Context)

@Summary Get matchRules @Description Returns a list of matchRules @Tags MatchRules @Produce json @Success 200 {object} MatchRuleListResponse @Failure 400 {object} MatchRuleListResponse @Failure 500 {object} MatchRuleListResponse @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" @Param offset query uint false "The offset of the first Match Rule returned. Defaults to 0." @Param limit query int false "Maximum number of Match Rules to return. Defaults to 50.". @Router /v4/match-rules [get]

func GetMonth

func GetMonth(c *gin.Context)

@Summary Get data about a month @Description Returns data about a specific month. @Tags Months @Produce json @Success 200 {object} MonthResponse @Failure 400 {object} MonthResponse @Failure 404 {object} MonthResponse @Failure 500 {object} MonthResponse @Param budget query string true "ID formatted as string" @Param month query string true "The month in YYYY-MM format" @Router /v4/months [get]

func GetMonthConfig

func GetMonthConfig(c *gin.Context)

@Summary Get MonthConfig @Description Returns configuration for a specific month @Tags Envelopes @Produce json @Success 200 {object} MonthConfigResponse @Failure 400 {object} MonthConfigResponse @Failure 404 {object} MonthConfigResponse @Failure 500 {object} MonthConfigResponse @Param id path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Router /v4/envelopes/{id}/{month} [get]

func GetTransaction

func GetTransaction(c *gin.Context)

@Summary Get transaction @Description Returns a specific transaction @Tags Transactions @Produce json @Success 200 {object} TransactionResponse @Failure 400 {object} TransactionResponse @Failure 404 {object} TransactionResponse @Failure 500 {object} TransactionResponse @Param id path string true "ID formatted as string" @Router /v4/transactions/{id} [get]

func GetTransactions

func GetTransactions(c *gin.Context)

@Summary Get transactions @Description Returns a list of transactions @Tags Transactions @Produce json @Success 200 {object} TransactionListResponse @Failure 400 {object} TransactionListResponse @Failure 500 {object} TransactionListResponse @Router /v4/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 availableFromDate query string false "Availability date of the transaction. Ignores exact time, matches on the day of the RFC3339 timestamp provided." @Param availableFromFromDate query string false "Transactions available at and after this date. Ignores exact time, matches on the day of the RFC3339 timestamp provided." @Param availableFromUntilDate query string false "Transactions available 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 direction query TransactionDirection false "Filter by direction of transaction" @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 ImportYnab4

func ImportYnab4(c *gin.Context)

@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} BudgetResponse @Failure 500 {object} BudgetResponse @Param file formData file true "File to import" @Param budgetName query string false "Name of the Budget to create" @Router /v4/import/ynab4 [post]

func ImportYnabImportPreview

func ImportYnabImportPreview(c *gin.Context)

@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} ImportPreviewList @Failure 404 {object} ImportPreviewList @Failure 500 {object} ImportPreviewList @Param file formData file true "File to import" @Param accountId query string false "ID of the account to import transactions for" @Router /v4/import/ynab-import-preview [post]

func Options

func Options(c *gin.Context)

Options 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			v4
@Success		204
@Router			/v4 [options]

func OptionsAccountDetail

func OptionsAccountDetail(c *gin.Context)

@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} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/accounts/{id} [options]

func OptionsAccountList

func OptionsAccountList(c *gin.Context)

@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 /v4/accounts [options]

func OptionsBudgetDetail

func OptionsBudgetDetail(c *gin.Context)

@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} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/budgets/{id} [options]

func OptionsBudgetList

func OptionsBudgetList(c *gin.Context)

@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 /v4/budgets [options]

func OptionsCategoryDetail

func OptionsCategoryDetail(c *gin.Context)

@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} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/categories/{id} [options]

func OptionsCategoryList

func OptionsCategoryList(c *gin.Context)

@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 /v4/categories [options]

func OptionsEnvelopeDetail

func OptionsEnvelopeDetail(c *gin.Context)

@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} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/envelopes/{id} [options]

func OptionsEnvelopeList

func OptionsEnvelopeList(c *gin.Context)

@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 /v4/envelopes [options]

func OptionsExport added in v5.3.0

func OptionsExport(c *gin.Context)

@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Export @Success 204 @Router /v4/export [options]

func OptionsGoalDetail

func OptionsGoalDetail(c *gin.Context)

@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Goals @Success 204 @Failure 400 {object} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/goals/{id} [options]

func OptionsGoals

func OptionsGoals(c *gin.Context)

@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags Goals @Success 204 @Router /v4/goals [options]

func OptionsImport

func OptionsImport(c *gin.Context)

@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 /v4/import [options]

func OptionsImportYnab4

func OptionsImportYnab4(c *gin.Context)

@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 /v4/import/ynab4 [options]

func OptionsImportYnabImportPreview

func OptionsImportYnabImportPreview(c *gin.Context)

@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 /v4/import/ynab-import-preview [options]

func OptionsMatchRuleDetail

func OptionsMatchRuleDetail(c *gin.Context)

@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} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/match-rules/{id} [options]

func OptionsMatchRuleList

func OptionsMatchRuleList(c *gin.Context)

@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 /v4/match-rules [options]

func OptionsMonth

func OptionsMonth(c *gin.Context)

@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 /v4/months [options]

func OptionsMonthConfigDetail

func OptionsMonthConfigDetail(c *gin.Context)

@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} httpError @Param id path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Router /v4/envelopes/{id}/{month} [options]

func OptionsTransactionDetail

func OptionsTransactionDetail(c *gin.Context)

@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} httpError @Failure 404 {object} httpError @Failure 500 {object} httpError @Param id path string true "ID formatted as string" @Router /v4/transactions/{id} [options]

func OptionsTransactions

func OptionsTransactions(c *gin.Context)

@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 /v4/transactions [options]

func RegisterAccountRoutes

func RegisterAccountRoutes(r *gin.RouterGroup)

RegisterAccountRoutes registers the routes for accounts with the RouterGroup that is passed.

func RegisterBudgetRoutes

func RegisterBudgetRoutes(r *gin.RouterGroup)

RegisterBudgetRoutes registers the routes for Budgets with the RouterGroup that is passed.

func RegisterCategoryRoutes

func RegisterCategoryRoutes(r *gin.RouterGroup)

RegisterCategoryRoutes registers the routes for categories with the RouterGroup that is passed.

func RegisterEnvelopeRoutes

func RegisterEnvelopeRoutes(r *gin.RouterGroup)

RegisterEnvelopeRoutes registers the routes for envelopes with the RouterGroup that is passed.

func RegisterExportRoutes added in v5.3.0

func RegisterExportRoutes(r *gin.RouterGroup, version string)

func RegisterGoalRoutes

func RegisterGoalRoutes(r *gin.RouterGroup)

func RegisterImportRoutes

func RegisterImportRoutes(r *gin.RouterGroup)

RegisterImportRoutes registers the routes for imports.

func RegisterMatchRuleRoutes

func RegisterMatchRuleRoutes(r *gin.RouterGroup)

RegisterMatchRuleRoutes registers the routes for matchRules with the RouterGroup that is passed.

func RegisterMonthConfigRoutes

func RegisterMonthConfigRoutes(r *gin.RouterGroup)

RegisterMonthConfigRoutes registers the routes for transactions with the RouterGroup that is passed.

func RegisterMonthRoutes

func RegisterMonthRoutes(r *gin.RouterGroup)

RegisterMonthRoutes registers the routes for months with the RouterGroup that is passed.

func RegisterRootRoutes

func RegisterRootRoutes(r *gin.RouterGroup)

func RegisterTransactionRoutes

func RegisterTransactionRoutes(r *gin.RouterGroup)

RegisterTransactionRoutes registers the routes for transactions with the RouterGroup that is passed.

func SetAllocations

func SetAllocations(c *gin.Context)

@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} httpError @Failure 404 {object} httpError @Failure 500 {object} 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 /v4/months [post]

func UpdateAccount

func UpdateAccount(c *gin.Context)

@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} AccountResponse @Failure 404 {object} AccountResponse @Failure 500 {object} AccountResponse @Param id path string true "ID formatted as string" @Param account body AccountEditable true "Account" @Router /v4/accounts/{id} [patch]

func UpdateBudget

func UpdateBudget(c *gin.Context)

@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} BudgetResponse @Failure 404 {object} BudgetResponse @Failure 500 {object} BudgetResponse @Param id path string true "ID formatted as string" @Param budget body BudgetEditable true "Budget" @Router /v4/budgets/{id} [patch]

func UpdateCategory

func UpdateCategory(c *gin.Context)

@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} CategoryResponse @Failure 404 {object} CategoryResponse @Failure 500 {object} CategoryResponse @Param id path string true "ID formatted as string" @Param category body CategoryEditable true "Category" @Router /v4/categories/{id} [patch]

func UpdateEnvelope

func UpdateEnvelope(c *gin.Context)

@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} EnvelopeResponse @Failure 404 {object} EnvelopeResponse @Failure 500 {object} EnvelopeResponse @Param id path string true "ID formatted as string" @Param envelope body v4.EnvelopeEditable true "Envelope" @Router /v4/envelopes/{id} [patch]

func UpdateGoal

func UpdateGoal(c *gin.Context)

@Summary Update goal @Description Updates an existing goal. Only values to be updated need to be specified. @Tags Goals @Accept json @Produce json @Success 200 {object} GoalResponse @Failure 400 {object} GoalResponse @Failure 404 {object} GoalResponse @Failure 500 {object} GoalResponse @Param id path string true "ID formatted as string" @Param goal body GoalEditable true "Goal" @Router /v4/goals/{id} [patch]

func UpdateMatchRule

func UpdateMatchRule(c *gin.Context)

@Summary Update matchRule @Description Update a matchRule. Only values to be updated need to be specified. @Tags MatchRules @Accept json @Produce json @Success 200 {object} MatchRuleResponse @Failure 400 {object} MatchRuleResponse @Failure 404 {object} MatchRuleResponse @Failure 500 {object} MatchRuleResponse @Param id path string true "ID formatted as string" @Param matchRule body MatchRuleEditable true "MatchRule" @Router /v4/match-rules/{id} [patch]

func UpdateMonthConfig

func UpdateMonthConfig(c *gin.Context)

@Summary Update MonthConfig @Description Changes configuration for a Month. If there is no configuration for the month yet, this endpoint transparently creates a configuration resource. @Tags Envelopes @Produce json @Success 201 {object} MonthConfigResponse @Failure 400 {object} MonthConfigResponse @Failure 404 {object} MonthConfigResponse @Failure 500 {object} MonthConfigResponse @Param id path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Param monthConfig body MonthConfigEditable true "MonthConfig" @Router /v4/envelopes/{id}/{month} [patch]

func UpdateTransaction

func UpdateTransaction(c *gin.Context)

@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} TransactionResponse @Failure 404 {object} TransactionResponse @Failure 500 {object} TransactionResponse @Param id path string true "ID formatted as string" @Param transaction body TransactionEditable true "Transaction" @Router /v4/transactions/{id} [patch]

Types

type Account

type Account struct {
	models.DefaultModel
	AccountEditable
	Links AccountLinks `json:"links"`
}

Account is the API v4 representation of an Account in EZ.

type AccountComputedData

type AccountComputedData struct {
	ID                uuid.UUID       `json:"id" example:"95018a69-758b-46c6-8bab-db70d9614f9d"` // ID of the 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
}

type AccountComputedDataResponse

type AccountComputedDataResponse struct {
	Data  []AccountComputedData `json:"data"`
	Error *string               `json:"error"`
}

type AccountComputedRequest

type AccountComputedRequest struct {
	Time time.Time `form:"time"` // The time for which the computation is requested
	IDs  []string  `form:"ids"`  // A list of UUIDs for the accounts
}

type AccountCreateResponse

type AccountCreateResponse struct {
	Error *string           `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
	Data  []AccountResponse `json:"data"`                                                          // List of created Accounts
}

type AccountEditable

type AccountEditable struct {
	Name           string          `json:"name" example:"Cash" default:""`                          // Name of the account
	Note           string          `json:"note" example:"Money in my wallet" default:""`            // A longer description for the account
	BudgetID       uuid.UUID       `json:"budgetId" example:"550dc009-cea6-4c12-b2a5-03446eb7b7cf"` // ID of the budget this account belongs to
	OnBudget       bool            `json:"onBudget" example:"true" default:"false"`                 // Does the account factor into the available budget? Always false when external: true
	External       bool            `json:"external" example:"false" default:"false"`                // Does the account belong to the budget owner or not?
	InitialBalance decimal.Decimal ``                                                               // Balance of the account before any transactions were recorded
	/* 127-byte string literal not displayed */
	InitialBalanceDate *time.Time `json:"initialBalanceDate" example:"2017-05-12T00:00:00Z"`                                                // Date of the initial balance
	Archived           bool       `json:"archived" example:"true" default:"false"`                                                          // Is the account archived?
	ImportHash         string     `json:"importHash" example:"867e3a26dc0baf73f4bff506f31a97f6c32088917e9e5cf1a5ed6f3f84a6fa70" default:""` // The SHA256 hash of a unique combination of values to use in duplicate detection for imports
}
type AccountLinks struct {
	Self            string `json:"self" example:"https://example.com/api/v4/accounts/af892e10-7e0a-4fb8-b1bc-4b6d88401ed2"`                             // The account itself
	RecentEnvelopes string `json:"recentEnvelopes" example:"https://example.com/api/v4/accounts/af892e10-7e0a-4fb8-b1bc-4b6d88401ed2/recent-envelopes"` // Envelopes in recent transactions where this account was the target
	ComputedData    string `json:"computedData" example:"https://example.com/api/v4/accounts/computed"`                                                 // Computed data endpoint for accounts
	Transactions    string `json:"transactions" example:"https://example.com/api/v4/transactions?account=af892e10-7e0a-4fb8-b1bc-4b6d88401ed2"`         // Transactions referencing the account
}

type AccountListResponse

type AccountListResponse struct {
	Data       []Account   `json:"data"`                                                          // List of accounts
	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 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?
	Archived bool   `form:"archived"`                   // Is the account archived?
	Search   string `form:"search" filterField:"false"` // By string in name or note
	Offset   uint   `form:"offset" filterField:"false"` // The offset of the first Account returned. Defaults to 0.
	Limit    int    `form:"limit" filterField:"false"`  // Maximum number of Accounts to return. Defaults to 50.
}

type AccountResponse

type AccountResponse struct {
	Data  *Account `json:"data"`                                                          // Data for the account
	Error *string  `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred for this transaction
}

type AllocationMode

type AllocationMode string

swagger:enum AllocationMode

const (
	AllocateLastMonthBudget AllocationMode = "ALLOCATE_LAST_MONTH_BUDGET"
	AllocateLastMonthSpend  AllocationMode = "ALLOCATE_LAST_MONTH_SPEND"
)

type Budget

type Budget struct {
	models.DefaultModel
	BudgetEditable
	Links BudgetLinks `json:"links"`
}

Budget is the API v4 representation of a Budget.

type BudgetAllocationMode

type BudgetAllocationMode struct {
	Mode AllocationMode `json:"mode" example:"ALLOCATE_LAST_MONTH_SPEND"` // Mode to allocate budget with
}

type BudgetCreateResponse

type BudgetCreateResponse struct {
	Error *string          `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
	Data  []BudgetResponse `json:"data"`                                                          // List of created Budgets
}

type BudgetEditable

type BudgetEditable struct {
	Name     string `json:"name" example:"Morre's Budget" default:""`       // Name of the budget
	Note     string `json:"note" example:"My personal expenses" default:""` // A longer description of the budget
	Currency string `json:"currency" example:"€" default:""`                // The currency for the budget
}
type BudgetLinks struct {
	Self         string `json:"self" example:"https://example.com/api/v4/budgets/550dc009-cea6-4c12-b2a5-03446eb7b7cf"`                      // The budget itself
	Accounts     string `json:"accounts" example:"https://example.com/api/v4/accounts?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"`          // Accounts for this budget
	Categories   string `json:"categories" example:"https://example.com/api/v4/categories?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"`      // Categories for this budget
	Envelopes    string `json:"envelopes" example:"https://example.com/api/v4/envelopes?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"`        // Envelopes for this budget
	Transactions string `json:"transactions" example:"https://example.com/api/v4/transactions?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"`  // Transactions for this budget
	Month        string `json:"month" example:"https://example.com/api/v4/months?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf&month=YYYY-MM"` // This uses 'YYYY-MM' for clients to replace with the actual year and month.
}

type BudgetListResponse

type BudgetListResponse struct {
	Data       []Budget    `json:"data"`                                                          // List of budgets
	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 BudgetQueryFilter

type BudgetQueryFilter struct {
	Name     string `form:"name" filterField:"false"`   // By name
	Note     string `form:"note" filterField:"false"`   // By note
	Currency string `form:"currency"`                   // By currency
	Search   string `form:"search" filterField:"false"` // By string in name or note
	Offset   uint   `form:"offset" filterField:"false"` // The offset of the first Budget returned. Defaults to 0.
	Limit    int    `form:"limit" filterField:"false"`  // Maximum number of Budgets to return. Defaults to 50.
}

type BudgetResponse

type BudgetResponse struct {
	Data  *Budget `json:"data"`                                                          // Data for the budget
	Error *string `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
}

type Category

type Category struct {
	models.DefaultModel
	CategoryEditable
	Links CategoryLinks `json:"links"`

	// These fields are computed
	Envelopes []Envelope `json:"envelopes"` // Envelopes for the category
}

type CategoryCreateResponse

type CategoryCreateResponse struct {
	Data  []CategoryResponse `json:"data"`                                                          // List of the created Categories or their respective error
	Error *string            `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
}

type CategoryEditable

type CategoryEditable struct {
	Name     string    `json:"name" example:"Saving" default:""`                             // Name of the category
	BudgetID uuid.UUID `json:"budgetId" example:"52d967d3-33f4-4b04-9ba7-772e5ab9d0ce"`      // ID of the budget the category belongs to
	Note     string    `json:"note" example:"All envelopes for long-term saving" default:""` // Notes about the category
	Archived bool      `json:"archived" example:"true" default:"false"`                      // Is the category archived?
}

CategoryEditable represents all user configurable parameters

type CategoryEnvelopes

type CategoryEnvelopes struct {
	Category
	Envelopes  []EnvelopeMonth `json:"envelopes"`                // Slice of all envelopes
	Balance    decimal.Decimal `json:"balance" example:"-10.13"` // Sum of the balances of the envelopes
	Allocation decimal.Decimal `json:"allocation" example:"90"`  // Sum of allocations for the envelopes
	Spent      decimal.Decimal `json:"spent" example:"100.13"`   // Sum spent for all envelopes
}
type CategoryLinks struct {
	Self      string `json:"self" example:"https://example.com/api/v4/categories/3b1ea324-d438-4419-882a-2fc91d71772f"`              // The category itself
	Envelopes string `json:"envelopes" example:"https://example.com/api/v4/envelopes?category=3b1ea324-d438-4419-882a-2fc91d71772f"` // Envelopes for this category
}

type CategoryListResponse

type CategoryListResponse struct {
	Data       []Category  `json:"data"`                                                          // List of Categories
	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 CategoryQueryFilter

type CategoryQueryFilter struct {
	BudgetID string `form:"budget"`                     // By ID of the Budget
	Name     string `form:"name" filterField:"false"`   // By name
	Note     string `form:"note" filterField:"false"`   // By note
	Archived bool   `form:"archived"`                   // Is the Category archived?
	Search   string `form:"search" filterField:"false"` // By string in name or note
	Offset   uint   `form:"offset" filterField:"false"` // The offset of the first Category returned. Defaults to 0.
	Limit    int    `form:"limit" filterField:"false"`  // Maximum number of Categories to return. Defaults to 50.
}

type CategoryResponse

type CategoryResponse struct {
	Data  *Category `json:"data"`                                                          // Data for the Category
	Error *string   `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
}

type Envelope

type Envelope struct {
	models.DefaultModel
	EnvelopeEditable
	Links EnvelopeLinks `json:"links"` // Links to related resources
}

type EnvelopeCreateResponse

type EnvelopeCreateResponse struct {
	Data  []EnvelopeResponse `json:"data"`                                                          // Data for the Envelope
	Error *string            `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
}

type EnvelopeEditable

type EnvelopeEditable struct {
	Name       string    `json:"name" example:"Groceries" default:""`                                       // Name of the envelope
	CategoryID uuid.UUID `json:"categoryId"  example:"878c831f-af99-4a71-b3ca-80deb7d793c1"`                // ID of the category the envelope belongs to
	Note       string    `json:"note" example:"For stuff bought at supermarkets and drugstores" default:""` // Notes about the envelope
	Archived   bool      `json:"archived" example:"true" default:"false"`                                   // Is the envelope archived?
}

EnvelopeEditable represents all user configurable parameters

type EnvelopeLinks struct {
	Self         string `json:"self" example:"https://example.com/api/v4/envelopes/45b6b5b9-f746-4ae9-b77b-7688b91f8166"`                     // The envelope itself
	Transactions string `json:"transactions" example:"https://example.com/api/v4/transactions?envelope=45b6b5b9-f746-4ae9-b77b-7688b91f8166"` // The envelope's transactions
	Month        string `json:"month" example:"https://example.com/api/v4/envelopes/45b6b5b9-f746-4ae9-b77b-7688b91f8166/YYYY-MM"`            // The MonthConfig for the envelope
}

type EnvelopeListResponse

type EnvelopeListResponse struct {
	Data       []Envelope  `json:"data"`                                                          // List of Envelopes
	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 EnvelopeMonth

type EnvelopeMonth struct {
	Envelope
	Spent      decimal.Decimal `json:"spent" example:"73.12"`      // The amount spent over the whole month
	Balance    decimal.Decimal `json:"balance" example:"12.32"`    // The balance at the end of the monht
	Allocation decimal.Decimal `json:"allocation" example:"85.44"` // The amount of money allocated
}

EnvelopeMonth contains data about an Envelope for a specific month.

type EnvelopeQueryFilter

type EnvelopeQueryFilter struct {
	BudgetID   string `form:"budget" filterField:"false"` // By budget ID
	CategoryID string `form:"category"`                   // By the ID of the category
	Name       string `form:"name" filterField:"false"`   // By name
	Note       string `form:"note" filterField:"false"`   // By the note
	Archived   bool   `form:"archived"`                   // Is the envelope archived?
	Search     string `form:"search" filterField:"false"` // By string in name or note
	Offset     uint   `form:"offset" filterField:"false"` // The offset of the first Envelope returned. Defaults to 0.
	Limit      int    `form:"limit" filterField:"false"`  // Maximum number of Envelopes to return. Defaults to 50.
}

type EnvelopeResponse

type EnvelopeResponse struct {
	Data  *Envelope `json:"data"`                                                          // Data for the Envelope
	Error *string   `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
}

type ExportResponse added in v5.3.0

type ExportResponse struct {
	Version      string                     `json:"version"`      // The version of the backend the export was made with
	Data         map[string]json.RawMessage `json:"data"`         // The exported data
	CreationTime time.Time                  `json:"creationTime"` // Time the export was created
	Clacks       string                     `json:"clacks"`       // This will always have the value "GNU Terry Pratchett"
}

type Goal

type Goal struct {
	models.DefaultModel
	GoalEditable
	Links GoalLinks `json:"links"`
}

type GoalCreateResponse

type GoalCreateResponse struct {
	Error *string        `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
	Data  []GoalResponse `json:"data"`                                                          // List of created resources
}

type GoalEditable

type GoalEditable struct {
	Name       string          `json:"name" example:"New TV" default:""`                                                                              // Name of the goal
	Note       string          `json:"note" example:"We want to replace the old CRT TV soon-ish" default:""`                                          // Note about the goal
	EnvelopeID uuid.UUID       `json:"envelopeId" example:"f81566d9-af4d-4f13-9830-c62c4b5e4c7e"`                                                     // The ID of the envelope this goal is for
	Amount     decimal.Decimal `json:"amount" example:"750" minimum:"0.00000001" maximum:"999999999999.99999999" multipleOf:"0.00000001" default:"0"` // How much money should be saved for this goal?
	Month      types.Month     `json:"month" example:"2024-07-01T00:00:00.000000Z"`                                                                   // The month the goal should be reached
	Archived   bool            `json:"archived" example:"true" default:"false"`                                                                       // If this goal is still in use or not
}
type GoalLinks struct {
	Self     string `json:"self" example:"https://example.com/api/v4/goals/438cc6c0-9baf-49fd-a75a-d76bd5cab19c"`         // The Goal itself
	Envelope string `json:"envelope" example:"https://example.com/api/v4/envelopes/c1a96ae4-80e3-4827-8ed0-c7656f224fee"` // The Envelope this goal references
}

type GoalListResponse

type GoalListResponse struct {
	Data       []Goal      `json:"data"`                                                          // List of resources
	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 GoalQueryFilter

type GoalQueryFilter struct {
	BudgetID          string          `form:"budget" filterField:"false"`            // By budget ID
	CategoryID        string          `form:"category" filterField:"false"`          // By category ID
	Name              string          `form:"name" filterField:"false"`              // By name
	Note              string          `form:"note" filterField:"false"`              // By the note
	Search            string          `form:"search" filterField:"false"`            // By string in name or note
	Archived          bool            `form:"archived"`                              // Is the goal archived?
	EnvelopeID        string          `form:"envelope"`                              // ID of the envelope
	Month             string          `form:"month"`                                 // Exact month
	FromMonth         string          `form:"fromMonth" filterField:"false"`         // From this month
	UntilMonth        string          `form:"untilMonth" filterField:"false"`        // Until this month
	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
	Offset            uint            `form:"offset" filterField:"false"`            // The offset of the first goal returned. Defaults to 0.
	Limit             int             `form:"limit" filterField:"false"`             // Maximum number of goals to return. Defaults to 50.
}

type GoalResponse

type GoalResponse struct {
	Error *string `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
	Data  *Goal   `json:"data"`                                                          // The resource
}
type ImportLinks struct {
	Ynab4             string `json:"transactions" example:"https://example.com/api/v4/import/ynab4"`             // URL of YNAB4 import endpoint
	YnabImportPreview string `json:"matchRules" example:"https://example.com/api/v4/import/ynab-import-preview"` // URL of YNAB Import preview endpoint
}

type ImportPreviewList

type ImportPreviewList struct {
	Data  []TransactionPreview `json:"data"`                                                          // List of transaction previews
	Error *string              `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred for this Match Rule
}

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 ImportResponse

type ImportResponse struct {
	Links ImportLinks `json:"links"` // Links for the v4 API
}
type Links struct {
	Accounts     string `json:"accounts" example:"https://example.com/api/v4/accounts"`         // URL of Account collection endpoint
	Budgets      string `json:"budgets" example:"https://example.com/api/v4/budgets"`           // URL of Budget collection endpoint
	Categories   string `json:"categories" example:"https://example.com/api/v4/categories"`     // URL of Category collection endpoint
	Envelopes    string `json:"envelopes" example:"https://example.com/api/v4/envelopes"`       // URL of Envelope collection endpoint
	Goals        string `json:"goals" example:"https://example.com/api/v4/goals"`               // URL of goal collection endpoint
	Import       string `json:"import" example:"https://example.com/api/v4/import"`             // URL of import list endpoint
	MatchRules   string `json:"matchRules" example:"https://example.com/api/v4/match-rules"`    // URL of Match Rule collection endpoint
	Months       string `json:"months" example:"https://example.com/api/v4/months"`             // URL of Month endpoint
	Transactions string `json:"transactions" example:"https://example.com/api/v4/transactions"` // URL of Transaction collection endpoint
}

type MatchRule

type MatchRule struct {
	models.DefaultModel
	MatchRuleEditable
	Links MatchRuleLinks `json:"links"`
}

MatchRule is the API representation of a Match Rule.

type MatchRuleCreateResponse

type MatchRuleCreateResponse struct {
	Error *string             `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
	Data  []MatchRuleResponse `json:"data"`                                                          // List of created Match Rules
}

type MatchRuleEditable

type MatchRuleEditable struct {
	AccountID uuid.UUID `json:"accountId" example:"f9e873c2-fb96-4367-bfb6-7ecd9bf4a6b5"` // The account to map matching transactions to
	Priority  uint      `json:"priority" example:"3"`                                     // The priority of the match rule
	Match     string    `json:"match" example:"Bank*"`                                    // The matching applied to the opposite account. This is a glob pattern. Multiple globs are allowed. Globbing is case sensitive.
}
type MatchRuleLinks struct {
	Self string `json:"self" example:"https://example.com/api/v4/match-rules/95685c82-53c6-455d-b235-f49960b73b21"` // The match rule itself
}

type MatchRuleListResponse

type MatchRuleListResponse struct {
	Data       []MatchRule `json:"data"`                                                          // List of Match Rules
	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 MatchRuleQueryFilter

type MatchRuleQueryFilter struct {
	BudgetID  string `form:"budget" filterField:"false"` // By budget ID
	Priority  uint   `form:"priority"`                   // By priority
	Match     string `form:"match" filterField:"false"`  // By match
	AccountID string `form:"account"`                    // By ID of the Account they map to
	Offset    uint   `form:"offset" filterField:"false"` // The offset of the first Match Rule returned. Defaults to 0.
	Limit     int    `form:"limit" filterField:"false"`  // Maximum number of Match Rules to return. Defaults to 50.
}

MatchRuleQueryFilter contains the fields that Match Rules can be filtered with.

type MatchRuleResponse

type MatchRuleResponse struct {
	Error *string    `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred for this Match Rule
	Data  *MatchRule `json:"data"`                                                          // The Match Rule data, if creation was successful
}

type Month

type Month struct {
	ID         uuid.UUID           `json:"id" example:"1e777d24-3f5b-4c43-8000-04f65f895578"` // The ID of the Budget
	Name       string              `json:"name" example:"Zero budget"`                        // The name of the Budget
	Month      types.Month         `json:"month" example:"2006-05-01T00:00:00.000000Z"`       // The month
	Income     decimal.Decimal     `json:"income" example:"2317.34"`                          // The total income for the month (sum of all incoming transactions without an Envelope)
	Available  decimal.Decimal     `json:"available" example:"217.34"`                        // The amount available to budget
	Balance    decimal.Decimal     `json:"balance" example:"5231.37"`                         // The sum of all envelope balances
	Spent      decimal.Decimal     `json:"spent" example:"133.70"`                            // The amount of money spent in this month
	Allocation decimal.Decimal     `json:"allocation" example:"1200.50"`                      // The sum of all allocations for this month
	Categories []CategoryEnvelopes `json:"categories"`                                        // A list of envelope month calculations grouped by category
}

type MonthConfig

type MonthConfig struct {
	MonthConfigEditable
	EnvelopeID uuid.UUID        // We do not use the default model here, we use envelope ID and month
	Month      types.Month      // We do not use the default model here, we use envelope ID and month
	Links      MonthConfigLinks `json:"links"`
}

type MonthConfigEditable

type MonthConfigEditable struct {
	EnvelopeID uuid.UUID       `json:"envelopeId" gorm:"primaryKey" example:"10b9705d-3356-459e-9d5a-28d42a6c4547"`                                      // ID of the envelope
	Month      types.Month     `json:"month" gorm:"primaryKey" example:"1969-06-01T00:00:00.000000Z"`                                                    // The month. This is always set to 00:00 UTC on the first of the month.
	Allocation decimal.Decimal `json:"allocation" gorm:"-" example:"22.01" minimum:"0.00000001" maximum:"999999999999.99999999" multipleOf:"0.00000001"` // The maximum value is "999999999999.99999999", swagger unfortunately rounds this.
	Note       string          `json:"note" example:"Added 200€ here because we replaced Tim's expensive vase" default:""`                               // A note for the month config
}
type MonthConfigLinks struct {
	Self     string `json:"self" example:"https://example.com/api/v4/envelopes/61027ebb-ab75-4a49-9e23-a104ddd9ba6b/2017-10"` // The Month Config itself
	Envelope string `json:"envelope" example:"https://example.com/api/v4/envelopes/61027ebb-ab75-4a49-9e23-a104ddd9ba6b"`     // The Envelope this config belongs to
}

type MonthConfigListResponse

type MonthConfigListResponse struct {
	Data       []MonthConfig `json:"data"`                                                          // List of Month Configs
	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 MonthConfigResponse

type MonthConfigResponse struct {
	Data  *MonthConfig `json:"data"`                                                          // Config for the month
	Error *string      `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
}

type MonthResponse

type MonthResponse struct {
	Data  *Month  `json:"data"`  // Data for the month
	Error *string `json:"error"` // The error, if any occurred
}

type Pagination

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 QueryMonth struct {
	Month time.Time `form:"month" time_format:"2006-01" time_utc:"1" example:"2022-07"` // Year and month
}

type RecentEnvelope

type RecentEnvelope struct {
	ID       *uuid.UUID `json:"id"`
	Name     string     `json:"name"`
	Archived bool       `json:"archived"`
}

type RecentEnvelopesResponse

type RecentEnvelopesResponse struct {
	Data  []RecentEnvelope `json:"data"`                                                          // Data for the account
	Error *string          `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred for this transaction
}

type Response

type Response struct {
	Links Links `json:"links"` // Links for the v4 API
}

type Transaction

type Transaction struct {
	models.DefaultModel
	TransactionEditable
	Links TransactionLinks `json:"links"`
}

Transaction is the representation of a Transaction in API v4.

type TransactionCreateResponse

type TransactionCreateResponse struct {
	Error *string               `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred
	Data  []TransactionResponse `json:"data"`                                                          // List of created Transactions
}

type TransactionDirection added in v5.2.0

type TransactionDirection string

swagger:enum TransactionDirection

const (
	DirectionIncoming TransactionDirection = "INCOMING"
	DirectionOutgoing TransactionDirection = "OUTGOING"
	DirectionTransfer TransactionDirection = "TRANSFER"
)

type TransactionEditable

type TransactionEditable struct {
	Date time.Time `json:"date" example:"1815-12-10T18:43:00.271152Z"` // Date of the transaction. Time is currently only used for sorting

	// The maximum value is "999999999999.99999999", swagger unfortunately rounds this.
	Amount decimal.Decimal `json:"amount" example:"14.03" minimum:"0.00000001" maximum:"999999999999.99999999" multipleOf:"0.00000001"` // The amount for the transaction

	Note                  string     `json:"note" example:"Lunch" default:""`                                     // A note
	SourceAccountID       uuid.UUID  `json:"sourceAccountId" example:"fd81dc45-a3a2-468e-a6fa-b2618f30aa45"`      // ID of the source account
	DestinationAccountID  uuid.UUID  `json:"destinationAccountId" example:"8e16b456-a719-48ce-9fec-e115cfa7cbcc"` // ID of the destination account
	EnvelopeID            *uuid.UUID `json:"envelopeId" example:"2649c965-7999-4873-ae16-89d5d5fa972e"`           // ID of the envelope
	ReconciledSource      bool       `json:"reconciledSource" example:"true" default:"false"`                     // Is the transaction reconciled in the source account?
	ReconciledDestination bool       `json:"reconciledDestination" example:"true" default:"false"`                // Is the transaction reconciled in the destination account?

	AvailableFrom types.Month `json:"availableFrom" example:"2021-11-17T00:00:00Z"` // The date from which on the transaction amount is available for budgeting. Only used for income transactions. Defaults to the transaction date.

	ImportHash string `json:"importHash" example:"867e3a26dc0baf73f4bff506f31a97f6c32088917e9e5cf1a5ed6f3f84a6fa70" default:""` // The SHA256 hash of a unique combination of values to use in duplicate detection
}
type TransactionLinks struct {
	Self string `json:"self" example:"https://example.com/api/v4/transactions/d430d7c3-d14c-4712-9336-ee56965a6673"` // The transaction itself
}

type TransactionListResponse

type TransactionListResponse struct {
	Data       []Transaction `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 TransactionPreview

type TransactionPreview struct {
	Transaction             Transaction `json:"transaction"`
	SourceAccountName       string      `json:"sourceAccountName" example:"Employer"`                       // Name of the source account from the CSV file
	DestinationAccountName  string      `json:"destinationAccountName" example:"Deutsche Bahn"`             // Name of the destination account from the CSV file
	DuplicateTransactionIDs []uuid.UUID `json:"duplicateTransactionIds"`                                    // IDs of transactions that this transaction duplicates
	MatchRuleID             *uuid.UUID  `json:"matchRuleId" example:"042d101d-f1de-4403-9295-59dc0ea58677"` // ID of the match rule that was applied to this transaction preview
}

TransactionPreview is used to preview transactions that will be imported to allow for editing.

type TransactionQueryFilter

type TransactionQueryFilter struct {
	AvailableFromDate      time.Time            `form:"availableFromDate" filterField:"false"`      // Exact date. Time is ignored.
	AvailableFromFromDate  time.Time            `form:"availableFromFromDate" filterField:"false"`  // From this date. Time is ignored.
	AvailableFromUntilDate time.Time            `form:"availableFromUntilDate" filterField:"false"` // Until this date. Time is ignored.
	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" filterField:"false"`                 // ID of the budget
	SourceAccountID        string               `form:"source"`                                     // ID of the source account
	DestinationAccountID   string               `form:"destination"`                                // ID of the destination account
	Direction              TransactionDirection `form:"direction" filterField:"false"`              // Direction of the transaction
	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.
}

type TransactionResponse

type TransactionResponse struct {
	Error *string      `json:"error" example:"the specified resource ID is not a valid UUID"` // The error, if any occurred for this transaction
	Data  *Transaction `json:"data"`                                                          // The Transaction data, if creation was successful
}

type URIMonth

type URIMonth struct {
	Month time.Time `uri:"month" time_format:"2006-01" time_utc:"1" example:"2013-11"` // Year and month
}

type URITime

type URITime struct {
	Time time.Time `uri:"time" example:"2024-01-07T18:43:00.271152Z"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL