updates
This commit is contained in:
@@ -13,6 +13,40 @@ const (
|
||||
MilerBlocked = "Blocked"
|
||||
)
|
||||
|
||||
// MilerWorkingStatuses are the states in which a miler may be GIVEN more work.
|
||||
//
|
||||
// A miler carrying an order is still a miler on the road. Courier rounds are
|
||||
// multi-stop by nature, and every candidate query used to test
|
||||
// `availabilitystatus = 'Available'`, which treats the first booking as a
|
||||
// lock: the moment a rider took one order they vanished from every assignment
|
||||
// path, and the per-rider load caps that exist precisely to govern this never
|
||||
// got a chance to run. Whether a rider can take another job is a question
|
||||
// about how much they are already carrying — counted from their open
|
||||
// assignments — not about whether they are carrying anything at all.
|
||||
//
|
||||
// Offline, Break and Blocked are the only states that take a miler out. They
|
||||
// are excluded by naming the ones that are in, so a status added later is
|
||||
// off-duty until someone decides otherwise.
|
||||
var MilerWorkingStatuses = []string{
|
||||
MilerAvailable,
|
||||
MilerAssigned,
|
||||
MilerOnPickup,
|
||||
MilerAtCustomer,
|
||||
MilerPickedUp,
|
||||
MilerOnDelivery,
|
||||
}
|
||||
|
||||
// MilerCanTakeWork reports whether a miler in this state may receive another
|
||||
// booking. Load is capped separately, by counting open assignments.
|
||||
func MilerCanTakeWork(status string) bool {
|
||||
for _, s := range MilerWorkingStatuses {
|
||||
if s == status {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Booking sources — where a booking originated. Left as their stored literals:
|
||||
// "CRM_Console" predates the outward express rename and is an existing DB value.
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user