db

package
v1.7.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConstraintViolation = 2627
)

Variables

View Source
var ErrConstraintViolation = &mssql.Error{
	Number: ConstraintViolation,
}

Functions

func ErrorCode

func ErrorCode(err error) int32

Types

type CreateClientGMFromThiCongParams

type CreateClientGMFromThiCongParams struct {
	SerialNumber   string
	Type           string
	Name           string
	Deputy         string
	DeputyPosition string
	POA            string
	Website        string
	BankAccount    string
	TaxCode        string
	Phone          string
	ClientCode     string
	Address        string
	AddressClock   string
	Email          string
	ClientType2    mssql.VarChar
	Tariff         uint8
	HCClockSize    uint8
	DateReviewed   string
}

type DBTX

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

type EContract

type EContract struct {
	ClientCode     sql.NullString // So Danh Bo
	Type           sql.NullString // Loai HoSo
	SerialNumber   sql.NullString // So Ho So
	EID            sql.NullString // CCCD
	DateCreatedEID sql.NullString
	TaxCode        sql.NullString // Ma so thue
	Phone          sql.NullString
	Email          sql.NullString
	Name           sql.NullString // Ten KH
	Deputy         sql.NullString
	DeputyPosition sql.NullString
	POA            sql.NullString // GIAYUYQUYEN
	Website        sql.NullString
	BankAccount    sql.NullString // SOTAIKHOAN
	Address        sql.NullString // Dia Chi Thong Bao - DIACHI_GIAYBAO
	AddressClock   sql.NullString // DIACHI_1
	// Tariff         sql.NullInt32  // Gia Bieu
	ClientType2 sql.NullString // Loai Danh Bo
	HCDate      sql.NullString
	HCClockSize sql.NullInt64
}

type Querier

type Querier interface {
	CreateClientGMFromThiCong(ctx context.Context, arg CreateClientGMFromThiCongParams) error
	GetClientGM(ctx context.Context) ([]EContract, error)
	GetClientThiCong(ctx context.Context) ([]THICONG, error)
	UpdateClientGMByID(ctx context.Context, arg UpdateClientGMByIDParams) error
	UpdateClientThiCongByID(ctx context.Context, arg UpdateClientThiCongByIDParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateClientGMFromThiCong

func (q *Queries) CreateClientGMFromThiCong(ctx context.Context, arg CreateClientGMFromThiCongParams) error

func (*Queries) GetClientGM

func (q *Queries) GetClientGM(ctx context.Context) ([]EContract, error)

func (*Queries) GetClientThiCong

func (q *Queries) GetClientThiCong(ctx context.Context) ([]THICONG, error)

func (*Queries) UpdateClientGMByID

func (q *Queries) UpdateClientGMByID(ctx context.Context, arg UpdateClientGMByIDParams) error

func (*Queries) UpdateClientThiCongByID

func (q *Queries) UpdateClientThiCongByID(ctx context.Context, arg UpdateClientThiCongByIDParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx DBTX) *Queries

type SQLStore

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

type Store

type Store interface {
	Querier
}

func NewStore

func NewStore(connPool *sql.DB) Store

type THICONG

type THICONG struct {
	ClientCode     sql.NullString // So Danh Bo
	Type           sql.NullString // Loai HoSo
	SerialNumber   sql.NullString // So Ho So
	EID            sql.NullString
	DateCreatedEID sql.NullString
	TaxCode        sql.NullString // Ma so thue
	Phone          sql.NullString
	Email          sql.NullString
	Name           sql.NullString // Ten KH
	Deputy         sql.NullString // Dai Dien
	DeputyPosition sql.NullString // CHUCVU
	POA            sql.NullString // GIAYUYQUYEN
	Website        sql.NullString
	BankAccount    sql.NullString // SOTAIKHOAN
	Address        sql.NullString // Dia Chi Thong Bao - DIACHI_2
	AddressClock   sql.NullString // DIACHI_1
	Tariff         sql.NullString // Gia Bieu
	ClientType2    sql.NullString // Loai Danh Bo
	HCDate         sql.NullString
	HCClockSize    sql.NullString
}

type UpdateClientGMByIDParams

type UpdateClientGMByIDParams struct {
	SerialID   string
	ClientCode string
	Moderator  string
	UpdateTime time.Time
}

type UpdateClientThiCongByIDParams

type UpdateClientThiCongByIDParams struct {
	SerialID   string
	ClientCode string
}

Jump to

Keyboard shortcuts

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