386 Commits

Author SHA1 Message Date
6001df27f2 feat:검사항목 frequency_n/c, standard_criteria 컬럼 추가
- frequency_n(측정횟수), frequency_c(합격판정기준) TINYINT 추가
- standard_criteria JSON 컬럼 추가 (구조화된 검사기준 비교용)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:36:57 +09:00
김보곤
7b06644f23 fix:gcs_uri 마이그레이션 컬럼 존재 체크 추가 2026-02-02 20:16:12 +09:00
김보곤
502e34d88e feat:수당 지급 추적 컬럼 추가 마이그레이션
- 1차/2차 납입완료일, 수당지급일 컬럼 추가
- 매니저 수당 관련 컬럼 추가 (첫 구독료, 지급일)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:56:09 +09:00
f701e0636e feat:검사기준서 탭 개선 - tolerance, measurement_type 컬럼 및 inspection_method 공통코드 추가
- document_template_section_items에 tolerance(공차), measurement_type(측정유형) 컬럼 추가
- common_codes에 inspection_method 그룹 6개 코드 삽입
- DocumentTemplateSectionItem 모델 $fillable 업데이트

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:29:39 +09:00
김보곤
c90077bd51 feat:sales_consultations 테이블에 gcs_uri 컬럼 추가
음성 녹음 파일의 GCS URI 저장용

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 10:30:22 +09:00
김보곤
9cc73f4688 fix:sales_contract_products.tenant_id nullable 허용
가망고객 단계에서는 아직 테넌트가 생성되지 않으므로
tenant_id가 null일 수 있음

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 09:53:35 +09:00
김보곤
32392ef4de fix:sales_contract_products.tenant_id nullable 변경
- 가망고객(prospect) 모드에서 계약상품 저장 지원
- tenant_id가 없어도 management_id로 연결 가능

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:44:18 +09:00
김보곤
fd3dbb75af feat:sales_consultations 테이블에 tenant_prospect_id 컬럼 추가
- 가망고객(prospect) 상담 기록 지원을 위해 tenant_prospect_id 컬럼 추가
- tenant_id를 nullable로 변경 (가망고객일 경우 null)
- tenant_prospect_id 인덱스 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:50:37 +09:00
김보곤
3a2eeb299c Merge branch 'develop' of http://114.203.209.83:3000/SamProject/sam-api into develop 2026-01-31 19:35:27 +09:00
김보곤
6db428ccc5 feat:영업 관리 테이블에 tenant_prospect_id 컬럼 추가
- sales_tenant_managements에 tenant_prospect_id 추가
- sales_scenario_checklists에 tenant_prospect_id 추가
- 가망고객 단계에서도 영업/매니저 체크리스트 사용 가능

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:35:00 +09:00
49d163ae0c feat: 인앱 업데이트 체크 API 구현
- app_versions 테이블 마이그레이션 (시스템 레벨, tenant_id 없음)
- AppVersion 모델 (SoftDeletes)
- AppVersionService: getLatestVersion, downloadApk
- AppVersionController: GET /api/v1/app/version, GET /api/v1/app/download/{id}
- ApiKeyMiddleware 화이트리스트에 api/v1/app/* 추가
- app_releases 스토리지 디스크 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:53:09 +09:00
pro
1ae9a29c62 feat:법인카드 테이블 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:12:32 +09:00
591197f29c fix(API): fix_unique_key 마이그레이션에 테이블 존재 체크 추가
- 테이블 미존재 시 스킵하여 순서 무관하게 안전 실행

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:32:29 +09:00
5b553ea13c fix(API): 마이그레이션 순서 수정 - fix_unique_key를 테이블 생성 이후로 이동
- 090000 → 100500으로 변경 (100200 create, 100400 add_columns 이후 실행되도록)
- 로컬 fresh 환경에서 테이블 미존재 상태로 unique key 추가 시 에러 방지

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

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