refactor:거래처 유형/분류를 사업자등록증 양식(업태/종목)으로 변경

- select → 자유 텍스트 입력으로 변경
- OCR에서 업태/종목 직접 매핑
- 컨트롤러 enum 검증 제거
- 필터 동적 옵션, 통계 카드 간소화

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-13 11:13:08 +09:00
parent 8a18244000
commit 13bbe5731b
3 changed files with 30 additions and 51 deletions

View File

@@ -63,9 +63,8 @@ public function index(Request $request): JsonResponse
$allPartners = TradingPartner::forTenant($tenantId);
$stats = [
'total' => (clone $allPartners)->count(),
'vendor' => (clone $allPartners)->where('type', 'vendor')->count(),
'freelancer' => (clone $allPartners)->where('type', 'freelancer')->count(),
'active' => (clone $allPartners)->where('status', 'active')->count(),
'inactive' => (clone $allPartners)->where('status', 'inactive')->count(),
];
return response()->json([
@@ -79,8 +78,8 @@ public function store(Request $request): JsonResponse
{
$request->validate([
'name' => 'required|string|max:100',
'type' => 'required|in:vendor,freelancer',
'category' => 'required|string|max:50',
'type' => 'nullable|string|max:100',
'category' => 'nullable|string|max:100',
]);
$tenantId = session('selected_tenant_id', 1);
@@ -88,8 +87,8 @@ public function store(Request $request): JsonResponse
$partner = TradingPartner::create([
'tenant_id' => $tenantId,
'name' => $request->input('name'),
'type' => $request->input('type', 'vendor'),
'category' => $request->input('category', '기타'),
'type' => $request->input('type'),
'category' => $request->input('category'),
'biz_no' => $request->input('bizNo'),
'bank_account' => $request->input('bankAccount'),
'contact' => $request->input('contact'),
@@ -127,8 +126,8 @@ public function update(Request $request, int $id): JsonResponse
$request->validate([
'name' => 'required|string|max:100',
'type' => 'required|in:vendor,freelancer',
'category' => 'required|string|max:50',
'type' => 'nullable|string|max:100',
'category' => 'nullable|string|max:100',
]);
$partner->update([