tenantIntegrationService = $tenantIntegrationService; } public function index(string $tenantCode) { return response()->json($this->tenantIntegrationService->getAllForTenant($tenantCode)); } public function show(string $tenantCode, string $integrationCode) { $integration = $this->tenantIntegrationService->getTenantIntegration($tenantCode, $integrationCode); if (!$integration) { return response()->json(['message' => 'Integration not configured for this tenant'], 404); } return response()->json($integration); } public function store(StoreTenantIntegrationRequest $request, string $tenantCode, string $integrationCode) { $integration = Integration::where('integration_code', $integrationCode)->firstOrFail(); $tenantIntegration = $this->tenantIntegrationService->updateOrCreateIntegration( $tenantCode, $integration, $request->input('integration_data', []) ); return response()->json($tenantIntegration); } }