Commit Graph

772 Commits

Author SHA1 Message Date
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
pro
f163373fb0 feat:credit_inquiries 테이블에 tenant_id 컬럼 추가
- 신용평가 조회회수 집계 기능을 위한 테넌트 구분 컬럼
- tenant_id, (tenant_id, inquired_at) 인덱스 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:49:31 +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
pro
6e553ce3c9 feat:tenant_prospects 테이블에 첨부파일 컬럼 추가
- id_card_path: 신분증 사본 경로
- bankbook_path: 통장 사본 경로

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 08:49:40 +09:00
pro
a88f8a2021 feat:sales_prospects 테이블에 신분증/통장사본 컬럼 추가
- id_card_image: 신분증 사본 이미지 경로
- bankbook_image: 통장 사본 이미지 경로

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 23:42:20 +09:00
pro
3e8570ac3f feat:sales_prospects 테이블에 business_card_image 컬럼 추가
명함 이미지 저장을 위한 컬럼 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 23:36:32 +09:00
pro
4839cfcad2 feat:ai_configs 테이블 마이그레이션 추가
- AI API 설정 테이블 (Gemini, Claude, OpenAI 지원)
- provider별 활성화 상태 관리
- 명함 OCR 시스템을 위한 기반 구조
2026-01-27 23:00:43 +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
pro
9182cbc1b3 feat:영업권(명함등록) 테이블 마이그레이션 추가
- tenant_prospects 테이블 생성
- 영업권 2개월 유효, 1개월 쿨다운 정책 지원
- 테넌트 전환 추적 기능 포함

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 22:39:30 +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
pro
5de77e3b35 feat:영업담당자 User 통합을 위한 마이그레이션 추가
- users 테이블에 parent_id, approval_status, approved_by, approved_at, rejection_reason 컬럼 추가
- sales_manager_documents 테이블 생성 (멀티파일 업로드)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 20:06:36 +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
pro
4106f59cd1 feat:바로빌 과금 정책 테이블 마이그레이션
- barobill_pricing_policies 테이블 생성
- 서비스 유형별 과금 정책 저장 (무료 제공량, 추가 과금 단위/금액)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:17:34 +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
pro
597d24eb19 feat:바로빌 과금관리 테이블 마이그레이션
- barobill_subscriptions: 월정액 구독 관리
- barobill_billing_records: 과금 내역 기록
- barobill_monthly_summaries: 월별 집계 테이블

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 15:03:57 +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
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