voucher

package
v0.0.0-...-568f4c1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JpegToPng

func JpegToPng(pngdata []byte) ([]byte, error)

Types

type Voucher

type Voucher struct {
	Id             string
	BatchId        string
	IsActive       bool
	IsUse          bool
	AssignTo       string
	AssignName     string
	AssignCode     string
	UsedBy         string
	UsedDate       string
	ExpiredDate    time.Time
	Description    string
	BrandId        string
	HeaderLogoData []byte
	IconLogoData   []byte

	No        int
	Rmin      int
	Rmax      int
	Value     float32
	BatchCode string
	Type      string
}

func (*Voucher) CreateVoucherQrJPG

func (v *Voucher) CreateVoucherQrJPG() ([]byte, error)

func (*Voucher) CreateVoucherQrPNG

func (v *Voucher) CreateVoucherQrPNG() ([]byte, error)

func (*Voucher) CreateVoucherQrSvg

func (v *Voucher) CreateVoucherQrSvg() (string, error)

type VoucherBatch

type VoucherBatch struct {
	Id string

	Type              *string
	BrandId           *string
	Description       *string
	Greeting          *string
	CrmEventId        *string
	DtStart           time.Time
	DtEnd             time.Time
	DtActive          time.Time
	DtExpired         time.Time
	Value             float32
	IsGenerated       bool
	IsMultiple        bool
	UseActivationCode bool
	// contains filtered or unexported fields
}

type VoucherDB

type VoucherDB struct {
	Connection *sql.DB
}

func NewVoucherDB

func NewVoucherDB(conn *sql.DB) *VoucherDB

func (*VoucherDB) CreateNewVoucher

func (v *VoucherDB) CreateNewVoucher(voubatch_id string, phonenumber string, customername string, code string) (voucher *Voucher, err error)

func (*VoucherDB) GetAllUnusedVoucherByPhoneNumber

func (v *VoucherDB) GetAllUnusedVoucherByPhoneNumber(voubatch_id string, phonenumber string) (vouchers []*Voucher, err error)

func (*VoucherDB) GetSingleVoucherByPhoneNumber

func (v *VoucherDB) GetSingleVoucherByPhoneNumber(voubatch_id string, phonenumber string) (voucher *Voucher, err error)

func (*VoucherDB) GetVoucher

func (v *VoucherDB) GetVoucher(vou_id string) (*Voucher, error)

func (*VoucherDB) GetVoucherBatch

func (v *VoucherDB) GetVoucherBatch(voubatch_id string) (*VoucherBatch, error)

func (*VoucherDB) GetVoucherByPhoneNumber

func (v *VoucherDB) GetVoucherByPhoneNumber(voubatch_id string, phonenumber string, code string) (voucher *Voucher, err error)

func (*VoucherDB) ParseMessage

func (v *VoucherDB) ParseMessage(msg string) *VoucherMessageIntent

func (*VoucherDB) VerifyBatchRequest

func (v *VoucherDB) VerifyBatchRequest(vb *VoucherBatch) (bool, error)

func (*VoucherDB) VerifyCode

func (v *VoucherDB) VerifyCode(code string) (string, bool)

type VoucherMessageIntent

type VoucherMessageIntent struct {
	VoubatchId string
}

Jump to

Keyboard shortcuts

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