Commit Graph

247 Commits

Author SHA1 Message Date
pro
d412ae45b7 fix:Laravel 12 호환 - Doctrine DBAL 대신 DB::select 사용
- getDoctrineSchemaManager() 제거 (Laravel 12에서 미지원)
- 인덱스 존재 여부 확인을 SHOW INDEX 쿼리로 변경

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:17:16 +09:00
pro
73dd6595d0 fix:sales_scenario_checklists 생성 마이그레이션 테이블 존재 체크 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:16:20 +09:00
pro
f30fbadc90 fix:sales_consultations 마이그레이션 테이블 존재 체크 추가
- 테이블이 없으면 건너뛰도록 수정
- 컬럼이 이미 존재하면 건너뛰도록 수정

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:15:53 +09:00
pro
e407c40228 fix:마이그레이션 인덱스 존재 여부 체크 추가
- sales_scenario_unique 인덱스 삭제 전 존재 여부 확인
- sales_scenario_checkpoint_unique 생성 전 존재 여부 확인
- 서버 환경에서 이미 수동으로 인덱스가 변경된 경우 대응

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:15:09 +09:00
pro
60a1d753fd feat:sales_scenario_checklists 테이블 누락 컬럼 마이그레이션 추가
- scenario_type (ENUM: sales/manager)
- checkpoint_id (VARCHAR 50)
- checked_at (TIMESTAMP)
- checked_by (BIGINT UNSIGNED)
- memo (TEXT)
- UNIQUE KEY, INDEX 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:12:25 +09:00
pro
69fa80d36e merge: origin/develop 병합
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:55:50 +09:00
ca51867cc2 feat: sam_stat 최적화 및 안정화 (Phase 5)
- StatBackfillCommand: 과거 데이터 일괄 백필 (일간+월간, 프로그레스바, 에러 리포트)
- StatVerifyCommand: 원본 DB vs sam_stat 정합성 교차 검증 (--fix 자동 재집계)
- 파티셔닝 준비: 7개 일간 테이블 RANGE COLUMNS(stat_date) 마이그레이션
- Redis 캐싱: StatQueryService Cache::remember TTL 5분 + invalidateCache()
- StatMonitorService: 집계 실패/누락/불일치 시 stat_alerts 알림 기록
- StatAggregatorService: 모니터링 알림 + 캐시 무효화 연동

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 22:17:11 +09:00
4d8dac1091 feat: sam_stat P2 도메인 + 통계 API + 대시보드 전환 (Phase 4)
- 4.1: stat_project_monthly + ProjectStatService (건설/프로젝트 월간)
- 4.2: stat_system_daily + SystemStatService (API/감사/FCM/파일/결재)
- 4.3: stat_events, stat_snapshots + StatEventService + StatEventObserver
- 4.4: StatController (summary/daily/monthly/alerts) + StatQueryService + FormRequest 3개 + routes/stats.php
- 4.5: DashboardService sam_stat 우선 조회 + 원본 DB 폴백 패턴

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 21:56:53 +09:00
595e3d59b4 feat: sam_stat P1 도메인 확장 (Phase 3)
- 차원 테이블: dim_client, dim_product 마이그레이션 + SCD Type 2 동기화 (DimensionSyncService)
- 재고 통계: stat_inventory_daily + InventoryStatService (stocks, stock_transactions, inspections)
- 견적/영업 통계: stat_quote_pipeline_daily + QuoteStatService (quotes, biddings, sales_prospects)
- 인사/근태 통계: stat_hr_attendance_daily + HrStatService (attendances, leaves, user_tenants)
- KPI/알림: stat_kpi_targets, stat_alerts + KpiAlertService + StatCheckKpiAlertsCommand
- StatAggregatorService에 inventory, quote, hr 도메인 추가 (총 6개 도메인)
- 스케줄러: stat:check-kpi-alerts 매일 09:00 등록

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 20:19:50 +09:00
e882d33de1 feat: sam_stat P0 도메인 집계 구현 (Phase 2)
- 영업(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>
2026-01-29 19:30:30 +09:00
pro
68ffbdfa08 feat:영업수수료 정산 마이그레이션 추가
- sales_commissions 테이블 생성 (영업수수료 정산)
- sales_commission_details 테이블 생성 (상품별 수당 내역)
- sales_tenant_managements 테이블에 입금 정보 컬럼 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:13:59 +09:00
c88048db67 feat: sam_stat 통계 DB 인프라 구축 (Phase 1)
- sam_stat DB 연결 설정 (config/database.php, .env)
- 메타 테이블 마이그레이션 (stat_definitions, stat_job_logs)
- dim_date 차원 테이블 + DimDateSeeder (2020~2030, 4018건)
- 기반 모델: BaseStatModel, StatDefinition, StatJobLog, DimDate
- 집계 커맨드: stat:aggregate-daily, stat:aggregate-monthly
- StatAggregatorService + StatDomainServiceInterface 골격

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 17:13:36 +09:00
pro
f8d37f0b5e refactor:sales_contract_products 테이블 development_fee → registration_fee 변경 2026-01-29 16:38:34 +09:00
pro
ff829ad184 feat:가입비(registration_fee) 컬럼 추가 및 시더 업데이트 2026-01-29 16:31:50 +09:00
pro
8327568a77 fix:상품 가격 데이터 현실화 (개발비 8천만원, 구독료 50만원 등) 2026-01-29 16:25:30 +09:00
pro
e7054b6633 feat:영업파트너/매니저 수당율 분리 (commission_rate → partner/manager) 2026-01-29 16:18:22 +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
pro
e439bfffda feat:영업 상품관리 DB 스키마 및 시더 추가
- sales_product_categories: 상품 카테고리 테이블
- sales_products: 영업 상품 테이블
- sales_contract_products: 계약별 선택 상품 테이블
- SalesProductSeeder: 제조업체 8개, 공사업체 3개 상품 초기 데이터

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:02:07 +09:00
pro
c7339ac7db feat:본사 진행 상태 및 수당 지급 상태 컬럼 추가
sales_tenant_managements 테이블:
- hq_status: 본사 진행 상태 (pending, review, planning, coding, dev_test, dev_done, int_test, handover)
- incentive_status: 수당 지급 상태 (pending, eligible, paid)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:39:20 +09:00
pro
27a558dafb feat:sales_consultations에 gcs_uri 컬럼 추가
- 음성 녹음 파일의 Google Cloud Storage URI 저장용

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:15:22 +09:00
pro
4c7cf85ef9 fix:시나리오 체크리스트 유니크 키 수정
- 기존 유니크 키 (tenant_id, user_id, step_id, checkpoint_index) 삭제
- 새 유니크 키 (tenant_id, scenario_type, step_id, checkpoint_id) 생성
- checkpoint_index를 nullable로 변경

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:00:07 +09:00
pro
6208d90244 feat:영업관리 테이블 마이그레이션 추가
- sales_partners: 영업 파트너 정보
- sales_tenant_managements: 테넌트별 영업 관리 (tenant_id FK)
- sales_scenario_checklists: 시나리오 체크리스트
- sales_consultations: 상담 기록 (텍스트/음성/파일)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 06:42:25 +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
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
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
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
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
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
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
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
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
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
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
e285e3eca2 feat(api): 배송방식 공통코드 추가
- delivery_method 코드 그룹 추가
- direct: 상차, pickup: 택배

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 16:01:32 +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
7162fc2b46 feat: 매입관리 품의서/지출결의서 연동 기능 추가
- purchases 테이블에 approval_id 컬럼 추가 (마이그레이션)
- Purchase 모델에 approval 관계 정의
- PurchaseService에서 approval 데이터 eager loading 구현
- FormRequest에 approval_id 유효성 검증 추가
- Swagger 문서에 approval 관련 스키마 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 22:47:25 +09:00
c8d7990313 feat: 수주(Order) ↔ 매출(Sale) 연동 스키마 구현
- 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>
2026-01-22 17:23:36 +09:00