models

package
v0.0.0-...-1aaf8f9 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionCreditCard  = "creditCard"
	TransactionGiftCard    = "giftCard"
	TransactionStoreCredit = "storeCredit"
)
View Source
const (
	ShippingTypeFlat = iota
	ShippingTypeVariable
)
View Source
const NumberOfUnitTypes = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type AFS

type AFS struct {
	StockItemID uint
	SKU         string
	AFS         int
}

type Address

type Address struct {
	gormfox.Base
	Name        string
	RegionID    uint
	Region      Region
	City        string
	Zip         string
	Address1    string
	Address2    sql.NullString
	PhoneNumber string
}

type AfsByType

type AfsByType struct {
	Afs  int
	Type UnitType
}

type Carrier

type Carrier struct {
	ID               uint
	Name             string
	TrackingTemplate string
	Scope            string
}

func (*Carrier) Identifier

func (carrier *Carrier) Identifier() uint

type Country

type Country struct {
	ID   uint
	Name string
}

type Region

type Region struct {
	ID        uint
	Name      string
	CountryID uint
	Country   Country
}

type Release

type Release struct {
	StockItemID uint
	Qty         int
}

type Reservation

type Reservation struct {
	gormfox.Base
	RefNum string
	Scope  string
}

func (Reservation) Identifier

func (r Reservation) Identifier() uint

type SKU

type SKU struct {
	gormfox.Base
	Scope                              string
	Code                               string
	UPC                                string
	Title                              string
	UnitCostCurrency                   string
	UnitCostValue                      int
	TaxClass                           string
	RequiresShipping                   bool
	ShippingClass                      string
	IsReturnable                       bool
	ReturnWindowValue                  float64
	ReturnWindowUnits                  string
	HeightValue                        float64
	HeightUnits                        string
	WeightValue                        float64
	WeightUnits                        string
	LengthValue                        float64
	LengthUnits                        string
	WidthValue                         float64
	WidthUnits                         string
	RequiresInventoryTracking          bool
	InventoryWarningLevelIsEnabled     bool
	InventoryWarningLevelValue         int
	MaximumQuantityInCartValue         int
	MaximumQuantityInCartIsEnabled     bool
	MinimumQuantityInCartValue         int
	MinimumQuantityInCartIsEnabled     bool
	AllowBackorder                     bool
	AllowPreorder                      bool
	RequiresLotTracking                bool
	LotExpirationThresholdValue        float64
	LotExpirationThresholdUnits        string
	LotExpirationWarningThresholdValue float64
	LotExpirationWarningThresholdUnits string
}

func (*SKU) Validate

func (s *SKU) Validate() error

type Shipment

type Shipment struct {
	gormfox.Base
	ReferenceNumber    string
	ShippingMethodCode string
	ShippingMethod     ShippingMethod `gorm:"ForeignKey:ShippingMethodCode"`
	OrderRefNum        string
	State              ShipmentState
	ShipmentDate       sql.NullString
	EstimatedArrival   sql.NullString
	DeliveredDate      sql.NullString
	AddressID          uint
	Address            Address
	ShipmentLineItems  []ShipmentLineItem
	TrackingNumber     sql.NullString
	ShippingPrice      int
	Scope              string
}

func (Shipment) IsUpdated

func (s Shipment) IsUpdated(other *Shipment) bool

type ShipmentLineItem

type ShipmentLineItem struct {
	gormfox.Base
	ShipmentID       uint
	ReferenceNumbers StringsArray
	StockItemUnitID  uint
	StockItemUnit    StockItemUnit
	SKU              string
	Name             string
	Price            uint
	ImagePath        string
}

type ShipmentState

type ShipmentState string
const (
	ShipmentStatePending   ShipmentState = "pending"
	ShipmentStateShipped   ShipmentState = "shipped"
	ShipmentStateDelivered ShipmentState = "delivered"
	ShipmentStateCancelled ShipmentState = "cancelled"
)

func (*ShipmentState) Scan

func (u *ShipmentState) Scan(value interface{}) error

implement Scanner and Valuer interfaces to provide read/write for alias type

func (ShipmentState) Value

func (u ShipmentState) Value() (driver.Value, error)

type ShipmentTransaction

type ShipmentTransaction struct {
	ID         uint
	ShipmentID uint
	Type       string
	Source     string
	CreatedAt  time.Time
	Amount     uint
}

type ShippingMethod

type ShippingMethod struct {
	ID           uint
	CarrierID    uint
	Carrier      Carrier
	Name         string
	Code         string
	ShippingType int
	Cost         uint
	Scope        string
}

func (*ShippingMethod) Identifier

func (shippingMethod *ShippingMethod) Identifier() uint

type StatusChange

type StatusChange struct {
	From UnitStatus
	To   UnitStatus
}

type StockItem

type StockItem struct {
	gormfox.Base
	SKU             string
	StockLocation   StockLocation
	StockLocationID uint
	DefaultUnitCost int
}

func (StockItem) Identifier

func (si StockItem) Identifier() uint

type StockItemSummary

type StockItemSummary struct {
	gormfox.Base
	StockItem   StockItem
	StockItemID uint
	Type        UnitType
	OnHand      int
	OnHold      int
	Reserved    int
	Shipped     int
	AFS         int
	AFSCost     int
}

func (StockItemSummary) Identifier

func (sis StockItemSummary) Identifier() uint

type StockItemTransaction

type StockItemTransaction struct {
	ID             uint
	StockItemId    uint
	Type           UnitType
	Status         UnitStatus
	QuantityNew    uint
	QuantityChange int
	AFSNew         uint
	CreatedAt      time.Time
}

type StockItemUnit

type StockItemUnit struct {
	gormfox.Base
	StockItemID uint
	StockItem   StockItem
	Type        UnitType
	RefNum      sql.NullString
	UnitCost    int
	Status      UnitStatus
}

func (StockItemUnit) Identifier

func (siu StockItemUnit) Identifier() uint

type StockLocation

type StockLocation struct {
	gormfox.Base
	Name    string
	Type    string
	Address *Address
	Scope   string
}

type StringsArray

type StringsArray []string

func (*StringsArray) Scan

func (u *StringsArray) Scan(value interface{}) error

implement Scanner and Valuer interfaces to provide read/write for alias type

func (StringsArray) Value

func (u StringsArray) Value() (driver.Value, error)

type TransactionUpdates

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

TransactionUpdates is an aggregration of all the updates that are happening to a set of StockItems during a single transaction.

func NewTransactionUpdates

func NewTransactionUpdates() *TransactionUpdates

func (*TransactionUpdates) AddUpdate

func (t *TransactionUpdates) AddUpdate(stockItemID uint, txn *StockItemTransaction) error

AddUpdate adds a single StockItemTransaction to the list of updates. If an update to the specified stock item, unit type, and unit status is already specified, this update will get merged in. Otherwise, a new one will be created.

func (*TransactionUpdates) StockItemTransactions

func (t *TransactionUpdates) StockItemTransactions() []*StockItemTransaction

StockItemTransactions retrieves the flat list of all StockItemTransactions that have been associated with this update.

type UnitStatus

type UnitStatus string
const (
	StatusOnHand   UnitStatus = "onHand"
	StatusOnHold   UnitStatus = "onHold"
	StatusReserved UnitStatus = "reserved"
	StatusShipped  UnitStatus = "shipped"
	StatusEmpty    UnitStatus = ""
)

func (*UnitStatus) Scan

func (u *UnitStatus) Scan(value interface{}) error

implement Scanner and Valuer interfaces to provide read/write for alias type

func (UnitStatus) Value

func (u UnitStatus) Value() (driver.Value, error)

type UnitType

type UnitType string
const (
	Sellable    UnitType = "Sellable"
	NonSellable UnitType = "Non-sellable"
	Backorder   UnitType = "Backorder"
	Preorder    UnitType = "Preorder"
)

func (*UnitType) Scan

func (u *UnitType) Scan(value interface{}) error

implement Scanner and Valuer interfaces to provide read/write for alias type

func (UnitType) Value

func (u UnitType) Value() (driver.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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