- 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`.
40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace modules\virkdata\helpers;
|
|
/**
|
|
* Class virkdata_request_parameters
|
|
* @package modules\virkdata\helpers
|
|
* @see https://virkdata.dk/app/dokumentation
|
|
* @note https://virkdata.dk/api/?search=telia&format=json&country=dk - This is the final request example
|
|
*/
|
|
class virkdata_request_parameters
|
|
{
|
|
/**
|
|
* Search string
|
|
* @var string $search
|
|
*/
|
|
public string $search;
|
|
/**
|
|
* The format of response data
|
|
* @var virkdata_request_parameters_format $format
|
|
* @see virkdata_request_parameters_format::cases()
|
|
*/
|
|
public virkdata_request_parameters_format $format = virkdata_request_parameters_format::json;
|
|
/**
|
|
* The countrycode for database of companies you would like to search through
|
|
* @var virkdata_request_parameters_country $country
|
|
* @see virkdata_request_parameters_country::cases()
|
|
*/
|
|
public virkdata_request_parameters_country $country = virkdata_request_parameters_country::dk;
|
|
/**
|
|
* Financial Summary, only available for dk
|
|
* @var bool $financial_summary
|
|
*/
|
|
public bool $financial_summary = false;
|
|
/**
|
|
* Custom variable to add to the request. You can filter all your requests in your dashboard
|
|
* @use https://virkdata.dk/app/dokumentation
|
|
* @var ?string $custom
|
|
*/
|
|
public ?string $custom;
|
|
} |