Commit Graph

548 Commits

Author SHA1 Message Date
f8858cf1b7 fix(WEB): 수주 상태변경 API 응답에 공통 relations 로딩 적용
- loadDetailRelations() 공통 메서드 추가 (show()와 동일한 relations 보장)
- store/update/updateStatus/createFromQuote/revert 등 11곳 일괄 적용
- 수주확정/되돌리기 시 제품내용이 기타부품으로 매핑되던 문제 해결
- 원인: updateStatus 등에서 quote relation 미로딩 → products 빈 배열

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 04:19:47 +09:00
c637dd38eb docs(WEB): 수주 Swagger 문서 추가 - bulkDestroy, revertProductionOrder
- OrderBulkDeleteRequest 스키마 추가 (ids, force)
- OrderRevertProductionRequest 스키마 추가 (force, reason)
- DELETE /api/v1/orders/bulk 엔드포인트 문서 추가
- POST /api/v1/orders/{id}/revert-production 엔드포인트 문서 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 04:19:47 +09:00
37424b9cef feat(WEB): 수주 Bulk Delete API + 작업지시 Revert Force 통합
- 수주 일괄 삭제 API 추가 (DELETE /orders/bulk)
  - OrderBulkDeleteRequest (ids, force 검증)
  - force=true: hard delete (운영환경 차단), force=false: soft delete
  - 삭제 불가 건(상태/작업지시/출하) skip 처리 + skipped_ids 반환

- 작업지시 되돌리기 force/운영 모드 분기
  - force=true (개발): 기존 hard delete 로직 유지
  - force=false (운영): 작업지시 cancelled 상태 변경, options에 취소정보 기록, 자재 투입분 재고 역분개, 데이터 보존
  - reason 필수 (운영 모드)

- WorkOrder 모델에 STATUS_CANCELLED 상수 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 04:19:47 +09:00
d7ca8cfa00 refactor:견적 converted 상태를 데이터 기반(order_id)으로 변경
- Quote 모델에 getStatusAttribute() accessor 추가: order_id 존재 시 자동으로 'converted' 반환
- scopeConverted() → whereNotNull('order_id') 변경
- QuoteService/OrderService에서 status='converted' 직접 세팅 제거, order_id만 세팅
- 상태 필터 쿼리: converted는 order_id IS NOT NULL 기반
- 통계 쿼리: status='converted' → order_id IS NOT NULL
- 수주 직접 등록 시에도 자동으로 수주전환 상태 반영

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 04:19:47 +09:00
a2dbdae14b fix(WEB): 입고 등록 검증 실패 수정 - Store 규칙 보완 및 상태값 정합성
- StoreReceivingRequest에 receiving_qty, receiving_date, lot_no 규칙 추가
- UpdateReceivingRequest status에 inspection_completed 허용 추가
- ReceivingService store()에 receiving_qty/date/lot_no 저장 처리
- order_qty null 안전 처리, 기본 status를 receiving_pending으로 변경

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 04:19:47 +09:00
5cc43828d3 fix(WEB): 철재 면적 공식 레거시 일치 (W1×H1)
- FormulaEvaluatorService: steel 면적 W1×(H1+550) → W1×H1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 04:19:47 +09:00
김보곤
3ae3a1dcda feat: [tax-invoice] 공급자 설정 Tenant Fallback 로직 추가
- BarobillSetting 미설정 시 Tenant 정보를 기본값으로 반환
- corp_num/corp_name이 비어있으면 Fallback 동작
- Tenant 필드 매핑: business_num, company_name, ceo_name, address, phone
- Tenant options 매핑: business_type, business_category, tax_invoice_contact, tax_invoice_email
2026-02-21 17:19:18 +09:00
김보곤
ef33540940 fix: [tax-invoice] ApiResponse::handle() 호출 방식 수정
- named parameter(data:, message:) → callable 콜백 패턴으로 전환
- ApiResponse::handle(fn () => ..., '제목') 형식 적용
- 기존 scaffold 코드의 잘못된 호출 방식 전체 수정
2026-02-21 17:19:18 +09:00
김보곤
3b116c980b feat: [tax-invoice] 바로빌 SOAP 연동 및 공급자 설정 API 추가
- BarobillService HTTP→SOAP 전환 (MNG EtaxController 포팅)
- TI SOAP 클라이언트, callSoap(), buildTaxInvoiceData MNG 형식 적용
- issueTaxInvoice/cancelTaxInvoice/checkNtsSendStatus SOAP 방식
- 공급자 설정 조회/저장 API (GET/PUT /supplier-settings)
- 생성+즉시발행 통합 API (POST /issue-direct)
- SaveSupplierSettingsRequest FormRequest 추가
2026-02-21 17:19:18 +09:00
김보곤
cdbb825fbe fix: [permission] Role::users() 반환 타입 선언 추가
- Spatie Role::users(): BelongsToMany 시그니처와 호환되도록 수정
- FatalError: Declaration must be compatible 에러 해결
2026-02-21 17:19:18 +09:00
김보곤
295f7b7ee9 fix: [card] CSV(CVC) 복호화 값을 API 응답에 포함
- $appends에 csv 추가, getCsvAttribute accessor 생성
- cvc_encrypted는 $hidden 유지 (암호문 노출 방지)
2026-02-21 17:19:18 +09:00
김보곤
03e3e84066 fix: [card] store/update 응답에 관계(assignedUser) 포함
- fresh() → show() 재사용으로 관계 로딩 보장
2026-02-21 17:19:18 +09:00
김보곤
83ddfabd7c fix: [card] 카드 상세 수정/저장 누락 필드 9개 보강
- 마이그레이션: card_type, alias, cvc_encrypted, payment_day, total_limit, used_amount, remaining_limit, is_manual, memo 컬럼 추가
- Card 모델: $fillable, $casts, $hidden 확장 + CVC 암호화/복호화 메서드 추가
- CardService: store(), update() 메서드에 9개 필드 처리 로직 추가
- StoreCardRequest, UpdateCardRequest: 9개 필드 검증 규칙 추가
2026-02-21 17:19:18 +09:00
김보곤
961ab47bac feat: [corporate-card] 법인카드 관리 API 7개 엔드포인트 구현
- CorporateCard 모델 (corporate_cards 테이블)
- CorporateCardService (CRUD + 토글 + 활성 목록)
- CorporateCardController (ApiResponse 패턴)
- Store/Update FormRequest 검증
- 라우트: /api/v1/corporate-cards (index, store, show, update, destroy, toggle, active)
2026-02-21 17:19:18 +09:00
김보곤
fdea1d0244 fix: [bank-account] 계좌 관리 API 누락 필드 8개 보강
- account_type, balance, currency, opened_at, branch_name, memo, sort_order, last_transaction_at 추가
- Model: fillable, casts, hidden, scopes, accessors를 MNG 모델 기준으로 통일
- Service: store/update에 누락 필드 반영
- FormRequest: Store/Update에 검증 규칙 추가
2026-02-21 17:19:18 +09:00
김보곤
b576fe97e8 feat: [barobill] 바로빌 연동 관리 API 7개 엔드포인트 구현
- SOAP 기반 BarobillSoapService 생성 (MNG 코드 포팅)
- BarobillMember, BarobillConfig 모델 생성
- BarobillController 7개 메서드 (login, signup, status, URL 조회)
- FormRequest 검증 클래스 3개 생성
- 라우트 등록 (POST /barobill/login, /signup, GET /status 등)
- i18n 메시지 키 추가 (ko/en)
- config/services.php에 barobill 설정 추가
2026-02-21 17:19:18 +09:00
김보곤
1dd9057540 refactor: [authz] 역할/권한 API 품질 개선
- Validator::make를 FormRequest로 분리 (6개 생성)
- 하드코딩 한글 문자열을 i18n 키로 교체
- RoleMenuPermission 데드코드 제거
- Role 모델 SpatieRole 상속으로 일원화
- 권한 변경 후 캐시 무효화 추가 (AccessService::bumpVersion)
- 미문서화 8개 Swagger 엔드포인트 추가
- 역할/권한 라우트에 perm.map+permission 미들웨어 추가
2026-02-21 17:19:17 +09:00
400adb7c58 fix(WEB): 방화유리 수량 폴백 제거 및 수주→작업지시 파이프라인 개선
- OrderService: glass_qty에서 quantity 폴백 제거 (투시창 선택 시에만 유효)
- OrderService: createProductionOrder()에서 절곡 공정 bending_info 자동 생성
- OrderService: formula_source 없는 레거시 데이터의 sort_order 기반 개소 분배
- OrderService: note 파싱에서 '-' 단독값 무시 처리
- FormulaEvaluatorService: 철재 W1 계산 (W0+160 → W0+110) 레거시 일치
- WorkOrderService: store()에서 order_node_id null 품목용 rootNodes fallback 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 01:02:23 +09:00
3ab4f24bb4 fix(WEB): 철재 모터용량/셔터박스 계산 레거시 일치 수정
- FormulaHandler: 철재 면적 공식 W1×(H1+550) → W1×H1 (레거시 Slat_updateCol12and13 동일)
- FormulaHandler: 샤프트 인치 자동계산 추가 (레거시 Slat_updateCol22 동일)
- BendingInfoBuilder: 셔터박스 크기를 모터용량→브라켓→박스 매핑으로 결정
  (BOM 원자재 코드 BD-케이스-500*380 대신 조립 크기 650*550 등 사용)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:34:01 +09:00
602702b891 feat(WEB): 절곡 공정 BendingInfoBuilder 추가
- 수주→작업지시 시 bending_info JSON 자동 생성 서비스
- 가이드레일: qty×2 적용, baseDimension 벽면형 135*80 / 측면형 135*130
- 하단마감재: 범위별 3000/4000mm 배분 로직
- 셔터박스: coverQty/finCoverQty 계산, 조합배분 로직
- 연기차단재: W50(open_height+250 범위별), W80(floor 공식)
- 레거시(viewBendingWork_slat.php) 수식 기반 구현

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 23:52:08 +09:00
71dc5fae68 refactor: KyungdongFormulaHandler 삭제 (Tenant287/FormulaHandler로 이동 완료)
- b0547c4에서 Tenant287/FormulaHandler.php 신규 생성 완료
- 원본 KyungdongFormulaHandler.php 삭제 (중복 제거)
- Strategy + Factory 패턴 전환의 마지막 정리 작업

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:02:29 +09:00
b0547c425f fix:FG 수식 산출 시 제품모델/설치타입/마감타입 올바르게 적용
- parseFgCode() 추가: FG 코드에서 모델/설치타입/마감타입 파싱
- calculateTenantBom() 폴백 순서: 입력값 > FG코드 파싱 > 기본값(KSS01/벽면형/SUS)
- KQTS01 제품이 KSS01 가이드레일 규격(120*70)으로 잘못 산출되던 문제 해결

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:41:21 +09:00
edb81a1041 feat: work_orders 테이블에 options JSON 컬럼 추가
- 마이그레이션: work_orders.options JSON nullable 컬럼 추가
- WorkOrder 모델: $fillable, $casts에 options 추가
- bending_info 등 작업지시 레벨 추가 옵션 저장용

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:50:23 +09:00
6ae82b7057 fix: 작업지시 단건조회(show)에 materialInputs eager loading 추가
- show() 메서드에 items.materialInputs, items.materialInputs.stockLot 누락
- 목록조회에만 있고 단건조회에 빠져서 프론트 입고 LOT NO 표시 안됨

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:50:23 +09:00
2fedc3a712 fix: 조인트바 자동 계산 추가 (레거시 5130 공식 적용)
- KyungdongFormulaHandler: joint_bar_qty 미전달 시 자동 계산
  공식: (2 + floor((제작가로 - 500) / 1000)) × 셔터수량
- OrderService.extractSlatInfoFromBom(): 동일 폴백 추가
- OrderService.createWorkOrders(): slat_info.joint_bar 0일 때 width 기반 계산
- CURRENT_WORKS.md 업데이트

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:50:23 +09:00
1429f22f11 fix: 견적 산출 가이드레일 혼합형(mixed) validation 허용
- QuoteBomBulkCalculateRequest: guideRailType, GT에 mixed 추가
- QuoteBomCalculateRequest: GT에 mixed 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:50:23 +09:00
89344c0755 fix: 견적 산출 모터 전압/가이드레일 설치유형 매핑 누락 수정
- MP(single/three) → motor_voltage(220V/380V) 매핑 추가
- GT(wall/floor/mixed) → installation_type(벽면형/측면형/혼합형) 매핑 추가
- 기존: 프론트 선택값이 BOM 계산에 반영되지 않던 버그

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:50:23 +09:00
74a83e6711 fix: 슬랫 작업일지 데이터 파이프라인 구축
- OrderService.createFromQuote: BOM 결과에서 slat_info(조인트바/방화유리 수량) 추출하여 OrderNode.options에 저장
- OrderService.createWorkOrders: nodeOptions에 slat_info 없을 때 bom_result에서 fallback 추출
- OrderService.syncFromQuote: 동일하게 slat_info 추출 추가
- WorkOrderService: salesOrder eager loading에 client_contact, options 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:50:23 +09:00
10b1b26c1b fix: 경동 BOM 계산 수정 및 품목-공정 매핑
- KyungdongFormulaHandler: product_type 자동 추론(item_category 기반), 철재 주자재 EGI코일로 변경, 조인트바 steel 공통 지원
- FormulaEvaluatorService: FG item_category에서 product_type 자동 판별
- MapItemsToProcesses: 경동 품목-공정 매핑 커맨드 정비
- KyungdongItemMasterSeeder: BOM child_item_id code 기반 재매핑
- ItemsBomController: ghost ID 유효성 검증 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:50:21 +09:00
55270198d4 fix: 견적→수주 변환 시 담당자 정보 누락 수정
- Order::createFromQuote() 잘못된 필드명 수정 (contact_person→contact, delivery_date→completion_date)
- 견적 담당자(manager)를 orders.options.manager_name에 저장
- StoreOrderRequest/UpdateOrderRequest에 options.manager_name 유효성 검증 추가
- WorkOrderService show()에서 salesOrder.options 컬럼 포함하여 담당자 표시

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:50:13 +09:00
유병철
6f456f2cfd fix: 급여 수당/공제 상세 벨리데이션 규칙 수정 (array → numeric)
- StoreSalaryRequest, UpdateSalaryRequest의 allowance_details.*, deduction_details.* 벨리데이션을 array에서 numeric으로 변경
- 수당/공제 항목은 {항목명: 금액} 구조이므로 값은 숫자가 올바름

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:34:57 +09:00
59cd8cf4fe feat: 수주 목록 rootNodes 수량 합계 조회 추가
- OrderService index()에 withSum('rootNodes', 'quantity') 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 11:22:08 +09:00
6ac3f0c860 feat: 트리거 감사로그 operation_id 컬럼 추가 및 요청별 UUID 설정
- trigger_audit_logs 테이블에 operation_id(VARCHAR 36) 컬럼 추가
- ix_trig_operation 인덱스 생성 (일괄 롤백 조회용)
- SetAuditSessionVariables 미들웨어에서 요청마다 @sam_operation_id UUID 설정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 11:22:08 +09:00
adfccc9af0 fix:생산지시 생성 시 다중 담당자(assignee_ids) 저장 누락 수정
- CreateProductionOrderRequest에 assignee_ids 배열 validation 추가
- OrderService::createProductionOrder에 work_order_assignees 저장 로직 추가
- 담당자 유무에 따른 status 분기 (pending/unassigned) 적용

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:57:39 +09:00
김보곤
cd20f8d73f feat:E-Sign 템플릿 변수 시스템 추가 (마이그레이션+모델)
- field_variable, metadata, variables 컬럼 마이그레이션 추가
- EsignContract 모델에 metadata (JSON cast) 추가
- EsignSignField 모델에 field_variable 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:22:28 +09:00
김보곤
ef23b9dda6 feat:E-Sign 필드에 font_size 컬럼 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:22:28 +09:00
090a978991 fix:생산지시 되돌리기 시 누락된 관련 데이터 삭제 보완
- 자재 투입(material_inputs) 재고 복구(increaseToLot) 후 삭제
- 문서(documents/data/approvals) 영구삭제 (검사 성적서, 작업일지)
- 출하(shipments) work_order_id 참조 해제
- step_progress, assignees, bending_details, issues 명시적 삭제 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 04:03:10 +09:00
fc4fad6e75 refactor:공정 단계 completion_type 한글→영문 코드 전환
- completion_type 값을 한글(클릭 시 완료)에서 영문 코드(click_complete)로 변환
- FormRequest에 in 검증 규칙 추가 (click_complete, selection_complete, inspection_complete)
- 기존 데이터 마이그레이션 포함

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 03:41:41 +09:00
e4c53c7b17 feat:개소별 자재 투입 관리 API 추가
- work_order_material_inputs 테이블 신규 생성 (개소별 자재 투입 추적)
- 개소별 자재 조회/투입/이력/삭제/수정 API 5개 추가
- StockService.increaseToLot: LOT 수량 복원 메서드 추가
- WorkOrderService에 개소별 자재 투입 비즈니스 로직 구현
- WorkOrder, WorkOrderItem 모델에 materialInputs 관계 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 03:41:35 +09:00
d730c2d91a feat:FQC 제품검사 문서 일괄생성 API 추가
- POST /v1/documents/bulk-create-fqc: 수주 개소별 제품검사 문서 일괄생성
- GET /v1/documents/fqc-status: 수주별 FQC 진행현황 조회
- BulkCreateFqcRequest FormRequest 추가
- error.php에 no_order_items, already_created 메시지 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 03:41:27 +09:00
441359f5fd fix:FQC 문서 기본필드 키 형식 수정 (bf_라벨 → bf_ID)
- 제품검사 문서 생성 시 bf_납품명 형식 → bf_{field->id} 형식으로 변경
- 템플릿 basicFields를 로드하여 field_key 기반 매핑
- mng show.blade.php와 키 형식 통일

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 00:32:41 +09:00
32cbb1071d Merge remote-tracking branch 'origin/develop' into develop 2026-02-12 14:16:32 +09:00
45dd18dbab feat(API): 작업일지 생성/조회 API 추가
- WorkOrderService: getWorkLogTemplate, getWorkLog, createWorkLog 메서드 추가
- WorkOrderController: 작업일지 3개 엔드포인트 추가
- 라우트: GET work-log-template, GET/POST work-log
- WorkOrder 모델: documents() MorphMany 관계 추가
- i18n: work_log_saved, no_work_log_template 메시지 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 09:39:48 +09:00
김보곤
6958be1fd8 feat:E-Sign 전자계약 서명 솔루션 백엔드 구현
- 마이그레이션 4개 (esign_contracts, esign_signers, esign_sign_fields, esign_audit_logs)
- 모델 4개 (EsignContract, EsignSigner, EsignSignField, EsignAuditLog)
- 서비스 4개 (EsignContractService, EsignSignService, EsignPdfService, EsignAuditService)
- 컨트롤러 2개 (EsignContractController, EsignSignController)
- FormRequest 4개 (ContractStore, FieldConfigure, SignSubmit, SignReject)
- Mail 1개 (EsignRequestMail + 이메일 템플릿)
- API 라우트 (인증 계약 관리 + 토큰 기반 서명 프로세스)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 07:02:39 +09:00
911c8a36ad feat(API):문서 데이터 정규화 커맨드 추가
- NormalizeDocumentData: 기존 document_data를 정규화 형식으로 일괄 변환

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 00:01:30 +09:00
376348a491 feat(API):자재 투입 LOT 조회 API 및 중간검사 데이터 정규화
- materialInputLots: stock_transactions 기반 투입 LOT 조회 엔드포인트 추가
- createInspectionDocument: 정규화 형식(section_id/column_id/field_key) 지원
- 레거시 형식(section_X_item_Y) 자동 변환 로직 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 00:01:25 +09:00
de10441275 fix(API): 경동 견적 수식 핸들러 개선
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:58:42 +09:00
bcad646ea6 feat(API): 수주 서비스 기능 개선
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:58:40 +09:00
51aad4e522 feat(API): 검사 문서/성적서 연동 개선
- DocumentService: formatTemplateForReact 필드명 정합성 수정 (column_type, sub_labels, section title/image_path)
- WorkOrderService: process.options 로딩, 검사데이터 document_data 변환 로직 추가
- StoreItemInspectionRequest: templateValues 유효성 규칙 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:58:39 +09:00
a3a4e18e8a feat(API): 문서 템플릿 기본필드 field_key $fillable 추가
- DocumentTemplateBasicField 모델에 field_key 필드 추가
- Mass Assignment 보호로 field_key 저장 누락 방지

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:58:37 +09:00