Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Basket ¶
type Basket struct { Id uuid.UUID `json:"id"` Items map[uuid.UUID]*BasketItem `json:"items"` State BasketState `json:"state"` }
Basket represents a record of the items that customer have chosen to buy
type BasketItem ¶
func (*BasketItem) Print ¶
func (bi *BasketItem) Print() string
func (*BasketItem) String ¶
func (bi *BasketItem) String() string
func (*BasketItem) TotalGross ¶
func (bi *BasketItem) TotalGross() decimal.Decimal
func (*BasketItem) TotalPrice ¶
func (bi *BasketItem) TotalPrice() decimal.Decimal
func (*BasketItem) TotalTax ¶
func (bi *BasketItem) TotalTax() decimal.Decimal
type BasketState ¶
type BasketState string
const ( BasketStateOpened BasketState = "OPENED" BasketStateClosed BasketState = "CLOSED" BasketStateCancelled BasketState = "CANCELLED" )
type Category ¶
type Category struct { Id uuid.UUID `json:"id"` Name string `json:"name"` }
Category is used to define if an item is suitable for billing or pricing.
type InventoryItem ¶
type InventoryItem struct { Id uuid.UUID `json:"id"` Name string `json:"name"` CategoryId uuid.UUID `json:"category"` Origin ItemOrigin `json:"origin"` Price decimal.Decimal `json:"price"` }
InventoryItem represents the physical good available
func (*InventoryItem) String ¶
func (i *InventoryItem) String() string
type ItemOrigin ¶
type ItemOrigin string
const ( ItemOriginImported ItemOrigin = "IMPORT" ItemOriginLocal ItemOrigin = "LOCAL" )
func (*ItemOrigin) UnmarshalText ¶
func (io *ItemOrigin) UnmarshalText(b []byte) error
type Receipt ¶
type Receipt struct { Id uuid.UUID `json:"id"` Items []*BasketItem `json:"items"` TotalTax decimal.Decimal `json:"total_tax"` TotalPrice decimal.Decimal `json:"total_price"` TotalGross decimal.Decimal `json:"total_gross"` // contains filtered or unexported fields }
Receipt represents written acknowledgment that something of value has been received.
type SaleItem ¶
type SaleItem struct { *InventoryItem Taxes decimal.Decimal `json:"taxes"` Gross decimal.Decimal `json:"gross"` }
type Tax ¶
type Tax struct { Id uuid.UUID `json:"id"` Name string `json:"name"` Rate decimal.Decimal `json:"rate"` Origin TaxOrigin `json:"origin"` Condition TaxCondition `json:"condition"` Categories map[uuid.UUID]bool `json:"categories"` }
Tax
type TaxCondition ¶
type TaxCondition string
TaxCondition is defines category given in tax subject or exempt from tax.
const ( UnknownTC TaxCondition = "UNKNOWN" ExemptToTax TaxCondition = "EXEMPT" // refers to only tax types in context will be free from tax SubjectToTax TaxCondition = "SUBJECT" // refers to only tax types in context will be effected from tax )
func (*TaxCondition) UnmarshalText ¶
func (tc *TaxCondition) UnmarshalText(b []byte) error
type TaxOrigin ¶
type TaxOrigin string
TaxOrigin is defines tax scope according to inventory item origin
func (*TaxOrigin) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.