Versions in this module Expand all Collapse all v1 v1.0.0 Mar 8, 2026 Changes in this version + type Account struct + BalanceCents int64 + CreatedAt pgtype.Timestamptz + Currency string + DeletedAt pgtype.Timestamptz + ID string + Name string + TenantID string + Type AccountType + UpdatedAt pgtype.Timestamptz + UserID string + type AccountType string + const AccountTypeChecking + const AccountTypeCreditCard + const AccountTypeInvestment + const AccountTypeSavings + func (e *AccountType) Scan(src interface{}) error + type AdminListAllAuditLogsParams struct + Action NullAuditAction + ActorID string + EndDate pgtype.Timestamptz + EntityID pgtype.Text + EntityType pgtype.Text + LimitOff int32 + OffsetOff int32 + StartDate pgtype.Timestamptz + type AdminUpdateTenantPlanParams struct + ID string + Plan TenantPlan + type AuditAction string + const AuditActionCreate + const AuditActionLogin + const AuditActionLoginFailed + const AuditActionOtpRequested + const AuditActionOtpVerified + const AuditActionRestore + const AuditActionSoftDelete + const AuditActionUpdate + func (e *AuditAction) Scan(src interface{}) error + type AuditLog struct + Action AuditAction + ActorID string + ActorRole UserRole + CreatedAt pgtype.Timestamptz + EntityID pgtype.Text + EntityType string + ID string + IpAddress *netip.Addr + NewValues []byte + OldValues []byte + TenantID string + UserAgent pgtype.Text + type Category struct + Color pgtype.Text + CreatedAt pgtype.Timestamptz + DeletedAt pgtype.Timestamptz + ID string + Icon pgtype.Text + Name string + ParentID pgtype.Text + TenantID string + Type CategoryType + UpdatedAt pgtype.Timestamptz + type CategoryType string + const CategoryTypeExpense + const CategoryTypeIncome + const CategoryTypeTransfer + func (e *CategoryType) Scan(src interface{}) error + type CreateAccountParams struct + BalanceCents int64 + Currency string + ID string + Name string + TenantID string + Type AccountType + UserID string + type CreateAuditLogParams struct + Action AuditAction + ActorID string + ActorRole UserRole + EntityID pgtype.Text + EntityType string + ID string + IpAddress *netip.Addr + NewValues []byte + OldValues []byte + TenantID string + UserAgent pgtype.Text + type CreateCategoryParams struct + Color pgtype.Text + ID string + Icon pgtype.Text + Name string + ParentID pgtype.Text + TenantID string + Type CategoryType + type CreateOTPRequestParams struct + CodeHash string + Email string + ExpiresAt pgtype.Timestamptz + ID string + Used bool + type CreateTenantParams struct + ID string + Name string + Plan TenantPlan + type CreateTransactionParams struct + AccountID string + AmountCents int64 + CategoryID string + Description string + ID string + MasterPurchaseID pgtype.Text + OccurredAt pgtype.Timestamptz + TenantID string + Type TransactionType + UserID string + type CreateUserParams struct + Email string + ID string + Name string + Role UserRole + TenantID string + type DBTX interface + Exec func(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query func(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow func(context.Context, string, ...interface{}) pgx.Row + type GetAccountByIDParams struct + ID string + TenantID string + type GetCategoryByIDParams struct + ID string + TenantID string + type GetTransactionByIDParams struct + ID string + TenantID string + type GetUserByIDParams struct + ID string + TenantID string + type ListAccountsByUserParams struct + TenantID string + UserID string + type ListAuditLogsByEntityParams struct + EntityID pgtype.Text + EntityType string + TenantID string + type ListAuditLogsByTenantParams struct + LimitOff int32 + OffsetOff int32 + TenantID string + type ListChildCategoriesParams struct + ParentID pgtype.Text + TenantID string + type ListTransactionsByTenantParams struct + AccountID pgtype.Text + CategoryID pgtype.Text + EndDate pgtype.Timestamptz + LimitCount interface{} + OffsetCount int32 + StartDate pgtype.Timestamptz + TenantID string + Type NullTransactionType + type MasterPurchase struct + AccountID string + CategoryID string + CreatedAt pgtype.Timestamptz + DeletedAt pgtype.Timestamptz + Description string + FirstDueDate pgtype.Date + ID string + InstallmentCents int64 + InstallmentCount int16 + LastSettledInstallment int16 + TenantID string + TotalAmountCents int64 + UpdatedAt pgtype.Timestamptz + UserID string + type NullAccountType struct + AccountType AccountType + Valid bool + func (ns *NullAccountType) Scan(value interface{}) error + func (ns NullAccountType) Value() (driver.Value, error) + type NullAuditAction struct + AuditAction AuditAction + Valid bool + func (ns *NullAuditAction) Scan(value interface{}) error + func (ns NullAuditAction) Value() (driver.Value, error) + type NullCategoryType struct + CategoryType CategoryType + Valid bool + func (ns *NullCategoryType) Scan(value interface{}) error + func (ns NullCategoryType) Value() (driver.Value, error) + type NullTenantPlan struct + TenantPlan TenantPlan + Valid bool + func (ns *NullTenantPlan) Scan(value interface{}) error + func (ns NullTenantPlan) Value() (driver.Value, error) + type NullTransactionType struct + TransactionType TransactionType + Valid bool + func (ns *NullTransactionType) Scan(value interface{}) error + func (ns NullTransactionType) Value() (driver.Value, error) + type NullUserRole struct + UserRole UserRole + Valid bool + func (ns *NullUserRole) Scan(value interface{}) error + func (ns NullUserRole) Value() (driver.Value, error) + type OtpRequest struct + CodeHash string + CreatedAt pgtype.Timestamptz + Email string + ExpiresAt pgtype.Timestamptz + ID string + Used bool + type Querier interface + AdminForceDeleteUser func(ctx context.Context, id string) error + AdminGetTenantByID func(ctx context.Context, id string) (Tenant, error) + AdminGetUserByID func(ctx context.Context, id string) (User, error) + AdminHardDeleteTenant func(ctx context.Context, id string) error + AdminListAllAuditLogs func(ctx context.Context, arg AdminListAllAuditLogsParams) ([]AuditLog, error) + AdminListAllTenants func(ctx context.Context, withDeleted bool) ([]Tenant, error) + AdminListAllUsers func(ctx context.Context) ([]User, error) + AdminRestoreTenant func(ctx context.Context, id string) error + AdminSuspendTenant func(ctx context.Context, id string) error + AdminUpdateTenantPlan func(ctx context.Context, arg AdminUpdateTenantPlanParams) (Tenant, error) + CreateAccount func(ctx context.Context, arg CreateAccountParams) (Account, error) + CreateAuditLog func(ctx context.Context, arg CreateAuditLogParams) (AuditLog, error) + CreateCategory func(ctx context.Context, arg CreateCategoryParams) (Category, error) + CreateOTPRequest func(ctx context.Context, arg CreateOTPRequestParams) (OtpRequest, error) + CreateTenant func(ctx context.Context, arg CreateTenantParams) (Tenant, error) + CreateTransaction func(ctx context.Context, arg CreateTransactionParams) (Transaction, error) + CreateUser func(ctx context.Context, arg CreateUserParams) (User, error) + DeleteExpiredOTPs func(ctx context.Context) error + GetAccountByID func(ctx context.Context, arg GetAccountByIDParams) (Account, error) + GetActiveOTPByEmail func(ctx context.Context, email string) (OtpRequest, error) + GetCategoryByID func(ctx context.Context, arg GetCategoryByIDParams) (Category, error) + GetTenantByID func(ctx context.Context, id string) (Tenant, error) + GetTransactionByID func(ctx context.Context, arg GetTransactionByIDParams) (Transaction, error) + GetUserByEmail func(ctx context.Context, email string) (User, error) + GetUserByID func(ctx context.Context, arg GetUserByIDParams) (User, error) + ListAccountsByTenant func(ctx context.Context, tenantID string) ([]Account, error) + ListAccountsByUser func(ctx context.Context, arg ListAccountsByUserParams) ([]Account, error) + ListAuditLogsByEntity func(ctx context.Context, arg ListAuditLogsByEntityParams) ([]AuditLog, error) + ListAuditLogsByTenant func(ctx context.Context, arg ListAuditLogsByTenantParams) ([]AuditLog, error) + ListCategoriesByTenant func(ctx context.Context, tenantID string) ([]Category, error) + ListChildCategories func(ctx context.Context, arg ListChildCategoriesParams) ([]Category, error) + ListTenants func(ctx context.Context) ([]Tenant, error) + ListTransactionsByTenant func(ctx context.Context, arg ListTransactionsByTenantParams) ([]Transaction, error) + ListUsersByTenant func(ctx context.Context, tenantID string) ([]User, error) + MarkOTPUsed func(ctx context.Context, id string) error + SoftDeleteAccount func(ctx context.Context, arg SoftDeleteAccountParams) error + SoftDeleteCategory func(ctx context.Context, arg SoftDeleteCategoryParams) error + SoftDeleteTenant func(ctx context.Context, id string) error + SoftDeleteTransaction func(ctx context.Context, arg SoftDeleteTransactionParams) error + SoftDeleteUser func(ctx context.Context, arg SoftDeleteUserParams) error + UpdateAccount func(ctx context.Context, arg UpdateAccountParams) (Account, error) + UpdateAccountBalance func(ctx context.Context, arg UpdateAccountBalanceParams) error + UpdateCategory func(ctx context.Context, arg UpdateCategoryParams) (Category, error) + UpdateTenant func(ctx context.Context, arg UpdateTenantParams) (Tenant, error) + UpdateTransaction func(ctx context.Context, arg UpdateTransactionParams) (Transaction, error) + UpdateUser func(ctx context.Context, arg UpdateUserParams) (User, error) + UpdateUserLastLogin func(ctx context.Context, id string) error + type Queries struct + func New(db DBTX) *Queries + func (q *Queries) AdminForceDeleteUser(ctx context.Context, id string) error + func (q *Queries) AdminGetTenantByID(ctx context.Context, id string) (Tenant, error) + func (q *Queries) AdminGetUserByID(ctx context.Context, id string) (User, error) + func (q *Queries) AdminHardDeleteTenant(ctx context.Context, id string) error + func (q *Queries) AdminListAllAuditLogs(ctx context.Context, arg AdminListAllAuditLogsParams) ([]AuditLog, error) + func (q *Queries) AdminListAllTenants(ctx context.Context, withDeleted bool) ([]Tenant, error) + func (q *Queries) AdminListAllUsers(ctx context.Context) ([]User, error) + func (q *Queries) AdminRestoreTenant(ctx context.Context, id string) error + func (q *Queries) AdminSuspendTenant(ctx context.Context, id string) error + func (q *Queries) AdminUpdateTenantPlan(ctx context.Context, arg AdminUpdateTenantPlanParams) (Tenant, error) + func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) (Account, error) + func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) (AuditLog, error) + func (q *Queries) CreateCategory(ctx context.Context, arg CreateCategoryParams) (Category, error) + func (q *Queries) CreateOTPRequest(ctx context.Context, arg CreateOTPRequestParams) (OtpRequest, error) + func (q *Queries) CreateTenant(ctx context.Context, arg CreateTenantParams) (Tenant, error) + func (q *Queries) CreateTransaction(ctx context.Context, arg CreateTransactionParams) (Transaction, error) + func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) + func (q *Queries) DeleteExpiredOTPs(ctx context.Context) error + func (q *Queries) GetAccountByID(ctx context.Context, arg GetAccountByIDParams) (Account, error) + func (q *Queries) GetActiveOTPByEmail(ctx context.Context, email string) (OtpRequest, error) + func (q *Queries) GetCategoryByID(ctx context.Context, arg GetCategoryByIDParams) (Category, error) + func (q *Queries) GetTenantByID(ctx context.Context, id string) (Tenant, error) + func (q *Queries) GetTransactionByID(ctx context.Context, arg GetTransactionByIDParams) (Transaction, error) + func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error) + func (q *Queries) GetUserByID(ctx context.Context, arg GetUserByIDParams) (User, error) + func (q *Queries) ListAccountsByTenant(ctx context.Context, tenantID string) ([]Account, error) + func (q *Queries) ListAccountsByUser(ctx context.Context, arg ListAccountsByUserParams) ([]Account, error) + func (q *Queries) ListAuditLogsByEntity(ctx context.Context, arg ListAuditLogsByEntityParams) ([]AuditLog, error) + func (q *Queries) ListAuditLogsByTenant(ctx context.Context, arg ListAuditLogsByTenantParams) ([]AuditLog, error) + func (q *Queries) ListCategoriesByTenant(ctx context.Context, tenantID string) ([]Category, error) + func (q *Queries) ListChildCategories(ctx context.Context, arg ListChildCategoriesParams) ([]Category, error) + func (q *Queries) ListTenants(ctx context.Context) ([]Tenant, error) + func (q *Queries) ListTransactionsByTenant(ctx context.Context, arg ListTransactionsByTenantParams) ([]Transaction, error) + func (q *Queries) ListUsersByTenant(ctx context.Context, tenantID string) ([]User, error) + func (q *Queries) MarkOTPUsed(ctx context.Context, id string) error + func (q *Queries) SoftDeleteAccount(ctx context.Context, arg SoftDeleteAccountParams) error + func (q *Queries) SoftDeleteCategory(ctx context.Context, arg SoftDeleteCategoryParams) error + func (q *Queries) SoftDeleteTenant(ctx context.Context, id string) error + func (q *Queries) SoftDeleteTransaction(ctx context.Context, arg SoftDeleteTransactionParams) error + func (q *Queries) SoftDeleteUser(ctx context.Context, arg SoftDeleteUserParams) error + func (q *Queries) UpdateAccount(ctx context.Context, arg UpdateAccountParams) (Account, error) + func (q *Queries) UpdateAccountBalance(ctx context.Context, arg UpdateAccountBalanceParams) error + func (q *Queries) UpdateCategory(ctx context.Context, arg UpdateCategoryParams) (Category, error) + func (q *Queries) UpdateTenant(ctx context.Context, arg UpdateTenantParams) (Tenant, error) + func (q *Queries) UpdateTransaction(ctx context.Context, arg UpdateTransactionParams) (Transaction, error) + func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) + func (q *Queries) UpdateUserLastLogin(ctx context.Context, id string) error + func (q *Queries) WithTx(tx pgx.Tx) *Queries + type SoftDeleteAccountParams struct + ID string + TenantID string + type SoftDeleteCategoryParams struct + ID string + TenantID string + type SoftDeleteTransactionParams struct + ID string + TenantID string + type SoftDeleteUserParams struct + ID string + TenantID string + type Tenant struct + CreatedAt pgtype.Timestamptz + DeletedAt pgtype.Timestamptz + ID string + Name string + Plan TenantPlan + UpdatedAt pgtype.Timestamptz + type TenantPlan string + const TenantPlanBasic + const TenantPlanFree + const TenantPlanPremium + func (e *TenantPlan) Scan(src interface{}) error + type Transaction struct + AccountID string + AmountCents int64 + CategoryID string + CreatedAt pgtype.Timestamptz + DeletedAt pgtype.Timestamptz + Description string + ID string + MasterPurchaseID pgtype.Text + OccurredAt pgtype.Timestamptz + TenantID string + Type TransactionType + UpdatedAt pgtype.Timestamptz + UserID string + type TransactionType string + const TransactionTypeExpense + const TransactionTypeIncome + const TransactionTypeTransfer + func (e *TransactionType) Scan(src interface{}) error + type UpdateAccountBalanceParams struct + BalanceCents int64 + ID string + TenantID string + type UpdateAccountParams struct + Currency string + ID string + Name string + TenantID string + Type AccountType + type UpdateCategoryParams struct + Color pgtype.Text + ID string + Icon pgtype.Text + Name string + ParentID pgtype.Text + TenantID string + Type CategoryType + type UpdateTenantParams struct + ID string + Name string + Plan TenantPlan + type UpdateTransactionParams struct + AccountID string + AmountCents int64 + CategoryID string + Description string + ID string + OccurredAt pgtype.Timestamptz + TenantID string + Type TransactionType + type UpdateUserParams struct + Email string + ID string + Name string + Role UserRole + TenantID string + type User struct + CreatedAt pgtype.Timestamptz + DeletedAt pgtype.Timestamptz + Email string + ID string + LastLoginAt pgtype.Timestamptz + Name string + Role UserRole + TenantID string + UpdatedAt pgtype.Timestamptz + type UserRole string + const UserRoleAdmin + const UserRoleMember + const UserRoleSysadmin + func (e *UserRole) Scan(src interface{}) error