Flow Tester AI 프롬프트 템플릿 개선

- config.apiKey 필드를 JSON에서 제거 (서버 자동 주입)
- config.baseUrl을 빈 문자열로 설정 (서버 기본값 사용)
- 프롬프트 템플릿에 더 명확한 규칙 추가
- 로그인 스텝 포함한 완전한 예시 제공
- 예시 프롬프트 간소화
This commit is contained in:
2025-12-05 14:19:59 +09:00
parent 5c892c1ed9
commit 858ce6194d
6 changed files with 150 additions and 75 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Requests;
use App\Models\Tenants\Tenant;
use Illuminate\Foundation\Http\FormRequest;
class StoreUserRequest extends FormRequest
@@ -14,6 +15,21 @@ public function authorize(): bool
return true;
}
/**
* 현재 선택된 테넌트가 본사(HQ)인지 확인
*/
protected function isHQTenant(): bool
{
$tenantId = session('selected_tenant_id');
if (! $tenantId) {
return false;
}
$tenant = Tenant::find($tenantId);
return $tenant?->tenant_type === 'HQ';
}
/**
* Prepare the data for validation.
* 일반관리자가 슈퍼관리자를 생성하려는 경우 is_super_admin 필드 제거
@@ -35,12 +51,11 @@ protected function prepareForValidation(): void
*/
public function rules(): array
{
return [
$rules = [
'user_id' => 'nullable|string|max:50|unique:users,user_id',
'name' => 'required|string|max:100',
'email' => 'required|email|max:255|unique:users,email',
'phone' => 'nullable|string|max:20',
// password는 시스템이 자동 생성하므로 입력 받지 않음
'role' => 'nullable|string|max:50',
'is_active' => 'nullable|boolean',
'is_super_admin' => 'nullable|boolean',
@@ -49,6 +64,13 @@ public function rules(): array
'department_ids' => 'nullable|array',
'department_ids.*' => 'integer|exists:departments,id',
];
// 비본사 테넌트: 비밀번호 직접 입력 필수
if (! $this->isHQTenant()) {
$rules['password'] = 'required|string|min:8|max:100|confirmed';
}
return $rules;
}
/**