Documentation ¶
Index ¶
- func WithID[T IDable](id string, i T) T
- type Area
- type AreaCommodities
- type Commodity
- type CommodityImages
- type CommodityInvoices
- type CommodityManuals
- type CommodityStatus
- type CommodityType
- type Currency
- type Date
- type EntityID
- type File
- type IDable
- type Image
- type Invoice
- type Location
- type LocationAreas
- type Manual
- type PDate
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Area ¶
type AreaCommodities ¶
AreaCommodities represents an index of commodities for a given area. Map key is an AreaID and value is a slice of CommodityIDs.
type Commodity ¶
type Commodity struct { EntityID Name string `json:"name"` ShortName string `json:"short_name"` Type CommodityType `json:"type"` AreaID string `json:"area_id"` Count int `json:"count"` OriginalPrice decimal.Decimal `json:"original_price"` OriginalPriceCurrency Currency `json:"original_price_currency"` ConvertedOriginalPrice decimal.Decimal `json:"converted_original_price"` CurrentPrice decimal.Decimal `json:"current_price"` SerialNumber string `json:"serial_number"` ExtraSerialNumbers []string `json:"extra_serial_numbers"` PartNumbers []string `json:"part_numbers"` Tags []string `json:"tags"` Status CommodityStatus `json:"status"` PurchaseDate PDate `json:"purchase_date"` RegisteredDate PDate `json:"registered_date"` LastModifiedDate PDate `json:"last_modified_date"` URLs []*URL `json:"urls" swaggertype:"string"` Comments string `json:"comments"` Draft bool `json:"draft"` }
func (*Commodity) MarshalJSON ¶
func (*Commodity) UnmarshalJSON ¶
type CommodityImages ¶
CommodityImages represents an index of images for a given commodity. Map key is a CommodityID and value is a slice of ImageIDs.
type CommodityInvoices ¶
CommodityInvoices represents an index of invoices for a given commodity. Map key is a CommodityID and value is a slice of InvoiceIDs.
type CommodityManuals ¶
CommodityManuals represents an index of manuals for a given commodity. Map key is a CommodityID and value is a slice of ManualIDs.
type CommodityStatus ¶
type CommodityStatus string
const ( CommodityStatusInUse CommodityStatus = "in_use" CommodityStatusSold CommodityStatus = "sold" CommodityStatusLost CommodityStatus = "lost" CommodityStatusDisposed CommodityStatus = "disposed" CommodityStatusWrittenOff CommodityStatus = "written_off" )
Commodity statuses. Adding a new status? Don't forget to update IsValid() method.
func (CommodityStatus) IsValid ¶
func (c CommodityStatus) IsValid() bool
func (CommodityStatus) Validate ¶
func (c CommodityStatus) Validate() error
type CommodityType ¶
type CommodityType string
const ( CommodityTypeWhiteGoods CommodityType = "white_goods" CommodityTypeElectronics CommodityType = "electronics" CommodityTypeEquipment CommodityType = "equipment" CommodityTypeFurniture CommodityType = "furniture" CommodityTypeClothes CommodityType = "clothes" CommodyTypeOther CommodityType = "other" )
Commodity types. Adding a new type? Don't forget to update IsValid() method.
func (CommodityType) IsValid ¶
func (c CommodityType) IsValid() bool
func (CommodityType) Validate ¶
func (c CommodityType) Validate() error
type File ¶
type LocationAreas ¶
LocationAreas represents an index of areas for a given location. Map key is a LocationID and value is a slice of AreaIDs.