add: tests
This commit is contained in:
parent
eebf859afa
commit
ce7f620984
16 changed files with 681 additions and 152 deletions
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers\CsvController\CsvCostCalc;
|
|||
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Utils\utils;
|
||||
|
||||
class CsvMinuteCostCalc
|
||||
{
|
||||
|
@ -27,7 +28,7 @@ class CsvMinuteCostCalc
|
|||
|
||||
private function calculate_minute_cost(int $hourly_cost)
|
||||
{
|
||||
return $hourly_cost / 60;
|
||||
return utils::round_up_to_two_decimals($hourly_cost / 60);
|
||||
}
|
||||
|
||||
private function extract_string_from_label($label)
|
||||
|
@ -35,7 +36,8 @@ class CsvMinuteCostCalc
|
|||
return strtolower(substr($label, strpos($label, '/') + 1));
|
||||
}
|
||||
|
||||
function select_correct_cost($requested_by, $priority)
|
||||
function
|
||||
select_correct_cost($requested_by, $priority)
|
||||
{
|
||||
$requested_by = $this->extract_string_from_label($requested_by);
|
||||
$priority = $this->extract_string_from_label($priority);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue