Fix command validation rules
This commit is contained in:
@@ -69,12 +69,12 @@ final class AddComponentCommand
|
|||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'description' => 'string',
|
'description' => 'required|string',
|
||||||
'status' => 'int|min:1|max:4',
|
'status' => 'required|int|min:1|max:4',
|
||||||
'link' => 'url',
|
'link' => 'nullable|url',
|
||||||
'order' => 'int',
|
'order' => 'nullable|int',
|
||||||
'group_id' => 'int',
|
'group_id' => 'nullable|int',
|
||||||
'enabled' => 'bool',
|
'enabled' => 'nullable|bool',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -77,13 +77,13 @@ final class UpdateComponentCommand
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'string',
|
'name' => 'nullable|string',
|
||||||
'description' => 'string',
|
'description' => 'nullable|string',
|
||||||
'status' => 'int|min:1|max:4',
|
'status' => 'nullable|int|min:1|max:4',
|
||||||
'link' => 'url',
|
'link' => 'nullable|url',
|
||||||
'order' => 'int',
|
'order' => 'nullable|int',
|
||||||
'group_id' => 'int',
|
'group_id' => 'nullable|int',
|
||||||
'enabled' => 'bool',
|
'enabled' => 'nullable|bool',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ final class AddComponentGroupCommand
|
|||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'order' => 'int',
|
'order' => 'required|int',
|
||||||
'collapsed' => 'int|between:0,3',
|
'collapsed' => 'required|int|between:0,3',
|
||||||
'visible' => 'bool',
|
'visible' => 'required|bool',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -61,10 +61,10 @@ final class UpdateComponentGroupCommand
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'string',
|
'name' => 'nullable|string',
|
||||||
'order' => 'int',
|
'order' => 'nullable|int',
|
||||||
'collapsed' => 'int|between:0,3',
|
'collapsed' => 'nullable|int|between:0,3',
|
||||||
'visible' => 'bool',
|
'visible' => 'nullable|bool',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -104,14 +104,14 @@ final class ReportIncidentCommand
|
|||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'status' => 'required|int|min:0|max:4',
|
'status' => 'required|int|min:0|max:4',
|
||||||
'message' => 'string',
|
'message' => 'required|string',
|
||||||
'visible' => 'bool',
|
'visible' => 'nullable|bool',
|
||||||
'component_id' => 'int|required_with:component_status',
|
'component_id' => 'nullable|required_with:component_status|int',
|
||||||
'component_status' => 'int|min:1|max:4|required_with:component_id',
|
'component_status' => 'nullable|required_with:component_id|int|min:1|max:4',
|
||||||
'notify' => 'bool',
|
'notify' => 'nullable|bool',
|
||||||
'stickied' => 'bool',
|
'stickied' => 'required|bool',
|
||||||
'incident_date' => 'string',
|
'incident_date' => 'nullable|string',
|
||||||
'template' => 'string',
|
'template' => 'nullable|string',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ final class ReportMaintenanceCommand
|
|||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'message' => 'string',
|
'message' => 'required|string',
|
||||||
'notify' => 'bool',
|
'notify' => 'nullable|bool',
|
||||||
'timestamp' => 'string',
|
'timestamp' => 'required|string',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -105,15 +105,15 @@ final class UpdateIncidentCommand
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'string',
|
'name' => 'nullable|string',
|
||||||
'status' => 'int|min:0|max:4',
|
'status' => 'nullable|int|min:0|max:4',
|
||||||
'message' => 'string',
|
'message' => 'nullable|string',
|
||||||
'visible' => 'bool',
|
'visible' => 'nullable|bool',
|
||||||
'component_id' => 'int',
|
'component_id' => 'nullable|int',
|
||||||
'component_status' => 'int|min:1|max:4|required_with:component_id',
|
'component_status' => 'nullable|int|min:1|max:4|required_with:component_id',
|
||||||
'notify' => 'bool',
|
'notify' => 'nullable|bool',
|
||||||
'stickied' => 'bool',
|
'stickied' => 'nullable|bool',
|
||||||
'template' => 'string',
|
'template' => 'nullable|string',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -55,10 +55,8 @@ final class UpdateIncidentUpdateCommand
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'update' => 'required',
|
'status' => 'nullable|int|min:1|max:4',
|
||||||
'status' => 'int|min:1|max:4',
|
'message' => 'nullable|string',
|
||||||
'message' => 'string',
|
|
||||||
'user' => 'required',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -91,15 +91,15 @@ final class AddMetricCommand
|
|||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'suffix' => 'required|string',
|
'suffix' => 'required|string',
|
||||||
'description' => 'string',
|
'description' => 'nullable|string',
|
||||||
'display_chart' => 'bool',
|
'display_chart' => 'nullable|bool',
|
||||||
'default_value' => 'int',
|
'default_value' => 'required|int',
|
||||||
'calc_type' => 'int',
|
'calc_type' => 'required|int',
|
||||||
'display_chart' => 'int',
|
'display_chart' => 'nullable|int',
|
||||||
'places' => 'int|between:0,4',
|
'places' => 'nullable|int|between:0,4',
|
||||||
'default_view' => 'int|between:0,3',
|
'default_view' => 'required|int|between:0,3',
|
||||||
'threshold' => 'numeric|between:0,10',
|
'threshold' => 'nullable|numeric|between:0,10',
|
||||||
'order' => 'int',
|
'order' => 'nullable|int',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ final class AddMetricPointCommand
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'value' => 'numeric',
|
'value' => 'required|numeric',
|
||||||
'created_at' => 'string',
|
'created_at' => 'required|string',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -98,17 +98,17 @@ final class UpdateMetricCommand
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'string',
|
'name' => 'nullable|string',
|
||||||
'suffix' => 'string',
|
'suffix' => 'nullable|string',
|
||||||
'description' => 'string',
|
'description' => 'nullable|string',
|
||||||
'display_chart' => 'bool',
|
'display_chart' => 'nullable|bool',
|
||||||
'default_value' => 'numeric',
|
'default_value' => 'nullable|numeric',
|
||||||
'calc_type' => 'int|in:0,1',
|
'calc_type' => 'nullable|int|in:0,1',
|
||||||
'display_chart' => 'int',
|
'display_chart' => 'nullable|int',
|
||||||
'places' => 'numeric|between:0,4',
|
'places' => 'nullable|numeric|between:0,4',
|
||||||
'default_view' => 'numeric|between:0,4',
|
'default_view' => 'nullable|numeric|between:0,4',
|
||||||
'threshold' => 'numeric|between:0,10',
|
'threshold' => 'nullable|numeric|between:0,10',
|
||||||
'order' => 'int',
|
'order' => 'nullable|int',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ final class UpdateMetricPointCommand
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'value' => 'numeric',
|
'value' => 'nullable|numeric',
|
||||||
'created_at' => 'string',
|
'created_at' => 'nullable|string',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ final class AddUserCommand
|
|||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'username' => 'required|string',
|
'username' => 'required|string',
|
||||||
'password' => 'string',
|
'password' => 'required|string',
|
||||||
'level' => 'int',
|
'level' => 'required|int',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ final class SignupUserCommand
|
|||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'username' => 'required|string',
|
'username' => 'required|string',
|
||||||
'password' => 'string',
|
'password' => 'required|string',
|
||||||
'email' => 'required|string|email',
|
'email' => 'required|string|email',
|
||||||
'level' => 'int',
|
'level' => 'required|int',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user