fix: reconcile accepted source classifications for protected investor aggregates
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-15 23:25:51 +02:00
parent c8957ecb9d
commit b60c231ddc
14 changed files with 11171 additions and 26 deletions
+22
View File
@@ -11,6 +11,28 @@ use Illuminate\Support\Facades\Schema;
/** Shared read contract. It deliberately has no dependency on the installation controller/service. */
class EconomicReferenceCatalog
{
/** Accepted source hierarchy for the private aggregate adapter; no catalogue publication or writes.
* @return array{source_sha256:string,nodes:list<array{id:string,code:string,label:string,group:string,group_code:string,group_label:string}>}
*/
public function supplyClassification(): array
{
$data = json_decode(CheckedFile::read(database_path('data/proactive-supply-classification.json')), true, 512, JSON_THROW_ON_ERROR);
abort_unless(($data['format'] ?? null) === 'accepted-source-classification-v1'
&& ($data['source_sha256'] ?? null) === '83b4f1200988e99834c2ae3915346fbf237d128308554b67b5a080d4956bf506', 503);
$nodes = [];
foreach ($data['nodes'] ?? [] as $node) {
if (! is_array($node) || ! is_string($node['id'] ?? null) || ! is_string($node['code'] ?? null)
|| ! is_string($node['label'] ?? null) || ! is_string($node['group'] ?? null)
|| ! is_string($node['group_code'] ?? null) || ! is_string($node['group_label'] ?? null)) {
abort(503, 'Referência de classificação indisponível.');
}
$nodes[] = ['id' => $node['id'], 'code' => $node['code'], 'label' => $node['label'], 'group' => $node['group'], 'group_code' => $node['group_code'], 'group_label' => $node['group_label']];
}
return ['source_sha256' => '83b4f1200988e99834c2ae3915346fbf237d128308554b67b5a080d4956bf506', 'nodes' => $nodes];
}
public const LOT = 'lot-01';
public const SOURCE = 'economic-reference-lot-01';