fix: env vars handled via conf file, add: functional tests
This commit is contained in:
parent
3d08b14f11
commit
21c4330f16
39 changed files with 416 additions and 172 deletions
|
@ -6,9 +6,9 @@ use App\Http\Controllers\CsvController\CsvCostCalc\CsvCostCalc;
|
|||
|
||||
class CsvDataHandling
|
||||
{
|
||||
public function __construct()
|
||||
public function __construct($calculate_agent_cost = false)
|
||||
{
|
||||
$this->calculate_agent_cost = env('GITEA_CALCULATE_AGENT_COST');
|
||||
$this->calculate_agent_cost = $calculate_agent_cost || config('app.gitea_calculate_agent_cost');
|
||||
$this->csv_cost_calc = new CsvCostCalc();
|
||||
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class CsvDataHandling
|
|||
return [$total_issue_time, $agents_issue_time];
|
||||
}
|
||||
|
||||
function handle_csv_time(array $array, array $issue, array $issue_time, array $company_agents = [])
|
||||
function handle_csv_time(array $array, array $issue, array $issue_time, array $company_agents = [], $calculate_agent_cost = false)
|
||||
{
|
||||
[$total_time, $agents_time] = $this->get_issue_total_time($issue_time);
|
||||
$array = $this->csv_cost_calc->total_time_cost($array, $total_time);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue