transaction

package
v0.0.0-...-e7bea0e Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PromoRule

type PromoRule struct {
	ID               *uint32
	SkuID            uint32
	RequirementType  string
	RequirementValue string
	RewardType       string
	RewardValue      int
}

func NewPromoRule

func NewPromoRule(skuID uint32, requirementType string, requirementValue string, rewardType string, rewardValue int) (*PromoRule, error)

func (*PromoRule) Validate

func (p *PromoRule) Validate() error

type Sku

type Sku struct {
	ID           *uint32
	SKU          string
	Name         string
	Price        float64
	InventoryQty int
}

func NewSku

func NewSku(sku string, name string, price float64, inventoryQty int) (*Sku, error)

func (*Sku) Validate

func (s *Sku) Validate() error

type Transaction

type Transaction struct {
	ID          *uint32
	UserID      uint32
	SubTotal    float64
	Discount    *float64
	Total       float64
	Status      string
	CreatedDate time.Time
	UpdatedDate *time.Time
}

func NewTransaction

func NewTransaction(userID uint32, subTotal float64, discount float64, total float64, status string) (*Transaction, error)

func (*Transaction) Validate

func (t *Transaction) Validate() error

type TransactionItem

type TransactionItem struct {
	ID            *uint32
	TransactionID uint32
	SkuID         uint32
	BasePrice     float64
	Discount      *float64
	Qty           int
	CreatedDate   time.Time
	UpdatedDate   *time.Time
}

func NewTransactionItem

func NewTransactionItem(transactionID uint32, skuID uint32, basePrice float64, discount float64, qty int) (*TransactionItem, error)

func (*TransactionItem) Validate

func (t *TransactionItem) Validate() error

Jump to

Keyboard shortcuts

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