2023-12-22 21:25:16 +00:00
|
|
|
package entity
|
|
|
|
|
|
|
|
type KindBoxStatus uint
|
|
|
|
|
|
|
|
const (
|
2024-03-14 13:38:42 +00:00
|
|
|
KindBoxDeliveredStatus KindBoxStatus = iota + 1
|
|
|
|
KindBoxReadyToReturnStatus
|
|
|
|
KindBoxAssignedReceiverAgentStatus
|
|
|
|
KindBoxReturnedStatus
|
2023-12-22 21:25:16 +00:00
|
|
|
KindBoxEnumeratedStatus
|
|
|
|
)
|
|
|
|
|
2023-12-28 13:43:06 +00:00
|
|
|
var kindBoxStatusStrings = map[KindBoxStatus]string{
|
2024-03-14 13:38:42 +00:00
|
|
|
KindBoxDeliveredStatus: "delivered",
|
|
|
|
KindBoxReadyToReturnStatus: "ready-to-return",
|
|
|
|
KindBoxAssignedReceiverAgentStatus: "assigned-receiver-agent",
|
|
|
|
KindBoxReturnedStatus: "returned",
|
|
|
|
KindBoxEnumeratedStatus: "enumerated",
|
2023-12-28 13:43:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s KindBoxStatus) String() string {
|
|
|
|
return kindBoxStatusStrings[s]
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllKindBoxStatus returns a slice containing all string values of KindBoxStatus.
|
|
|
|
func AllKindBoxStatus() []string {
|
|
|
|
statusStrings := make([]string, len(kindBoxStatusStrings))
|
|
|
|
for status, str := range kindBoxStatusStrings {
|
|
|
|
statusStrings[int(status)-1] = str
|
|
|
|
}
|
2024-01-01 07:22:14 +00:00
|
|
|
|
2023-12-28 13:43:06 +00:00
|
|
|
return statusStrings
|
|
|
|
}
|
|
|
|
|
|
|
|
// MapToKindBoxStatus converts a string to the corresponding KindBoxStatus value.
|
|
|
|
func MapToKindBoxStatus(statusStr string) KindBoxStatus {
|
|
|
|
for status, str := range kindBoxStatusStrings {
|
|
|
|
if str == statusStr {
|
|
|
|
return status
|
|
|
|
}
|
|
|
|
}
|
2024-01-01 07:22:14 +00:00
|
|
|
|
2023-12-28 13:43:06 +00:00
|
|
|
return KindBoxStatus(0)
|
|
|
|
}
|