Commit Graph

29 Commits

Author SHA1 Message Date
09db0da43b feat(API): 부실채권, 재고, 입고 기능 개선
- BadDebt 컨트롤러/서비스 기능 확장
- StockService 재고 조회 로직 개선
- ProcessReceivingRequest 검증 규칙 수정
- Item, Order, CommonCode, Shipment 모델 업데이트
- TodayIssueObserverService 개선

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:32:23 +09:00
pro
da45e1433b fix:수정 2026-01-20 20:51:42 +09:00
pro
0ae3c5aa07 feat: 계좌관리 추가 2026-01-20 20:43:38 +09:00
8ab65e18d0 refactor: prices.item_type_code 통합 및 하드코딩 제거
- 레거시 PRODUCT/MATERIAL 값을 실제 item_type(FG, PT 등)으로 마이그레이션
- Price 모델에서 하드코딩된 ITEM_TYPE_* 상수 제거
- PricingService.getCost()에서 하드코딩된 자재 유형 배열을
  common_codes.attributes.is_material 플래그 조회로 변경
- common_codes item_type 그룹에 is_material 플래그 추가
  - FG, PT: is_material = false (제품)
  - SM, RM, CS: is_material = true (자재)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:22:51 +09:00
0d49e4cc75 refactor: 견적 산출 서비스 DB 기반으로 재작성
- Quote 수식 모델 추가 (mng 패턴 적용)
  - QuoteFormula: 수식 정의 (input/calculation/range/mapping)
  - QuoteFormulaCategory: 카테고리 정의
  - QuoteFormulaItem: 품목 출력 정의
  - QuoteFormulaRange: 범위별 값 정의
  - QuoteFormulaMapping: 매핑 값 정의

- FormulaEvaluatorService 확장
  - executeAll(): 카테고리별 수식 실행
  - evaluateRangeFormula/evaluateMappingFormula: QuoteFormula 기반 평가
  - getItemPrice(): prices 테이블 연동

- QuoteCalculationService DB 기반으로 재작성
  - 하드코딩된 품목 코드/로직 제거
  - quote_formulas 테이블 기반 동적 계산
  - getInputSchema(): DB 기반 입력 스키마 생성

- Price 모델 수정
  - items 테이블 연동 (products/materials 대체)
  - ITEM_TYPE 상수 업데이트 (FG/PT/RM/SM/CS)
2025-12-19 16:49:26 +09:00
4d3085e705 feat: 견적 산출 서비스 prices 테이블 연동
- Price 모델에 getCurrentPrice(), getSalesPriceByItemCode() 메서드 추가
- Price 모델에 STATUS_*, ITEM_TYPE_* 상수 추가
- QuoteCalculationService에 setTenantId(), getUnitPrice() 메서드 추가
- 스크린 품목 단가: 원단, 케이스, 브라켓, 인건비 prices 조회로 변경
- 철재 품목 단가: 철판, 용접, 표면처리, 가공비 prices 조회로 변경
- 모터 용량별 단가: 50W~300W prices 조회로 변경
- 모든 단가는 prices 조회 실패 시 기존 하드코딩 값을 fallback으로 사용
2025-12-19 16:20:38 +09:00
a1980adb20 feat: Price, PriceRevision 모델 생성 및 서비스 정리
- Price 모델 생성 (prices 테이블)
- PriceRevision 모델 생성 (price_revisions 테이블)
- 레거시 Pricing/PricingService 삭제 (PriceHistory 사용)
- pricing 에러/메시지 추가
2025-12-17 20:57:38 +09:00
039fd623df refactor: products/materials 테이블 및 관련 코드 삭제
- products, materials, product_components 테이블 삭제 마이그레이션
- FK 제약조건 정리 (orders, order_items, material_receipts, lots)
- 관련 Models 삭제: Product, Material, ProductComponent 등
- 관련 Controllers 삭제: ProductController, MaterialController, ProductBomItemController
- 관련 Services 삭제: ProductService, MaterialService, ProductBomService
- 관련 Requests, Swagger 파일 삭제
- 라우트 정리: /products, /materials 엔드포인트 제거

모든 품목 관리는 /items 엔드포인트로 통합됨
item_id_mappings 테이블에 ID 매핑 보존

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 00:20:09 +09:00
84ff9d7fd8 feat: Items API BOM 데이터 확장 기능 추가
- GET /items/{id} 응답에 BOM 확장 데이터 포함
  - child_item_code, child_item_name, unit, specification 필드 추가
- expandBomData() 메서드 구현 (ItemsService)
- Product 모델 bom 캐스팅 추가
2025-12-11 23:17:52 +09:00
b086518075 feat: Material/Product 동적 필드 options 저장 및 자재 삭제 보호
- products 테이블에 options JSON 컬럼 추가 (마이그레이션)
- Material/Product 모델에 options 필드 추가 (fillable, casts)
- SystemFields::PRODUCTS에 options 상수 추가
- MaterialService/ProductService에 동적 필드 자동 추출 로직:
  - getKnownFields(): SystemFields + ItemField 기반 고정 필드 조회
  - extractDynamicOptions(): 동적 필드 추출
  - normalizeOptions(): [{label, value, unit}] 형태로 정규화
- material_code 중복 체크 시 soft delete 포함 (withTrashed)
- 사용 중인 자재 삭제 방지 (checkMaterialUsage)
- Material 모델에 category 관계 추가
2025-12-10 21:37:20 +09:00
8d3ea4bb39 feat: 단가 관리 API 구현 및 Flow Tester 호환성 개선
- Price, PriceRevision 모델 추가 (PriceHistory 대체)
- PricingService: CRUD, 원가 조회, 확정 기능
- PricingController: statusCode 파라미터로 201 반환 지원
- NotFoundHttpException(404) 적용 (존재하지 않는 리소스)
- FormRequest 분리 (Store, Update, Index, Cost, ByItems)
- Swagger 문서 업데이트
- ApiResponse::handle()에 statusCode 옵션 추가
- prices/price_revisions 마이그레이션 및 데이터 이관
2025-12-08 19:03:50 +09:00
517d5940e9 feat: products 및 materials 테이블에 is_active 컬럼 추가
- is_active 컬럼 추가 마이그레이션 (default 1)
- Product 모델 fillable 및 casts 업데이트
- Material 모델 fillable 및 casts 업데이트
- Material 모델에 material_type fillable 추가
- ModelTrait의 scopeActive() 메서드 지원
2025-11-17 14:55:31 +09:00
4749761519 feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
  - bending_diagram, bending_details (JSON)
  - specification_file, specification_file_name
  - certification_file, certification_file_name
  - certification_number, certification_start_date, certification_end_date

- ItemsFileController 구현 (Code-based API)
  - POST /items/{code}/files - 파일 업로드
  - DELETE /items/{code}/files/{type} - 파일 삭제
  - 파일 타입: bending_diagram, specification, certification

- ItemsFileUploadRequest 검증
  - 파일 타입별 MIME 검증 (이미지/문서)
  - 파일 크기 제한 (10MB/20MB)
  - 인증 정보 및 절곡 상세 정보 검증

- Swagger 문서 작성 (ItemsFileApi.php)
  - 업로드/삭제 API 스펙
  - 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
4fde8c0221 feat: BP-MES Phase 1 모델 업데이트 및 Seeder 실행
[모델 업데이트]
- Product 모델: 하이브리드 구조 필드로 fillable/casts 간소화
  - 고정 필드: safety_stock, lead_time, is_variable_size, product_category, part_type, attributes_archive
  - 동적 필드: attributes JSON (category_fields로 관리)
  - 제거: BP-MES 전용 33개 필드 (이제 attributes에 저장)

- ProductComponent 모델: BOM 계산 필드 + 동적 필드
  - 고정 필드: quantity_formula, condition
  - 동적 필드: attributes JSON
  - 제거: is_bending, bending_diagram, bending_details (이제 attributes에 저장)

[Seeder 실행]
- BpMesCategoryFieldsSeeder: FG/PT/절곡품 카테고리 및 필드 생성
- BpMesTenantStatFieldsSeeder: 통계 필드 설정 (마진율, 가공비, 인건비, 설치비 등)

[검증 완료]
- Tinker 모델 테스트 통과
- Pint 코드 포맷팅 검사 통과
2025-11-14 11:11:55 +09:00
d5bfb24ef9 feat: BP-MES Phase 1 - products/product_components 테이블 확장
- products 테이블에 33개 필드 추가
  - 공통: is_active, margin_rate, costs, safety_stock, lead_time, is_variable_size
  - FG 전용: product_category, lot_abbreviation, note
  - PT 전용: part_type, part_usage, installation_type, assembly_type,
    side_spec_width, side_spec_height, assembly_length,
    guide_rail_model_type, guide_rail_model
  - 절곡품: bending_diagram, bending_details, material, length, bending_length
  - 인증: certification_number, start/end_date, specification/certification files
  - 동적 확장: options (JSON)

- product_components 테이블에 5개 필드 추가
  - 수식 계산: quantity_formula
  - 조건부 BOM: condition
  - 절곡품: is_bending, bending_diagram, bending_details

- Product/ProductComponent 모델 fillable/casts 업데이트
- 인덱스 추가: is_active, product_category, part_type, part_usage, is_bending
2025-11-14 09:07:33 +09:00
cc206fdbed style: Laravel Pint 코드 포맷팅 적용
- PSR-12 스타일 가이드 준수
- 302개 파일 스타일 이슈 자동 수정
- 코드 로직 변경 없음 (포맷팅만)
2025-11-06 17:45:49 +09:00
a6b06be61d feat: 견적 단가 자동 적용 기능 추가
- 고객 그룹별 단가 조정 지원
- 견적 생성 시 자동 단가 조회
- 매출단가만 사용 (매입단가는 경고)
2025-10-13 21:52:34 +09:00
d94ab59fd1 refactor: 모델 개선 및 관계 정의 수정
- Material 모델
  - fillable 속성 추가 (모든 필드 명시)

- User 모델
  - BelongsToMany 관계 타입 힌트 추가

- Product 모델
  - fillable에 unit 필드 추가
  - casts 순서 정리 (boolean 그룹화)

- ProductComponent 모델
  - quantity 캐스트 정밀도 변경 (decimal:4 → decimal:6)
  - referencedItem() 메서드 추가 (동적 관계 로드)
  - product(), material() 관계 메서드 수정 (where 조건 추가)
  - is_default 캐스트 제거 (컬럼 없음)

- Tenant 모델
  - options 캐스트 추가 (array)
  - scopeActive() 추가 (trial, active 상태 필터링)
  - isActive(), isTrial() 헬퍼 메서드 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 14:35:26 +09:00
b6ff56023f refactor: BOM 시스템 정리 및 API 구조 최적화
## 주요 변경사항

### BOM 시스템 통합 및 정리
- 기본 BOM 시스템 완전 제거 (미완성 3-tier 구조)
  - app/Http/Controllers/Api/V1/BomController.php 삭제
  - app/Services/BomService.php 삭제
  - app/Models/Products/Bom.php 삭제
  - app/Models/Products/BomItem.php 삭제
- BOM 역할 명확화: Product BOM (운영용) + Design BOM (설계용)
- Tag 모델에서 불필요한 BOM 참조 제거

### API 그룹핑 최적화
- Products & Materials 통합: /v1/products/materials/*
- Settings & Configuration 통합: /v1/settings/*
  - 필드 설정: /v1/settings/fields/*
  - 옵션 관리: /v1/settings/options/*
  - 공통 코드: /v1/settings/common/*
- 기존 분산된 라우트 통합으로 일관성 향상

### 번역 완성도 향상
- 영어 에러 메시지 누락 항목 추가
- Settings, Materials, File 관련 메시지 보완
- 한국어/영어 번역 파일 동기화 완료

### 시스템 품질 개선
- API 구조 논리적 재구성으로 사용자 경험 향상
- 코드 복잡도 감소 및 유지보수성 개선
- 불필요한 컨트롤러/서비스 제거로 시스템 단순화

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 20:35:17 +09:00
622c4905fa fix : BOM구성 API, DB 작업
- product_components 컬럼 변경
- BOM 구성, 카테고리리스트, BOM트리(재귀)호출 API 개발
2025-09-02 10:08:55 +09:00
028af8fbfa fix : 모델 및 자재관리 수정 2025-09-02 10:08:51 +09:00
52bf8527e2 fix : 카테고리, 제품등록, BOM등록 API (일부 개발 - BOM 추가 작업 필요) 2025-08-25 17:46:34 +09:00
189bdbfd80 fix : Category, Product 관련 테이블 정리 (Models, DB, seeder) 2025-08-22 15:57:14 +09:00
3707b53ffc fix : _ide_helper.php 헬퍼 추가
- 개발 보조 기능
2025-08-21 09:50:15 +09:00
24c85a0605 feat : Tag 모델 추가 2025-07-29 17:20:44 +09:00
1942f51cf7 fix : 모델 경로 수정 2025-07-29 13:00:25 +09:00
94501d5624 feat : Tenant Scope 추가 - 모델에 해당 유저의 tenant_id 로 자동 매핑 (CommonCode 모델에 추가) 2025-07-25 17:31:08 +09:00
593d81c4cb feat : common_codes 테이블 수정 2025-07-23 16:14:18 +09:00
609ac39ffb feat : 테이블 및 DB 마이그레이션 파일 추가
products
  - common_codes
  - parts
  - products
  - files
  - price_histories
  - boms
  - bom_items

  boards
  - boards
  - board_settings
  - posts
  - board_comments
  - board_files
  - post_custom_field_values

  permissions
  - menus
  - roles
  - user_menu_permissions
  - role_menu_permissions

  tenants
  - tenants
  - plans
  - subscriptions
  - payments
2025-07-23 15:41:01 +09:00