[FIX] suppliers create/update: persistono category_id (era ignorato)

Bug trovato da review UI multi-agente: create() e update() non includevano
category_id nell'INSERT/UPDATE, quindi la categoria assegnata a un fornitore
(dropdown UI / API) veniva silenziosamente persa. La colonna esiste da mig 033.
Ora create lo salva (?: null) e update lo include nei campi whitelisted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
DevEnv nis2-agile 2026-05-31 11:20:49 +02:00
parent 78758f6d65
commit 9fbf72a113

View File

@ -35,6 +35,7 @@ class SupplyChainController extends BaseController
'service_type' => $this->getParam('service_type'),
'service_description' => $this->getParam('service_description'),
'criticality' => $this->getParam('criticality', 'medium'),
'category_id' => $this->getParam('category_id') ?: null,
'contract_start_date' => $this->getParam('contract_start_date'),
'contract_expiry_date' => $this->getParam('contract_expiry_date'),
'notes' => $this->getParam('notes'),
@ -66,7 +67,7 @@ class SupplyChainController extends BaseController
$updates = [];
$fields = ['name', 'vat_number', 'contact_email', 'contact_name', 'service_type',
'service_description', 'criticality', 'contract_start_date', 'contract_expiry_date',
'service_description', 'criticality', 'category_id', 'contract_start_date', 'contract_expiry_date',
'security_requirements_met', 'notes', 'status'];
foreach ($fields as $field) {