feat: company create with copy-from + fix missing fields

- Add phone_number_id and display_phone fields to create/edit form
  (were never shown or saved despite existing in the DB)
- Add phone_number_id and display_phone to CompanyRepository::save()
- New company form shows "Copiar configuración de empresa" dropdown:
  selecting an existing company pre-fills api_base_url, api_key,
  bot_type, config_json, etc. so admins only need to change
  the name and phone_number_id

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-28 17:47:16 -05:00
co-authored by Claude Sonnet 4.6
parent 838cc651b2
commit 84afeb598c
2 changed files with 86 additions and 14 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ class CompanyRepository
$db = db();
$id = (int)($data['id'] ?? 0);
$fields = ['name', 'display_name', 'api_base_url', 'api_key', 'bot_type', 'requires_approval', 'is_active', 'config_json', 'erp_active_users'];
$fields = ['name', 'display_name', 'phone_number_id', 'display_phone', 'api_base_url', 'api_key', 'bot_type', 'requires_approval', 'is_active', 'config_json', 'erp_active_users'];
$params = [];
$sets = [];
foreach ($fields as $f) {