sqlc

package
v0.0.0-...-d402834 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateLedgerEntryParams

type CreateLedgerEntryParams struct {
	VirtualAccountNo pgtype.Int8
	OrgID            pgtype.Int4
	Credit           pgtype.Numeric
	Debit            pgtype.Numeric
	OpeningBalance   pgtype.Numeric
	ClosingBalance   pgtype.Numeric
	Crn              pgtype.Int8
}

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 Payout

type Payout struct {
	CreatedAt           pgtype.Timestamp
	UpdatedAt           pgtype.Timestamp
	VirtualAccountNo    pgtype.Int8
	UserID              pgtype.Int4
	OrgID               pgtype.Int4
	WalletBalance       pgtype.Numeric
	TransactionAmount   pgtype.Numeric
	CustomerName        pgtype.Text
	CustomerEmail       pgtype.Text
	CustomerPhoneNumber pgtype.Text
	TransactionType     pgtype.Text
	TransactionStatus   pgtype.Text
	DestinationBank     pgtype.Text
	BeneAccountNumber   pgtype.Text
	StatusDescription   pgtype.Text
	UtrNo               pgtype.Text
	TransactionID       pgtype.Text
	BeneLocation        pgtype.Text
	BeneCode            pgtype.Text
	Ifsc                pgtype.Text
	Crn                 int64
	RequestUuid         pgtype.UUID
	ProcessingFee       pgtype.Numeric
	ClientOrderID       pgtype.Text
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateLedgerEntry

func (q *Queries) CreateLedgerEntry(ctx context.Context, arg CreateLedgerEntryParams) error

func (*Queries) CreateVA

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

func (*Queries) GetLatestWalletLedgerForUpdate

func (q *Queries) GetLatestWalletLedgerForUpdate(ctx context.Context, virtualAccountNo pgtype.Int8) (pgtype.Numeric, error)

func (*Queries) ListAllPayouts

func (q *Queries) ListAllPayouts(ctx context.Context) ([]Payout, error)

func (*Queries) ListLedgerEntries

func (q *Queries) ListLedgerEntries(ctx context.Context) ([]WalletLedger, error)

func (*Queries) SavePayout

func (q *Queries) SavePayout(ctx context.Context, arg SavePayoutParams) error

func (*Queries) WithTx

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

type SavePayoutParams

type SavePayoutParams struct {
	VirtualAccountNo    pgtype.Int8
	UserID              pgtype.Int4
	OrgID               pgtype.Int4
	WalletBalance       pgtype.Numeric
	TransactionAmount   pgtype.Numeric
	CustomerName        pgtype.Text
	CustomerEmail       pgtype.Text
	CustomerPhoneNumber pgtype.Text
	TransactionType     pgtype.Text
	TransactionStatus   pgtype.Text
	DestinationBank     pgtype.Text
	BeneAccountNumber   pgtype.Text
	StatusDescription   pgtype.Text
	UtrNo               pgtype.Text
	TransactionID       pgtype.Text
	BeneLocation        pgtype.Text
	BeneCode            pgtype.Text
	Ifsc                pgtype.Text
	RequestUuid         pgtype.UUID
	ProcessingFee       pgtype.Numeric
	ClientOrderID       pgtype.Text
}

type Store

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

Store provides all functions to execute db queries and transactions

func NewStore

func NewStore(connPool *pgxpool.Pool) *Store

NewStore creates a new Store for sqlc database operations

func (*Store) NewTx

func (store *Store) NewTx(ctx context.Context) (pgx.Tx, error)

NewTx starts a new database transaction using the connection pool

type Va

type Va struct {
	VirtualAccountNo int64
}

type WalletLedger

type WalletLedger struct {
	ID               int64
	CreatedAt        pgtype.Timestamp
	UpdatedAt        pgtype.Timestamp
	VirtualAccountNo pgtype.Int8
	OrgID            pgtype.Int4
	Credit           pgtype.Numeric
	Debit            pgtype.Numeric
	OpeningBalance   pgtype.Numeric
	ClosingBalance   pgtype.Numeric
	Crn              pgtype.Int8
}

Jump to

Keyboard shortcuts

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