sigd/app/Enums/GcomCrfData.php

160 lines
7.6 KiB
PHP

<?php
namespace App\Enums;
enum GcomCrfData: string
{
case STATIONARY_ENERGY = 'stationary_energy';
case TRANSPORTATION = 'transportation';
case WASTE = 'waste';
case IPPU = 'ippu';
case AFOLU = 'afolu';
case GRID_SUPPLIED_ENERGY = 'grid_supplied_energy';
public function getData(): array
{
return match ($this) {
self::STATIONARY_ENERGY => [
'Residential buildings' => [
1 => (object)['gpc_code' => 'i_1_1', 'notation_key' => 'NE'],
2 => (object)['gpc_code' => 'i_1_2', 'notation_key' => 'NE'],
3 => (object)['gpc_code' => 'i_1_3', 'notation_key' => 'NE'], // DEFAULT
],
'Commercial buildings & facilities' => [
1 => (object)['gpc_code' => ['i_2_1','i_6_1'], 'notation_key' => 'NE'],
2 => (object)['gpc_code' => ['i_2_2','i_6_2'], 'notation_key' => 'NE'],
3 => (object)['gpc_code' => ['i_2_3','i_6_3'], 'notation_key' => 'NE'], // DEFAULT
],
'Institutional buildings & facilities' => [
1 => (object)['gpc_code' => 'ie', 'notation_key' => 'IE'],
2 => (object)['gpc_code' => 'ie', 'notation_key' => 'IE'],
3 => (object)['gpc_code' => 'ie', 'notation_key' => 'IE'],
'info' => 'Included in Commercial Buildings and Facilities'
],
'Industrial buildings & facilities' => [
1 => (object)['gpc_code' => 'i_3_1', 'notation_key' => 'NE'],
2 => (object)['gpc_code' => 'i_3_2', 'notation_key' => 'NE'],
3 => (object)['gpc_code' => 'i_3_3', 'notation_key' => 'NE'],
],
'Agriculture' => [
1 => (object)['gpc_code' => 'i_5_1', 'notation_key' => 'NO'],
2 => (object)['gpc_code' => 'i_5_2', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'i_5_3', 'notation_key' => 'NE'], // DEFAULT
],
'Fugitive emissions' => [
1 => (object)['gpc_code' => 'i_8_1', 'notation_key' => 'C'],
3 => (object)['gpc_code' => 'i_7_1', 'notation_key' => 'NO'],
]
],
self::TRANSPORTATION => [
'On-road' => [
1 => (object)['gpc_code' => 'ii_1_1', 'notation_key' => 'NE'],
2 => (object)['gpc_code' => 'ii_1_2', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'ii_1_3', 'notation_key' => 'NE'], // DEFAULT
],
'Rail' => [
1 => (object)['gpc_code' => 'ii_2_1', 'notation_key' => 'IE'],
2 => (object)['gpc_code' => 'ii_2_2', 'notation_key' => 'NE'],
3 => (object)['gpc_code' => 'ii_2_3', 'notation_key' => 'NE'], // DEFAULT
],
'Waterborne navigation' => [
1 => (object)['gpc_code' => 'ii_3_1', 'notation_key' => 'IE'],
2 => (object)['gpc_code' => 'ii_3_2', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'ii_3_3', 'notation_key' => 'NE'], // DEFAULT
],
'Aviation' => [
1 => (object)['gpc_code' => 'ii_4_1', 'notation_key' => 'NO'],
2 => (object)['gpc_code' => 'ii_4_2', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'ii_4_3', 'notation_key' => 'NE'], // DEFAULT
],
'Off-road' => [
1 => (object)['gpc_code' => 'ii_5_1', 'notation_key' => 'NO'],
2 => (object)['gpc_code' => 'ii_5_2', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'ii_5_3', 'notation_key' => 'NE'], // DEFAULT
],
],
self::WASTE => [
'Solid waste disposal' => [
1 => (object)['gpc_code' => ['iii_1_1','iii_1_3'], 'notation_key' => 'NE'],
3 => (object)['gpc_code' => 'iii_1_3', 'notation_key' => 'NO'],
],
'Biological treatment' => [
1 => (object)['gpc_code' => ['iii_2_1','iii_2_3'], 'notation_key' => 'NE'],
3 => (object)['gpc_code' => 'iii_2_3', 'notation_key' => 'NO'],
],
'Incinerated and open burning' => [
1 => (object)['gpc_code' => ['iii_3_1','iii_3_3'], 'notation_key' => 'NE'],
3 => (object)['gpc_code' => 'iii_3_3', 'notation_key' => 'NE'],
],
'Wastewater' => [
1 => (object)['gpc_code' => ['iii_4_1','iii_4_3'], 'notation_key' => 'NE'],
3 => (object)['gpc_code' => 'iii_4_3', 'notation_key' => 'NE'],
],
],
self::IPPU => [
'Industrial processes' => [
1 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'iv_1', 'notation_key' => 'NE'], // DEFAULT
],
'Produce Use' => [
1 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'iv_2', 'notation_key' => 'NE'], // DEFAULT
],
],
self::AFOLU => [
'Livestock' => [
1 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'v_1', 'notation_key' => 'NE'], // DEFAULT
],
'Land Use' => [
1 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'v_2', 'notation_key' => 'NE'], // DEFAULT
],
'Other AFOLU' => [
1 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'v_3', 'notation_key' => 'NE'], // DEFAULT
],
],
self::GRID_SUPPLIED_ENERGY => [
'Electricity-only generation' => [
1 => (object)['gpc_code' => 'i_4_4', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
],
'CHP generation' => [
1 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
],
'Heat/cold generation' => [
1 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
],
'Local renewable generation' => [
1 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
3 => (object)['gpc_code' => 'no', 'notation_key' => 'NO'],
]
],
};
}
public function getLabel(): string
{
return match ($this) {
self::STATIONARY_ENERGY => 'Stationary Energy',
self::TRANSPORTATION => 'Transportation',
self::WASTE => 'Waste',
self::IPPU => 'IPPU',
self::AFOLU => 'AFOLU',
self::GRID_SUPPLIED_ENERGY => 'Generation of grid-supplied energy',
};
}
public static function getAllData(): array
{
$data = [];
foreach (self::cases() as $case) {
$data[$case->getLabel()] = $case->getData();
}
return $data;
}
}