fix: env vars handled via conf file, add: functional tests

This commit is contained in:
Michael 2024-08-17 18:06:06 +02:00
parent 3d08b14f11
commit 21c4330f16
39 changed files with 416 additions and 172 deletions

View file

@ -10,18 +10,18 @@ class CsvMinuteCostCalc
{
public function __construct()
{
$this->internal_percentage_to_deduct = getenv('PRICE_INTERNAL_PERCENTAGE_TO_DEDUCT');
$this->partner_organization = strtolower(getenv('GITEA_PARTNER_ORGANIZATION'));
$this->internal_percentage_to_deduct = config('app.price_internal_percentage_to_deduct');
$this->partner_organization = strtolower(config('app.gitea_partner_organization'));
$this->price_partner = [
'high' => $this->calculate_minute_cost((int)getenv('PRICE_PARTNER_HIGH')),
'normal' => $this->calculate_minute_cost((int)getenv('PRICE_PARTNER_NORMAL')),
'low' => $this->calculate_minute_cost((int)getenv('PRICE_PARTNER_LOW')),
'high' => $this->calculate_minute_cost((int)config('app.price_partner_high')),
'normal' => $this->calculate_minute_cost((int)config('app.price_partner_normal')),
'low' => $this->calculate_minute_cost((int)config('app.price_partner_low')),
'0'=>0,
];
$this->price_client = [
'high' => $this->calculate_minute_cost((int)getenv('PRICE_CLIENT_HIGH')),
'normal' => $this->calculate_minute_cost((int)getenv('PRICE_CLIENT_NORMAL')),
'low' => $this->calculate_minute_cost((int)getenv('PRICE_CLIENT_LOW')),
'high' => $this->calculate_minute_cost((int)config('app.price_client_high')),
'normal' => $this->calculate_minute_cost((int)config('app.price_client_normal')),
'low' => $this->calculate_minute_cost((int)config('app.price_client_low')),
'0'=>0,
];
}