diff --git a/app/Modules/Companies/CompanyService.php b/app/Modules/Companies/CompanyService.php index e5bfa14..bc69c7a 100644 --- a/app/Modules/Companies/CompanyService.php +++ b/app/Modules/Companies/CompanyService.php @@ -6,6 +6,7 @@ namespace App\Modules\Companies; use App\Services\Security\EncryptionService; use App\Modules\Companies\CompanyModel; +use Ramsey\Uuid\Uuid; final class CompanyService { @@ -16,6 +17,9 @@ final class CompanyService public function createCompany(array $data): string { + if (!isset($data['id'])) { + $data['id'] = Uuid::uuid4()->toString(); + } // Encrypt sensitive JoFotara credentials if (isset($data['jofotara_client_id'])) { $data['jofotara_client_id_encrypted'] = $this->encryption->encrypt($data['jofotara_client_id']); diff --git a/public/shell.php b/public/shell.php index 2f0b97a..653cb1e 100644 --- a/public/shell.php +++ b/public/shell.php @@ -375,7 +375,7 @@ try { const name = document.getElementById('comp-name').value; const tax = document.getElementById('comp-tax').value; - await API.post('/companies', { name, tax_number: tax }); + await API.post('/companies', { name, tax_identification_number: tax }); document.getElementById('company-modal').remove(); renderCompanies(); } catch(err) {