controllers

package
v4.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCreateResponseV3

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

type AccountCreateV3

type AccountCreateV3 struct {
	Name               string          `json:"name" example:"Cash" default:"" gorm:"uniqueIndex:account_name_budget_id"`                          // 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" gorm:"uniqueIndex:account_name_budget_id"` // 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 `json:"initialBalance" example:"173.12" default:"0"`                                                       // Balance of the account before any transactions were recorded
	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
}

AccountCreateV3 represents all user configurable parameters

func (AccountCreateV3) ToCreate

func (a AccountCreateV3) ToCreate() models.AccountCreate

ToCreate transforms the API representation into the model representation

type AccountListResponseV3

type AccountListResponseV3 struct {
	Data       []AccountV3 `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
}

func (AccountQueryFilter) ToCreate

type AccountQueryFilterV3

type AccountQueryFilterV3 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.
}

func (AccountQueryFilterV3) ToCreate

type AccountResponseV3

type AccountResponseV3 struct {
	Data  *AccountV3 `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 AccountV3

type AccountV3 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/v3/accounts/af892e10-7e0a-4fb8-b1bc-4b6d88401ed2"`                     // The account itself
		Transactions string `json:"transactions" example:"https://example.com/api/v3/transactions?account=af892e10-7e0a-4fb8-b1bc-4b6d88401ed2"` // Transactions referencing the account
	} `json:"links"`
}

AccountV3 is the API v3 representation of an Account in EZ.

type AllocationMode

type AllocationMode string

swagger:enum AllocationMode

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

type BudgetAllocationMode

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

type BudgetCreateResponseV3

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

type BudgetListResponseV3

type BudgetListResponseV3 struct {
	Data       []BudgetV3  `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 BudgetQueryFilterV3

type BudgetQueryFilterV3 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 BudgetResponseV3

type BudgetResponseV3 struct {
	Data  *BudgetV3 `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 BudgetV3

type BudgetV3 struct {
	models.Budget
	Links struct {
		Self         string `json:"self" example:"https://example.com/api/v3/budgets/550dc009-cea6-4c12-b2a5-03446eb7b7cf"`                      // The budget itself
		Accounts     string `json:"accounts" example:"https://example.com/api/v3/accounts?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"`          // Accounts for this budget
		Categories   string `json:"categories" example:"https://example.com/api/v3/categories?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"`      // Categories for this budget
		Envelopes    string `json:"envelopes" example:"https://example.com/api/v3/envelopes?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"`        // Envelopes for this budget
		Transactions string `json:"transactions" example:"https://example.com/api/v3/transactions?budget=550dc009-cea6-4c12-b2a5-03446eb7b7cf"`  // Transactions for this budget
		Month        string `json:"month" example:"https://example.com/api/v3/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"`
}

Budget is the API v3 representation of a Budget.

type CategoryCreateResponseV3

type CategoryCreateResponseV3 struct {
	Data  []CategoryResponseV3 `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 CategoryCreateV3

type CategoryCreateV3 struct {
	Name     string    `json:"name" gorm:"uniqueIndex:category_budget_name" example:"Saving" default:""`                        // Name of the category
	BudgetID uuid.UUID `json:"budgetId" gorm:"uniqueIndex:category_budget_name" 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?
}

CategoryCreateV3 represents all user configurable parameters

func (CategoryCreateV3) ToCreate

func (c CategoryCreateV3) ToCreate() models.CategoryCreate

ToCreate transforms the API representation into the model representation

type CategoryEnvelopesV3

type CategoryEnvelopesV3 struct {
	models.Category
	Envelopes  []EnvelopeMonthV3 `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 CategoryListResponseV3

type CategoryListResponseV3 struct {
	Data       []CategoryV3 `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 CategoryQueryFilterV3

type CategoryQueryFilterV3 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
	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.
}

func (CategoryQueryFilterV3) ToCreate

type CategoryResponseV3

type CategoryResponseV3 struct {
	Data  *CategoryV3 `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 CategoryV3

type CategoryV3 struct {
	models.Category
	Envelopes []EnvelopeV3 `json:"envelopes"` // Envelopes for the category

	Links struct {
		Self      string `json:"self" example:"https://example.com/api/v3/categories/3b1ea324-d438-4419-882a-2fc91d71772f"`              // The category itself
		Envelopes string `json:"envelopes" example:"https://example.com/api/v3/envelopes?category=3b1ea324-d438-4419-882a-2fc91d71772f"` // Envelopes for this category
	} `json:"links"`
}

type Controller

type Controller struct {
	DB *gorm.DB
}

func (Controller) CleanupV3

func (co Controller) CleanupV3(c *gin.Context)

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

func (Controller) CreateAccountsV3

func (co Controller) CreateAccountsV3(c *gin.Context)

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

func (Controller) CreateBudgetsV3

func (co Controller) CreateBudgetsV3(c *gin.Context)

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

func (Controller) CreateCategoriesV3

func (co Controller) CreateCategoriesV3(c *gin.Context)

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

func (Controller) CreateEnvelopesV3

func (co Controller) CreateEnvelopesV3(c *gin.Context)

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

func (Controller) CreateGoalsV3

func (co Controller) CreateGoalsV3(c *gin.Context)

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

func (Controller) CreateMatchRulesV3

func (co Controller) CreateMatchRulesV3(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} MatchRuleCreateResponseV3 @Failure 400 {object} MatchRuleCreateResponseV3 @Failure 404 {object} MatchRuleCreateResponseV3 @Failure 500 {object} MatchRuleCreateResponseV3 @Param matchRules body []models.MatchRuleCreate true "MatchRules" @Router /v3/match-rules [post]

func (Controller) CreateTransactionsV3

func (co Controller) CreateTransactionsV3(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} 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) DeleteAccountV3

func (co Controller) DeleteAccountV3(c *gin.Context)

@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 /v3/accounts/{id} [delete]

func (Controller) DeleteAllocationsV3

func (co Controller) DeleteAllocationsV3(c *gin.Context)

@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 /v3/months [delete]

func (Controller) DeleteBudgetV3

func (co Controller) DeleteBudgetV3(c *gin.Context)

@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 /v3/budgets/{id} [delete]

func (Controller) DeleteCategoryV3

func (co Controller) DeleteCategoryV3(c *gin.Context)

@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 /v3/categories/{id} [delete]

func (Controller) DeleteEnvelopeV3

func (co Controller) DeleteEnvelopeV3(c *gin.Context)

@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 /v3/envelopes/{id} [delete]

func (Controller) DeleteGoalV3

func (co Controller) DeleteGoalV3(c *gin.Context)

@Summary Delete goal @Description Deletes a goal @Tags Goals @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/goals/{id} [delete]

func (Controller) DeleteMatchRuleV3

func (co Controller) DeleteMatchRuleV3(c *gin.Context)

@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 /v3/match-rules/{id} [delete]

func (Controller) DeleteTransactionV3

func (co Controller) DeleteTransactionV3(c *gin.Context)

@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) GetAccountV3

func (co Controller) GetAccountV3(c *gin.Context)

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

func (Controller) GetAccountsV3

func (co Controller) GetAccountsV3(c *gin.Context)

@Summary List accounts @Description Returns a list of accounts @Tags Accounts @Produce json @Success 200 {object} AccountListResponseV3 @Failure 400 {object} AccountListResponseV3 @Failure 500 {object} AccountListResponseV3 @Router /v3/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 (Controller) GetBudgetV3

func (co Controller) GetBudgetV3(c *gin.Context)

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

func (Controller) GetBudgetsV3

func (co Controller) GetBudgetsV3(c *gin.Context)

@Summary List budgets @Description Returns a list of budgets @Tags Budgets @Produce json @Success 200 {object} BudgetListResponseV3 @Failure 500 {object} BudgetListResponseV3 @Router /v3/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 (Controller) GetCategoriesV3

func (co Controller) GetCategoriesV3(c *gin.Context)

@Summary Get categories @Description Returns a list of categories @Tags Categories @Produce json @Success 200 {object} CategoryListResponseV3 @Failure 400 {object} CategoryListResponseV3 @Failure 500 {object} CategoryListResponseV3 @Router /v3/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 (Controller) GetCategoryV3

func (co Controller) GetCategoryV3(c *gin.Context)

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

func (Controller) GetEnvelopeV3

func (co Controller) GetEnvelopeV3(c *gin.Context)

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

func (Controller) GetEnvelopesV3

func (co Controller) GetEnvelopesV3(c *gin.Context)

@Summary Get envelopes @Description Returns a list of envelopes @Tags Envelopes @Produce json @Success 200 {object} EnvelopeListResponseV3 @Failure 400 {object} EnvelopeListResponseV3 @Failure 500 {object} EnvelopeListResponseV3 @Router /v3/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 (Controller) GetGoalV3

func (co Controller) GetGoalV3(c *gin.Context)

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

func (Controller) GetGoalsV3

func (co Controller) GetGoalsV3(c *gin.Context)

@Summary Get goals @Description Returns a list of goals @Tags Goals @Produce json @Success 200 {object} GoalListResponseV3 @Failure 400 {object} GoalListResponseV3 @Failure 500 {object} GoalListResponseV3 @Router /v3/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 (Controller) GetHealthz

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) GetImportV3

func (Controller) GetImportV3(c *gin.Context)

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

func (Controller) GetMatchRuleV3

func (co Controller) GetMatchRuleV3(c *gin.Context)

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

func (Controller) GetMatchRulesV3

func (co Controller) GetMatchRulesV3(c *gin.Context)

@Summary Get matchRules @Description Returns a list of matchRules @Tags MatchRules @Produce json @Success 200 {object} MatchRuleListResponseV3 @Failure 400 {object} MatchRuleListResponseV3 @Failure 500 {object} MatchRuleListResponseV3 @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 /v3/match-rules [get]

func (Controller) GetMonthConfigV3

func (co Controller) GetMonthConfigV3(c *gin.Context)

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

func (Controller) GetMonthV3

func (co Controller) GetMonthV3(c *gin.Context)

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

func (Controller) GetTransactionV3

func (co Controller) GetTransactionV3(c *gin.Context)

@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) GetTransactionsV3

func (co Controller) GetTransactionsV3(c *gin.Context)

@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) ImportYnab4V3

func (co Controller) ImportYnab4V3(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} BudgetResponseV3 @Failure 400 {object} BudgetResponseV3 @Failure 500 {object} BudgetResponseV3 @Param file formData file true "File to import" @Param budgetName query string false "Name of the Budget to create" @Router /v3/import/ynab4 [post]

func (Controller) ImportYnabImportPreviewV3

func (co Controller) ImportYnabImportPreviewV3(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} ImportPreviewListV3 @Failure 400 {object} ImportPreviewListV3 @Failure 404 {object} ImportPreviewListV3 @Failure 500 {object} ImportPreviewListV3 @Param file formData file true "File to import" @Param accountId query string false "ID of the account to import transactions for" @Router /v3/import/ynab-import-preview [post]

func (Controller) OptionsAccountDetailV3

func (co Controller) OptionsAccountDetailV3(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} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param id path string true "ID formatted as string" @Router /v3/accounts/{id} [options].

func (Controller) OptionsAccountListV3

func (co Controller) OptionsAccountListV3(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 /v3/accounts [options].

func (Controller) OptionsBudgetDetailV3

func (co Controller) OptionsBudgetDetailV3(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} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param id path string true "ID formatted as string" @Router /v3/budgets/{id} [options]

func (Controller) OptionsBudgetListV3

func (co Controller) OptionsBudgetListV3(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 /v3/budgets [options]

func (Controller) OptionsCategoryDetailV3

func (co Controller) OptionsCategoryDetailV3(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} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param id path string true "ID formatted as string" @Router /v3/categories/{id} [options]

func (Controller) OptionsCategoryListV3

func (co Controller) OptionsCategoryListV3(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 /v3/categories [options]

func (Controller) OptionsEnvelopeDetailV3

func (co Controller) OptionsEnvelopeDetailV3(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} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param id path string true "ID formatted as string" @Router /v3/envelopes/{id} [options]

func (Controller) OptionsEnvelopeListV3

func (co Controller) OptionsEnvelopeListV3(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 /v3/envelopes [options]

func (Controller) OptionsGoalDetailV3

func (co Controller) OptionsGoalDetailV3(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} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param id path string true "ID formatted as string" @Router /v3/goals/{id} [options]

func (Controller) OptionsGoalsV3

func (co Controller) OptionsGoalsV3(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 /v3/goals [options]

func (Controller) OptionsHealthz

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) OptionsImportV3

func (co Controller) OptionsImportV3(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 /v3/import [options]

func (Controller) OptionsImportYnab4V3

func (co Controller) OptionsImportYnab4V3(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 /v3/import/ynab4 [options]

func (Controller) OptionsImportYnabImportPreviewV3

func (co Controller) OptionsImportYnabImportPreviewV3(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 /v3/import/ynab-import-preview [options]

func (Controller) OptionsMatchRuleDetailV3

func (co Controller) OptionsMatchRuleDetailV3(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} httperrors.HTTPError @Failure 404 {object} httperrors.HTTPError @Failure 500 {object} httperrors.HTTPError @Param id path string true "ID formatted as string" @Router /v3/match-rules/{id} [options]

func (Controller) OptionsMatchRuleListV3

func (co Controller) OptionsMatchRuleListV3(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 /v3/match-rules [options]

func (Controller) OptionsMonthConfigDetailV3

func (co Controller) OptionsMonthConfigDetailV3(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} httperrors.HTTPError @Param id path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Router /v3/envelopes/{id}/{month} [options]

func (Controller) OptionsMonthV3

func (co Controller) OptionsMonthV3(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 /v3/months [options]

func (Controller) OptionsTransactionDetailV3

func (co Controller) OptionsTransactionDetailV3(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} 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) OptionsTransactionsV3

func (co Controller) OptionsTransactionsV3(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 /v3/transactions [options]

func (Controller) RegisterAccountRoutesV3

func (co Controller) RegisterAccountRoutesV3(r *gin.RouterGroup)

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

func (Controller) RegisterBudgetRoutesV3

func (co Controller) RegisterBudgetRoutesV3(r *gin.RouterGroup)

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

func (Controller) RegisterCategoryRoutesV3

func (co Controller) RegisterCategoryRoutesV3(r *gin.RouterGroup)

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

func (Controller) RegisterEnvelopeRoutesV3

func (co Controller) RegisterEnvelopeRoutesV3(r *gin.RouterGroup)

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

func (Controller) RegisterGoalRoutesV3

func (co Controller) RegisterGoalRoutesV3(r *gin.RouterGroup)

func (Controller) RegisterHealthzRoutes

func (co Controller) RegisterHealthzRoutes(r *gin.RouterGroup)

RegisterHealthzRoutes registers the routes for the healthz endpoint.

func (Controller) RegisterImportRoutesV3

func (co Controller) RegisterImportRoutesV3(r *gin.RouterGroup)

RegisterImportRoutes registers the routes for imports.

func (Controller) RegisterMatchRuleRoutesV3

func (co Controller) RegisterMatchRuleRoutesV3(r *gin.RouterGroup)

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

func (Controller) RegisterMonthConfigRoutesV3

func (co Controller) RegisterMonthConfigRoutesV3(r *gin.RouterGroup)

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

func (Controller) RegisterMonthRoutesV3

func (co Controller) RegisterMonthRoutesV3(r *gin.RouterGroup)

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

func (Controller) RegisterTransactionRoutesV3

func (co Controller) RegisterTransactionRoutesV3(r *gin.RouterGroup)

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

func (Controller) SetAllocationsV3

func (co Controller) SetAllocationsV3(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} 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 /v3/months [post]

func (Controller) UpdateAccountV3

func (co Controller) UpdateAccountV3(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} AccountResponseV3 @Failure 400 {object} AccountResponseV3 @Failure 404 {object} AccountResponseV3 @Failure 500 {object} AccountResponseV3 @Param id path string true "ID formatted as string" @Param account body AccountCreateV3 true "Account" @Router /v3/accounts/{id} [patch]

func (Controller) UpdateBudgetV3

func (co Controller) UpdateBudgetV3(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} BudgetResponseV3 @Failure 400 {object} BudgetResponseV3 @Failure 404 {object} BudgetResponseV3 @Failure 500 {object} BudgetResponseV3 @Param id path string true "ID formatted as string" @Param budget body models.BudgetCreate true "Budget" @Router /v3/budgets/{id} [patch]

func (Controller) UpdateCategoryV3

func (co Controller) UpdateCategoryV3(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} CategoryResponseV3 @Failure 400 {object} CategoryResponseV3 @Failure 404 {object} CategoryResponseV3 @Failure 500 {object} CategoryResponseV3 @Param id path string true "ID formatted as string" @Param category body CategoryCreateV3 true "Category" @Router /v3/categories/{id} [patch]

func (Controller) UpdateEnvelopeV3

func (co Controller) UpdateEnvelopeV3(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} EnvelopeResponseV3 @Failure 400 {object} EnvelopeResponseV3 @Failure 404 {object} EnvelopeResponseV3 @Failure 500 {object} EnvelopeResponseV3 @Param id path string true "ID formatted as string" @Param envelope body controllers.EnvelopeCreateV3 true "Envelope" @Router /v3/envelopes/{id} [patch]

func (Controller) UpdateGoalV3

func (co Controller) UpdateGoalV3(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} GoalResponseV3 @Failure 400 {object} GoalResponseV3 @Failure 404 {object} GoalResponseV3 @Failure 500 {object} GoalResponseV3 @Param id path string true "ID formatted as string" @Param goal body GoalV3Editable true "Goal" @Router /v3/goals/{id} [patch]

func (Controller) UpdateMatchRuleV3

func (co Controller) UpdateMatchRuleV3(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} MatchRuleResponseV3 @Failure 400 {object} MatchRuleResponseV3 @Failure 404 {object} MatchRuleResponseV3 @Failure 500 {object} MatchRuleResponseV3 @Param id path string true "ID formatted as string" @Param matchRule body models.MatchRuleCreate true "MatchRule" @Router /v3/match-rules/{id} [patch]

func (Controller) UpdateMonthConfigV3

func (co Controller) UpdateMonthConfigV3(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} MonthConfigResponseV3 @Failure 400 {object} MonthConfigResponseV3 @Failure 404 {object} MonthConfigResponseV3 @Failure 500 {object} MonthConfigResponseV3 @Param id path string true "ID of the Envelope" @Param month path string true "The month in YYYY-MM format" @Param monthConfig body MonthConfigCreateV3 true "MonthConfig" @Router /v3/envelopes/{id}/{month} [patch]

func (Controller) UpdateTransactionV3

func (co Controller) UpdateTransactionV3(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} 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 EnvelopeCreateResponseV3

type EnvelopeCreateResponseV3 struct {
	Data  []EnvelopeResponseV3 `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 EnvelopeCreateV3

type EnvelopeCreateV3 struct {
	Name       string    `json:"name" gorm:"uniqueIndex:envelope_category_name" example:"Groceries" default:""`                       // Name of the envelope
	CategoryID uuid.UUID `json:"categoryId" gorm:"uniqueIndex:envelope_category_name" 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?
}

EnvelopeCreateV3 represents all user configurable parameters

func (EnvelopeCreateV3) ToCreate

func (e EnvelopeCreateV3) ToCreate() models.EnvelopeCreate

ToCreate transforms the API representation into the model representation

type EnvelopeListResponseV3

type EnvelopeListResponseV3 struct {
	Data       []EnvelopeV3 `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 EnvelopeMonthResponseV3

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

type EnvelopeMonthV3

type EnvelopeMonthV3 struct {
	models.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
	Links      EnvelopeV3Links `json:"links"`
}

EnvelopeMonthV3 contains data about an Envelope for a specific month.

type EnvelopeQueryFilterV3

type EnvelopeQueryFilterV3 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
	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.
}

func (EnvelopeQueryFilterV3) ToCreate

type EnvelopeResponseV3

type EnvelopeResponseV3 struct {
	Data  *EnvelopeV3 `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 EnvelopeV3

type EnvelopeV3 struct {
	models.Envelope
	Links EnvelopeV3Links `json:"links"` // Links to related resources
}
type EnvelopeV3Links struct {
	Self         string `json:"self" example:"https://example.com/api/v3/envelopes/45b6b5b9-f746-4ae9-b77b-7688b91f8166"`                     // The envelope itself
	Transactions string `json:"transactions" example:"https://example.com/api/v3/transactions?envelope=45b6b5b9-f746-4ae9-b77b-7688b91f8166"` // The envelope's transactions
	Month        string `json:"month" example:"https://example.com/api/v3/envelopes/45b6b5b9-f746-4ae9-b77b-7688b91f8166/YYYY-MM"`            // The MonthConfig for the envelope
}

type GoalCreateResponseV3

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

type GoalListResponseV3

type GoalListResponseV3 struct {
	Data       []GoalV3    `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 GoalQueryFilterV3

type GoalQueryFilterV3 struct {
	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 GoalResponseV3

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

type GoalV3

type GoalV3 struct {
	models.DefaultModel
	GoalV3Editable
	Links GoalV3Links `json:"links"`
}

type GoalV3Editable

type GoalV3Editable 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:"127" 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 balance of the envelope should be the set amount
	Archived   bool            `json:"archived" example:"true" default:"false"`                              // If this goal is still in use or not
}
type GoalV3Links struct {
	Self     string `json:"self" example:"https://example.com/api/v3/goals/438cc6c0-9baf-49fd-a75a-d76bd5cab19c"`         // The Goal itself
	Envelope string `json:"envelope" example:"https://example.com/api/v3/envelopes/c1a96ae4-80e3-4827-8ed0-c7656f224fee"` // The Envelope this goal references
}

type HealthResponse

type HealthResponse struct {
	Error error `json:"error" example:"The database cannot be accessed"`
}

type ImportPreviewListV3

type ImportPreviewListV3 struct {
	Data  []importer.TransactionPreviewV3 `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 ImportV3Links struct {
	Ynab4             string `json:"transactions" example:"https://example.com/api/v3/import/ynab4"`             // URL of YNAB4 import endpoint
	YnabImportPreview string `json:"matchRules" example:"https://example.com/api/v3/import/ynab-import-preview"` // URL of YNAB Import preview endpoint
}

type ImportV3Response

type ImportV3Response struct {
	Links ImportV3Links `json:"links"` // Links for the v3 API
}

type MatchRuleCreateResponseV3

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

type MatchRuleListResponseV3

type MatchRuleListResponseV3 struct {
	Data       []MatchRuleV3 `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 MatchRuleQueryFilterV3

type MatchRuleQueryFilterV3 struct {
	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.

func (MatchRuleQueryFilterV3) Parse

Parse returns a models.MatchRuleCreate struct that represents the MatchRuleQueryFilter.

type MatchRuleResponseV3

type MatchRuleResponseV3 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  *MatchRuleV3 `json:"data"`                                                          // The Match Rule data, if creation was successful
}

type MatchRuleV3

type MatchRuleV3 struct {
	models.MatchRule
	Links struct {
		Self string `json:"self" example:"https://example.com/api/v3/match-rules/95685c82-53c6-455d-b235-f49960b73b21"` // The match rule itself
	} `json:"links"`
}

MatchRuleV3 is the API representation of a Match Rule.

type MonthConfigCreateV3

type MonthConfigCreateV3 struct {
	Note       string          `json:"note" example:"Added 200€ here because we replaced Tim's expensive vase" default:""` // A note for the month config
	Allocation decimal.Decimal ``                                                                                          // The maximum value is "999999999999.99999999", swagger unfortunately rounds this.
	/* 136-byte string literal not displayed */
}

MonthConfigCreateV3 contains the fields relevant for MonthConfigs in APIv3.

func (MonthConfigCreateV3) ToCreate

func (m MonthConfigCreateV3) ToCreate() (create models.MonthConfigCreate)

ToCreate is used to transform the API representation into the model representation

type MonthConfigFilter

type MonthConfigFilter struct {
	EnvelopeID uuid.UUID
	Month      types.Month
}

type MonthConfigListResponseV3

type MonthConfigListResponseV3 struct {
	Data       []MonthConfigV3 `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 MonthConfigResponseV3

type MonthConfigResponseV3 struct {
	Data  *MonthConfigV3 `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 MonthConfigV3

type MonthConfigV3 struct {
	models.MonthConfig
	Links struct {
		Self     string `json:"self" example:"https://example.com/api/v3/envelopes/61027ebb-ab75-4a49-9e23-a104ddd9ba6b/2017-10"` // The Month Config itself
		Envelope string `json:"envelope" example:"https://example.com/api/v3/envelopes/61027ebb-ab75-4a49-9e23-a104ddd9ba6b"`     // The Envelope this config belongs to
	} `json:"links"`
}

type MonthConfigV3Editable

type MonthConfigV3Editable 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 MonthResponseV3

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

type MonthV3

type MonthV3 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 []CategoryEnvelopesV3 `json:"categories"`                                        // A list of envelope month calculations grouped by category
}

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 TransactionCreateResponseV3

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 TransactionListResponseV3

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 TransactionQueryFilterV3

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

ToCreate parses the query string and returns a TransactionCreate struct for the database request. On error, it returns httperrors.ErrorStatus struct with.

type TransactionResponseV3

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 TransactionV3

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.

type URIMonth

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

Jump to

Keyboard shortcuts

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