added component and status to CreateIncidentUpdateCommand

This commit is contained in:
Knight Tan
2017-10-26 09:16:20 +08:00
committed by James Brooks
parent ab01609bb5
commit d2975cd1eb
2 changed files with 19 additions and 1 deletions

View File

@@ -41,7 +41,19 @@ final class CreateIncidentUpdateCommand
* @var string
*/
public $message;
/**
* The incident component.
*
* @var int
*/
public $component_id;
/**
* The component status.
*
* @var int
*/
public $component_status;
/**
* The user.
*
@@ -58,6 +70,8 @@ final class CreateIncidentUpdateCommand
'incident' => 'required',
'status' => 'required|int|min:1|max:4',
'message' => 'required|string',
'component_id' => 'nullable|required_with:component_status|int',
'component_status' => 'nullable|required_with:component_id|int|min:0|max:4',
'user' => 'required',
];
@@ -71,11 +85,13 @@ final class CreateIncidentUpdateCommand
*
* @return void
*/
public function __construct(Incident $incident, $status, $message, User $user)
public function __construct(Incident $incident, $status, $message, $component_id, $component_status, User $user)
{
$this->incident = $incident;
$this->status = $status;
$this->message = $message;
$this->component_id = $component_id;
$this->component_status = $component_status;
$this->user = $user;
}
}