- Added `virkdata` class to handle API operations for company information retrieval and config validation. - Introduced `virkdata_i` interface and supporting helpers: `virkdata_request_parameters`, `virkdata_response`, and enums for formats, countries, and error codes. - Implemented new routes: `/worker/debug`, `/worker/licenseplates`, `/cvr/lookup`, and `/economic/doesCustomerExist`. - Added module `Virkdata` route for searching company data and fetching/updating configurations (`moduleVirkDataRoute`). - Created `virkdata` module configurations: `enabled`, `secret_key`, and `monthly_limit`. - Integrated virkdata initialization in `index.php`.
51 lines
1.7 KiB
PHP
51 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace virkdata;
|
|
require_once WD . '/modules/virkdata/config/virkdata_enabled_c.php';
|
|
require_once WD . '/modules/virkdata/config/virkdata_secret_key_c.php';
|
|
require_once WD . '/modules/virkdata/config/virkdata_monthly_limit_c.php';
|
|
// Require helpers
|
|
require_once WD . '/modules/virkdata/helpers/virkdata_request_parameters_country.php';
|
|
require_once WD . '/modules/virkdata/helpers/virkdata_request_parameters_format.php';
|
|
require_once WD . '/modules/virkdata/helpers/virkdata_response_error_codes.php';
|
|
require_once WD . '/modules/virkdata/helpers/virkdata_request_parameters.php';
|
|
require_once WD . '/modules/virkdata/helpers/virkdata_response.php';
|
|
|
|
use virkdata\config\virkdata_monthly_limit_c;
|
|
use virkdata\config\virkdata_enabled_c;
|
|
use virkdata\config\virkdata_secret_key_c;
|
|
use traits\module_config_t;
|
|
|
|
class virkdata_c
|
|
{
|
|
use module_config_t;
|
|
|
|
/**
|
|
* The status of the virkdata module
|
|
* @var virkdata_enabled_c
|
|
*/
|
|
public virkdata_enabled_c $enabled;
|
|
/**
|
|
* The secret key for the virkdata module (API token)
|
|
* @var virkdata_secret_key_c
|
|
*/
|
|
public virkdata_secret_key_c $secret_key;
|
|
/**
|
|
* The monthly limit for the virkdata module
|
|
* @var virkdata_monthly_limit_c
|
|
*/
|
|
public virkdata_monthly_limit_c $monthly_limit;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->setupConfig('virkdata');
|
|
$this->allowUpdate([
|
|
virkdata_enabled_c::class,
|
|
virkdata_secret_key_c::class,
|
|
virkdata_monthly_limit_c::class
|
|
]);
|
|
$this->enabled = new virkdata_enabled_c();
|
|
$this->secret_key = new virkdata_secret_key_c();
|
|
$this->monthly_limit = new virkdata_monthly_limit_c();
|
|
}
|
|
} |