Updated ticket status when created
This commit is contained in:
parent
a5d20daab3
commit
78c80b9b38
1 changed files with 4 additions and 2 deletions
|
|
@ -63,8 +63,10 @@ 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())) {
|
||||
// If bug force the ticket status on takenInAccount. All the others are estimateTodo.
|
||||
if ($ticket->type->equals(TicketType::bug())) {
|
||||
$ticket->status = TicketStatus::takenInAccount();
|
||||
} else {
|
||||
$ticket->status = TicketStatus::estimateTodo();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue