This commit is contained in:
2026-05-15 11:15:30 +02:00
parent 775b9200f5
commit 3eba3e3a15
10 changed files with 71 additions and 20 deletions
+10
View File
@@ -903,3 +903,13 @@ func (d *Database) ApproveDeliveryAtomicByStaff(commandID int, staffUsername str
return totalPoints, pointCategory, clientUsernameOut, nil
}
func (d *Database) SetCommandCancelReason(commandID int, reason string) error {
if len(reason) > 500 {
reason = reason[:500]
}
return d.GDB.Exec(
`UPDATE commandes SET cancel_reason = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ?`,
reason, commandID,
).Error
}