Files
sam-react-prod/claudedocs/archive/sessions/[NEXT-2025-12-06] item-crud-session-context.md
유병철 07374c826c refactor(WEB): claudedocs 재정리 및 AuthContext/Zustand/유틸 코드 개선
- claudedocs 폴더 구조 재정리: archive/sessions, guides/migration·mobile·universal-list, refactoring 분류
- 오래된 세션 컨텍스트/체크리스트 문서 정리 (아카이브 이동 또는 삭제)
- AuthContext → authStore(Zustand) 전환 시작, RootProvider 간소화
- GenericCRUDDialog 공통 다이얼로그 컴포넌트 추가
- PermissionDialog 삭제 → GenericCRUDDialog로 대체
- RankDialog/TitleDialog GenericCRUDDialog 기반으로 리팩토링
- toast-utils.ts 삭제 (미사용)
- fileDownload.ts 개선, excel-download.ts 정리
- menuStore/themeStore Zustand 셀렉터 최적화
- useColumnSettings/useTableColumnStore 기능 보강
- 세금계산서/견적/작업자화면/결재 등 소규모 개선

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:17:13 +09:00

2.7 KiB

다음 세션 컨텍스트 - 품목관리 기능 개발

2025-12-06 세션에서 진행한 내용 및 다음 세션에서 이어갈 작업


완료된 작업

1. 삭제 알럿 제거

  • 품목 테이블에서 삭제 버튼 클릭 → 모달 확인 → 바로 삭제 (알럿 없이)
  • 파일: src/components/items/ItemListClient.tsx

2. 디버깅 콘솔 로그 제거

  • DropdownField.tsx - 단위 필드 디버깅 로그 제거
  • useConditionalDisplay.ts - 조건부 표시 디버깅 로그 제거
  • useDynamicFormState.ts - resetForm 디버깅 로그 제거

발견된 문제 (백엔드 수정 필요)

소모품(CS) 규격(specification) 저장 안됨 🔴

원인 분석 완료:

  1. 프론트엔드: 97_specificationspecspecification으로 정상 변환됨
  2. 백엔드 문제: ItemStoreRequest.php의 validation rules에 specification 필드가 없음
  3. Laravel FormRequest는 rules에 없는 필드를 $request->validated()에서 제외
  4. 결과: DB에 규격이 null로 저장됨

백엔드 수정 요청:

// /app/Http/Requests/Item/ItemStoreRequest.php
// rules()에 추가 필요:
'specification' => 'nullable|string|max:255',

상세 문서: claudedocs/item-master/[API-2025-12-06] item-crud-backend-requests.md


다음 세션에서 확인할 사항

  1. 백엔드 수정 후 테스트

    • 소모품 등록 시 규격 값 저장 확인
    • 상세 페이지에서 규격 표시 확인
  2. 수정 API도 확인 필요

    • ItemUpdateRequest.php에도 specification 필드 있는지 확인
    • 어제 "수정하면 규격이 보였다"고 했는데, 수정 API는 다를 수 있음
  3. 추가 편의 기능 개발 (사용자 요청 시)

    • 품목관리 관련 추가 기능 구현

관련 파일 위치

프론트엔드

  • src/components/items/ItemListClient.tsx - 품목 목록/삭제
  • src/components/items/ItemDetailClient.tsx - 품목 상세
  • src/components/items/DynamicItemForm/index.tsx - 동적 폼
  • src/app/[locale]/(protected)/items/create/page.tsx - 등록 페이지
  • src/app/[locale]/(protected)/items/[id]/edit/page.tsx - 수정 페이지
  • src/app/[locale]/(protected)/items/[id]/page.tsx - 상세 페이지

백엔드 (sam-api)

  • /app/Http/Requests/Item/ItemStoreRequest.php - 등록 요청 검증 ⚠️ 수정 필요
  • /app/Http/Requests/Item/ItemUpdateRequest.php - 수정 요청 검증 (확인 필요)
  • /app/Services/ItemsService.php - 품목 서비스
  • /app/Models/Materials/Material.php - Material 모델

명령어

# 프론트엔드 개발 서버
cd /Users/byeongcheolryu/codebridgex/sam_project/sam-next/sma-next-project/sam-react-prod
npm run dev