Set an order on metrics via the API. Closes #1874

This commit is contained in:
James Brooks
2016-06-02 09:06:40 +01:00
parent 439ac9fe44
commit cab030237b
12 changed files with 106 additions and 17 deletions

View File

@@ -85,6 +85,13 @@ final class UpdateMetricCommand
*/
public $threshold;
/**
* The order of which to place the metric in.
*
* @var int
*/
public $order;
/**
* The validation rules.
*
@@ -101,6 +108,7 @@ final class UpdateMetricCommand
'places' => 'numeric|between:0,4',
'default_view' => 'numeric|between:0,4',
'threshold' => 'numeric|between:0,10',
'order' => 'int',
];
/**
@@ -116,10 +124,11 @@ final class UpdateMetricCommand
* @param int $places
* @param int $default_view
* @param int $threshold
* @param int $order
*
* @return void
*/
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold)
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order)
{
$this->metric = $metric;
$this->name = $name;
@@ -131,5 +140,6 @@ final class UpdateMetricCommand
$this->places = $places;
$this->default_view = $default_view;
$this->threshold = $threshold;
$this->order = $order;
}
}