68 lines
1.5 KiB
Go
68 lines
1.5 KiB
Go
package main
|
|
|
|
import "time"
|
|
|
|
const (
|
|
StatusOpen = "open"
|
|
StatusAccepted = "accepted"
|
|
StatusInDelivery = "in_delivery"
|
|
StatusDelivered = "delivered"
|
|
StatusCompleted = "completed"
|
|
StatusDeclined = "declined"
|
|
StatusCancelled = "cancelled"
|
|
)
|
|
|
|
const (
|
|
EventOrderCreated = "order_created"
|
|
EventOrderAccepted = "order_accepted"
|
|
EventOrderDeclined = "order_declined"
|
|
EventOrderStatus = "order_status_changed"
|
|
EventMessageForwarded = "message_forwarded"
|
|
EventInventoryChanged = "inventory_changed"
|
|
)
|
|
|
|
type Order struct {
|
|
ID int64
|
|
SubmitterID string
|
|
SubmitterName string
|
|
AcceptorID string
|
|
AcceptorName string
|
|
Commodity string
|
|
Quality int
|
|
QuantityAmount float64
|
|
QuantityUnit string
|
|
Deadline string
|
|
DeliveryPlace string
|
|
MaxBudgetAUEC int64
|
|
Status string
|
|
PublicChannelID string
|
|
PublicMessageID string
|
|
InternalChannelID string
|
|
InternalMessageID string
|
|
ThreadID string
|
|
LastFeedback string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type InventoryItem struct {
|
|
ID int64
|
|
Name string
|
|
NormalizedName string
|
|
Quality int
|
|
QuantityAmount float64
|
|
QuantityUnit string
|
|
Location string
|
|
Note string
|
|
UpdatedByID string
|
|
UpdatedByName string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type InventoryMatch struct {
|
|
Item InventoryItem
|
|
RequestedQuantity float64
|
|
Available bool
|
|
}
|