If evolution force the ticket status on estimateTodo
This commit is contained in:
parent
6ed570709b
commit
fe252fa0ff
1 changed files with 6 additions and 0 deletions
|
|
@ -30,6 +30,12 @@ class Ticket extends Model
|
|||
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function (Ticket $ticket) {
|
||||
// If evolution force the ticket status on estimateTodo
|
||||
if ($ticket->type->equals(TicketType::evolution())) {
|
||||
$ticket->status = TicketStatus::estimateTodo();
|
||||
}
|
||||
});
|
||||
static::updating(function (Ticket $ticket) {
|
||||
$oldStatus = Ticket::where('id', $ticket->id)->first()->status;
|
||||
if (!$ticket->status->equals($oldStatus)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue