Commit Graph

486 Commits

Author SHA1 Message Date
4f2a329e4e fix: 출금 오늘의 이슈 path 분기 (1건: 상세, 2건+: 목록)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:42:41 +09:00
ef4a894cbc fix: TenantUserProfile 모델 Eloquent Model import 누락 수정
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:28:57 +09:00
e1aa1d1577 fix: TenantSettingController namespace 대소문자 수정 (v1 → V1)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:38:09 +09:00
45a15fe64f fix: BiddingController namespace 대소문자 수정 (v1 → V1)
- Linux 대소문자 구분으로 Swagger 문서 생성 실패 해결

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 21:40:37 +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
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
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
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
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
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
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
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
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
8c77d1b32b feat: 신규거래처 알림 메시지 간소화 및 신용평가 모달 경로 수정
- 알림 메시지: "신규 거래처 :name 등록 완료" → ":name 등록"
- 모달 파라미터: openModal=credit → modal=credit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 14:11:02 +09:00
222880479d fix: 신규 거래처 알림 클릭 시 신용평가 모달 자동 오픈
- TodayIssueObserverService에서 신규 거래처 알림 경로에 ?openModal=credit 파라미터 추가
- 알림 클릭 시 거래처 상세 페이지로 이동하면서 신용분석 모달 자동 오픈

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 13:11:52 +09:00
a7dcdd2469 fix: 헤더 알람 경로를 상세 페이지로 수정
- 입금: /accounting/deposit-management → /accounting/deposits/{id}
- 출금: /accounting/withdrawal-management → /accounting/withdrawals/{id}
- 수주: /sales/order-management-sales → /sales/order-management-sales/{id}
- 미수금: /accounting/receivables-status → /accounting/bad-debt-collection/{id}
- 재고: /material/stock-status → /material/stock-status/{id}
- 신규거래처: /accounting/vendors → /accounting/vendors/{id}

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 11:22:13 +09:00
fa210b91c2 feat: 예상 지출 자동 동기화 Observer 구현
- expected_expenses 테이블에 source_type, source_id 컬럼 추가
- PurchaseExpenseSyncObserver: 매입 → 예상 지출 동기화
- WithdrawalExpenseSyncObserver: 카드결제만 → 예상 지출 동기화
- BillExpenseSyncObserver: 발행어음만 → 예상 지출 동기화
- 생성/수정/삭제/복원/강제삭제 이벤트 모두 처리
- 조건 변경 시 자동 동기화 해제 (카드→현금, 발행→수취)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 11:06:06 +09:00
73e49f2736 fix(API): FCM 알림 채널 매핑 수정
- TodayIssue IMPORTANT_NOTIFICATIONS에서 deposit, withdrawal 제거
- notification_type별 채널 매핑 메서드 추가
  - new_vendor → push_urgent (긴급/신규업체)
  - approval_request → push_payment (결재)
  - sales_order → push_sales_order (수주)
  - purchase_order → push_purchase_order (발주)
  - contract → push_contract (계약)
  - 나머지 → push_default (일반)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 10:14:35 +09:00
d75f6f5bd1 feat(API): 입금/출금 알림 Observer 추가 및 LoanController 수정
- DepositIssueObserver, WithdrawalIssueObserver 신규 추가
- TodayIssueObserverService에 입금/출금 핸들러 및 디버그 로그 추가
- TodayIssue 모델에 입금/출금 상수 추가
- AppServiceProvider에 Observer 등록
- ApprovalService에 기존 결재선 사용 시 수동 알림 트리거 추가
- LoanController ApiResponse::handle() → ApiResponse::success() 수정

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 10:05:50 +09:00
fabf302e1f fix(API): 당월 매입 상세 API 응답 필드명 수정
- summary.current_month_total → current_month_amount 변경
- summary.previous_month_total → previous_month_amount 변경
- monthly_trend[].month → label 변경 ("2025-07" → "7월")
- by_type[].label → type_label 변경
- by_type[].color 필드 추가 (차트 색상)
- items[].date → purchase_date 변경

프론트엔드 transformer와 API 응답 구조 일치

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 09:08:37 +09:00
871db32e04 feat(API): 결재함 및 대시보드 관련 개선
- ApprovalService: inbox 쿼리에 결재자 상세 정보 추가 (직책, 부서)
- PurchaseController: dashboardDetail 엔드포인트 추가
- CardTransactionService: 당월 이용 건수 추가
- SaleService: 대시보드 조회 개선
- LOGICAL_RELATIONSHIPS.md 업데이트

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 23:19:05 +09:00
5ac83399b3 feat(API): CEO 대시보드 지출내역 상세 조회 API 추가
- BillService: 발행어음 대시보드 상세 조회 (me3 모달용)
- WelfareService: 직원 수/급여 총액 조회 로직 개선 (salaries 테이블 기반)
- BillApi/ExpectedExpenseApi: Swagger 스키마 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 23:18:33 +09:00
a994f27696 fix: 당월 예상 지출 모달 데이터 불일치 수정
- dashboardDetail() 메서드에 transaction_type 파라미터 추가
- 카드별 필터링 지원 (purchase, card, bill, null=전체)
- 카드 금액과 모달 금액이 동일한 데이터 소스 사용하도록 개선

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-22 23:16:49 +09:00
f089843e1e feat: 세금 시뮬레이션 API 개발 (Phase 1.3)
- LoanService에 taxSimulation() 메서드 추가
- LoanController에 taxSimulation() 액션 추가
- GET /api/v1/loans/tax-simulation 라우트 등록
- Swagger LoanTaxSimulation 스키마 및 엔드포인트 문서화
- 법인세/소득세 비교 분석 데이터 제공

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-22 22:47:59 +09:00