Documentation ¶
Index ¶
- type AssignCourier
- type AssignCouriers
- type AssignOrders
- type CompleteOrder
- type CompleteOrders
- type Courier
- type Courier1
- type CourierType
- type Couriers
- type Order
- type Order1
- type Orders
- type OrdersByCost
- type Response
- type Response1
- type ResponseCourier
- type ResponseCouriers
- type ResponseMetaInfo
- type ResponseOrder
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignCourier ¶
type AssignCourier struct { CourierId uint `json:"courier_id"` Orders []AssignOrders `json:"orders"` }
type AssignCouriers ¶
type AssignCouriers struct { Date time.Time `json:"date"` Couriers []AssignCourier `json:"orders"` }
type AssignOrders ¶
type AssignOrders struct { GroupOrderId uint `json:"group_order_id"` Orders []ResponseOrder `json:"orders"` }
type CompleteOrder ¶
type CompleteOrders ¶
type CompleteOrders struct {
Orders []CompleteOrder `json:"complete_info"`
}
type Courier ¶
type Courier struct { gorm.Model TypeID *string `json:"courier_type,omitempty"` Type *Type `json:"courier_type_full,omitempty"` Regions pq.Int64Array `json:"regions" gorm:"type:integer[]"` WorkingHours pq.StringArray `json:"working_hours" gorm:"type:text[]"` }
type Courier1 ¶
type Courier1 struct { CourierType CourierType MaxWeight float32 MaxOrders int Regions []int Orders []Order TotalWeight float32 TotalCost float32 TotalTime float32 }
func (*Courier1) CanTakeOrder ¶
func (*Courier1) CheckRegion ¶
func (*Courier1) CheckWeight ¶
type CourierType ¶
type CourierType string
const ( Foot CourierType = "Foot" Bike CourierType = "Bike" Car CourierType = "Car" )
type Order ¶
type Order struct { gorm.Model Name string `json:"name" gorm:"uniqueIndex"` Cost int `json:"cost"` //RegionID *uint `json:"region_id,omitempty"` //Region *Region `json:"regions" gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` Weight float32 `json:"weight"` DeliveryHours pq.StringArray `json:"delivery_hours" gorm:"type:text[]"` Regions int `json:"regions"` CompletedTime time.Time `json:"completed_time,omitempty"` CourierID *uint `json:"courier_id,omitempty"` Courier *Courier `json:"courier,omitempty"` }
type OrdersByCost ¶
type OrdersByCost []Order
func (OrdersByCost) Len ¶
func (o OrdersByCost) Len() int
func (OrdersByCost) Less ¶
func (o OrdersByCost) Less(i, j int) bool
func (OrdersByCost) Swap ¶
func (o OrdersByCost) Swap(i, j int)
type ResponseCourier ¶
type ResponseCouriers ¶
type ResponseCouriers struct { Couriers []ResponseCourier `json:"couriers"` Limit int `json:"limit,omitempty"` Offset int `json:"offset,omitempty"` }
type ResponseMetaInfo ¶
type ResponseMetaInfo struct { ResponseCourier Rating int `json:"rating"` Earnings int `json:"earnings"` }
type ResponseOrder ¶
Click to show internal directories.
Click to hide internal directories.