updates on the reverse logistics
This commit is contained in:
@@ -3166,6 +3166,13 @@ func AdminUpdateConsignmentStatus(c *fiber.Ctx) error {
|
||||
return utils.NotFound(c, "consignment not found")
|
||||
}
|
||||
|
||||
// Guard the move (reverse logistics plan, B1): this used to write any
|
||||
// string onto any parcel, including Delivered onto a cancelled one.
|
||||
if msg := checkGenericStatusChange(consignment.Status, req.Status); msg != "" {
|
||||
tx.Rollback()
|
||||
return utils.BadRequest(c, msg)
|
||||
}
|
||||
|
||||
consignment.Status = req.Status
|
||||
consignment.Updatedat = time.Now()
|
||||
if err := tx.Save(&consignment).Error; err != nil {
|
||||
|
||||
Reference in New Issue
Block a user