models

package
v0.0.0-...-0584c80 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID          int32            `json:"id"`
	WorkspaceID int32            `json:"workspace_id"`
	Name        string           `json:"name"`
	Balance     pgtype.Numeric   `json:"balance"`
	Color       *string          `json:"color"`
	Icon        *string          `json:"icon"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
	UpdatedAt   pgtype.Timestamp `json:"updated_at"`
}

type Category

type Category struct {
	ID          int32            `json:"id"`
	WorkspaceID int32            `json:"workspace_id"`
	Name        string           `json:"name"`
	Description *string          `json:"description"`
	Type        string           `json:"type"`
	Color       *string          `json:"color"`
	Icon        *string          `json:"icon"`
	CreatedBy   int32            `json:"created_by"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
	UpdatedAt   pgtype.Timestamp `json:"updated_at"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Invitation

type Invitation struct {
	Token         string           `json:"token"`
	Permission    string           `json:"permission"`
	WorkspaceID   int32            `json:"workspace_id"`
	InvitedUserID int32            `json:"invited_user_id"`
	InvitedBy     int32            `json:"invited_by"`
	CreatedAt     pgtype.Timestamp `json:"created_at"`
	DeletedAt     pgtype.Timestamp `json:"deleted_at"`
}

type Note

type Note struct {
	ID        int32            `json:"id"`
	Uid       string           `json:"uid"`
	Title     string           `json:"title"`
	Content   string           `json:"content"`
	UserID    int32            `json:"user_id"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type NotesDeleteParams

type NotesDeleteParams struct {
	ID     int32 `json:"id"`
	UserID int32 `json:"user_id"`
}

type NotesGetByIDParams

type NotesGetByIDParams struct {
	ID     int32 `json:"id"`
	UserID int32 `json:"user_id"`
}

type NotesGetByIDRow

type NotesGetByIDRow struct {
	ID        int32            `json:"id"`
	UserID    int32            `json:"user_id"`
	Title     string           `json:"title"`
	Content   string           `json:"content"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
}

type NotesGetByUserRow

type NotesGetByUserRow struct {
	ID        int32            `json:"id"`
	UserID    int32            `json:"user_id"`
	Title     string           `json:"title"`
	Content   string           `json:"content"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
}

type NotesInsertParams

type NotesInsertParams struct {
	UserID  int32  `json:"user_id"`
	Title   string `json:"title"`
	Content string `json:"content"`
}

type NotesUpdateParams

type NotesUpdateParams struct {
	Title   string `json:"title"`
	Content string `json:"content"`
	ID      int32  `json:"id"`
	UserID  int32  `json:"user_id"`
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) NotesDelete

func (q *Queries) NotesDelete(ctx context.Context, arg NotesDeleteParams) error

func (*Queries) NotesGetByID

func (q *Queries) NotesGetByID(ctx context.Context, arg NotesGetByIDParams) (*NotesGetByIDRow, error)

func (*Queries) NotesGetByUser

func (q *Queries) NotesGetByUser(ctx context.Context, userID int32) ([]*NotesGetByUserRow, error)

func (*Queries) NotesInsert

func (q *Queries) NotesInsert(ctx context.Context, arg NotesInsertParams) (*Note, error)

func (*Queries) NotesUpdate

func (q *Queries) NotesUpdate(ctx context.Context, arg NotesUpdateParams) (*Note, error)

func (*Queries) TokensVerificationInsert

func (q *Queries) TokensVerificationInsert(ctx context.Context, arg TokensVerificationInsertParams) error

func (*Queries) UserWithEmailExists

func (q *Queries) UserWithEmailExists(ctx context.Context, email string) (bool, error)

func (*Queries) UsersFindByEmail

func (q *Queries) UsersFindByEmail(ctx context.Context, email string) (*User, error)

func (*Queries) UsersFindByUid

func (q *Queries) UsersFindByUid(ctx context.Context, uid string) (*User, error)

func (*Queries) UsersInsert

func (q *Queries) UsersInsert(ctx context.Context, arg UsersInsertParams) (*User, error)

func (*Queries) UsersUpdateLastActive

func (q *Queries) UsersUpdateLastActive(ctx context.Context, id int32) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type TokensVerificationInsertParams

type TokensVerificationInsertParams struct {
	Token  string `json:"token"`
	UserID int32  `json:"user_id"`
}

type Transaction

type Transaction struct {
	ID          int32            `json:"id"`
	Uid         string           `json:"uid"`
	WorkspaceID int32            `json:"workspace_id"`
	CategoryID  int32            `json:"category_id"`
	AccountID   int32            `json:"account_id"`
	Title       string           `json:"title"`
	Note        *string          `json:"note"`
	TxnDate     pgtype.Timestamp `json:"txn_date"`
	Price       pgtype.Numeric   `json:"price"`
	Type        string           `json:"type"`
	Paid        bool             `json:"paid"`
	CreatedBy   int32            `json:"created_by"`
	UpdatedBy   *int32           `json:"updated_by"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
	UpdatedAt   pgtype.Timestamp `json:"updated_at"`
}

type User

type User struct {
	ID           int32            `json:"id"`
	Uid          string           `json:"uid"`
	FirstName    string           `json:"first_name"`
	LastName     *string          `json:"last_name"`
	Email        string           `json:"email"`
	Password     *string          `json:"password"`
	Avatar       *string          `json:"avatar"`
	Verified     bool             `json:"verified"`
	Role         string           `json:"role"`
	CreatedAt    pgtype.Timestamp `json:"created_at"`
	UpdatedAt    pgtype.Timestamp `json:"updated_at"`
	DeletedAt    pgtype.Timestamp `json:"deleted_at"`
	LastActiveAt pgtype.Timestamp `json:"last_active_at"`
}

type UserOauthProvider

type UserOauthProvider struct {
	ID        int32            `json:"id"`
	UserID    int32            `json:"user_id"`
	Provider  string           `json:"provider"`
	OauthUid  string           `json:"oauth_uid"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type UserToken

type UserToken struct {
	Token     string           `json:"token"`
	TokeyType string           `json:"tokey_type"`
	UserID    int32            `json:"user_id"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	DeletedAt pgtype.Timestamp `json:"deleted_at"`
}

type UsersInsertParams

type UsersInsertParams struct {
	Uid       string  `json:"uid"`
	FirstName string  `json:"first_name"`
	LastName  *string `json:"last_name"`
	Email     string  `json:"email"`
	Password  *string `json:"password"`
	Avatar    *string `json:"avatar"`
	Role      string  `json:"role"`
	Verified  bool    `json:"verified"`
}

type Workspace

type Workspace struct {
	ID        int32            `json:"id"`
	Uid       string           `json:"uid"`
	Name      string           `json:"name"`
	OwnerID   int32            `json:"owner_id"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type WorkspaceMember

type WorkspaceMember struct {
	WorkspaceID int32            `json:"workspace_id"`
	UserID      int32            `json:"user_id"`
	Permission  string           `json:"permission"`
	Active      bool             `json:"active"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
	UpdatedAt   pgtype.Timestamp `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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