Documentation
¶
Index ¶
- Constants
- func FromContext(ctx context.Context, defaultInstance *gorm.DB) *gorm.DB
- func GetDb(t DbType) *gorm.DB
- func GetDbWithContext(ctx context.Context, t DbType) *gorm.DB
- func InitDb() error
- func WithContext(ctx context.Context, db *gorm.DB) context.Context
- func WithContextType(ctx context.Context, dbType DbType) context.Context
- type Account
- type AccountFlag
- type AppConfig
- type Category
- type Currency
- type DailyStat
- type DbType
- type DoubleEntry
- type ImportDeduplication
- type JtiRevocation
- type MonthlyStat
- type Rule
- type ScheduleRule
- type ServiceToken
- type SystemConfig
- type SystemConfigRepository
- type Tag
- type Transaction
- type TransactionFlags
- type User
Constants ¶
View Source
const ( DbTypeMaster = DbType(1) DbTypeReadonly = DbType(2) )
View Source
const (
SystemConfigKeyJwtPrivateKey = "jwt_private_key"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct {
ID int32
Name string
Currency string // code
CurrentBalance decimal.Decimal
Extra map[string]string `gorm:"serializer:json"`
Flags AccountFlag
LastUpdatedAt time.Time
CreatedAt time.Time
DeletedAt gorm.DeletedAt
Type gomoneypbv1.AccountType
Note string
AccountNumber string
Iban string
LiabilityPercent decimal.NullDecimal
DisplayOrder *int32
FirstTransactionAt *time.Time
}
type AccountFlag ¶ added in v0.2.0
type AccountFlag = int64
const (
AccountFlagIsDefault AccountFlag = 1 << 0
)
type AppConfig ¶ added in v0.2.25
type Category ¶
type Currency ¶
type DailyStat ¶
type DoubleEntry ¶ added in v0.2.0
type ImportDeduplication ¶
type ImportDeduplication struct {
ImportSource importv1.ImportSource
Key string
CreatedAt time.Time
TransactionID int64
}
func (*ImportDeduplication) TableName ¶
func (*ImportDeduplication) TableName() string
type JtiRevocation ¶ added in v0.2.26
type JtiRevocation struct {
ID string `gorm:"type:text;primaryKey"`
ExpiresAt time.Time `gorm:"type:timestamp;not null"`
}
func (JtiRevocation) TableName ¶ added in v0.2.26
func (JtiRevocation) TableName() string
type MonthlyStat ¶
type ScheduleRule ¶ added in v0.1.1
type ServiceToken ¶ added in v0.2.26
type SystemConfig ¶ added in v0.2.29
func (SystemConfig) TableName ¶ added in v0.2.29
func (SystemConfig) TableName() string
type SystemConfigRepository ¶ added in v0.2.29
type SystemConfigRepository struct {
// contains filtered or unexported fields
}
func NewSystemConfigRepository ¶ added in v0.2.29
func NewSystemConfigRepository(db *gorm.DB) *SystemConfigRepository
type Tag ¶
type Transaction ¶
type Transaction struct {
ID int64
SourceAmount decimal.NullDecimal
SourceCurrency string
SourceAmountInBaseCurrency decimal.NullDecimal
FxSourceAmount decimal.NullDecimal // withdrawals only
FxSourceCurrency string // withdrawals only
DestinationAmount decimal.NullDecimal
DestinationCurrency string
DestinationAmountInBaseCurrency decimal.NullDecimal
SourceAccountID int32
DestinationAccountID int32
TagIDs pq.Int32Array `gorm:"type:integer[]"`
CreatedAt time.Time
UpdatedAt time.Time
Notes string
Extra map[string]string `gorm:"serializer:json"`
TransactionDateTime time.Time `gorm:"type:timestamp"`
TransactionDateOnly time.Time `gorm:"type:date"`
TransactionType gomoneypbv1.TransactionType `gorm:"type:int"`
Flags TransactionFlags `gorm:"type:bigint"`
VoidedByTransactionID *int64
Title string
DeletedAt gorm.DeletedAt
ReferenceNumber *string
InternalReferenceNumbers pq.StringArray `gorm:"type:text[]"`
CategoryID *int32
}
type TransactionFlags ¶
type TransactionFlags int64
Click to show internal directories.
Click to hide internal directories.