Documentation
¶
Index ¶
- type Category
- type CategoryProduct
- type ComponentConsumeLogs
- type ItemCost
- type JSONFloat
- type Material
- type MaterialEntry
- type MaterialSettings
- type Order
- type OrderItem
- type OrderItemMaterial
- type Product
- type ProductEntry
- type SalesLogs
- type SalesPerDay
- type SalesPerDayOrder
- type Topic
- type WebsocketClientBaseMessage
- type WebsocketOrderFinishClientMessage
- type WebsocketOrderFinishServerMessage
- type WebsocketSubscribeClientMessage
- type WebsocketTopicClientMessage
- type WebsocketTopicServerMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct {
Id string `json:"id" bson:"id"`
Name string `json:"name"`
Products []CategoryProduct `json:"products"` // product ids
}
type CategoryProduct ¶
type ComponentConsumeLogs ¶
type ComponentConsumeLogs struct {
Id string `json:"id,omitempty" bson:"id,omitempty"`
Date time.Time `json:"date" bson:"date"`
Name string `json:"component_name" bson:"name"`
Quantity float32 `json:"quantity" bson:"quantity"`
Company string `json:"company" bson:"company"`
ItemName string `json:"item_name" bson:"item_name"`
ItemOrderIndex uint `json:"item_order_index" bson:"item_order_index"`
OrderId string `json:"order_id" bson:"order_id"`
}
type Material ¶
type Material struct {
Id string `json:"id,omitempty" bson:"id,omitempty"`
Name string `json:"name"`
Entries []MaterialEntry `json:"entries" bson:"entries"`
Quantity float64 `json:"quantity"`
Settings MaterialSettings `json:"settings" bson:"settings"`
Unit string `json:"unit" bson:"unit"`
}
type MaterialEntry ¶
type MaterialEntry struct {
Id string `json:"id,omitempty" bson:"id,omitempty"`
PurchaseQuantity float32 `json:"purchase_quantity" bson:"purchase_quantity"`
PurchasePrice float64 `json:"purchase_price" bson:"price"`
Quantity float32 `json:"quantity"`
Company string `json:"company"`
SKU string `json:"sku"`
ExpirationDate time.Time `json:"expiration_date" bson:"expiration_date"`
}
type MaterialSettings ¶
type MaterialSettings struct {
StockAlertTreshold float64 `json:"stock_alert_treshold" bson:"stock_alert_treshold"`
}
type Order ¶
type Order struct {
SubmittedAt time.Time `json:"submitted_at" bson:"submitted_at"`
Id string `json:"id" bson:"id,omitempty"`
DisplayId string `json:"display_id" bson:"display_id"`
Items []OrderItem `json:"items" bson:"items"`
Discount float64 `json:"discount" bson:"discount"`
State string `json:"state" bson:"state"`
StartedAt time.Time `json:"started_at" bson:"started_at"`
Comment string `json:"comment" bson:"comment"`
Cost float64 `json:"cost" bson:"cost"`
SalePrice float64 `json:"sale_price" bson:"sale_price"`
IsPayLater bool `json:"is_pay_later" bson:"is_pay_later"`
IsPaid bool `json:"is_paid" bson:"is_paid"`
}
type OrderItem ¶
type OrderItem struct {
Id string `json:"id" bson:"id"`
Product Product `json:"product"`
Price float64 `json:"price" bson:"price"`
Materials []OrderItemMaterial `json:"materials" bson:"materials"`
IsConsumeFromReady bool `json:"is_consume_from_ready"`
SubItems []OrderItem `json:"sub_items" bson:"sub_items"`
Quantity float64 `json:"quantity" bson:"quantity"`
Comment string `json:"comment" bson:"comment"`
SalePrice float64 `json:"sale_price" bson:"sale_price"`
Cost float64 `json:"cost" bson:"cost"`
}
type OrderItemMaterial ¶
type OrderItemMaterial struct {
Material Material `json:"material"`
Entry MaterialEntry `json:"entry"`
Quantity float64 `json:"quantity" bson:"quantity"`
}
type Product ¶
type Product struct {
Id string `bson:"id,omitempty" json:"id"`
Name string `bson:"name" json:"name"`
Materials []Material `bson:"materials" json:"materials"`
SubProducts []Product `bson:"sub_products" json:"sub_products"`
Entries []ProductEntry `bson:"entries" json:"entries"`
Price float64 `bson:"price" json:"price"`
ImageURL string `bson:"imageurl" json:"image_url"`
Unit string `bson:"unit" json:"unit"`
Quantity float64 `bson:"quantity" json:"quantity"`
Ready float64 `bson:"ready" json:"ready"`
}
type ProductEntry ¶
type ProductEntry struct {
Id string `json:"id,omitempty" bson:"id,omitempty"`
PurchaseQuantity float32 `json:"purchase_quantity" bson:"purchase_quantity"`
PurchasePrice float64 `json:"purchase_price"`
Quantity float32 `json:"quantity"`
Company string `json:"company"`
Unit string `json:"unit"`
SKU string `json:"sku"`
}
type SalesLogs ¶
type SalesLogs struct {
Id string `json:"id" bson:"id,omitempty"`
SalePrice JSONFloat `json:"sale_price" bson:"sale_price"`
Items []ItemCost
OrderId string `json:"order_id"`
TimeConsumed time.Time `json:"time_consumed"`
Type string `json:"type"`
Date time.Time `json:"date"`
Cost JSONFloat `json:"cost"`
}
type SalesPerDay ¶
type SalesPerDay struct {
Id string `json:"id" bson:"id,omitempty"`
Date string `json:"date" bson:"date"`
Orders []SalesPerDayOrder `json:"orders" bson:"orders"`
Costs float64 `json:"costs" bson:"costs"`
TotalSales float64 `json:"total_sales" bson:"total_sales"`
}
type SalesPerDayOrder ¶
type WebsocketClientBaseMessage ¶
type WebsocketClientBaseMessage struct {
Type string `json:"type"`
}
type WebsocketOrderFinishClientMessage ¶
type WebsocketOrderFinishClientMessage struct {
OrderId string `json:"order_id"`
}
type WebsocketOrderFinishServerMessage ¶
type WebsocketOrderFinishServerMessage struct {
WebsocketTopicServerMessage `json:",inline"`
OrderId string `json:"order_id"`
}
type WebsocketSubscribeClientMessage ¶
type WebsocketSubscribeClientMessage struct {
WebsocketClientBaseMessage `json:",inline"`
TopicName string `json:"topic_name"`
}
type WebsocketTopicClientMessage ¶
type WebsocketTopicClientMessage struct {
TopicName string `json:"topic_name"`
}
Click to show internal directories.
Click to hide internal directories.