Commit Graph

579 Commits

Author SHA1 Message Date
189b38c936 feat: Auditable 트레이트 구현 및 97개 모델 적용
- 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>
2026-01-29 15:33:54 +09:00
00a1257c63 fix: ApprovalStep 모델 Eloquent Model import 누락 수정
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:29:01 +09:00
99a6c89d41 feat: 견적 할인금액(discount_amount) 직접 입력 지원
- QuoteStoreRequest/UpdateRequest에 discount_amount 필드 추가
- QuoteService: 프론트엔드에서 계산한 할인금액 우선 사용, 없으면 비율로 계산

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:05:14 +09:00
f7ad9ae36e feat(재고): stock_transactions 입출고 거래 이력 테이블 추가
- 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>
2026-01-29 15:05:03 +09:00
847717e631 feat(거래처): client_type 필터 추가
- ClientService.index()에 client_type 파라미터 필터 추가
- 쉼표 구분 복수 값 지원 (예: PURCHASE,BOTH)
- 매입 가능 거래처만 조회하는 용도

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:04:55 +09:00
e8fc42c14d fix: 입고 목록 날짜 필터 기준을 created_at으로 변경
- receiving_date 기준 → created_at(작성일) 기준으로 변경
- 입고처리 전(receiving_date=NULL) 데이터가 필터에서 누락되는 문제 해결
- creator 관계 eager loading 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:40:32 +09:00
a25d267550 fix: 입고 등록 order_qty 필수 검증 제거
- StoreReceivingRequest에서 order_qty를 required → nullable로 변경
- 입고 등록 시 발주수량 없이도 등록 가능하도록 수정

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:48:03 +09:00
7acaac8340 feat: 출금 오늘의 이슈를 일일 누계 방식으로 변경
- 출금 건별 개별 이슈 → 해당일 누계 1건으로 upsert
- 첫 건: "거래처명 출금 금액원"
- 2건+: "첫거래처명 외 N건 출금 합계 금액원"
- 삭제 시 남은 건수/금액으로 자동 갱신
- FCM 푸시 미발송 (알림 설정 미구현)
- 기존 개별 source_id 레거시 이슈 자동 정리

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:03:19 +09:00
aa7678c358 feat: 수동 품목 단가 조회 API 추가 및 디버그 로그 정리
- QuoteController에 getItemPrices 엔드포인트 추가
- QuoteCalculationService에 품목 코드 배열로 단가 조회 기능 추가
- 불필요한 디버그 로그 제거

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:29:19 +09:00
946e008b02 fix: API 라우트 분리 시 누락된 라우트 복구
분리 전 원본 라우트와 비교하여 누락된 17개 라우트 복구:

[design.php]
- BomCalculationController: calculateBom, getCompanyFormulas, getEstimateParameters, saveCompanyFormula, testFormula
- DesignBomTemplateController: cloneTemplate, diff, listByVersion, replaceItems, upsertTemplate
- DesignModelVersionController: createDraft (store → createDraft 메서드명 수정)
- ModelSetController: calculateBom, getBomTemplates, getCategoryFields, getEstimateParameters

[inventory.php]
- ItemsFileController: upload, delete (store/destroy → upload/delete 메서드명 수정)
- ItemsBomController: listAll, listCategories, tree, replace
- ItemsController: showByCode, batchDestroy
- LaborController: stats, bulkDestroy

[sales.php]
- ClientController: bulkDestroy
- ClientGroupController: toggle
- BiddingController: updateStatus
- PricingController: stats, cost, byItems, bulkDestroy, finalize, revisions
- QuoteController: convertToBidding, convertToOrder, sendHistory

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:10:13 +09:00
87e20e965a feat: BOM 계산 debug_steps에 수식 정보 추가
- calculateKyungdongBom 메서드에 formulas 배열 추가
- Step 1: 입력값 (변수, 설명, 값, 단위)
- Step 3: 변수계산 (수식, 대입, 결과)
- Step 6-7: 품목별 수량/금액 계산 과정
- Step 9: 카테고리별 소계 계산
- Step 10: 최종합계 수식
- 프론트엔드에서 실제 계산 수식 확인 가능

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:17:34 +09:00
a0ffeb954b fix: 견적 확정/취소 API 라우트 추가
- POST /quotes/{id}/finalize 라우트 추가
- POST /quotes/{id}/cancel-finalize 라우트 추가
- 라우트 누락으로 인한 404 오류 수정

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 07:44:04 +09:00
90bcfaf268 chore: 논리적 관계 문서 및 글로벌 카테고리 마이그레이션 추가
- LOGICAL_RELATIONSHIPS.md 업데이트
- create_global_categories_table 마이그레이션 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 01:12:40 +09:00
3fce54b7d4 feat: 경동기업 전용 견적 계산 로직 구현 (Phase 4 완료)
- 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>
2026-01-29 01:10:42 +09:00
e9894fef61 feat: 수주 목록/상세 필드 개선
- 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>
2026-01-28 22:24:21 +09:00
42deb60861 fix: Quote API 라우트 누락 복구
- 라우트 분리(a96499a) 시 누락된 견적 라우트 복구
- /calculate, /calculate/bom, /calculate/bom/bulk
- /number/preview, /calculation/schema
- /{id}/pdf, /{id}/send/email, /{id}/send/kakao
- 잘못 추가된 bulk-issue-document 라우트 제거

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:07:37 +09:00
d3825e4bfb fix: 매입 수정 시 알림/푸시 발송 제외
- handleExpectedExpenseChange()에서 source_type이 'purchases'인 경우 알림 제외
- 매입 알림은 결재 상신 시에만 발송되도록 변경

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 21:40:37 +09:00
8cf588bf05 feat: Phase 3 단가 테이블 마이그레이션 추가
- Phase 3.1: price_motor → items (SM) 누락 품목 13건 추가
  - PM-020~PM-032: 제어기 (6P~100회선)
  - PM-033~PM-035: 방화/방범 콘트롤박스, 스위치
- Phase 3.2: price_raw_materials → items (RM) 누락 품목 4건 추가
  - RM-007~RM-011: 신설비상문, 제연커튼, 화이바/와이어원단
- 중복 확인 로직: 기존 품목명과 mb_strtolower 비교
- 최종 결과: items 651건, prices 651건, BOM 18건

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 21:29:13 +09:00
e06b0637fa feat: 문서 관리 시스템 Route 및 Swagger 구현 (Phase 1.8)
- Document API Route 등록 (CRUD 5개 엔드포인트)
- Swagger 문서 작성 (Document, DocumentApproval, DocumentData, DocumentAttachment 스키마)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 21:29:10 +09:00
9bceaab8a3 feat: 문서 관리 시스템 FormRequest 구현 (Phase 1.7)
- IndexRequest: 목록 조회 필터/페이징 검증
- StoreRequest: 문서 생성 검증 (템플릿, 데이터, 첨부파일)
- UpdateRequest: 문서 수정 검증

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 21:14:30 +09:00
b7f8157548 feat: 문서 관리 시스템 Controller 구현 (Phase 1.6)
- DocumentController CRUD 엔드포인트 구현
- 결재 워크플로우는 기존 시스템 연동을 위해 보류

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 21:11:40 +09:00
94612e3b50 refactor: Attendance store() 메서드를 Upsert 패턴으로 변경
- 같은 날 같은 사용자의 기록이 있으면 업데이트, 없으면 생성
- 기존 Create Only 패턴에서 Upsert 패턴으로 변경
- Swagger 문서 업데이트 (409 응답 제거, 설명 변경)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 21:09:53 +09:00
2e219edf8a feat: Phase 2 BOM 마이그레이션 추가
- Phase 2.1: BDmodels.seconditem → PT items 6건 추가
  - 누락 부품: L-BAR, 보강평철, 케이스, 하단마감재 등
- Phase 2.2: items.bom JSON 연결 18건
  - FG items (models) ↔ PT items (seconditem) BOM 관계 설정
- 최종: items 634건, prices 634건, BOM 18건

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 21:06:59 +09:00
bacc42da73 feat: 문서 관리 시스템 Service 구현 (Phase 1.5)
- DocumentService 생성 (CRUD + 결재 워크플로우)
- 순차 결재 로직 구현 (submit/approve/reject/cancel)
- Multi-tenancy 및 DB 트랜잭션 지원

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 20:41:31 +09:00
ec47c26ea8 feat: Phase 1.1-1.2 추가 (models, item_list 마이그레이션)
- migrateModels(): chandj.models → items (FG) 18건
- migrateItemList(): chandj.item_list → items (PT) 9건
- migratePrices(): 다양한 소스 단가 처리 로직 개선
- 코드 포맷: FG-{model}-{type}-{finish}, PT-{name}

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:38:29 +09:00
2bce30056d feat: 문서 관리 시스템 모델 생성 (Phase 1.2)
- Document 모델 (상태 관리, 다형성 연결, 결재 처리)
- DocumentApproval 모델 (결재 단계, 상태 처리)
- DocumentData 모델 (EAV 패턴 데이터 저장)
- DocumentAttachment 모델 (파일 첨부 연결)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:57:22 +09:00
c7b2e97189 feat: 경동기업 품목/단가 마이그레이션 Seeder 구현 (Phase 1.0)
- KyungdongItemSeeder.php 생성
- chandj.KDunitprice → samdb.items, prices 마이그레이션
- is_deleted=NULL 조건 반영 (레거시 데이터 특성)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 19:22:18 +09:00
f76fd2f865 feat: 문서 관리 시스템 DB 스키마 구현 (Phase 1.1)
- documents 테이블 생성 (문서 기본 정보, 상태, 다형성 연결)
- document_approvals 테이블 생성 (결재 처리)
- document_data 테이블 생성 (EAV 패턴 데이터 저장)
- document_attachments 테이블 생성 (파일 첨부)
- SAM 규칙 준수 (tenant_id, 감사 컬럼, softDeletes, comment)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:22:05 +09:00
a96499a66d feat: API 라우터 분리 및 버전 폴백 시스템 구현
- api.php를 13개 도메인별 파일로 분리 (1,479줄 → 61줄)
- ApiVersionMiddleware 생성 (헤더/쿼리 기반 버전 선택)
- v2 요청 시 v2 없으면 v1으로 자동 폴백
- 지원 헤더: Accept-Version, X-API-Version, api_version 쿼리

분리된 도메인:
auth, admin, users, tenants, hr, finance, sales,
inventory, production, design, files, boards, common

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:30:19 +09:00
f74767563f feat: FCM 사용자별 타겟 알림 발송 기능 추가
- today_issues 테이블에 target_user_id 컬럼 추가 (마이그레이션)
- TodayIssue 모델: target_user_id 필드, targetUser 관계, forUser/targetedTo 스코프 추가
- TodayIssue 모델: 기안 상태 뱃지 상수 추가 (BADGE_DRAFT_APPROVED/REJECTED/COMPLETED)
- TodayIssueObserverService: createIssueWithFcm, sendFcmNotification, getEnabledUserTokens에 targetUserId 파라미터 추가
- TodayIssueObserverService: handleApprovalStepChange - 결재자에게만 발송
- TodayIssueObserverService: handleApprovalStatusChange 추가 - 기안자에게만 발송
- ApprovalIssueObserver 신규 생성 및 AppServiceProvider에 등록
- i18n: 기안 승인/반려/완료 알림 메시지 추가

결재요청은 결재자(ApprovalStep.user_id)에게만,
기안 승인/반려는 기안자(Approval.drafter_id)에게만 FCM 발송

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:57:46 +09:00
518ae4657e fix: 오늘의 이슈 뱃지 타입 source_type 기반 매핑
- TodayIssue 모델에 SOURCE_TO_BADGE 매핑 상수 추가
- TodayIssueService에서 source_type 기반 badge 매핑 적용
- 입금/출금 소스 타입 및 뱃지 상수 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 22:40:54 +09:00
3917ea3831 fix: 거래처 연체/악성채권 저장 버그 수정
- ClientUpdateRequest, ClientStoreRequest에 is_overdue 필드 추가
  - FormRequest rules에 누락되어 프론트엔드 값이 필터링됨
- ClientService.update()에 bad_debt 토글 연동 로직 추가
  - bad_debt=true → BadDebt 레코드 생성 (status: collecting)
  - bad_debt=false → BadDebt 레코드 종료 (status: recovered)
- ClientService의 has_bad_debt 판단 로직 수정
  - 기존: sum(debt_amount) > 0
  - 변경: exists() - 금액과 무관하게 레코드 존재 여부로 판단

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 22:39:04 +09:00
51b23adcfe fix: 오늘의 이슈 오늘 날짜만 표시하도록 수정
- TodayIssue 모델에 scopeToday() 스코프 추가
- TodayIssueService::summary()에 오늘 날짜 필터 적용
- 전체 개수 계산에도 오늘 날짜 필터 적용

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-27 21:10:50 +09:00
7bd296b2fa fix: 카테고리 라우트 순서 수정 (/tree → /{id} 앞으로 이동)
- /tree, /reorder 라우트를 /{id} 와일드카드 라우트보다 먼저 정의
- 500 에러 해결: "tree"가 id 파라미터로 잘못 매칭되던 문제

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-27 15:51:16 +09:00
a9cdf004e3 fix: 게시판 코드 기반 조회 라우트 추가
- BoardController에 showByCode(string $code) 메서드 추가
- GET /api/v1/boards/{code} 라우트 등록
- 기존 ID 기반 조회와 코드 기반 조회 분리

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-27 15:24:35 +09:00
dd8a744d12 fix: QuoteItemCategorySeeder 중복 실행 지원
- insertGetId → updateOrInsert로 변경
- 이미 존재하는 카테고리는 업데이트, 없으면 생성

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-27 15:23:02 +09:00
8a1e78ec72 feat: 견적 V2 동적 카테고리 시스템 구현
- CategoryService: tree 메서드에 code_group 필터 지원 추가
- FormulaEvaluatorService: 하드코딩된 process_type을 동적 카테고리로 변경
  - groupItemsByProcess(): item_category 필드 기반 그룹화
  - getItemCategoryTree(): DB에서 카테고리 트리 조회
  - buildCategoryMapping(): BENDING 하위 카테고리 처리
  - addProcessGroupToItems(): category_code 필드 추가 (레거시 호환 유지)
- QuoteItemCategorySeeder: 품목 카테고리 초기 데이터 시더 추가
  - BODY, BENDING(하위 3개), MOTOR_CTRL, ACCESSORY

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-27 15:17:30 +09:00
유병철
4c22b74b27 feat: 출퇴근 설정에 자동 출퇴근 사용 여부 필드 추가
- attendance_settings 테이블에 use_auto 컬럼 추가
- AttendanceSetting 모델에 use_auto 필드 추가 (fillable, casts, attributes)
- UpdateAttendanceSettingRequest에 use_auto 유효성 검사 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 14:47:39 +09:00
22f7e9d94a fix: FULLTEXT 검색을 LIKE 검색으로 롤백
- 개발 서버에 FULLTEXT 인덱스 미설치로 500 에러 발생
- 기존 LIKE 검색 방식으로 복원

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 13:55:12 +09:00
3ff3c65ade feat: 품목 조회 시 BOM 유무 필터 및 코드+이름 형식 지원
- has_bom 파라미터 추가 (1: BOM 있는 품목만, 0: BOM 없는 품목만)
- JSON_LENGTH 활용한 BOM 유무 필터링 구현
- name 필드를 "코드 이름" 형식으로 반환 (일시적 변경)
- FULLTEXT 인덱스 활용 검색 개선 (BOOLEAN MODE)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 12:47:38 +09:00
eeb55d1c28 feat: 문서 템플릿 마이그레이션 추가 및 관계 문서 업데이트
- document_templates 테이블 마이그레이션 추가
- LOGICAL_RELATIONSHIPS.md 업데이트

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:12:17 +09:00
6d05ab815f feat:테넌트설정 API 및 다수 서비스 개선
- TenantSetting CRUD API 추가
- Calendar, Entertainment, VAT 서비스 개선
- 5130 BOM 계산 로직 수정
- quote_items에 item_type 컬럼 추가
- tenant_settings 테이블 마이그레이션
- Swagger 문서 업데이트
2026-01-26 20:29:22 +09:00
f2da990771 fix: 견적 V2 BOM 계산 오류 수정
- ItemService.php: has_bom 계산 필드 추가 (BOM 필터링용)
- FormulaEvaluatorService.php: process_group 필드 추가 (공정별 그룹핑)

관련: 견적 V2 자동 견적 산출 4가지 오류 수정

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:12:45 +09:00
pro
462f6bd9e3 feat:MNG 마이그레이션 파일 전체 이동
MNG에서 API로 이동된 마이그레이션:
- sales_scenario_checklists
- simulator_fields, category_groups
- barobill_members, barobill_configs
- coocon_configs, credit_inquiries
- barobill_bank_transactions, account_codes
- barobill_card_transactions 관련 테이블들

모든 DB 마이그레이션은 API 프로젝트에서 관리

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:02:42 +09:00
pro
53cd04f6fa feat:영업관리 마이그레이션 파일 추가
MNG에서 이동:
- sales_managers 테이블
- sales_prospects 테이블
- sales_prospect_products 테이블
- sales_prospect_scenarios 테이블
- sales_prospect_consultations 테이블
- sales_records 테이블

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:02:42 +09:00
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
5104a6641c fix(API): 입고처리 receiving_location 필드 null 처리
- nullable 필드 접근 시 undefined array key 에러 수정
- null 병합 연산자 적용

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:30:45 +09:00
758ce2b988 feat(api): 특정 IP에서 발생하는 예외 슬랙/로그 제외 기능
- EXCEPTION_IGNORED_IPS 환경변수로 무시할 IP 목록 관리
- 해당 IP에서 '회원정보 정보 없음' 예외 발생 시 슬랙/로그 건너뜀
- 사무실/개발자 IP에서 발생하는 불필요한 알림 방지

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 21:08:52 +09:00
e285e3eca2 feat(api): 배송방식 공통코드 추가
- delivery_method 코드 그룹 추가
- direct: 상차, pickup: 택배

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 16:01:32 +09:00
131c0fc5dc feat(api): 예상비용 동기화 커맨드 및 서비스 개선
- SyncExpectedExpensesCommand 추가
- ExpectedExpenseService 로직 개선
- LOGICAL_RELATIONSHIPS 문서 업데이트

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:38:32 +09:00