- Added client_id field to StoreTenantRequest and UpdateTenantRequest for tenant management. - Updated TenantResource to include client_id in the response. - Created migration to establish clients table and link tenants to clients. - Migrated existing tenant integrations to client_integrations table. - Grouped specific tenants under a shared client (OnTicket) in a new migration. - Updated seeders to reflect new client structure and relationships. - Adjusted integration configurations to require client instead of tenant. - Added tests for client integration functionality and ensured existing tests reflect the new client structure.
28 lines
819 B
PHP
28 lines
819 B
PHP
<?php
|
|
|
|
namespace App\Domains\Integration\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateIntegrationRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
$integration = $this->route('integration');
|
|
|
|
return [
|
|
'name' => ['sometimes', 'required', 'string', 'max:255'],
|
|
'url' => ['nullable', 'url', 'max:255'],
|
|
'integration_data_schema' => ['nullable', 'array'],
|
|
'requires_client_configuration' => ['sometimes', 'boolean'],
|
|
// the code shouldn't ideally be updatable, but if it is:
|
|
'integration_code' => ['sometimes', 'required', 'string', 'unique:integrations,integration_code,'.($integration->id ?? '')],
|
|
];
|
|
}
|
|
}
|