From 3d21444d1f28c267888bbfb6fb91441d0085be72 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Mon, 4 May 2026 21:46:07 +0300 Subject: [PATCH] Update: 2026-05-04 21:46:07 --- app/modules_app/companies/create.php | 5 +++-- app/modules_app/users/create.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/modules_app/companies/create.php b/app/modules_app/companies/create.php index 641e24f..f908e26 100644 --- a/app/modules_app/companies/create.php +++ b/app/modules_app/companies/create.php @@ -41,11 +41,11 @@ try { // 3. Save to Database $stmt = $db->prepare(" INSERT INTO companies ( - tenant_id, name, name_en, tax_identification_number, commercial_registration_number, + id, tenant_id, name, name_en, tax_identification_number, commercial_registration_number, city, address, contact_email, contact_phone, jofotara_client_id_encrypted, jofotara_secret_key_encrypted, created_at - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) "); // Determine tenant_id: Super Admin chooses, Admin uses own @@ -60,6 +60,7 @@ try { } $stmt->execute([ + \App\Core\Database::generateUuid(), $tenantId, $encryptedName, $encryptedNameEn, diff --git a/app/modules_app/users/create.php b/app/modules_app/users/create.php index 7bca1ee..e22a7ce 100644 --- a/app/modules_app/users/create.php +++ b/app/modules_app/users/create.php @@ -59,8 +59,9 @@ if ($decoded['role'] === 'super_admin') { // 4. Save to Database try { - $stmt = $db->prepare("INSERT INTO users (tenant_id, name, email, email_hash, password_hash, role, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)"); + $stmt = $db->prepare("INSERT INTO users (id, tenant_id, name, email, email_hash, password_hash, role, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); $stmt->execute([ + \App\Core\Database::generateUuid(), $tenantId, $encryptedName, $encryptedEmail,