database

package
v0.0.0-...-bf028c8 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bank

type Bank struct {
	ID              uuid.UUID
	CreatedAt       time.Time
	UpdatedAt       time.Time
	DeletedAt       sql.NullTime
	IsDeleted       bool
	Name            string
	ContactPhone    sql.NullString
	ContactEmail    string
	Address         sql.NullString
	Type            BankType
	EstablishedYear int32
}

type BankAccount

type BankAccount struct {
	ID            uuid.UUID
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     sql.NullTime
	IsDeleted     bool
	IsActive      bool
	BankID        uuid.UUID
	UserID        uuid.UUID
	Name          string
	AccountNumber string
	AccountType   BankAccountType
	Balance       string
	Currency      string
}

type BankAccountType

type BankAccountType string
const (
	BankAccountTypeSavings  BankAccountType = "savings"
	BankAccountTypeChecking BankAccountType = "checking"
)

func (*BankAccountType) Scan

func (e *BankAccountType) Scan(src interface{}) error

type BankType

type BankType string
const (
	BankTypeCentral      BankType = "central"
	BankTypeCooperative  BankType = "cooperative"
	BankTypeCommercial   BankType = "commercial"
	BankTypeRegional     BankType = "regional"
	BankTypeLocal        BankType = "local"
	BankTypeSpecialized  BankType = "specialized"
	BankTypeSmallFinance BankType = "small_finance"
	BankTypePayments     BankType = "payments"
)

func (*BankType) Scan

func (e *BankType) Scan(src interface{}) error

type Card

type Card struct {
	ID            uuid.UUID
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     sql.NullTime
	IsDeleted     bool
	IsActive      bool
	UserID        uuid.UUID
	BankID        uuid.UUID
	BankAccountID uuid.NullUUID
	Name          string
	Nickname      string
	Number        string
	Type          CardType
	ExpMonth      int32
	ExpYear       int32
	Cvv           string
	TotalLimit    string
	BillDate      int32
}

type CardType

type CardType string
const (
	CardTypeCredit CardType = "credit"
	CardTypeDebit  CardType = "debit"
)

func (*CardType) Scan

func (e *CardType) Scan(src interface{}) error

type CreateBankAccountParams

type CreateBankAccountParams struct {
	ID            uuid.UUID
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     sql.NullTime
	IsDeleted     bool
	IsActive      bool
	BankID        uuid.UUID
	UserID        uuid.UUID
	AccountNumber string
	AccountType   BankAccountType
	Name          string
	Balance       string
	Currency      string
}

type CreateBankParams

type CreateBankParams struct {
	ID              uuid.UUID
	CreatedAt       time.Time
	UpdatedAt       time.Time
	DeletedAt       sql.NullTime
	IsDeleted       bool
	Name            string
	ContactPhone    sql.NullString
	ContactEmail    string
	Address         sql.NullString
	Type            BankType
	EstablishedYear int32
}

type CreateCardParams

type CreateCardParams struct {
	ID            uuid.UUID
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     sql.NullTime
	IsDeleted     bool
	IsActive      bool
	BankID        uuid.UUID
	UserID        uuid.UUID
	BankAccountID uuid.NullUUID
	Name          string
	Nickname      string
	Number        string
	Type          CardType
	ExpMonth      int32
	ExpYear       int32
	Cvv           string
	TotalLimit    string
	BillDate      int32
}

type CreateUserParams

type CreateUserParams struct {
	ID             uuid.UUID
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeletedAt      sql.NullTime
	IsDeleted      bool
	Name           string
	PhoneNum       string
	Email          string
	Username       string
	ProfileImg     string
	Role           int32
	HashedPassword string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteBankAccountParams

type DeleteBankAccountParams struct {
	ID        uuid.UUID
	DeletedAt sql.NullTime
	UpdatedAt time.Time
}

type DeleteBankParams

type DeleteBankParams struct {
	ID        uuid.UUID
	DeletedAt sql.NullTime
	UpdatedAt time.Time
}

type DeleteCardParams

type DeleteCardParams struct {
	ID        uuid.UUID
	DeletedAt sql.NullTime
	UpdatedAt time.Time
}

type DeleteUserParams

type DeleteUserParams struct {
	ID        uuid.UUID
	DeletedAt sql.NullTime
	UpdatedAt time.Time
}

type GetAllBankAccountParams

type GetAllBankAccountParams struct {
	Limit  int32
	Offset int32
}

type GetAllBankParams

type GetAllBankParams struct {
	Limit  int32
	Offset int32
}

type GetAllCardParams

type GetAllCardParams struct {
	Limit  int32
	Offset int32
}

type GetAllUsersParams

type GetAllUsersParams struct {
	Limit  int32
	Offset int32
}

type GetUserBankAccountsParams

type GetUserBankAccountsParams struct {
	Limit  int32
	Offset int32
	UserID uuid.UUID
}

type GetUserCardsParams

type GetUserCardsParams struct {
	Limit  int32
	Offset int32
	UserID uuid.UUID
}

type NullBankAccountType

type NullBankAccountType struct {
	BankAccountType BankAccountType
	Valid           bool // Valid is true if BankAccountType is not NULL
}

func (*NullBankAccountType) Scan

func (ns *NullBankAccountType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullBankAccountType) Value

func (ns NullBankAccountType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullBankType

type NullBankType struct {
	BankType BankType
	Valid    bool // Valid is true if BankType is not NULL
}

func (*NullBankType) Scan

func (ns *NullBankType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullBankType) Value

func (ns NullBankType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullCardType

type NullCardType struct {
	CardType CardType
	Valid    bool // Valid is true if CardType is not NULL
}

func (*NullCardType) Scan

func (ns *NullCardType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullCardType) Value

func (ns NullCardType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateBank

func (q *Queries) CreateBank(ctx context.Context, arg CreateBankParams) (Bank, error)

func (*Queries) CreateBankAccount

func (q *Queries) CreateBankAccount(ctx context.Context, arg CreateBankAccountParams) (BankAccount, error)

func (*Queries) CreateCard

func (q *Queries) CreateCard(ctx context.Context, arg CreateCardParams) (Card, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteBank

func (q *Queries) DeleteBank(ctx context.Context, arg DeleteBankParams) error

func (*Queries) DeleteBankAccount

func (q *Queries) DeleteBankAccount(ctx context.Context, arg DeleteBankAccountParams) error

func (*Queries) DeleteCard

func (q *Queries) DeleteCard(ctx context.Context, arg DeleteCardParams) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, arg DeleteUserParams) error

func (*Queries) GetAllBank

func (q *Queries) GetAllBank(ctx context.Context, arg GetAllBankParams) ([]Bank, error)

func (*Queries) GetAllBankAccount

func (q *Queries) GetAllBankAccount(ctx context.Context, arg GetAllBankAccountParams) ([]BankAccount, error)

func (*Queries) GetAllCard

func (q *Queries) GetAllCard(ctx context.Context, arg GetAllCardParams) ([]Card, error)

func (*Queries) GetAllUsers

func (q *Queries) GetAllUsers(ctx context.Context, arg GetAllUsersParams) ([]User, error)

func (*Queries) GetBankAccountById

func (q *Queries) GetBankAccountById(ctx context.Context, id uuid.UUID) (BankAccount, error)

func (*Queries) GetBankAccountCount

func (q *Queries) GetBankAccountCount(ctx context.Context) (int64, error)

func (*Queries) GetBankById

func (q *Queries) GetBankById(ctx context.Context, id uuid.UUID) (Bank, error)

func (*Queries) GetBankByName

func (q *Queries) GetBankByName(ctx context.Context, name string) (Bank, error)

func (*Queries) GetBankCount

func (q *Queries) GetBankCount(ctx context.Context) (int64, error)

func (*Queries) GetCardById

func (q *Queries) GetCardById(ctx context.Context, id uuid.UUID) (Card, error)

func (*Queries) GetCardCount

func (q *Queries) GetCardCount(ctx context.Context) (int64, error)

func (*Queries) GetUserBankAccountCount

func (q *Queries) GetUserBankAccountCount(ctx context.Context, userID uuid.UUID) (int64, error)

func (*Queries) GetUserBankAccounts

func (q *Queries) GetUserBankAccounts(ctx context.Context, arg GetUserBankAccountsParams) ([]BankAccount, error)

func (*Queries) GetUserByEmail

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

func (*Queries) GetUserById

func (q *Queries) GetUserById(ctx context.Context, id uuid.UUID) (User, error)

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)

func (*Queries) GetUserCardCount

func (q *Queries) GetUserCardCount(ctx context.Context, userID uuid.UUID) (int64, error)

func (*Queries) GetUserCards

func (q *Queries) GetUserCards(ctx context.Context, arg GetUserCardsParams) ([]Card, error)

func (*Queries) GetUserCount

func (q *Queries) GetUserCount(ctx context.Context) (int64, error)

func (*Queries) HardDeleteBank

func (q *Queries) HardDeleteBank(ctx context.Context, id uuid.UUID) error

func (*Queries) HardDeleteBankAccount

func (q *Queries) HardDeleteBankAccount(ctx context.Context, id uuid.UUID) error

func (*Queries) HardDeleteCard

func (q *Queries) HardDeleteCard(ctx context.Context, id uuid.UUID) error

func (*Queries) HardDeleteUser

func (q *Queries) HardDeleteUser(ctx context.Context, id uuid.UUID) error

func (*Queries) UpdateBank

func (q *Queries) UpdateBank(ctx context.Context, arg UpdateBankParams) error

func (*Queries) UpdateBankAccount

func (q *Queries) UpdateBankAccount(ctx context.Context, arg UpdateBankAccountParams) error

func (*Queries) UpdateCard

func (q *Queries) UpdateCard(ctx context.Context, arg UpdateCardParams) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error

func (*Queries) WithTx

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

type UpdateBankAccountParams

type UpdateBankAccountParams struct {
	ID            uuid.UUID
	UpdatedAt     time.Time
	AccountNumber string
	AccountType   BankAccountType
	IsActive      bool
	Name          string
	Balance       string
	Currency      string
}

type UpdateBankParams

type UpdateBankParams struct {
	ID           uuid.UUID
	UpdatedAt    time.Time
	Name         string
	ContactPhone sql.NullString
	ContactEmail string
	Address      sql.NullString
	Type         BankType
}

type UpdateCardParams

type UpdateCardParams struct {
	ID        uuid.UUID
	UpdatedAt time.Time
	Name      string
	Nickname  string
	IsActive  bool
	Number    string
	Type      CardType
	ExpMonth  int32
	ExpYear   int32
	Cvv       string
}

type UpdateUserParams

type UpdateUserParams struct {
	ID         uuid.UUID
	UpdatedAt  time.Time
	Name       string
	PhoneNum   string
	Email      string
	Username   string
	ProfileImg string
	Role       int32
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	ID             uuid.UUID
	HashedPassword string
	UpdatedAt      time.Time
}

type User

type User struct {
	ID             uuid.UUID
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeletedAt      sql.NullTime
	IsDeleted      bool
	Name           string
	PhoneNum       string
	Email          string
	Username       string
	ProfileImg     string
	Role           int32
	HashedPassword string
	IsActive       bool
}

Jump to

Keyboard shortcuts

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