models

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 7 Imported by: 24

Documentation

Index

Constants

View Source
const LevelOneAccountParentId = 0

LevelOneAccountParentId represents the parent id of level-one account

View Source
const LevelOneTransactionCategoryParentId = 0

LevelOneTransactionCategoryParentId represents the parent id of level-one transaction category

View Source
const MaximumPicturesCountOfTransaction = 10
View Source
const MaximumTagsCountOfTransaction = 10
View Source
const TokenMaxUserAgentLength = 255

TokenMaxUserAgentLength represents the maximum size of user agent stored in database

View Source
const TransactionNoTagFilterValue = "none"

TransactionTagFilterValue represents transaction tag filter value for no tag

View Source
const TransactionPictureNewPictureTransactionId = int64(0)
View Source
const UserCustomExchangeRateFactorInDatabase = int64(100000000)

Variables

View Source
var ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES = map[string]UserApplicationCloudSettingType{

	"showAccountBalance":          USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
	"autoUpdateExchangeRatesData": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,

	"showAddTransactionButtonInDesktopNavbar": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,

	"showAmountInHomePage":                        USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
	"timezoneUsedForStatisticsInHomePage":         USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"overviewAccountFilterInHomePage":             USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP,
	"overviewTransactionCategoryFilterInHomePage": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP,

	"itemsCountInTransactionListPage":      USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"showTotalAmountInTransactionListPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
	"showTagInTransactionListPage":         USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,

	"quickSaveButtonStyleInMobileTransactionListPage":          USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"quickAddButtonActionInMobileTransactionEditPage":          USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"autoSaveTransactionDraft":                                 USER_APPLICATION_CLOUD_SETTING_TYPE_STRING,
	"autoGetCurrentGeoLocation":                                USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
	"alwaysShowTransactionPicturesInMobileTransactionEditPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,

	"rememberLastSelectedFileTypeInImportTransactionDialog": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
	"lastSelectedFileTypeInImportTransactionDialog":         USER_APPLICATION_CLOUD_SETTING_TYPE_STRING,

	"insightsExplorerDefaultDateRangeType": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"showTagInInsightsExplorerPage":        USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,

	"totalAmountExcludeAccountIds":  USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP,
	"accountCategoryOrders":         USER_APPLICATION_CLOUD_SETTING_TYPE_STRING,
	"hideCategoriesWithoutAccounts": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,

	"currencySortByInExchangeRatesPage": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,

	"mapCacheExpiration":               USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"exchangeRatesDataCacheExpiration": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,

	"statistics.defaultChartDataType":                 USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"statistics.defaultTimezoneType":                  USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"statistics.defaultAccountFilter":                 USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP,
	"statistics.defaultTransactionCategoryFilter":     USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP,
	"statistics.defaultSortingType":                   USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"statistics.defaultCategoricalChartType":          USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"statistics.defaultCategoricalChartDataRangeType": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"statistics.defaultTrendChartType":                USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"statistics.defaultTrendChartDataRangeType":       USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"statistics.defaultAssetTrendsChartType":          USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
	"statistics.defaultAssetTrendsChartDataRangeType": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
}

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountId       int64           `xorm:"PK"`
	Uid             int64           `xorm:"INDEX(IDX_account_uid_deleted_parent_account_id_order) NOT NULL"`
	Deleted         bool            `xorm:"INDEX(IDX_account_uid_deleted_parent_account_id_order) NOT NULL"`
	Category        AccountCategory `xorm:"NOT NULL"`
	Type            AccountType     `xorm:"NOT NULL"`
	ParentAccountId int64           `xorm:"INDEX(IDX_account_uid_deleted_parent_account_id_order) NOT NULL"`
	Name            string          `xorm:"VARCHAR(64) NOT NULL"`
	DisplayOrder    int32           `xorm:"INDEX(IDX_account_uid_deleted_parent_account_id_order) NOT NULL"`
	Icon            int64           `xorm:"NOT NULL"`
	Color           string          `xorm:"VARCHAR(6) NOT NULL"`
	Currency        string          `xorm:"VARCHAR(3) NOT NULL"`
	Balance         int64           `xorm:"NOT NULL"`
	Comment         string          `xorm:"VARCHAR(255) NOT NULL"`
	Extend          *AccountExtend  `xorm:"BLOB"`
	Hidden          bool            `xorm:"NOT NULL"`
	CreatedUnixTime int64
	UpdatedUnixTime int64
	DeletedUnixTime int64
}

Account represents account data stored in database

func (*Account) ToAccountInfoResponse

func (a *Account) ToAccountInfoResponse() *AccountInfoResponse

ToAccountInfoResponse returns a view-object according to database model

type AccountCategory

type AccountCategory byte

AccountCategory represents account category

const (
	ACCOUNT_CATEGORY_CASH                   AccountCategory = 1
	ACCOUNT_CATEGORY_CHECKING_ACCOUNT       AccountCategory = 2
	ACCOUNT_CATEGORY_CREDIT_CARD            AccountCategory = 3
	ACCOUNT_CATEGORY_VIRTUAL                AccountCategory = 4
	ACCOUNT_CATEGORY_DEBT                   AccountCategory = 5
	ACCOUNT_CATEGORY_RECEIVABLES            AccountCategory = 6
	ACCOUNT_CATEGORY_INVESTMENT             AccountCategory = 7
	ACCOUNT_CATEGORY_SAVINGS_ACCOUNT        AccountCategory = 8
	ACCOUNT_CATEGORY_CERTIFICATE_OF_DEPOSIT AccountCategory = 9
)

Account categories

func (AccountCategory) IsAsset added in v1.0.0

func (c AccountCategory) IsAsset() bool

IsAsset returns whether the account category is an asset category

func (AccountCategory) IsLiability added in v1.0.0

func (c AccountCategory) IsLiability() bool

IsLiability returns whether the account category is a liability category

type AccountCreateRequest

type AccountCreateRequest struct {
	Name                    string                  `json:"name" binding:"required,notBlank,max=64"`
	Category                AccountCategory         `json:"category" binding:"required"`
	Type                    AccountType             `json:"type" binding:"required"`
	Icon                    int64                   `json:"icon,string" binding:"required,min=1"`
	Color                   string                  `json:"color" binding:"required,len=6,validHexRGBColor"`
	Currency                string                  `json:"currency" binding:"required,len=3,validCurrency"`
	Balance                 int64                   `json:"balance"`
	BalanceTime             int64                   `json:"balanceTime"`
	Comment                 string                  `json:"comment" binding:"max=255"`
	CreditCardStatementDate int                     `json:"creditCardStatementDate" binding:"min=0,max=28"`
	SubAccounts             []*AccountCreateRequest `json:"subAccounts" binding:"omitempty"`
	ClientSessionId         string                  `json:"clientSessionId"`
}

AccountCreateRequest represents all parameters of account creation request

type AccountDeleteRequest

type AccountDeleteRequest struct {
	Id int64 `json:"id,string" binding:"required,min=1"`
}

AccountDeleteRequest represents all parameters of account deleting request

type AccountExtend added in v0.7.0

type AccountExtend struct {
	CreditCardStatementDate *int `json:"creditCardStatementDate"`
}

AccountExtend represents account extend data stored in database

func (*AccountExtend) FromDB added in v0.7.0

func (a *AccountExtend) FromDB(data []byte) error

FromDB fills the fields from the data stored in database

func (*AccountExtend) ToDB added in v0.7.0

func (a *AccountExtend) ToDB() ([]byte, error)

ToDB returns the actual stored data in database

type AccountGetRequest

type AccountGetRequest struct {
	Id int64 `form:"id,string" binding:"required,min=1"`
}

AccountGetRequest represents all parameters of account getting request

type AccountHideRequest

type AccountHideRequest struct {
	Id     int64 `json:"id,string" binding:"required,min=1"`
	Hidden bool  `json:"hidden"`
}

AccountHideRequest represents all parameters of account hiding request

type AccountInfoResponse

type AccountInfoResponse struct {
	Id                      int64                    `json:"id,string"`
	Name                    string                   `json:"name"`
	ParentId                int64                    `json:"parentId,string"`
	Category                AccountCategory          `json:"category"`
	Type                    AccountType              `json:"type"`
	Icon                    int64                    `json:"icon,string"`
	Color                   string                   `json:"color"`
	Currency                string                   `json:"currency"`
	Balance                 int64                    `json:"balance"`
	Comment                 string                   `json:"comment"`
	CreditCardStatementDate *int                     `json:"creditCardStatementDate,omitempty"`
	DisplayOrder            int32                    `json:"displayOrder"`
	IsAsset                 bool                     `json:"isAsset,omitempty"`
	IsLiability             bool                     `json:"isLiability,omitempty"`
	Hidden                  bool                     `json:"hidden"`
	SubAccounts             AccountInfoResponseSlice `json:"subAccounts,omitempty"`
}

AccountInfoResponse represents a view-object of account

type AccountInfoResponseSlice

type AccountInfoResponseSlice []*AccountInfoResponse

AccountInfoResponseSlice represents the slice data structure of AccountInfoResponse

func (AccountInfoResponseSlice) Len

func (a AccountInfoResponseSlice) Len() int

Len returns the count of items

func (AccountInfoResponseSlice) Less

func (a AccountInfoResponseSlice) Less(i, j int) bool

Less reports whether the first item is less than the second one

func (AccountInfoResponseSlice) Swap

func (a AccountInfoResponseSlice) Swap(i, j int)

Swap swaps two items

type AccountListRequest

type AccountListRequest struct {
	VisibleOnly bool `form:"visible_only"`
}

AccountListRequest represents all parameters of account listing request

type AccountModifyRequest

type AccountModifyRequest struct {
	Id                      int64                   `json:"id,string" binding:"required,min=0"`
	Name                    string                  `json:"name" binding:"required,notBlank,max=64"`
	Category                AccountCategory         `json:"category" binding:"required"`
	Icon                    int64                   `json:"icon,string" binding:"min=1"`
	Color                   string                  `json:"color" binding:"required,len=6,validHexRGBColor"`
	Currency                *string                 `json:"currency" binding:"omitempty,len=3,validCurrency"`
	Balance                 *int64                  `json:"balance" binding:"omitempty"`
	BalanceTime             *int64                  `json:"balanceTime" binding:"omitempty"`
	Comment                 string                  `json:"comment" binding:"max=255"`
	CreditCardStatementDate int                     `json:"creditCardStatementDate" binding:"min=0,max=28"`
	Hidden                  bool                    `json:"hidden"`
	SubAccounts             []*AccountModifyRequest `json:"subAccounts" binding:"omitempty"`
	ClientSessionId         string                  `json:"clientSessionId"`
}

AccountModifyRequest represents all parameters of account modification request

type AccountMoveRequest

type AccountMoveRequest struct {
	NewDisplayOrders []*AccountNewDisplayOrderRequest `json:"newDisplayOrders" binding:"required,min=1"`
}

AccountMoveRequest represents all parameters of account moving request

type AccountNewDisplayOrderRequest

type AccountNewDisplayOrderRequest struct {
	Id           int64 `json:"id,string" binding:"required,min=1"`
	DisplayOrder int32 `json:"displayOrder"`
}

AccountNewDisplayOrderRequest represents a data pair of id and display order

type AccountType

type AccountType byte

AccountType represents account type

const (
	ACCOUNT_TYPE_SINGLE_ACCOUNT     AccountType = 1
	ACCOUNT_TYPE_MULTI_SUB_ACCOUNTS AccountType = 2
)

Account types

type AmountColorType added in v0.5.0

type AmountColorType byte

AmountColorType represents the type of amount color in frontend

const (
	AMOUNT_COLOR_TYPE_DEFAULT        AmountColorType = 0
	AMOUNT_COLOR_TYPE_GREEN          AmountColorType = 1
	AMOUNT_COLOR_TYPE_RED            AmountColorType = 2
	AMOUNT_COLOR_TYPE_YELLOW         AmountColorType = 3
	AMOUNT_COLOR_TYPE_BLACK_OR_WHITE AmountColorType = 4
	AMOUNT_COLOR_TYPE_INVALID        AmountColorType = 255
)

Amount Color Types

func (AmountColorType) String added in v0.5.0

func (s AmountColorType) String() string

String returns a textual representation of the amount color type enum

type ApplicationCloudSetting added in v0.10.0

type ApplicationCloudSetting struct {
	SettingKey   string `json:"settingKey"`
	SettingValue string `json:"settingValue"`
}

ApplicationCloudSetting represents one application cloud setting

type ApplicationCloudSettingSlice added in v0.10.0

type ApplicationCloudSettingSlice []ApplicationCloudSetting

ApplicationCloudSettingSlice represents the slice data structure of ApplicationCloudSetting

func (*ApplicationCloudSettingSlice) FromDB added in v0.10.0

func (s *ApplicationCloudSettingSlice) FromDB(data []byte) error

FromDB fills the fields from the data stored in database

func (ApplicationCloudSettingSlice) Len added in v0.10.0

Len returns the count of items

func (ApplicationCloudSettingSlice) Less added in v0.10.0

func (s ApplicationCloudSettingSlice) Less(i, j int) bool

Less reports whether the first item is less than the second one

func (ApplicationCloudSettingSlice) Swap added in v0.10.0

func (s ApplicationCloudSettingSlice) Swap(i, j int)

Swap swaps two items

func (*ApplicationCloudSettingSlice) ToDB added in v0.10.0

func (s *ApplicationCloudSettingSlice) ToDB() ([]byte, error)

ToDB returns the actual stored data in database

type AuthResponse

type AuthResponse struct {
	Token                    string                        `json:"token"`
	Need2FA                  bool                          `json:"need2FA"`
	User                     *UserBasicInfo                `json:"user"`
	ApplicationCloudSettings *ApplicationCloudSettingSlice `json:"applicationCloudSettings,omitempty"`
	NotificationContent      string                        `json:"notificationContent,omitempty"`
}

AuthResponse returns a view-object of user authorization

type ClearAccountTransactionsRequest added in v1.1.0

type ClearAccountTransactionsRequest struct {
	AccountId int64  `json:"accountId,string" binding:"required,min=1"`
	Password  string `json:"password" binding:"omitempty,min=6,max=128"`
}

ClearAccountTransactionsRequest represents all parameters of clear transaction data of a specific account request

type ClearDataRequest

type ClearDataRequest struct {
	Password string `json:"password" binding:"omitempty,min=6,max=128"`
}

ClearDataRequest represents all parameters of clear user data request

type DataStatisticsResponse added in v0.2.0

type DataStatisticsResponse struct {
	TotalAccountCount              int64 `json:"totalAccountCount,string"`
	TotalTransactionCategoryCount  int64 `json:"totalTransactionCategoryCount,string"`
	TotalTransactionTagCount       int64 `json:"totalTransactionTagCount,string"`
	TotalTransactionCount          int64 `json:"totalTransactionCount,string"`
	TotalTransactionPictureCount   int64 `json:"totalTransactionPictureCount,string"`
	TotalInsightsExplorerCount     int64 `json:"totalInsightsExplorerCount,string"`
	TotalTransactionTemplateCount  int64 `json:"totalTransactionTemplateCount,string"`
	TotalScheduledTransactionCount int64 `json:"totalScheduledTransactionCount,string"`
}

DataStatisticsResponse represents a view-object of user data statistic

type ExportTransactionDataRequest added in v0.10.0

type ExportTransactionDataRequest struct {
	Type         TransactionType `form:"type" binding:"min=0,max=4"`
	CategoryIds  string          `form:"category_ids"`
	AccountIds   string          `form:"account_ids"`
	TagFilter    string          `form:"tag_filter" binding:"validTagFilter"`
	AmountFilter string          `form:"amount_filter" binding:"validAmountFilter"`
	Keyword      string          `form:"keyword"`
	MaxTime      int64           `form:"max_time" binding:"min=0"` // Unix timestamp in seconds
	MinTime      int64           `form:"min_time" binding:"min=0"` // Unix timestamp in seconds
}

ExportTransactionDataRequest represents export transaction request

type ForgetPasswordRequest added in v0.4.0

type ForgetPasswordRequest struct {
	Email string `json:"email" binding:"required,notBlank,max=100,validEmail"`
}

ForgetPasswordRequest represents all parameters of forget password request

type ImportTransaction added in v0.6.0

type ImportTransaction struct {
	*Transaction
	TagIds                             []string
	OriginalCategoryName               string
	OriginalSourceAccountName          string
	OriginalSourceAccountCurrency      string
	OriginalDestinationAccountName     string
	OriginalDestinationAccountCurrency string
	OriginalTagNames                   []string
}

ImportTransaction represents the imported transaction data

func (ImportTransaction) ToImportTransactionResponse added in v0.6.0

func (t ImportTransaction) ToImportTransactionResponse() *ImportTransactionResponse

ToImportTransactionResponse returns the a view-objects according to imported transaction data

type ImportTransactionRequest added in v1.1.0

type ImportTransactionRequest struct {
	Transactions []*ImportTransactionRequestItem
}

ImportTransactionRequest represents all parameters of the imported transaction data

type ImportTransactionRequestItem added in v1.1.0

type ImportTransactionRequestItem struct {
	Time                   string `json:"time"`
	UtcOffset              string `json:"utcOffset"`
	Type                   string `json:"type"`
	CategoryName           string `json:"categoryName,omitempty"`
	SourceAccountName      string `json:"sourceAccountName,omitempty"`
	DestinationAccountName string `json:"destinationAccountName,omitempty"`
	SourceAmount           string `json:"sourceAmount"`
	DestinationAmount      string `json:"destinationAmount,omitempty"`
	GeoLocation            string `json:"geoLocation,omitempty"`
	TagNames               string `json:"tagNames,omitempty"`
	Comment                string `json:"comment,omitempty"`
}

ImportTransactionRequestItem represents a single item of the imported transaction data

type ImportTransactionResponse added in v0.6.0

type ImportTransactionResponse struct {
	Type                               TransactionType                 `json:"type"`
	CategoryId                         int64                           `json:"categoryId,string"`
	OriginalCategoryName               string                          `json:"originalCategoryName"`
	Time                               int64                           `json:"time"`
	UtcOffset                          int16                           `json:"utcOffset"`
	SourceAccountId                    int64                           `json:"sourceAccountId,string"`
	OriginalSourceAccountName          string                          `json:"originalSourceAccountName"`
	OriginalSourceAccountCurrency      string                          `json:"originalSourceAccountCurrency"`
	DestinationAccountId               int64                           `json:"destinationAccountId,string,omitempty"`
	OriginalDestinationAccountName     string                          `json:"originalDestinationAccountName,omitempty"`
	OriginalDestinationAccountCurrency string                          `json:"originalDestinationAccountCurrency,omitempty"`
	SourceAmount                       int64                           `json:"sourceAmount"`
	DestinationAmount                  int64                           `json:"destinationAmount,omitempty"`
	TagIds                             []string                        `json:"tagIds"`
	OriginalTagNames                   []string                        `json:"originalTagNames"`
	Comment                            string                          `json:"comment"`
	GeoLocation                        *TransactionGeoLocationResponse `json:"geoLocation,omitempty"`
}

ImportTransactionResponse represents a view-object of the imported transaction data

type ImportTransactionResponsePageWrapper added in v0.6.0

type ImportTransactionResponsePageWrapper struct {
	Items      []*ImportTransactionResponse `json:"items"`
	TotalCount int64                        `json:"totalCount"`
}

ImportTransactionResponsePageWrapper represents a response of imported transaction which contains items and count

type ImportedTransactionSlice added in v0.6.0

type ImportedTransactionSlice []*ImportTransaction

ImportedTransactionSlice represents the slice data structure of import transaction data

func (ImportedTransactionSlice) Len added in v0.6.0

func (s ImportedTransactionSlice) Len() int

Len returns the count of items

func (ImportedTransactionSlice) Less added in v0.6.0

func (s ImportedTransactionSlice) Less(i, j int) bool

Less reports whether the first item is less than the second one

func (ImportedTransactionSlice) Swap added in v0.6.0

func (s ImportedTransactionSlice) Swap(i, j int)

Swap swaps two items

func (ImportedTransactionSlice) ToImportTransactionResponseList added in v0.6.0

func (s ImportedTransactionSlice) ToImportTransactionResponseList() []*ImportTransactionResponse

ToImportTransactionResponseList returns the a list of view-objects according to imported transaction data

func (ImportedTransactionSlice) ToTransactionTagIdsMap added in v0.6.0

func (s ImportedTransactionSlice) ToTransactionTagIdsMap() (map[int][]int64, error)

ToTransactionTagIdsMap returns a list of transaction tag ids

func (ImportedTransactionSlice) ToTransactionsList added in v0.6.0

func (s ImportedTransactionSlice) ToTransactionsList() []*Transaction

ToTransactionsList returns a list of transaction models

type InsightsExplorer added in v1.3.0

type InsightsExplorer struct {
	ExplorerId      int64  `xorm:"PK"`
	Uid             int64  `xorm:"INDEX(IDX_insights_explorer_uid_deleted_order) NOT NULL"`
	Deleted         bool   `xorm:"INDEX(IDX_insights_explorer_uid_deleted_order) NOT NULL"`
	Name            string `xorm:"VARCHAR(64) NOT NULL"`
	DisplayOrder    int32  `xorm:"INDEX(IDX_insights_explorer_uid_deleted_order) NOT NULL"`
	Data            string `xorm:"MEDIUMBLOB"`
	Hidden          bool   `xorm:"NOT NULL"`
	CreatedUnixTime int64
	UpdatedUnixTime int64
	DeletedUnixTime int64
}

InsightsExplorer represents a saved insights explorer configuration

func (*InsightsExplorer) ToInsightsExplorerInfoResponse added in v1.3.0

func (a *InsightsExplorer) ToInsightsExplorerInfoResponse() (*InsightsExplorerInfoResponse, error)

ToInsightsExplorerInfoResponse returns a view-object according to database model

type InsightsExplorerCreateRequest added in v1.3.0

type InsightsExplorerCreateRequest struct {
	Name            string         `json:"name" binding:"required,notBlank,max=64"`
	Data            map[string]any `json:"data" binding:"required"`
	ClientSessionId string         `json:"clientSessionId"`
}

InsightsExplorerCreateRequest represents all parameters of insights explorer creation request

type InsightsExplorerDeleteRequest added in v1.3.0

type InsightsExplorerDeleteRequest struct {
	Id int64 `json:"id,string" binding:"required,min=1"`
}

InsightsExplorerDeleteRequest represents all parameters of insights explorer deleting request

type InsightsExplorerGetRequest added in v1.3.0

type InsightsExplorerGetRequest struct {
	Id int64 `form:"id,string" binding:"required,min=1"`
}

InsightsExplorerGetRequest represents all parameters of insights explorer getting request

type InsightsExplorerHideRequest added in v1.3.0

type InsightsExplorerHideRequest struct {
	Id     int64 `json:"id,string" binding:"required,min=1"`
	Hidden bool  `json:"hidden"`
}

InsightsExplorerHideRequest represents all parameters of insights explorer hiding request

type InsightsExplorerInfoResponse added in v1.3.0

type InsightsExplorerInfoResponse struct {
	Id           int64          `json:"id,string"`
	Name         string         `json:"name"`
	DisplayOrder int32          `json:"displayOrder"`
	Hidden       bool           `json:"hidden"`
	Data         map[string]any `json:"data,omitempty"`
}

InsightsExplorerInfoResponse represents a view-object of insights explorer info

type InsightsExplorerInfoResponseSlice added in v1.3.0

type InsightsExplorerInfoResponseSlice []*InsightsExplorerInfoResponse

InsightsExplorerInfoResponseSlice represents the slice data structure of InsightsExplorerInfoResponse

func (InsightsExplorerInfoResponseSlice) Len added in v1.3.0

Len returns the count of items

func (InsightsExplorerInfoResponseSlice) Less added in v1.3.0

Less reports whether the first item is less than the second one

func (InsightsExplorerInfoResponseSlice) Swap added in v1.3.0

Swap swaps two items

type InsightsExplorerModifyRequest added in v1.3.0

type InsightsExplorerModifyRequest struct {
	Id              int64          `json:"id,string" binding:"required,min=0"`
	Name            string         `json:"name" binding:"required,notBlank,max=64"`
	Data            map[string]any `json:"data" binding:"required"`
	Hidden          bool           `json:"hidden"`
	ClientSessionId string         `json:"clientSessionId"`
}

InsightsExplorerModifyRequest represents all parameters of insights explorer modification request

type InsightsExplorerMoveRequest added in v1.3.0

type InsightsExplorerMoveRequest struct {
	NewDisplayOrders []*InsightsExplorerNewDisplayOrderRequest `json:"newDisplayOrders" binding:"required,min=1"`
}

InsightsExplorerMoveRequest represents all parameters of insights explorer moving request

type InsightsExplorerNewDisplayOrderRequest added in v1.3.0

type InsightsExplorerNewDisplayOrderRequest struct {
	Id           int64 `json:"id,string" binding:"required,min=1"`
	DisplayOrder int32 `json:"displayOrder"`
}

InsightsExplorerNewDisplayOrderRequest represents a data pair of id and display order

type LatestExchangeRate

type LatestExchangeRate struct {
	Currency string `json:"currency"`
	Rate     string `json:"rate"`
}

LatestExchangeRate represents a data pair of currency and exchange rate

type LatestExchangeRateResponse

type LatestExchangeRateResponse struct {
	DataSource    string                  `json:"dataSource"`
	ReferenceUrl  string                  `json:"referenceUrl"`
	UpdateTime    int64                   `json:"updateTime"`
	BaseCurrency  string                  `json:"baseCurrency"`
	ExchangeRates LatestExchangeRateSlice `json:"exchangeRates"`
}

LatestExchangeRateResponse returns a view-object which contains latest exchange rate

type LatestExchangeRateSlice

type LatestExchangeRateSlice []*LatestExchangeRate

LatestExchangeRateSlice represents the slice data structure of LatestExchangeRate

func (LatestExchangeRateSlice) Len

func (s LatestExchangeRateSlice) Len() int

Len returns the count of items

func (LatestExchangeRateSlice) Less

func (s LatestExchangeRateSlice) Less(i, j int) bool

Less reports whether the first item is less than the second one

func (LatestExchangeRateSlice) Swap

func (s LatestExchangeRateSlice) Swap(i, j int)

Swap swaps two items

type OAuth2CallbackLoginRequest added in v1.2.0

type OAuth2CallbackLoginRequest struct {
	Password string `json:"password" binding:"omitempty,min=6,max=128"`
	Passcode string `json:"passcode" binding:"omitempty,notBlank,len=6"`
	Token    string `json:"token" binding:"omitempty"`
}

OAuth2CallbackLoginRequest represents all parameters of OAuth 2.0 callback login request

type OAuth2CallbackRequest added in v1.2.0

type OAuth2CallbackRequest struct {
	State            string `form:"state"`
	Code             string `form:"code"`
	Error            string `form:"error"`
	ErrorDescription string `form:"error_description"`
}

OAuth2CallbackRequest represents all parameters of OAuth 2.0 callback request

type OAuth2CallbackTokenContext added in v1.2.0

type OAuth2CallbackTokenContext struct {
	ExternalAuthType core.UserExternalAuthType `json:"externalAuthType"`
	ExternalUsername string                    `json:"externalUsername"`
	ExternalEmail    string                    `json:"externalEmail"`
}

OAuth2CallbackTokenContext represents the context data of oauth 2.0 callback token

type OAuth2LoginRequest added in v1.2.0

type OAuth2LoginRequest struct {
	Platform        string `form:"platform" binding:"required"`
	ClientSessionId string `form:"client_session_id" binding:"required"`
	Token           string `form:"token"`
}

OAuth2LoginRequest represents all parameters of OAuth 2.0 login request

type PasswordResetRequest added in v0.4.0

type PasswordResetRequest struct {
	Email    string `json:"email" binding:"required,notBlank,max=100,validEmail"`
	Password string `json:"password" binding:"required,min=6,max=128"`
}

PasswordResetRequest represents all parameters of reset password request

type RecognizedReceiptImageResponse added in v1.1.0

type RecognizedReceiptImageResponse struct {
	Type                 TransactionType `json:"type"`
	Time                 int64           `json:"time,omitempty"`
	CategoryId           int64           `json:"categoryId,string,omitempty"`
	SourceAccountId      int64           `json:"sourceAccountId,string,omitempty"`
	DestinationAccountId int64           `json:"destinationAccountId,string,omitempty"`
	SourceAmount         int64           `json:"sourceAmount,omitempty"`
	DestinationAmount    int64           `json:"destinationAmount,omitempty"`
	TagIds               []string        `json:"tagIds,omitempty"`
	Comment              string          `json:"comment,omitempty"`
}

RecognizedReceiptImageResponse represents a view-object of recognized receipt image response

type RecognizedReceiptImageResult added in v1.1.0

type RecognizedReceiptImageResult struct {
	Type                   string   `` /* 143-byte string literal not displayed */
	Time                   string   `` /* 156-byte string literal not displayed */
	Amount                 string   `json:"amount,omitempty" jsonschema_description:"Transaction amount"`
	AccountName            string   `json:"account,omitempty" jsonschema_description:"Account name for the transaction"`
	CategoryName           string   `json:"category,omitempty" jsonschema_description:"Category name for the transaction"`
	TagNames               []string `json:"tags,omitempty" jsonschema_description:"List of tags associated with the transaction (maximum 10 tags allowed)"`
	Description            string   `json:"description,omitempty" jsonschema_description:"Transaction description"`
	DestinationAmount      string   `json:"destination_amount,omitempty" jsonschema_description:"Destination amount for transfer transactions"`
	DestinationAccountName string   `json:"destination_account,omitempty" jsonschema_description:"Destination account name for transfer transactions"`
}

RecognizedReceiptImageResult represents the result of recognized receipt image

type RegisterResponse added in v0.4.0

type RegisterResponse struct {
	AuthResponse
	NeedVerifyEmail       bool `json:"needVerifyEmail"`
	PresetCategoriesSaved bool `json:"presetCategoriesSaved"`
}

RegisterResponse returns a view-object of user register response

type TokenGenerateAPIRequest added in v1.2.0

type TokenGenerateAPIRequest struct {
	ExpiredInSeconds int64  `json:"expiresInSeconds" binding:"omitempty,min=0,max=4294967295"`
	Password         string `json:"password" binding:"omitempty,min=6,max=128"`
}

TokenGenerateAPIRequest represents all parameters of api token generation request

type TokenGenerateAPIResponse added in v1.2.0

type TokenGenerateAPIResponse struct {
	Token      string `json:"token"`
	APIBaseUrl string `json:"apiBaseUrl"`
}

TokenGenerateAPIResponse represents all response parameters of generated api token

type TokenGenerateMCPRequest added in v0.10.0

type TokenGenerateMCPRequest struct {
	ExpiredInSeconds int64  `json:"expiresInSeconds" binding:"omitempty,min=0,max=4294967295"`
	Password         string `json:"password" binding:"omitempty,min=6,max=128"`
}

TokenGenerateMCPRequest represents all parameters of mcp token generation request

type TokenGenerateMCPResponse added in v0.10.0

type TokenGenerateMCPResponse struct {
	Token  string `json:"token"`
	MCPUrl string `json:"mcpUrl"`
}

TokenGenerateMCPResponse represents all response parameters of generated mcp token

type TokenInfoResponse

type TokenInfoResponse struct {
	TokenId   string         `json:"tokenId"`
	TokenType core.TokenType `json:"tokenType"`
	UserAgent string         `json:"userAgent"`
	LastSeen  int64          `json:"lastSeen"`
	IsCurrent bool           `json:"isCurrent"`
}

TokenInfoResponse represents a view-object of token

type TokenInfoResponseSlice

type TokenInfoResponseSlice []*TokenInfoResponse

TokenInfoResponseSlice represents the slice data structure of TokenInfoResponse

func (TokenInfoResponseSlice) Len

func (a TokenInfoResponseSlice) Len() int

Len returns the count of items

func (TokenInfoResponseSlice) Less

func (a TokenInfoResponseSlice) Less(i, j int) bool

Less reports whether the first item is less than the second one

func (TokenInfoResponseSlice) Swap

func (a TokenInfoResponseSlice) Swap(i, j int)

Swap swaps two items

type TokenRecord

type TokenRecord struct {
	Uid              int64          `xorm:"PK INDEX(IDX_token_record_uid_type_expired_time) INDEX(IDX_token_record_expired_time)"`
	UserTokenId      int64          `xorm:"PK"`
	TokenType        core.TokenType `xorm:"INDEX(IDX_token_record_uid_type_expired_time) TINYINT NOT NULL"`
	Secret           string         `xorm:"VARCHAR(10) NOT NULL"`
	UserAgent        string         `xorm:"VARCHAR(255)"`
	Context          string         `xorm:"BLOB"`
	CreatedUnixTime  int64          `xorm:"PK"`
	ExpiredUnixTime  int64          `xorm:"INDEX(IDX_token_record_uid_type_expired_time) INDEX(IDX_token_record_expired_time)"`
	LastSeenUnixTime int64
}

TokenRecord represents token data stored in database

type TokenRefreshResponse

type TokenRefreshResponse struct {
	NewToken                 string                        `json:"newToken,omitempty"`
	OldTokenId               string                        `json:"oldTokenId,omitempty"`
	User                     *UserBasicInfo                `json:"user"`
	ApplicationCloudSettings *ApplicationCloudSettingSlice `json:"applicationCloudSettings,omitempty"`
	NotificationContent      string                        `json:"notificationContent,omitempty"`
}

TokenRefreshResponse represents all response parameters of token refreshing

type TokenRevokeRequest

type TokenRevokeRequest struct {
	TokenId string `json:"tokenId" binding:"required,notBlank"`
}

TokenRevokeRequest represents all parameters of token revoking request

type Transaction

type Transaction struct {
	TransactionId        int64             `xorm:"PK"`
	Uid                  int64             `` /* 351-byte string literal not displayed */
	Deleted              bool              `` /* 318-byte string literal not displayed */
	Type                 TransactionDbType `xorm:"INDEX(IDX_transaction_uid_deleted_type_time) INDEX(IDX_transaction_uid_deleted_type_account_id_time) NOT NULL"`
	CategoryId           int64             `xorm:"INDEX(IDX_transaction_uid_deleted_category_id_time) NOT NULL"`
	AccountId            int64             `xorm:"INDEX(IDX_transaction_uid_deleted_account_id_time) INDEX(IDX_transaction_uid_deleted_type_account_id_time) NOT NULL"`
	TransactionTime      int64             `` /* 292-byte string literal not displayed */
	TimezoneUtcOffset    int16             `xorm:"NOT NULL"`
	Amount               int64             `xorm:"NOT NULL"`
	RelatedId            int64             `xorm:"NOT NULL"`
	RelatedAccountId     int64             `xorm:"NOT NULL"`
	RelatedAccountAmount int64             `xorm:"NOT NULL"`
	HideAmount           bool              `xorm:"NOT NULL"`
	Comment              string            `xorm:"VARCHAR(255) NOT NULL"`
	GeoLongitude         float64           `xorm:"INDEX(IDX_transaction_uid_deleted_time_longitude_latitude)"`
	GeoLatitude          float64           `xorm:"INDEX(IDX_transaction_uid_deleted_time_longitude_latitude)"`
	CreatedIp            string            `xorm:"VARCHAR(39)"`
	ScheduledCreated     bool
	CreatedUnixTime      int64
	UpdatedUnixTime      int64
	DeletedUnixTime      int64
}

Transaction represents transaction data stored in database

func (*Transaction) IsEditable

func (t *Transaction) IsEditable(currentUser *User, clientTimezone *time.Location, account *Account, relatedAccount *Account) bool

IsEditable returns whether this transaction can be edited

func (*Transaction) ToTransactionInfoResponse

func (t *Transaction) ToTransactionInfoResponse(tagIds []int64, editable bool) *TransactionInfoResponse

ToTransactionInfoResponse returns a view-object according to database model

type TransactionAllListRequest added in v1.3.0

type TransactionAllListRequest struct {
	Type         TransactionType `form:"type" binding:"min=0,max=4"`
	CategoryIds  string          `form:"category_ids"`
	AccountIds   string          `form:"account_ids"`
	TagFilter    string          `form:"tag_filter" binding:"validTagFilter"`
	AmountFilter string          `form:"amount_filter" binding:"validAmountFilter"`
	Keyword      string          `form:"keyword"`
	StartTime    int64           `form:"start_time" binding:"min=0"`
	EndTime      int64           `form:"end_time" binding:"min=0"`
	WithPictures bool            `form:"with_pictures"`
	TrimAccount  bool            `form:"trim_account"`
	TrimCategory bool            `form:"trim_category"`
	TrimTag      bool            `form:"trim_tag"`
}

TransactionAllListRequest represents all parameters of all transaction listing request

type TransactionAmountsRequest

type TransactionAmountsRequest struct {
	Query                  string `form:"query"`
	ExcludeAccountIds      string `form:"exclude_account_ids"`
	ExcludeCategoryIds     string `form:"exclude_category_ids"`
	UseTransactionTimezone bool   `form:"use_transaction_timezone"`
}

TransactionAmountsRequest represents all parameters of transaction amounts request

func (*TransactionAmountsRequest) GetTransactionAmountsRequestItems

func (t *TransactionAmountsRequest) GetTransactionAmountsRequestItems() ([]*TransactionAmountsRequestItem, error)

GetTransactionAmountsRequestItems returns request items by query parameters

type TransactionAmountsRequestItem

type TransactionAmountsRequestItem struct {
	Name      string
	StartTime int64
	EndTime   int64
}

TransactionAmountsRequestItem represents an item of transaction amounts request

type TransactionAmountsResponseItem

type TransactionAmountsResponseItem struct {
	StartTime int64                                       `json:"startTime"`
	EndTime   int64                                       `json:"endTime"`
	Amounts   []*TransactionAmountsResponseItemAmountInfo `json:"amounts"`
}

TransactionAmountsResponseItem represents an item of transaction amounts

type TransactionAmountsResponseItemAmountInfo

type TransactionAmountsResponseItemAmountInfo struct {
	Currency      string `json:"currency"`
	IncomeAmount  int64  `json:"incomeAmount"`
	ExpenseAmount int64  `json:"expenseAmount"`
}

TransactionAmountsResponseItemAmountInfo represents amount info for a response item

type TransactionAmountsResponseItemAmountInfoSlice added in v0.4.0

type TransactionAmountsResponseItemAmountInfoSlice []*TransactionAmountsResponseItemAmountInfo

TransactionAmountsResponseItemAmountInfoSlice represents the slice data structure of TransactionAmountsResponseItemAmountInfo

func (TransactionAmountsResponseItemAmountInfoSlice) Len added in v0.4.0

Len returns the count of items

func (TransactionAmountsResponseItemAmountInfoSlice) Less added in v0.4.0

Less reports whether the first item is less than the second one

func (TransactionAmountsResponseItemAmountInfoSlice) Swap added in v0.4.0

Swap swaps two items

type TransactionCategory

type TransactionCategory struct {
	CategoryId       int64                   `xorm:"PK"`
	Uid              int64                   `xorm:"INDEX(IDX_category_uid_deleted_type_parent_category_id_order) NOT NULL"`
	Deleted          bool                    `xorm:"INDEX(IDX_category_uid_deleted_type_parent_category_id_order) NOT NULL"`
	Type             TransactionCategoryType `xorm:"INDEX(IDX_category_uid_deleted_type_parent_category_id_order) NOT NULL"`
	ParentCategoryId int64                   `xorm:"INDEX(IDX_category_uid_deleted_type_parent_category_id_order) NOT NULL"`
	Name             string                  `xorm:"VARCHAR(64) NOT NULL"`
	DisplayOrder     int32                   `xorm:"INDEX(IDX_category_uid_deleted_type_parent_category_id_order) NOT NULL"`
	Icon             int64                   `xorm:"NOT NULL"`
	Color            string                  `xorm:"VARCHAR(6) NOT NULL"`
	Hidden           bool                    `xorm:"NOT NULL"`
	Comment          string                  `xorm:"VARCHAR(255) NOT NULL"`
	CreatedUnixTime  int64
	UpdatedUnixTime  int64
	DeletedUnixTime  int64
}

TransactionCategory represents transaction category data stored in database

func (*TransactionCategory) ToTransactionCategoryInfoResponse

func (c *TransactionCategory) ToTransactionCategoryInfoResponse() *TransactionCategoryInfoResponse

ToTransactionCategoryInfoResponse returns a view-object according to database model

type TransactionCategoryCreateBatchRequest

type TransactionCategoryCreateBatchRequest struct {
	Categories []*TransactionCategoryCreateWithSubCategories `json:"categories" binding:"required"`
}

TransactionCategoryCreateBatchRequest represents all parameters of transaction category batch creation request

type TransactionCategoryCreateRequest

type TransactionCategoryCreateRequest struct {
	Name            string                  `json:"name" binding:"required,notBlank,max=64"`
	Type            TransactionCategoryType `json:"type" binding:"required"`
	ParentId        int64                   `json:"parentId,string" binding:"min=0"`
	Icon            int64                   `json:"icon,string" binding:"min=1"`
	Color           string                  `json:"color" binding:"required,len=6,validHexRGBColor"`
	Comment         string                  `json:"comment" binding:"max=255"`
	ClientSessionId string                  `json:"clientSessionId"`
}

TransactionCategoryCreateRequest represents all parameters of single transaction category creation request

type TransactionCategoryCreateWithSubCategories

type TransactionCategoryCreateWithSubCategories struct {
	Name          string                              `json:"name" binding:"required,notBlank,max=64"`
	Type          TransactionCategoryType             `json:"type" binding:"required"`
	Icon          int64                               `json:"icon,string" binding:"min=1"`
	Color         string                              `json:"color" binding:"required,len=6,validHexRGBColor"`
	Comment       string                              `json:"comment" binding:"max=255"`
	SubCategories []*TransactionCategoryCreateRequest `json:"subCategories" binding:"required"`
}

TransactionCategoryCreateWithSubCategories represents all parameters of multi transaction categories creation request

type TransactionCategoryDeleteRequest

type TransactionCategoryDeleteRequest struct {
	Id int64 `json:"id,string" binding:"required,min=1"`
}

TransactionCategoryDeleteRequest represents all parameters of transaction category deleting request

type TransactionCategoryGetRequest

type TransactionCategoryGetRequest struct {
	Id int64 `form:"id,string" binding:"required,min=1"`
}

TransactionCategoryGetRequest represents all parameters of transaction category getting request

type TransactionCategoryHideRequest

type TransactionCategoryHideRequest struct {
	Id     int64 `json:"id,string" binding:"required,min=1"`
	Hidden bool  `json:"hidden"`
}

TransactionCategoryHideRequest represents all parameters of transaction category hiding request

type TransactionCategoryInfoResponse

type TransactionCategoryInfoResponse struct {
	Id            int64                                `json:"id,string"`
	Name          string                               `json:"name"`
	ParentId      int64                                `json:"parentId,string"`
	Type          TransactionCategoryType              `json:"type"`
	Icon          int64                                `json:"icon,string"`
	Color         string                               `json:"color"`
	Comment       string                               `json:"comment"`
	DisplayOrder  int32                                `json:"displayOrder"`
	Hidden        bool                                 `json:"hidden"`
	SubCategories TransactionCategoryInfoResponseSlice `json:"subCategories,omitempty"`
}

TransactionCategoryInfoResponse represents a view-object of transaction category

type TransactionCategoryInfoResponseSlice

type TransactionCategoryInfoResponseSlice []*TransactionCategoryInfoResponse

TransactionCategoryInfoResponseSlice represents the slice data structure of TransactionCategoryInfoResponse

func (TransactionCategoryInfoResponseSlice) Len

Len returns the count of items

func (TransactionCategoryInfoResponseSlice) Less

Less reports whether the first item is less than the second one

func (TransactionCategoryInfoResponseSlice) Swap

Swap swaps two items

type TransactionCategoryListRequest

type TransactionCategoryListRequest struct {
	Type     TransactionCategoryType `form:"type" binding:"min=0"`
	ParentId int64                   `form:"parent_id,string,default=-1" binding:"min=-1"`
}

TransactionCategoryListRequest represents all parameters of transaction category listing request

type TransactionCategoryModifyRequest

type TransactionCategoryModifyRequest struct {
	Id       int64  `json:"id,string" binding:"required,min=1"`
	Name     string `json:"name" binding:"required,notBlank,max=64"`
	ParentId int64  `json:"parentId,string" binding:"min=0"`
	Icon     int64  `json:"icon,string" binding:"min=1"`
	Color    string `json:"color" binding:"required,len=6,validHexRGBColor"`
	Comment  string `json:"comment" binding:"max=255"`
	Hidden   bool   `json:"hidden"`
}

TransactionCategoryModifyRequest represents all parameters of transaction category modification request

type TransactionCategoryMoveRequest

type TransactionCategoryMoveRequest struct {
	NewDisplayOrders []*TransactionCategoryNewDisplayOrderRequest `json:"newDisplayOrders" binding:"required,min=1"`
}

TransactionCategoryMoveRequest represents all parameters of transaction category moving request

type TransactionCategoryNewDisplayOrderRequest

type TransactionCategoryNewDisplayOrderRequest struct {
	Id           int64 `json:"id,string" binding:"required,min=1"`
	DisplayOrder int32 `json:"displayOrder"`
}

TransactionCategoryNewDisplayOrderRequest represents a data pair of id and display order

type TransactionCategoryType

type TransactionCategoryType byte

TransactionCategoryType represents transaction category type

const (
	CATEGORY_TYPE_INCOME   TransactionCategoryType = 1
	CATEGORY_TYPE_EXPENSE  TransactionCategoryType = 2
	CATEGORY_TYPE_TRANSFER TransactionCategoryType = 3
)

Transaction category types

type TransactionCountRequest

type TransactionCountRequest struct {
	Type         TransactionType `form:"type" binding:"min=0,max=4"`
	CategoryIds  string          `form:"category_ids"`
	AccountIds   string          `form:"account_ids"`
	TagFilter    string          `form:"tag_filter" binding:"validTagFilter"`
	AmountFilter string          `form:"amount_filter" binding:"validAmountFilter"`
	Keyword      string          `form:"keyword"`
	MaxTime      int64           `form:"max_time" binding:"min=0"` // Transaction time sequence id
	MinTime      int64           `form:"min_time" binding:"min=0"` // Transaction time sequence id
}

TransactionCountRequest represents transaction count request

type TransactionCountResponse

type TransactionCountResponse struct {
	TotalCount int64 `json:"totalCount"`
}

TransactionCountResponse represents transaction count response

type TransactionCreateRequest

type TransactionCreateRequest struct {
	Type                 TransactionType                `json:"type" binding:"required"`
	CategoryId           int64                          `json:"categoryId,string"`
	Time                 int64                          `json:"time" binding:"required,min=1"`
	UtcOffset            int16                          `json:"utcOffset" binding:"min=-720,max=840"`
	SourceAccountId      int64                          `json:"sourceAccountId,string" binding:"required,min=1"`
	DestinationAccountId int64                          `json:"destinationAccountId,string" binding:"min=0"`
	SourceAmount         int64                          `json:"sourceAmount" binding:"min=-99999999999,max=99999999999"`
	DestinationAmount    int64                          `json:"destinationAmount" binding:"min=-99999999999,max=99999999999"`
	HideAmount           bool                           `json:"hideAmount"`
	TagIds               []string                       `json:"tagIds"`
	PictureIds           []string                       `json:"pictureIds"`
	Comment              string                         `json:"comment" binding:"max=255"`
	GeoLocation          *TransactionGeoLocationRequest `json:"geoLocation" binding:"omitempty"`
	ClientSessionId      string                         `json:"clientSessionId"`
}

TransactionCreateRequest represents all parameters of transaction creation request

type TransactionDbType

type TransactionDbType byte

TransactionDbType represents transaction type in database

const (
	TRANSACTION_DB_TYPE_MODIFY_BALANCE TransactionDbType = 1
	TRANSACTION_DB_TYPE_INCOME         TransactionDbType = 2
	TRANSACTION_DB_TYPE_EXPENSE        TransactionDbType = 3
	TRANSACTION_DB_TYPE_TRANSFER_OUT   TransactionDbType = 4
	TRANSACTION_DB_TYPE_TRANSFER_IN    TransactionDbType = 5
)

Transaction db types

func (TransactionDbType) String added in v0.6.0

func (t TransactionDbType) String() string

String returns a textual representation of the transaction types for db enum

func (TransactionDbType) ToTransactionRelatedAccountType added in v1.2.0

func (t TransactionDbType) ToTransactionRelatedAccountType() (TransactionRelatedAccountType, error)

ToTransactionRelatedAccountType returns the related account type for this db enum

func (TransactionDbType) ToTransactionType added in v0.6.0

func (t TransactionDbType) ToTransactionType() (TransactionType, error)

ToTransactionType returns the transaction type for this db enum

type TransactionDeleteRequest

type TransactionDeleteRequest struct {
	Id int64 `json:"id,string" binding:"required,min=1"`
}

TransactionDeleteRequest represents all parameters of transaction deleting request

type TransactionEditScope

type TransactionEditScope byte

TransactionEditScope represents the scope which transaction can be edited

const (
	TRANSACTION_EDIT_SCOPE_NONE                TransactionEditScope = 0
	TRANSACTION_EDIT_SCOPE_ALL                 TransactionEditScope = 1
	TRANSACTION_EDIT_SCOPE_TODAY_OR_LATER      TransactionEditScope = 2
	TRANSACTION_EDIT_SCOPE_LAST_24H_OR_LATER   TransactionEditScope = 3
	TRANSACTION_EDIT_SCOPE_THIS_WEEK_OR_LATER  TransactionEditScope = 4
	TRANSACTION_EDIT_SCOPE_THIS_MONTH_OR_LATER TransactionEditScope = 5
	TRANSACTION_EDIT_SCOPE_THIS_YEAR_OR_LATER  TransactionEditScope = 6
	TRANSACTION_EDIT_SCOPE_INVALID             TransactionEditScope = 255
)

Editable Transaction Ranges

func (TransactionEditScope) String

func (s TransactionEditScope) String() string

String returns a textual representation of the editable transaction ranges enum

type TransactionGeoLocationRequest added in v0.3.0

type TransactionGeoLocationRequest struct {
	Latitude  float64 `json:"latitude" binding:"required"`
	Longitude float64 `json:"longitude" binding:"required"`
}

TransactionGeoLocationRequest represents all parameters of transaction geographic location info update request

type TransactionGeoLocationResponse added in v0.3.0

type TransactionGeoLocationResponse struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

TransactionGeoLocationResponse represents a view-object of transaction geographic location info

type TransactionGetRequest

type TransactionGetRequest struct {
	Id           int64 `form:"id,string" binding:"required,min=1"`
	WithPictures bool  `form:"with_pictures"`
	TrimAccount  bool  `form:"trim_account"`
	TrimCategory bool  `form:"trim_category"`
	TrimTag      bool  `form:"trim_tag"`
}

TransactionGetRequest represents all parameters of transaction getting request

type TransactionImportProcessRequest added in v0.9.0

type TransactionImportProcessRequest struct {
	ClientSessionId string `form:"client_session_id"`
}

TransactionImportProcessRequest represents all parameters of transaction import process request

type TransactionImportRequest added in v0.6.0

type TransactionImportRequest struct {
	Transactions    []*TransactionCreateRequest `json:"transactions"`
	ClientSessionId string                      `json:"clientSessionId"`
}

TransactionImportRequest represents all parameters of transaction import request

type TransactionInfoPageWrapperResponse

type TransactionInfoPageWrapperResponse struct {
	Items              TransactionInfoResponseSlice `json:"items"`
	NextTimeSequenceId *int64                       `json:"nextTimeSequenceId,string"`
	TotalCount         *int64                       `json:"totalCount,omitempty"`
}

TransactionInfoPageWrapperResponse represents a response of transaction which contains items and next id

type TransactionInfoPageWrapperResponse2

type TransactionInfoPageWrapperResponse2 struct {
	Items      TransactionInfoResponseSlice `json:"items"`
	TotalCount int64                        `json:"totalCount"`
}

TransactionInfoPageWrapperResponse2 represents a response of transaction which contains items and count

type TransactionInfoResponse

type TransactionInfoResponse struct {
	Id                   int64                                    `json:"id,string"`
	TimeSequenceId       int64                                    `json:"timeSequenceId,string"`
	Type                 TransactionType                          `json:"type"`
	CategoryId           int64                                    `json:"categoryId,string"`
	Category             *TransactionCategoryInfoResponse         `json:"category,omitempty"`
	Time                 int64                                    `json:"time"`
	UtcOffset            int16                                    `json:"utcOffset"`
	SourceAccountId      int64                                    `json:"sourceAccountId,string"`
	SourceAccount        *AccountInfoResponse                     `json:"sourceAccount,omitempty"`
	DestinationAccountId int64                                    `json:"destinationAccountId,string,omitempty"`
	DestinationAccount   *AccountInfoResponse                     `json:"destinationAccount,omitempty"`
	SourceAmount         int64                                    `json:"sourceAmount"`
	DestinationAmount    int64                                    `json:"destinationAmount,omitempty"`
	HideAmount           bool                                     `json:"hideAmount"`
	TagIds               []string                                 `json:"tagIds"`
	Tags                 []*TransactionTagInfoResponse            `json:"tags,omitempty"`
	Pictures             TransactionPictureInfoBasicResponseSlice `json:"pictures,omitempty"`
	Comment              string                                   `json:"comment"`
	GeoLocation          *TransactionGeoLocationResponse          `json:"geoLocation,omitempty"`
	Editable             bool                                     `json:"editable"`
}

TransactionInfoResponse represents a view-object of transaction

type TransactionInfoResponseSlice

type TransactionInfoResponseSlice []*TransactionInfoResponse

TransactionInfoResponseSlice represents the slice data structure of TransactionInfoResponse

func (TransactionInfoResponseSlice) Len

Len returns the count of items

func (TransactionInfoResponseSlice) Less

func (s TransactionInfoResponseSlice) Less(i, j int) bool

Less reports whether the first item is less than the second one

func (TransactionInfoResponseSlice) Swap

func (s TransactionInfoResponseSlice) Swap(i, j int)

Swap swaps two items

type TransactionListByMaxTimeRequest

type TransactionListByMaxTimeRequest struct {
	Type         TransactionType `form:"type" binding:"min=0,max=4"`
	CategoryIds  string          `form:"category_ids"`
	AccountIds   string          `form:"account_ids"`
	TagFilter    string          `form:"tag_filter" binding:"validTagFilter"`
	AmountFilter string          `form:"amount_filter" binding:"validAmountFilter"`
	Keyword      string          `form:"keyword"`
	MaxTime      int64           `form:"max_time" binding:"min=0"` // Transaction time sequence id
	MinTime      int64           `form:"min_time" binding:"min=0"` // Transaction time sequence id
	Page         int32           `form:"page" binding:"min=0"`
	Count        int32           `form:"count" binding:"required,min=1,max=50"`
	WithCount    bool            `form:"with_count"`
	WithPictures bool            `form:"with_pictures"`
	TrimAccount  bool            `form:"trim_account"`
	TrimCategory bool            `form:"trim_category"`
	TrimTag      bool            `form:"trim_tag"`
}

TransactionListByMaxTimeRequest represents all parameters of transaction listing by max time request

type TransactionListInMonthByPageRequest

type TransactionListInMonthByPageRequest struct {
	Year         int32           `form:"year" binding:"required,min=1"`
	Month        int32           `form:"month" binding:"required,min=1"`
	Type         TransactionType `form:"type" binding:"min=0,max=4"`
	CategoryIds  string          `form:"category_ids"`
	AccountIds   string          `form:"account_ids"`
	TagFilter    string          `form:"tag_filter" binding:"validTagFilter"`
	AmountFilter string          `form:"amount_filter" binding:"validAmountFilter"`
	Keyword      string          `form:"keyword"`
	WithPictures bool            `form:"with_pictures"`
	TrimAccount  bool            `form:"trim_account"`
	TrimCategory bool            `form:"trim_category"`
	TrimTag      bool            `form:"trim_tag"`
}

TransactionListInMonthByPageRequest represents all parameters of transaction listing by month request

type TransactionModifyRequest

type TransactionModifyRequest struct {
	Id                   int64                          `json:"id,string" binding:"required,min=1"`
	CategoryId           int64                          `json:"categoryId,string"`
	Time                 int64                          `json:"time" binding:"required,min=1"`
	UtcOffset            int16                          `json:"utcOffset" binding:"min=-720,max=840"`
	SourceAccountId      int64                          `json:"sourceAccountId,string" binding:"required,min=1"`
	DestinationAccountId int64                          `json:"destinationAccountId,string" binding:"min=0"`
	SourceAmount         int64                          `json:"sourceAmount" binding:"min=-99999999999,max=99999999999"`
	DestinationAmount    int64                          `json:"destinationAmount" binding:"min=-99999999999,max=99999999999"`
	HideAmount           bool                           `json:"hideAmount"`
	TagIds               []string                       `json:"tagIds"`
	PictureIds           []string                       `json:"pictureIds"`
	Comment              string                         `json:"comment" binding:"max=255"`
	GeoLocation          *TransactionGeoLocationRequest `json:"geoLocation" binding:"omitempty"`
}

TransactionModifyRequest represents all parameters of transaction modification request

type TransactionMonthAmountsResponseItem

type TransactionMonthAmountsResponseItem struct {
	Year    int32                                       `json:"year"`
	Month   int32                                       `json:"month"`
	Amounts []*TransactionAmountsResponseItemAmountInfo `json:"amounts"`
}

TransactionMonthAmountsResponseItem represents an item of transaction month amounts

type TransactionMoveBetweenAccountsRequest added in v1.2.0

type TransactionMoveBetweenAccountsRequest struct {
	FromAccountId int64 `json:"fromAccountId,string" binding:"required,min=1"`
	ToAccountId   int64 `json:"toAccountId,string" binding:"required,min=1"`
}

TransactionMoveBetweenAccountsRequest represents all parameters of moving all transactions between accounts request

type TransactionPictureInfo added in v0.6.0

type TransactionPictureInfo struct {
	Uid              int64  `` /* 138-byte string literal not displayed */
	Deleted          bool   `` /* 138-byte string literal not displayed */
	TransactionId    int64  `xorm:"INDEX(IDX_transaction_picture_uid_deleted_transaction_id_picture_id) NOT NULL"`
	PictureId        int64  `` /* 132-byte string literal not displayed */
	PictureExtension string `xorm:"VARCHAR(10) NOT NULL"`
	CreatedIp        string `xorm:"VARCHAR(39)"`
	CreatedUnixTime  int64
	UpdatedUnixTime  int64
	DeletedUnixTime  int64
}

TransactionPictureInfo represents transaction picture file info stored in database

func (*TransactionPictureInfo) ToTransactionPictureInfoBasicResponse added in v0.6.0

func (p *TransactionPictureInfo) ToTransactionPictureInfoBasicResponse(originalUrl string) *TransactionPictureInfoBasicResponse

ToTransactionPictureInfoBasicResponse returns a view-object according to database model

type TransactionPictureInfoBasicResponse added in v0.6.0

type TransactionPictureInfoBasicResponse struct {
	PictureId   int64  `json:"pictureId,string"`
	OriginalUrl string `json:"originalUrl"`
}

TransactionPictureInfoBasicResponse represents a view-object of transaction picture basic info

type TransactionPictureInfoBasicResponseSlice added in v0.6.0

type TransactionPictureInfoBasicResponseSlice []*TransactionPictureInfoBasicResponse

TransactionPictureInfoBasicResponseSlice represents the slice data structure of TransactionPictureInfoBasicResponse

func (TransactionPictureInfoBasicResponseSlice) Len added in v0.6.0

Len returns the count of items

func (TransactionPictureInfoBasicResponseSlice) Less added in v0.6.0

Less reports whether the first item is less than the second one

func (TransactionPictureInfoBasicResponseSlice) Swap added in v0.6.0

Swap swaps two items

type TransactionPictureUnusedDeleteRequest added in v0.6.0

type TransactionPictureUnusedDeleteRequest struct {
	Id int64 `json:"id,string" binding:"required,min=1"`
}

TransactionPictureUnusedDeleteRequest represents all parameters of unused transaction picture deleting request

type TransactionReconciliationStatementRequest added in v1.0.0

type TransactionReconciliationStatementRequest struct {
	AccountId int64 `form:"account_id,string" binding:"required,min=1"`
	StartTime int64 `form:"start_time"`
	EndTime   int64 `form:"end_time"`
}

TransactionReconciliationStatementRequest represents all parameters of transaction reconciliation statement request

type TransactionReconciliationStatementResponse added in v1.0.0

type TransactionReconciliationStatementResponse struct {
	Transactions   []*TransactionReconciliationStatementResponseItem `json:"transactions"`
	TotalInflows   int64                                             `json:"totalInflows"`
	TotalOutflows  int64                                             `json:"totalOutflows"`
	OpeningBalance int64                                             `json:"openingBalance"`
	ClosingBalance int64                                             `json:"closingBalance"`
}

TransactionReconciliationStatementResponse represents the response of all transaction reconciliation statement response

type TransactionReconciliationStatementResponseItem added in v1.0.0

type TransactionReconciliationStatementResponseItem struct {
	*TransactionInfoResponse
	AccountOpeningBalance int64 `json:"accountOpeningBalance"`
	AccountClosingBalance int64 `json:"accountClosingBalance"`
}

TransactionReconciliationStatementResponseItem represents a transaction reconciliation statement response

type TransactionRelatedAccountType added in v1.2.0

type TransactionRelatedAccountType byte

TransactionRelatedAccountType represents related account type in transaction

const (
	TRANSACTION_RELATED_ACCOUNT_TYPE_TRANSFER_FROM TransactionRelatedAccountType = 1
	TRANSACTION_RELATED_ACCOUNT_TYPE_TRANSFER_TO   TransactionRelatedAccountType = 2
)

Transaction relation types

type TransactionScheduleFrequencyType added in v0.6.0

type TransactionScheduleFrequencyType byte

TransactionScheduleFrequencyType represents transaction template schedule frequency type

const (
	TRANSACTION_SCHEDULE_FREQUENCY_TYPE_DISABLED TransactionScheduleFrequencyType = 0
	TRANSACTION_SCHEDULE_FREQUENCY_TYPE_WEEKLY   TransactionScheduleFrequencyType = 1
	TRANSACTION_SCHEDULE_FREQUENCY_TYPE_MONTHLY  TransactionScheduleFrequencyType = 2
)

Transaction template schedule frequency types

type TransactionStatisticAssetTrendsRequest added in v1.2.0

type TransactionStatisticAssetTrendsRequest struct {
	StartTime int64 `form:"start_time"`
	EndTime   int64 `form:"end_time"`
}

TransactionStatisticAssetTrendsRequest represents all parameters of transaction statistic asset trends request

type TransactionStatisticAssetTrendsResponseDataItem added in v1.2.0

type TransactionStatisticAssetTrendsResponseDataItem struct {
	AccountId             int64 `json:"accountId,string"`
	AccountOpeningBalance int64 `json:"accountOpeningBalance"`
	AccountClosingBalance int64 `json:"accountClosingBalance"`
}

TransactionStatisticAssetTrendsResponseDataItem represents an asset trends data item

type TransactionStatisticAssetTrendsResponseItem added in v1.2.0

type TransactionStatisticAssetTrendsResponseItem struct {
	Year  int32                                              `json:"year"`
	Month int32                                              `json:"month"`
	Day   int32                                              `json:"day"`
	Items []*TransactionStatisticAssetTrendsResponseDataItem `json:"items"`
}

TransactionStatisticAssetTrendsResponseItem represents the data within each statistic interval

type TransactionStatisticAssetTrendsResponseItemSlice added in v1.2.0

type TransactionStatisticAssetTrendsResponseItemSlice []*TransactionStatisticAssetTrendsResponseItem

TransactionStatisticAssetTrendsResponseItemSlice represents the slice data structure of TransactionStatisticAssetTrendsResponseItem

func (TransactionStatisticAssetTrendsResponseItemSlice) Len added in v1.2.0

Len returns the count of items

func (TransactionStatisticAssetTrendsResponseItemSlice) Less added in v1.2.0

Less reports whether the first item is less than the second one

func (TransactionStatisticAssetTrendsResponseItemSlice) Swap added in v1.2.0

Swap swaps two items

type TransactionStatisticRequest

type TransactionStatisticRequest struct {
	StartTime              int64  `form:"start_time" binding:"min=0"`
	EndTime                int64  `form:"end_time" binding:"min=0"`
	TagFilter              string `form:"tag_filter" binding:"validTagFilter"`
	Keyword                string `form:"keyword"`
	UseTransactionTimezone bool   `form:"use_transaction_timezone"`
}

TransactionStatisticRequest represents all parameters of transaction statistic request

type TransactionStatisticResponse

type TransactionStatisticResponse struct {
	StartTime int64                               `json:"startTime"`
	EndTime   int64                               `json:"endTime"`
	Items     []*TransactionStatisticResponseItem `json:"items"`
}

TransactionStatisticResponse represents transaction statistic response

type TransactionStatisticResponseItem

type TransactionStatisticResponseItem struct {
	CategoryId         int64                         `json:"categoryId,string"`
	AccountId          int64                         `json:"accountId,string"`
	RelatedAccountId   int64                         `json:"relatedAccountId,string,omitempty"`
	RelatedAccountType TransactionRelatedAccountType `json:"relatedAccountType,omitempty"`
	TotalAmount        int64                         `json:"amount"`
}

TransactionStatisticResponseItem represents total amount item for a response

type TransactionStatisticTrendsRequest added in v0.5.0

type TransactionStatisticTrendsRequest struct {
	YearMonthRangeRequest
	TagFilter              string `form:"tag_filter" binding:"validTagFilter"`
	Keyword                string `form:"keyword"`
	UseTransactionTimezone bool   `form:"use_transaction_timezone"`
}

TransactionStatisticTrendsRequest represents all parameters of transaction statistic trends request

type TransactionStatisticTrendsResponseItem added in v0.8.0

type TransactionStatisticTrendsResponseItem struct {
	Year  int32                               `json:"year"`
	Month int32                               `json:"month"`
	Items []*TransactionStatisticResponseItem `json:"items"`
}

TransactionStatisticTrendsResponseItem represents the data within each statistic interval

type TransactionStatisticTrendsResponseItemSlice added in v0.8.0

type TransactionStatisticTrendsResponseItemSlice []*TransactionStatisticTrendsResponseItem

TransactionStatisticTrendsResponseItemSlice represents the slice data structure of TransactionStatisticTrendsResponseItem

func (TransactionStatisticTrendsResponseItemSlice) Len added in v0.8.0

Len returns the count of items

func (TransactionStatisticTrendsResponseItemSlice) Less added in v0.8.0

Less reports whether the first item is less than the second one

func (TransactionStatisticTrendsResponseItemSlice) Swap added in v0.8.0

Swap swaps two items

type TransactionTag

type TransactionTag struct {
	TagId           int64  `xorm:"PK"`
	Uid             int64  `xorm:"INDEX(IDX_tag_uid_deleted_group_order) NOT NULL"`
	Deleted         bool   `xorm:"INDEX(IDX_tag_uid_deleted_group_order) NOT NULL"`
	TagGroupId      int64  `xorm:"INDEX(IDX_tag_uid_deleted_group_order) NOT NULL DEFAULT 0"`
	Name            string `xorm:"VARCHAR(64) NOT NULL"`
	DisplayOrder    int32  `xorm:"INDEX(IDX_tag_uid_deleted_group_order) NOT NULL"`
	Hidden          bool   `xorm:"NOT NULL"`
	CreatedUnixTime int64
	UpdatedUnixTime int64
	DeletedUnixTime int64
}

TransactionTag represents transaction tag data stored in database

func (*TransactionTag) FillFromOtherTag added in v0.9.0

func (t *TransactionTag) FillFromOtherTag(tag *TransactionTag)

FillFromOtherTag fills all the fields in this current tag from other transaction tag

func (*TransactionTag) ToTransactionTagInfoResponse

func (t *TransactionTag) ToTransactionTagInfoResponse() *TransactionTagInfoResponse

ToTransactionTagInfoResponse returns a view-object according to database model

type TransactionTagCreateBatchRequest added in v0.9.0

type TransactionTagCreateBatchRequest struct {
	Tags       []*TransactionTagCreateRequest `json:"tags" binding:"required"`
	GroupId    int64                          `json:"groupId,string"`
	SkipExists bool                           `json:"skipExists"`
}

TransactionTagCreateBatchRequest represents all parameters of transaction tag batch creation request

type TransactionTagCreateRequest

type TransactionTagCreateRequest struct {
	GroupId int64  `json:"groupId,string"`
	Name    string `json:"name" binding:"required,notBlank,max=64"`
}

TransactionTagCreateRequest represents all parameters of transaction tag creation request

type TransactionTagDeleteRequest

type TransactionTagDeleteRequest struct {
	Id int64 `json:"id,string" binding:"required,min=1"`
}

TransactionTagDeleteRequest represents all parameters of transaction tag deleting request

type TransactionTagFilter added in v1.3.0

type TransactionTagFilter struct {
	TagIds []int64
	Type   TransactionTagFilterType
}

func ParseTransactionTagFilter added in v1.3.0

func ParseTransactionTagFilter(tagFilterStr string) ([]*TransactionTagFilter, error)

ParseTransactionTagFilter parses transaction tag filter from string

type TransactionTagFilterType added in v0.7.0

type TransactionTagFilterType byte

TransactionTagFilterType represents transaction tag filter type

const (
	TRANSACTION_TAG_FILTER_HAS_ANY     TransactionTagFilterType = 0
	TRANSACTION_TAG_FILTER_HAS_ALL     TransactionTagFilterType = 1
	TRANSACTION_TAG_FILTER_NOT_HAS_ANY TransactionTagFilterType = 2
	TRANSACTION_TAG_FILTER_NOT_HAS_ALL TransactionTagFilterType = 3
)

Transaction tag filter types

type TransactionTagGetRequest

type TransactionTagGetRequest struct {
	Id int64 `form:"id,string" binding:"required,min=1"`
}

TransactionTagGetRequest represents all parameters of transaction tag getting request

type TransactionTagGroup added in v1.3.0

type TransactionTagGroup struct {
	TagGroupId      int64  `xorm:"PK"`
	Uid             int64  `xorm:"INDEX(IDX_tag_group_uid_deleted_order) NOT NULL"`
	Deleted         bool   `xorm:"INDEX(IDX_tag_group_uid_deleted_order) NOT NULL"`
	Name            string `xorm:"VARCHAR(64) NOT NULL"`
	DisplayOrder    int32  `xorm:"INDEX(IDX_tag_group_uid_deleted_order) NOT NULL"`
	CreatedUnixTime int64
	UpdatedUnixTime int64
	DeletedUnixTime int64
}

TransactionTagGroup represents transaction tag group data stored in database

func (*TransactionTagGroup) ToTransactionTagGroupInfoResponse added in v1.3.0

func (t *TransactionTagGroup) ToTransactionTagGroupInfoResponse() *TransactionTagGroupInfoResponse

ToTransactionTagGroupInfoResponse returns a view-object according to database model

type TransactionTagGroupCreateRequest added in v1.3.0

type TransactionTagGroupCreateRequest struct {
	Name string `json:"name" binding:"required,notBlank,max=64"`
}

TransactionTagGroupCreateRequest represents all parameters of transaction tag group creation request

type TransactionTagGroupDeleteRequest added in v1.3.0

type TransactionTagGroupDeleteRequest struct {
	Id int64 `json:"id,string" binding:"required,min=1"`
}

TransactionTagGroupDeleteRequest represents all parameters of transaction tag group deleting request

type TransactionTagGroupGetRequest added in v1.3.0

type TransactionTagGroupGetRequest struct {
	Id int64 `form:"id,string" binding:"required,min=1"`
}

TransactionTagGroupGetRequest represents all parameters of transaction tag group getting request

type TransactionTagGroupInfoResponse added in v1.3.0

type TransactionTagGroupInfoResponse struct {
	Id           int64  `json:"id,string"`
	Name         string `json:"name"`
	DisplayOrder int32  `json:"displayOrder"`
}

TransactionTagGroupInfoResponse represents a view-object of transaction tag group

type TransactionTagGroupInfoResponseSlice added in v1.3.0

type TransactionTagGroupInfoResponseSlice []*TransactionTagGroupInfoResponse

TransactionTagGroupInfoResponseSlice represents the slice data structure of TransactionTagGroupInfoResponse

func (TransactionTagGroupInfoResponseSlice) Len added in v1.3.0

Len returns the count of items

func (TransactionTagGroupInfoResponseSlice) Less added in v1.3.0

Less reports whether the first item is less than the second one

func (TransactionTagGroupInfoResponseSlice) Swap added in v1.3.0

Swap swaps two items

type TransactionTagGroupModifyRequest added in v1.3.0

type TransactionTagGroupModifyRequest struct {
	Id   int64  `json:"id,string" binding:"required,min=1"`
	Name string `json:"name" binding:"required,notBlank,max=64"`
}

TransactionTagGroupModifyRequest represents all parameters of transaction tag group modification request

type TransactionTagGroupMoveRequest added in v1.3.0

type TransactionTagGroupMoveRequest struct {
	NewDisplayOrders []*TransactionTagGroupNewDisplayOrderRequest `json:"newDisplayOrders" binding:"required,min=1"`
}

TransactionTagGroupMoveRequest represents all parameters of transaction tag group moving request

type TransactionTagGroupNewDisplayOrderRequest added in v1.3.0

type TransactionTagGroupNewDisplayOrderRequest struct {
	Id           int64 `json:"id,string" binding:"required,min=1"`
	DisplayOrder int32 `json:"displayOrder"`
}

TransactionTagGroupNewDisplayOrderRequest represents a data pair of id and display order

type TransactionTagHideRequest

type TransactionTagHideRequest struct {
	Id     int64 `json:"id,string" binding:"required,min=1"`
	Hidden bool  `json:"hidden"`
}

TransactionTagHideRequest represents all parameters of transaction tag hiding request

type TransactionTagIndex

type TransactionTagIndex struct {
	TagIndexId      int64 `xorm:"PK"`
	Uid             int64 `` /* 202-byte string literal not displayed */
	Deleted         bool  `` /* 211-byte string literal not displayed */
	TransactionTime int64 `xorm:"INDEX(IDX_transaction_tag_index_uid_deleted_transaction_time_tag_id) NOT NULL"`
	TagId           int64 `` /* 142-byte string literal not displayed */
	TransactionId   int64 `` /* 133-byte string literal not displayed */
	CreatedUnixTime int64
	UpdatedUnixTime int64
	DeletedUnixTime int64
}

TransactionTagIndex represents transaction and transaction tag relation stored in database

type TransactionTagInfoResponse

type TransactionTagInfoResponse struct {
	Id           int64  `json:"id,string"`
	Name         string `json:"name"`
	TagGroupId   int64  `json:"groupId,string"`
	DisplayOrder int32  `json:"displayOrder"`
	Hidden       bool   `json:"hidden"`
}

TransactionTagInfoResponse represents a view-object of transaction tag

type TransactionTagInfoResponseSlice

type TransactionTagInfoResponseSlice []*TransactionTagInfoResponse

TransactionTagInfoResponseSlice represents the slice data structure of TransactionTagInfoResponse

func (TransactionTagInfoResponseSlice) Len

Len returns the count of items

func (TransactionTagInfoResponseSlice) Less

Less reports whether the first item is less than the second one

func (TransactionTagInfoResponseSlice) Swap

func (s TransactionTagInfoResponseSlice) Swap(i, j int)

Swap swaps two items

type TransactionTagModifyRequest

type TransactionTagModifyRequest struct {
	Id      int64  `json:"id,string" binding:"required,min=1"`
	GroupId int64  `json:"groupId,string"`
	Name    string `json:"name" binding:"required,notBlank,max=64"`
}

TransactionTagModifyRequest represents all parameters of transaction tag modification request

type TransactionTagMoveRequest

type TransactionTagMoveRequest struct {
	NewDisplayOrders []*TransactionTagNewDisplayOrderRequest `json:"newDisplayOrders" binding:"required,min=1"`
}

TransactionTagMoveRequest represents all parameters of transaction tag moving request

type TransactionTagNewDisplayOrderRequest

type TransactionTagNewDisplayOrderRequest struct {
	Id           int64 `json:"id,string" binding:"required,min=1"`
	DisplayOrder int32 `json:"displayOrder"`
}

TransactionTagNewDisplayOrderRequest represents a data pair of id and display order

type TransactionTemplate added in v0.5.0

type TransactionTemplate struct {
	TemplateId                 int64                            `xorm:"PK"`
	Uid                        int64                            `xorm:"INDEX(IDX_transaction_template_uid_deleted_template_type_order) NOT NULL"`
	Deleted                    bool                             `` /* 148-byte string literal not displayed */
	TemplateType               TransactionTemplateType          `` /* 148-byte string literal not displayed */
	Name                       string                           `xorm:"VARCHAR(64) NOT NULL"`
	Type                       TransactionType                  `xorm:"NOT NULL"`
	CategoryId                 int64                            `xorm:"NOT NULL"`
	AccountId                  int64                            `xorm:"NOT NULL"`
	ScheduledFrequencyType     TransactionScheduleFrequencyType `xorm:"INDEX(IDX_transaction_template_deleted_type_freqtype_scheduled_time)"`
	ScheduledFrequency         string                           `xorm:"VARCHAR(100)"`
	ScheduledStartTime         *int64                           `xorm:"INDEX(IDX_transaction_template_deleted_type_freqtype_scheduled_time)"`
	ScheduledEndTime           *int64                           `xorm:"INDEX(IDX_transaction_template_deleted_type_freqtype_scheduled_time)"`
	ScheduledAt                int16                            `xorm:"INDEX(IDX_transaction_template_deleted_type_freqtype_scheduled_time)"`
	ScheduledTimezoneUtcOffset int16
	TagIds                     string `xorm:"VARCHAR(255) NOT NULL"`
	Amount                     int64  `xorm:"NOT NULL"`
	RelatedAccountId           int64  `xorm:"NOT NULL"`
	RelatedAccountAmount       int64  `xorm:"NOT NULL"`
	HideAmount                 bool   `xorm:"NOT NULL"`
	Comment                    string `xorm:"VARCHAR(255) NOT NULL"`
	DisplayOrder               int32  `xorm:"INDEX(IDX_transaction_template_uid_deleted_template_type_order) NOT NULL"`
	Hidden                     bool   `xorm:"NOT NULL"`
	CreatedUnixTime            int64
	UpdatedUnixTime            int64
	DeletedUnixTime            int64
}

TransactionTemplate represents transaction template stored in database

func (*TransactionTemplate) GetTagIds added in v0.6.0

func (t *TransactionTemplate) GetTagIds() []int64

GetTagIds returns all tag ids of the transaction template

func (*TransactionTemplate) ToTransactionTemplateInfoResponse added in v0.5.0

func (t *TransactionTemplate) ToTransactionTemplateInfoResponse(serverUtcOffset int16) *TransactionTemplateInfoResponse

ToTransactionTemplateInfoResponse returns a view-object according to database model

type TransactionTemplateCreateRequest added in v0.5.0

type TransactionTemplateCreateRequest struct {
	TemplateType               TransactionTemplateType           `json:"templateType"`
	Name                       string                            `json:"name" binding:"required,notBlank,max=64"`
	Type                       TransactionType                   `json:"type" binding:"required"`
	CategoryId                 int64                             `json:"categoryId,string" binding:"required,min=1"`
	SourceAccountId            int64                             `json:"sourceAccountId,string" binding:"required,min=1"`
	DestinationAccountId       int64                             `json:"destinationAccountId,string" binding:"min=0"`
	SourceAmount               int64                             `json:"sourceAmount" binding:"min=-99999999999,max=99999999999"`
	DestinationAmount          int64                             `json:"destinationAmount" binding:"min=-99999999999,max=99999999999"`
	HideAmount                 bool                              `json:"hideAmount"`
	TagIds                     []string                          `json:"tagIds"`
	Comment                    string                            `json:"comment" binding:"max=255"`
	ScheduledFrequencyType     *TransactionScheduleFrequencyType `json:"scheduledFrequencyType" binding:"omitempty"`
	ScheduledFrequency         *string                           `json:"scheduledFrequency" binding:"omitempty"`
	ScheduledStartDate         *string                           `json:"scheduledStartDate" binding:"omitempty"`
	ScheduledEndDate           *string                           `json:"scheduledEndDate" binding:"omitempty"`
	ScheduledTimezoneUtcOffset *int16                            `json:"utcOffset" binding:"omitempty,min=-720,max=840"`
	ClientSessionId            string                            `json:"clientSessionId"`
}

TransactionTemplateCreateRequest represents all parameters of transaction template creation request

type TransactionTemplateDeleteRequest added in v0.5.0

type TransactionTemplateDeleteRequest struct {
	Id int64 `json:"id,string" binding:"required,min=1"`
}

TransactionTemplateDeleteRequest represents all parameters of transaction template deleting request

type TransactionTemplateGetRequest added in v0.5.0

type TransactionTemplateGetRequest struct {
	Id int64 `form:"id,string" binding:"required,min=1"`
}

TransactionTemplateGetRequest represents all parameters of transaction template getting request

type TransactionTemplateHideRequest added in v0.5.0

type TransactionTemplateHideRequest struct {
	Id     int64 `json:"id,string" binding:"required,min=1"`
	Hidden bool  `json:"hidden"`
}

TransactionTemplateHideRequest represents all parameters of transaction template hiding request

type TransactionTemplateInfoResponse added in v0.5.0

type TransactionTemplateInfoResponse struct {
	*TransactionInfoResponse
	TemplateType           TransactionTemplateType           `json:"templateType"`
	Name                   string                            `json:"name"`
	ScheduledFrequencyType *TransactionScheduleFrequencyType `json:"scheduledFrequencyType,omitempty"`
	ScheduledFrequency     *string                           `json:"scheduledFrequency,omitempty"`
	ScheduledStartDate     *string                           `json:"scheduledStartDate" binding:"omitempty"`
	ScheduledEndDate       *string                           `json:"scheduledEndDate" binding:"omitempty"`
	ScheduledAt            *int16                            `json:"scheduledAt,omitempty"`
	DisplayOrder           int32                             `json:"displayOrder"`
	Hidden                 bool                              `json:"hidden"`
}

type TransactionTemplateInfoResponseSlice added in v0.5.0

type TransactionTemplateInfoResponseSlice []*TransactionTemplateInfoResponse

TransactionTemplateInfoResponseSlice represents the slice data structure of TransactionTemplateInfoResponse

func (TransactionTemplateInfoResponseSlice) Len added in v0.5.0

Len returns the count of items

func (TransactionTemplateInfoResponseSlice) Less added in v0.5.0

Less reports whether the first item is less than the second one

func (TransactionTemplateInfoResponseSlice) Swap added in v0.5.0

Swap swaps two items

type TransactionTemplateListRequest added in v0.5.0

type TransactionTemplateListRequest struct {
	TemplateType TransactionTemplateType `form:"templateType"`
}

TransactionTemplateListRequest represents all parameters of transaction template list request

type TransactionTemplateModifyNameRequest added in v0.5.0

type TransactionTemplateModifyNameRequest struct {
	Id   int64  `json:"id,string" binding:"required,min=1"`
	Name string `json:"name" binding:"required,notBlank,max=64"`
}

TransactionTemplateModifyNameRequest represents all parameters of transaction template name modification request

type TransactionTemplateModifyRequest added in v0.5.0

type TransactionTemplateModifyRequest struct {
	Id                         int64                             `json:"id,string" binding:"required,min=1"`
	Name                       string                            `json:"name" binding:"required,notBlank,max=64"`
	Type                       TransactionType                   `json:"type" binding:"required"`
	CategoryId                 int64                             `json:"categoryId,string" binding:"required,min=1"`
	SourceAccountId            int64                             `json:"sourceAccountId,string" binding:"required,min=1"`
	DestinationAccountId       int64                             `json:"destinationAccountId,string" binding:"min=0"`
	SourceAmount               int64                             `json:"sourceAmount" binding:"min=-99999999999,max=99999999999"`
	DestinationAmount          int64                             `json:"destinationAmount" binding:"min=-99999999999,max=99999999999"`
	HideAmount                 bool                              `json:"hideAmount"`
	TagIds                     []string                          `json:"tagIds"`
	Comment                    string                            `json:"comment" binding:"max=255"`
	ScheduledFrequencyType     *TransactionScheduleFrequencyType `json:"scheduledFrequencyType" binding:"omitempty"`
	ScheduledFrequency         *string                           `json:"scheduledFrequency" binding:"omitempty"`
	ScheduledStartDate         *string                           `json:"scheduledStartDate" binding:"omitempty"`
	ScheduledEndDate           *string                           `json:"scheduledEndDate" binding:"omitempty"`
	ScheduledTimezoneUtcOffset *int16                            `json:"utcOffset" binding:"omitempty,min=-720,max=840"`
}

TransactionTemplateModifyRequest represents all parameters of transaction template modification request

type TransactionTemplateMoveRequest added in v0.5.0

type TransactionTemplateMoveRequest struct {
	NewDisplayOrders []*TransactionTemplateNewDisplayOrderRequest `json:"newDisplayOrders" binding:"required,min=1"`
}

TransactionTemplateMoveRequest represents all parameters of transaction template moving request

type TransactionTemplateNewDisplayOrderRequest added in v0.5.0

type TransactionTemplateNewDisplayOrderRequest struct {
	Id           int64 `json:"id,string" binding:"required,min=1"`
	DisplayOrder int32 `json:"displayOrder"`
}

TransactionTemplateNewDisplayOrderRequest represents a data pair of id and display order

type TransactionTemplateType added in v0.5.0

type TransactionTemplateType byte

TransactionTemplateType represents transaction template type in database

const (
	TRANSACTION_TEMPLATE_TYPE_NORMAL   TransactionTemplateType = 1
	TRANSACTION_TEMPLATE_TYPE_SCHEDULE TransactionTemplateType = 2
)

Transaction template types

type TransactionType

type TransactionType byte

TransactionType represents transaction type

const (
	TRANSACTION_TYPE_MODIFY_BALANCE TransactionType = 1
	TRANSACTION_TYPE_INCOME         TransactionType = 2
	TRANSACTION_TYPE_EXPENSE        TransactionType = 3
	TRANSACTION_TYPE_TRANSFER       TransactionType = 4
)

Transaction types

func (TransactionType) ToTransactionDbType added in v0.10.0

func (t TransactionType) ToTransactionDbType() (TransactionDbType, error)

ToTransactionDbType returns the transaction db type for this enum

type TransactionWithAccountBalance added in v1.0.0

type TransactionWithAccountBalance struct {
	*Transaction
	AccountOpeningBalance int64
	AccountClosingBalance int64
}

TransactionWithAccountBalance represents a transaction item with account balance

type TwoFactor

type TwoFactor struct {
	Uid             int64  `xorm:"PK"`
	Secret          string `xorm:"VARCHAR(80) NOT NULL"`
	CreatedUnixTime int64
}

TwoFactor represents user 2fa data stored in database

type TwoFactorDisableRequest

type TwoFactorDisableRequest struct {
	Password string `json:"password" binding:"omitempty,min=6,max=128"`
}

TwoFactorDisableRequest represents all parameters of 2fa disabling request

type TwoFactorEnableConfirmRequest

type TwoFactorEnableConfirmRequest struct {
	Secret   string `json:"secret" binding:"required,notBlank,len=32"`
	Passcode string `json:"passcode" binding:"required,notBlank,len=6"`
}

TwoFactorEnableConfirmRequest represents all parameters of 2fa confirm request

type TwoFactorEnableConfirmResponse

type TwoFactorEnableConfirmResponse struct {
	Token         string   `json:"token,omitempty"`
	RecoveryCodes []string `json:"recoveryCodes"`
}

TwoFactorEnableConfirmResponse represents all response parameters after user have enabled 2fa

type TwoFactorEnableResponse

type TwoFactorEnableResponse struct {
	Secret string `json:"secret"`
	QRCode string `json:"qrcode"`
}

TwoFactorEnableResponse represents all response parameters when user requests to enable 2fa

type TwoFactorLoginRequest

type TwoFactorLoginRequest struct {
	Passcode string `json:"passcode" binding:"required,notBlank,len=6"`
}

TwoFactorLoginRequest represents all parameters of 2fa login request

type TwoFactorRecoveryCode

type TwoFactorRecoveryCode struct {
	Uid             int64  `xorm:"PK"`
	RecoveryCode    string `xorm:"VARCHAR(64) PK"`
	Used            bool   `xorm:"NOT NULL"`
	CreatedUnixTime int64
	UsedUnixTime    int64
}

TwoFactorRecoveryCode represents user 2fa recovery codes stored in database

type TwoFactorRecoveryCodeLoginRequest

type TwoFactorRecoveryCodeLoginRequest struct {
	RecoveryCode string `json:"recoveryCode" binding:"required,notBlank,len=11"`
}

TwoFactorRecoveryCodeLoginRequest represents all parameters of 2fa login request via recovery code

type TwoFactorRegenerateRecoveryCodeRequest

type TwoFactorRegenerateRecoveryCodeRequest struct {
	Password string `json:"password" binding:"omitempty,min=6,max=128"`
}

TwoFactorRegenerateRecoveryCodeRequest represents all parameters of 2fa regenerating recovery codes request

type TwoFactorStatusResponse

type TwoFactorStatusResponse struct {
	Enable    bool  `json:"enable"`
	CreatedAt int64 `json:"createdAt,omitempty"`
}

TwoFactorStatusResponse represents a view-object of 2fa status

type User

type User struct {
	Uid                   int64  `xorm:"PK"`
	Username              string `xorm:"VARCHAR(32) UNIQUE NOT NULL"`
	Email                 string `xorm:"VARCHAR(100) UNIQUE NOT NULL"`
	Nickname              string `xorm:"VARCHAR(64) NOT NULL"`
	Password              string `xorm:"VARCHAR(64) NOT NULL"`
	Salt                  string `xorm:"VARCHAR(10) NOT NULL"`
	CustomAvatarType      string `xorm:"VARCHAR(10)"`
	DefaultAccountId      int64
	TransactionEditScope  TransactionEditScope       `xorm:"TINYINT NOT NULL"`
	Language              string                     `xorm:"VARCHAR(10)"`
	DefaultCurrency       string                     `xorm:"VARCHAR(3) NOT NULL"`
	FirstDayOfWeek        core.WeekDay               `xorm:"TINYINT NOT NULL"`
	FiscalYearStart       core.FiscalYearStart       `xorm:"SMALLINT"`
	CalendarDisplayType   core.CalendarDisplayType   `xorm:"TINYINT"`
	DateDisplayType       core.DateDisplayType       `xorm:"TINYINT"`
	LongDateFormat        core.LongDateFormat        `xorm:"TINYINT"`
	ShortDateFormat       core.ShortDateFormat       `xorm:"TINYINT"`
	LongTimeFormat        core.LongTimeFormat        `xorm:"TINYINT"`
	ShortTimeFormat       core.ShortTimeFormat       `xorm:"TINYINT"`
	FiscalYearFormat      core.FiscalYearFormat      `xorm:"TINYINT"`
	CurrencyDisplayType   core.CurrencyDisplayType   `xorm:"TINYINT"`
	NumeralSystem         core.NumeralSystem         `xorm:"TINYINT"`
	DecimalSeparator      core.DecimalSeparator      `xorm:"TINYINT"`
	DigitGroupingSymbol   core.DigitGroupingSymbol   `xorm:"TINYINT"`
	DigitGrouping         core.DigitGroupingType     `xorm:"TINYINT"`
	CoordinateDisplayType core.CoordinateDisplayType `xorm:"TINYINT"`
	ExpenseAmountColor    AmountColorType            `xorm:"TINYINT"`
	IncomeAmountColor     AmountColorType            `xorm:"TINYINT"`
	FeatureRestriction    core.UserFeatureRestrictions
	Disabled              bool
	Deleted               bool `xorm:"NOT NULL"`
	EmailVerified         bool `xorm:"NOT NULL"`
	CreatedUnixTime       int64
	UpdatedUnixTime       int64
	DeletedUnixTime       int64
	LastLoginUnixTime     int64
}

User represents user data stored in database

func (*User) CanEditTransactionByTransactionTime

func (u *User) CanEditTransactionByTransactionTime(transactionTime int64, clientTimezone *time.Location) bool

CanEditTransactionByTransactionTime returns whether this user can edit transaction with specified transaction time

func (*User) ToUserBasicInfo

func (u *User) ToUserBasicInfo(avatarProvider core.UserAvatarProviderType, avatarUrl string) *UserBasicInfo

ToUserBasicInfo returns a user basic view-object according to database model

func (*User) ToUserProfileResponse

func (u *User) ToUserProfileResponse(basicInfo *UserBasicInfo) *UserProfileResponse

ToUserProfileResponse returns a user profile view-object according to database model

type UserApplicationCloudSetting added in v0.10.0

type UserApplicationCloudSetting struct {
	Uid             int64                        `xorm:"PK"`
	Settings        ApplicationCloudSettingSlice `xorm:"BLOB"`
	UpdatedUnixTime int64
}

UserApplicationCloudSetting represents user application cloud setting stored in database

type UserApplicationCloudSettingType added in v0.10.0

type UserApplicationCloudSettingType string
const (
	USER_APPLICATION_CLOUD_SETTING_TYPE_STRING             UserApplicationCloudSettingType = "string"
	USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER             UserApplicationCloudSettingType = "number"
	USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN            UserApplicationCloudSettingType = "boolean"
	USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP UserApplicationCloudSettingType = "string_boolean_map"
)

type UserApplicationCloudSettingsUpdateRequest added in v0.10.0

type UserApplicationCloudSettingsUpdateRequest struct {
	Settings   ApplicationCloudSettingSlice `json:"settings"`
	FullUpdate bool                         `json:"fullUpdate"`
}

UserApplicationCloudSettingsUpdateRequest represents all parameters of application cloud settings update request

type UserBasicInfo

type UserBasicInfo struct {
	Username              string                     `json:"username"`
	Email                 string                     `json:"email"`
	Nickname              string                     `json:"nickname"`
	AvatarUrl             string                     `json:"avatar"`
	AvatarProvider        string                     `json:"avatarProvider,omitempty"`
	DefaultAccountId      int64                      `json:"defaultAccountId,string"`
	TransactionEditScope  TransactionEditScope       `json:"transactionEditScope"`
	Language              string                     `json:"language"`
	DefaultCurrency       string                     `json:"defaultCurrency"`
	FirstDayOfWeek        core.WeekDay               `json:"firstDayOfWeek"`
	FiscalYearStart       core.FiscalYearStart       `json:"fiscalYearStart"`
	CalendarDisplayType   core.CalendarDisplayType   `json:"calendarDisplayType"`
	DateDisplayType       core.DateDisplayType       `json:"dateDisplayType"`
	LongDateFormat        core.LongDateFormat        `json:"longDateFormat"`
	ShortDateFormat       core.ShortDateFormat       `json:"shortDateFormat"`
	LongTimeFormat        core.LongTimeFormat        `json:"longTimeFormat"`
	ShortTimeFormat       core.ShortTimeFormat       `json:"shortTimeFormat"`
	FiscalYearFormat      core.FiscalYearFormat      `json:"fiscalYearFormat"`
	CurrencyDisplayType   core.CurrencyDisplayType   `json:"currencyDisplayType"`
	NumeralSystem         core.NumeralSystem         `json:"numeralSystem"`
	DecimalSeparator      core.DecimalSeparator      `json:"decimalSeparator"`
	DigitGroupingSymbol   core.DigitGroupingSymbol   `json:"digitGroupingSymbol"`
	DigitGrouping         core.DigitGroupingType     `json:"digitGrouping"`
	CoordinateDisplayType core.CoordinateDisplayType `json:"coordinateDisplayType"`
	ExpenseAmountColor    AmountColorType            `json:"expenseAmountColor"`
	IncomeAmountColor     AmountColorType            `json:"incomeAmountColor"`
	EmailVerified         bool                       `json:"emailVerified"`
}

UserBasicInfo represents a view-object of user basic info

type UserCustomExchangeRate added in v0.9.0

type UserCustomExchangeRate struct {
	Uid             int64  `xorm:"PK NOT NULL"`
	DeletedUnixTime int64  `xorm:"PK NOT NULL"`
	Currency        string `xorm:"PK VARCHAR(3) NOT NULL"`
	Rate            int64  `xorm:"NOT NULL"`
	CreatedUnixTime int64
	UpdatedUnixTime int64
}

UserCustomExchangeRate represents user custom exchange rate data

func CreateUserCustomExchangeRate added in v0.9.0

func CreateUserCustomExchangeRate(uid int64, currency string, exchangeRate string, baseCurrencyRate int64) (*UserCustomExchangeRate, error)

CreateUserCustomExchangeRate returns a user custom exchange rate database model according to currency and rate

func (*UserCustomExchangeRate) ToLatestExchangeRate added in v0.9.0

func (r *UserCustomExchangeRate) ToLatestExchangeRate(baseCurrencyRate int64) *LatestExchangeRate

ToLatestExchangeRate returns a data pair of currency and exchange rate according to database model

func (*UserCustomExchangeRate) ToUserCustomExchangeRateUpdateResponse added in v0.9.0

func (r *UserCustomExchangeRate) ToUserCustomExchangeRateUpdateResponse(baseCurrencyRate int64) *UserCustomExchangeRateUpdateResponse

ToUserCustomExchangeRateUpdateResponse returns a view-object of the result of updating user custom exchange rate data according to database model

type UserCustomExchangeRateDeleteRequest added in v0.9.0

type UserCustomExchangeRateDeleteRequest struct {
	Currency string `json:"currency" binding:"required,len=3,validCurrency"`
}

UserCustomExchangeRateDeleteRequest represents all parameters of user custom exchange rate data deleting request

type UserCustomExchangeRateUpdateRequest added in v0.9.0

type UserCustomExchangeRateUpdateRequest struct {
	Currency string `json:"currency" binding:"required,len=3,validCurrency"`
	Rate     string `json:"rate"`
}

UserCustomExchangeRateUpdateRequest represents all parameters of user custom exchange rate data updating request

type UserCustomExchangeRateUpdateResponse added in v0.9.0

type UserCustomExchangeRateUpdateResponse struct {
	LatestExchangeRate
	UpdateTime int64 `json:"updateTime"`
}

UserCustomExchangeRateUpdateResponse represents a view-object of the result of updating user custom exchange rate data

type UserExternalAuth added in v1.2.0

type UserExternalAuth struct {
	Uid              int64                     `xorm:"PK"`
	ExternalAuthType core.UserExternalAuthType `xorm:"VARCHAR(32) PK UNIQUE(uqe_userexternalauth_authtype_username) UNIQUE(uqe_userexternalauth_authtype_email)"`
	ExternalUsername string                    `xorm:"VARCHAR(32) UNIQUE(uqe_userexternalauth_authtype_username) NOT NULL"`
	ExternalEmail    string                    `xorm:"VARCHAR(100) UNIQUE(uqe_userexternalauth_authtype_email) NOT NULL"`
	CreatedUnixTime  int64
}

UserExternalAuth represents user external auth data stored in database

func (*UserExternalAuth) ToUserExternalAuthInfoResponse added in v1.2.0

func (a *UserExternalAuth) ToUserExternalAuthInfoResponse() *UserExternalAuthInfoResponse

ToUserExternalAuthInfoResponse returns a view-object according to database model

type UserExternalAuthInfoResponse added in v1.2.0

type UserExternalAuthInfoResponse struct {
	ExternalAuthCategory string                    `json:"externalAuthCategory"`
	ExternalAuthType     core.UserExternalAuthType `json:"externalAuthType"`
	Linked               bool                      `json:"linked"`
	ExternalUsername     string                    `json:"externalUsername,omitempty"`
	CreatedAt            int64                     `json:"createdAt,omitempty"`
}

UserExternalAuthInfoResponse represents a view-object of user external auth

type UserExternalAuthInfoResponsesSlice added in v1.2.0

type UserExternalAuthInfoResponsesSlice []*UserExternalAuthInfoResponse

UserExternalAuthInfoResponsesSlice represents the slice data structure of UserExternalAuthInfoResponse

func (UserExternalAuthInfoResponsesSlice) Len added in v1.2.0

Len returns the count of items

func (UserExternalAuthInfoResponsesSlice) Less added in v1.2.0

Less reports whether the first item is less than the second one

func (UserExternalAuthInfoResponsesSlice) Swap added in v1.2.0

Swap swaps two items

type UserExternalAuthUnlinkRequest added in v1.2.0

type UserExternalAuthUnlinkRequest struct {
	ExternalAuthType string `json:"externalAuthType" binding:"required,notBlank"`
	Password         string `json:"password" binding:"required,min=6,max=128"`
}

UserExternalAuthUnlinkRequest represents all parameters of user external auth unlink request

type UserLoginRequest

type UserLoginRequest struct {
	LoginName string `json:"loginName" binding:"required,notBlank,max=100,validUsername|validEmail"`
	Password  string `json:"password" binding:"required,min=6,max=128"`
}

UserLoginRequest represents all parameters of user login request

type UserProfileResponse

type UserProfileResponse struct {
	*UserBasicInfo
	NoPassword  bool  `json:"noPassword,omitempty"`
	LastLoginAt int64 `json:"lastLoginAt"`
}

UserProfileResponse represents a view-object of user profile

type UserProfileUpdateRequest

type UserProfileUpdateRequest struct {
	Email                 string                      `json:"email" binding:"omitempty,notBlank,max=100,validEmail"`
	Nickname              string                      `json:"nickname" binding:"omitempty,notBlank,max=64,validNickname"`
	Password              string                      `json:"password" binding:"omitempty,min=6,max=128"`
	OldPassword           string                      `json:"oldPassword" binding:"omitempty,min=6,max=128"`
	DefaultAccountId      int64                       `json:"defaultAccountId,string" binding:"omitempty,min=1"`
	TransactionEditScope  *TransactionEditScope       `json:"transactionEditScope" binding:"omitempty,min=0,max=6"`
	Language              string                      `json:"language" binding:"omitempty,min=2,max=16"`
	DefaultCurrency       string                      `json:"defaultCurrency" binding:"omitempty,len=3,validCurrency"`
	FirstDayOfWeek        *core.WeekDay               `json:"firstDayOfWeek" binding:"omitempty,min=0,max=6"`
	FiscalYearStart       *core.FiscalYearStart       `json:"fiscalYearStart" binding:"omitempty,validFiscalYearStart"`
	CalendarDisplayType   *core.CalendarDisplayType   `json:"calendarDisplayType" binding:"omitempty,min=0,max=4"`
	DateDisplayType       *core.DateDisplayType       `json:"dateDisplayType" binding:"omitempty,min=0,max=3"`
	LongDateFormat        *core.LongDateFormat        `json:"longDateFormat" binding:"omitempty,min=0,max=3"`
	ShortDateFormat       *core.ShortDateFormat       `json:"shortDateFormat" binding:"omitempty,min=0,max=3"`
	LongTimeFormat        *core.LongTimeFormat        `json:"longTimeFormat" binding:"omitempty,min=0,max=3"`
	ShortTimeFormat       *core.ShortTimeFormat       `json:"shortTimeFormat" binding:"omitempty,min=0,max=3"`
	FiscalYearFormat      *core.FiscalYearFormat      `json:"fiscalYearFormat" binding:"omitempty,min=0,max=5"`
	CurrencyDisplayType   *core.CurrencyDisplayType   `json:"currencyDisplayType" binding:"omitempty,min=0,max=11"`
	NumeralSystem         *core.NumeralSystem         `json:"numeralSystem" binding:"omitempty,min=0,max=5"`
	DecimalSeparator      *core.DecimalSeparator      `json:"decimalSeparator" binding:"omitempty,min=0,max=3"`
	DigitGroupingSymbol   *core.DigitGroupingSymbol   `json:"digitGroupingSymbol" binding:"omitempty,min=0,max=4"`
	DigitGrouping         *core.DigitGroupingType     `json:"digitGrouping" binding:"omitempty,min=0,max=3"`
	CoordinateDisplayType *core.CoordinateDisplayType `json:"coordinateDisplayType" binding:"omitempty,min=0,max=6"`
	ExpenseAmountColor    *AmountColorType            `json:"expenseAmountColor" binding:"omitempty,min=0,max=4"`
	IncomeAmountColor     *AmountColorType            `json:"incomeAmountColor" binding:"omitempty,min=0,max=4"`
}

UserProfileUpdateRequest represents all parameters of user updating profile request

type UserProfileUpdateResponse

type UserProfileUpdateResponse struct {
	User     *UserBasicInfo `json:"user"`
	NewToken string         `json:"newToken,omitempty"`
}

UserProfileUpdateResponse represents the data returns to frontend after updating profile

type UserRegisterRequest

type UserRegisterRequest struct {
	Username        string       `json:"username" binding:"required,notBlank,max=32,validUsername"`
	Email           string       `json:"email" binding:"required,notBlank,max=100,validEmail"`
	Nickname        string       `json:"nickname" binding:"required,notBlank,max=64,validNickname"`
	Password        string       `json:"password" binding:"required,min=6,max=128"`
	Language        string       `json:"language" binding:"required,min=2,max=16"`
	DefaultCurrency string       `json:"defaultCurrency" binding:"required,len=3,validCurrency"`
	FirstDayOfWeek  core.WeekDay `json:"firstDayOfWeek" binding:"min=0,max=6"`
	TransactionCategoryCreateBatchRequest
}

UserRegisterRequest represents all parameters of user registering request

type UserResendVerifyEmailRequest added in v0.4.0

type UserResendVerifyEmailRequest struct {
	Email    string `json:"email" binding:"omitempty,max=100,validEmail"`
	Password string `json:"password" binding:"omitempty,min=6,max=128"`
}

UserResendVerifyEmailRequest represents all parameters of user resend verify email request

type UserVerifyEmailRequest added in v0.4.0

type UserVerifyEmailRequest struct {
	RequestNewToken bool `json:"requestNewToken" binding:"omitempty"`
}

UserVerifyEmailRequest represents all parameters of user verify email request

type UserVerifyEmailResponse added in v0.4.0

type UserVerifyEmailResponse struct {
	NewToken            string         `json:"newToken,omitempty"`
	User                *UserBasicInfo `json:"user"`
	NotificationContent string         `json:"notificationContent,omitempty"`
}

UserVerifyEmailResponse represents all response parameters after user have verified email

type YearMonthRangeRequest added in v0.5.0

type YearMonthRangeRequest struct {
	StartYearMonth string `form:"start_year_month"`
	EndYearMonth   string `form:"end_year_month"`
}

YearMonthRangeRequest represents all parameters of a request with year and month range

func (*YearMonthRangeRequest) GetNumericYearMonthRange added in v0.5.0

func (t *YearMonthRangeRequest) GetNumericYearMonthRange() (int32, int32, int32, int32, error)

GetNumericYearMonthRange returns numeric start year, start month, end year and end month

Jump to

Keyboard shortcuts

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