[FEAT] Visura auto-fill, adesione volontaria, modulo NCR/CAPA
1. Fix auto-fill visura: mapping corretto suggested_sector e employees_range, indicatori visivi verdi sui campi auto-compilati, fatturato sempre manuale 2. Adesione volontaria: colonna voluntary_compliance, checkbox in onboarding step 5 quando not_applicable, toggle in settings, reset su ri-classificazione 3. Modulo NCR/CAPA: NonConformityController con 10 endpoint API, tabelle non_conformities + capa_actions, generazione NCR dai gap assessment, predisposizione integrazione SistemiG.agile (webhook + sync) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -170,8 +170,12 @@ class OnboardingController extends BaseController
|
||||
(float) ($orgData['annual_turnover_eur'] ?? 0)
|
||||
);
|
||||
|
||||
// Handle voluntary compliance
|
||||
$voluntaryCompliance = ($entityType === 'not_applicable' && (int) $this->getParam('voluntary_compliance', 0)) ? 1 : 0;
|
||||
|
||||
Database::update('organizations', [
|
||||
'entity_type' => $entityType,
|
||||
'voluntary_compliance' => $voluntaryCompliance,
|
||||
], 'id = ?', [$orgId]);
|
||||
|
||||
// Link user as org_admin
|
||||
@@ -207,10 +211,11 @@ class OnboardingController extends BaseController
|
||||
]);
|
||||
|
||||
$this->jsonSuccess([
|
||||
'organization_id' => $orgId,
|
||||
'name' => $orgData['name'],
|
||||
'entity_type' => $entityType,
|
||||
'classification' => $this->getClassificationDetails($entityType, $orgData['sector'], (int)($orgData['employee_count'] ?? 0), (float)($orgData['annual_turnover_eur'] ?? 0)),
|
||||
'organization_id' => $orgId,
|
||||
'name' => $orgData['name'],
|
||||
'entity_type' => $entityType,
|
||||
'voluntary_compliance' => $voluntaryCompliance,
|
||||
'classification' => $this->getClassificationDetails($entityType, $orgData['sector'], (int)($orgData['employee_count'] ?? 0), (float)($orgData['annual_turnover_eur'] ?? 0)),
|
||||
], 'Onboarding completato', 201);
|
||||
|
||||
} catch (Throwable $e) {
|
||||
|
||||
Reference in New Issue
Block a user