- document_template_section_items에 tolerance(공차), measurement_type(측정유형) 컬럼 추가
- common_codes에 inspection_method 그룹 6개 코드 삽입
- DocumentTemplateSectionItem 모델 $fillable 업데이트
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- DocumentTemplate 모델 6개 생성 (Template, ApprovalLine, BasicField, Section, SectionItem, Column)
- DocumentTemplateService (list/show) + DocumentTemplateController (index/show)
- GET /v1/document-templates, GET /v1/document-templates/{id} 라우트
- DocumentTemplateApi.php Swagger (7개 스키마, 2개 엔드포인트)
- Document 결재 워크플로우 4개 엔드포인트 활성화 (submit/approve/reject/cancel)
- ApproveRequest, RejectRequest FormRequest 생성
- DocumentApi.php Swagger에 결재 엔드포인트 4개 추가
- Document.template() 참조 경로 수정 (DocumentTemplate → Documents 네임스페이스)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- app_versions 테이블 마이그레이션 (시스템 레벨, tenant_id 없음)
- AppVersion 모델 (SoftDeletes)
- AppVersionService: getLatestVersion, downloadApk
- AppVersionController: GET /api/v1/app/version, GET /api/v1/app/download/{id}
- ApiKeyMiddleware 화이트리스트에 api/v1/app/* 추가
- app_releases 스토리지 디스크 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- getLabel(), getCodeMap()에서 withoutGlobalScopes() → query()로 변경
- BelongsToTenant 스코프가 적용되어 테넌트별 공통코드 정상 조회
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- scopeForTenant 등 스코프 메서드에서 Builder 타입힌트 사용하나 import 누락
- CalendarService, StatusBoardService에서 forTenant() 호출 시 500 발생
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 영업(Sales), 재무(Finance), 생산(Production) 3개 도메인 구현
- 일간/월간 통계 테이블 6개 마이그레이션 생성
- 도메인별 StatService (SalesStatService, FinanceStatService, ProductionStatService)
- Daily/Monthly 6개 Eloquent 모델 생성
- StatAggregatorService에 도메인 서비스 매핑 활성화
- StatJobLog duration_ms abs() 처리
- 스케줄러 등록 (일간 02:00, 월간 1일 03:00)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Auditable 트레이트 신규 생성 (bootAuditable 패턴)
- creating: created_by/updated_by 자동 채우기
- updating: updated_by 자동 채우기
- deleting: deleted_by 채우기 + saveQuietly()
- created/updated/deleted: audit_logs 자동 기록
- 기존 AuditLogger 패턴과 동일한 try/catch 조용한 실패
- 변경된 필드만 before/after 기록 (updated 이벤트)
- auditExclude 프로퍼티로 모델별 제외 필드 설정 가능
- 제외 대상: Attendance, StockTransaction, TodayIssue 등 고빈도/시스템 모델
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- stock_transactions 마이그레이션 생성 (type, qty, balance_qty, reference)
- StockTransaction 모델 (IN/OUT/RESERVE/RELEASE 타입, 사유 상수)
- StockService 5개 메서드에 거래 이력 기록 추가
- increaseFromReceiving → IN
- decreaseFIFO → OUT (LOT별)
- reserve → RESERVE (LOT별)
- releaseReservation → RELEASE (LOT별)
- decreaseForShipment → OUT (LOT별)
- Stock 모델에 transactions() 관계 추가
- 기존 audit_logs 기록은 유지 (감사 로그와 거래 이력 목적 분리)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- KdPriceTable 모델: 경동기업 단가 테이블 (motor, shaft, pipe, angle, raw_material, bdmodels)
- KyungdongFormulaHandler: 모터 용량, 브라켓 크기, 절곡품(10종), 부자재(3종) 계산
- FormulaEvaluatorService: tenant_id=287 라우팅 추가
- kd_price_tables 마이그레이션 및 시더 (47건 단가 데이터)
테스트 결과: W0=3000, H0=2500 입력 시 16개 항목, 합계 751,200원 정상 계산
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- OrderService: client relation에 manager_name 추가
- Order 모델: shipping_cost_label accessor 추가 (common_codes 조회)
- $appends에 shipping_cost_label 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Document 모델 (상태 관리, 다형성 연결, 결재 처리)
- DocumentApproval 모델 (결재 단계, 상태 처리)
- DocumentData 모델 (EAV 패턴 데이터 저장)
- DocumentAttachment 모델 (파일 첨부 연결)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- TodayIssue 모델에 SOURCE_TO_BADGE 매핑 상수 추가
- TodayIssueService에서 source_type 기반 badge 매핑 적용
- 입금/출금 소스 타입 및 뱃지 상수 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- TodayIssue 모델에 scopeToday() 스코프 추가
- TodayIssueService::summary()에 오늘 날짜 필터 적용
- 전체 개수 계산에도 오늘 날짜 필터 적용
Co-Authored-By: Claude <noreply@anthropic.com>
- attendance_settings 테이블에 use_auto 컬럼 추가
- AttendanceSetting 모델에 use_auto 필드 추가 (fillable, casts, attributes)
- UpdateAttendanceSettingRequest에 use_auto 유효성 검사 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- TenantSetting CRUD API 추가
- Calendar, Entertainment, VAT 서비스 개선
- 5130 BOM 계산 로직 수정
- quote_items에 item_type 컬럼 추가
- tenant_settings 테이블 마이그레이션
- Swagger 문서 업데이트
- BadDebt 컨트롤러/서비스 기능 확장
- StockService 재고 조회 로직 개선
- ProcessReceivingRequest 검증 규칙 수정
- Item, Order, CommonCode, Shipment 모델 업데이트
- TodayIssueObserverService 개선
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- expected_expenses 테이블에 source_type, source_id 컬럼 추가
- PurchaseExpenseSyncObserver: 매입 → 예상 지출 동기화
- WithdrawalExpenseSyncObserver: 카드결제만 → 예상 지출 동기화
- BillExpenseSyncObserver: 발행어음만 → 예상 지출 동기화
- 생성/수정/삭제/복원/강제삭제 이벤트 모두 처리
- 조건 변경 시 자동 동기화 해제 (카드→현금, 발행→수취)
Co-Authored-By: Claude <noreply@anthropic.com>
- DepositIssueObserver, WithdrawalIssueObserver 신규 추가
- TodayIssueObserverService에 입금/출금 핸들러 및 디버그 로그 추가
- TodayIssue 모델에 입금/출금 상수 추가
- AppServiceProvider에 Observer 등록
- ApprovalService에 기존 결재선 사용 시 수동 알림 트리거 추가
- LoanController ApiResponse::handle() → ApiResponse::success() 수정
Co-Authored-By: Claude <noreply@anthropic.com>
- purchases 테이블에 approval_id 컬럼 추가 (마이그레이션)
- Purchase 모델에 approval 관계 정의
- PurchaseService에서 approval 데이터 eager loading 구현
- FormRequest에 approval_id 유효성 검증 추가
- Swagger 문서에 approval 관련 스키마 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- sales 테이블: order_id, shipment_id, source_type 컬럼 추가
- orders 테이블: sales_recognition, sale_id 컬럼 추가
- Sale 모델: order(), shipment() 관계 및 createFromOrder/Shipment 팩토리 메서드
- Order 모델: sale(), sales() 관계 및 shouldCreateSaleOnConfirm/Shipment 헬퍼
- 매출 인식 시점: 수주확정 시 / 출하완료 시 / 수동 선택 가능
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- TodayIssue 모델 및 마이그레이션 추가
- TodayIssueController, TodayIssueService 구현
- TodayIssueObserverService 및 Observer 패턴 적용
- DailyReportService 연동
- Swagger API 문서 업데이트
- 라우트 추가
- ApiClient 인터페이스: representative → manager_name, contact_person 변경
- transformApiToFrontend: client.representative → client.manager_name 수정
- ApiOrderItem에 floor_code, symbol_code 필드 추가 (제품-부품 매핑)
- ApiOrder에 options 타입 정의 추가
- ApiQuote에 calculation_inputs 타입 정의 추가
- 수주 상세 페이지 제품-부품 트리 구조 UI 개선
- Bidding 모델, 서비스, 컨트롤러, FormRequest 추가
- 마이그레이션 및 시더 추가
- Swagger API 문서 추가
- 견적에서 입찰 전환 시 중복 체크 로직 추가
- per_page 파라미터 100 초과 시 자동 클램핑 처리
- error.bidding.already_registered 에러 메시지 추가
- FormRequest에 options 필드 validation 추가 (StoreOrderRequest, UpdateOrderRequest)
- shipping_cost_code, receiver, receiver_contact, shipping_address 등
- OrderService.show()에서 client 로드 시 manager_name 필드 추가
- 수주확정/생산지시 되돌리기 기능 추가 (revertOrderConfirmation, revertProductionOrder)
- 견적 calculation_inputs 포함하여 로드
Co-Authored-By: Claude <noreply@anthropic.com>
- 작업지시 우선순위 필드 추가 (priority 마이그레이션)
- 수주-작업지시 품목 연동 source_order_item_id 컬럼 추가
- 수주 테이블에 account_code 필드 추가
- 작업지시 StoreRequest/UpdateRequest 우선순위 검증 추가
- WorkOrder 모델 priority fillable 추가
- 출근부 StoreRequest/UpdateRequest 검증 규칙 개선
- Employee Request 검증 규칙 수정
- SaleService/ItemService 수정
- WorkResultService 결과 처리 개선
- BankTransactionService 수정
- routes/api.php 엔드포인트 업데이트
- error.php 에러 메시지 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 작업지시 생성 시 수주 품목 자동 복사 기능 추가
- 품목 추적용 source_order_item_id 컬럼 추가
- 발주처 표시를 위해 salesOrder 로딩에 client_id 추가
- 담당자 수정 시 assignee_ids 배열 처리 추가
Co-Authored-By: Claude <noreply@anthropic.com>
- QuoteIndexRequest: for_order 파라미터 추가
- Quote 모델: orders() HasMany 관계 추가 (Order.quote_id 기준)
- QuoteService: for_order 필터링 로직 추가
- whereNull('order_id') - 빠른 체크
- whereDoesntHave('orders') - 이중 체크
- OrderService: 수주 생성 시 견적 상태를 converted로 업데이트
Co-Authored-By: Claude <noreply@anthropic.com>
- WorkOrderItem 모델 관계 정의 추가
- InspectionService, WorkResultService 로직 개선
- ItemReceipt, Inspection 모델 수정
- work_order_items 테이블에 options 컬럼 추가 마이그레이션
Co-Authored-By: Claude <noreply@anthropic.com>
- User 모델 $fillable에 is_active, created_by, updated_by 추가
- EmployeeService 이중 비밀번호 해싱 제거 (모델 hashed 캐스트 활용)
- create_account 플래그 의존성 제거 (password 있으면 계정 생성)
Fixes: employee-register E2E test failure
Co-Authored-By: Claude <noreply@anthropic.com>
- 견적요약, 공과상세, 품목 단가조정 데이터를 JSON으로 저장
- Quote 모델에 options 필드 추가 (fillable, casts)
- 중요도가 낮은 필드는 개별 테이블 대신 JSON으로 관리
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- HandoverReport, HandoverReportItem, HandoverReportManager 모델 추가
- SiteBriefing 모델 추가
- StructureReview, FcmSendLog, Position, Salary 수정
- Order 모델 정리
Co-Authored-By: Claude <noreply@anthropic.com>
- WorkOrder 모델에 process_id 추가
- process 관계 추가 (Process 모델)
- 공정별 다중 작업지시 생성 지원
- WorkOrderStoreRequest/UpdateRequest 수정
Co-Authored-By: Claude <noreply@anthropic.com>
- WorkOrderItem 모델에 status 컬럼 및 상수 추가 (waiting/in_progress/completed)
- 품목 상태 변경 API 엔드포인트 추가 (PATCH /work-orders/{id}/items/{itemId}/status)
- syncWorkOrderStatusFromItems() 메서드로 품목→작업지시 상태 자동 동기화
- 품목 중 하나라도 in_progress → 작업지시 in_progress
- 모든 품목 completed → 작업지시 completed
- 모든 품목 waiting → 작업지시 waiting
- 감사 로그: item_status_changed, status_synced_from_items 액션 추가
Co-Authored-By: Claude <noreply@anthropic.com>
- quotes 테이블에 quote_type 컬럼 추가 (manufacturing/construction)
- Quote 모델에 TYPE 상수 및 스코프 메서드 추가
- QuoteService.index()에 quote_type 필터 적용
- QuoteService.upsertFromSiteBriefing()에 construction 타입 설정
- QuoteIndexRequest에 quote_type 유효성 검증 추가
- 기존 site_briefing_id 있는 데이터는 construction으로 자동 업데이트
Co-Authored-By: Claude <noreply@anthropic.com>
- Labor 모델 (BelongsToTenant, SoftDeletes)
- LaborController 7개 엔드포인트
- LaborService 비즈니스 로직
- FormRequest 4개 (Index/Store/Update/BulkDelete)
- 마이그레이션 및 라우트 등록
API: GET/POST /labor, GET/PUT/DELETE /labor/{id}, DELETE /labor/bulk, GET /labor/stats
Co-Authored-By: Claude <noreply@anthropic.com>
- 마이그레이션: site_code, client_id, status 컬럼 추가
- Site 모델: 상태 상수, Client 관계 추가
- SiteService: stats(), bulkDestroy(), 필터 확장
- SiteController: stats, bulkDestroy 엔드포인트 추가
- 라우트: /stats, /bulk 추가
Co-Authored-By: Claude <noreply@anthropic.com>
- Contract 모델, 마이그레이션 추가
- ContractController CRUD 엔드포인트 구현
- ContractService 비즈니스 로직 구현
- ContractStoreRequest, ContractUpdateRequest 검증 추가
- Swagger API 문서 작성
- 라우트 등록 (GET/POST/PUT/DELETE)
- 통계 및 단계별 건수 조회 API 추가
Co-Authored-By: Claude <noreply@anthropic.com>