Commit Graph

249 Commits

Author SHA1 Message Date
d27061bbdc Merge remote-tracking branch 'origin/develop' into develop 2026-02-04 20:26:01 +09:00
af42c115ae feat:검사 기준서 동적화 + 외부 키 매핑 동적화
- 템플릿별 동적 필드 정의 (document_template_section_fields)
- 외부 키 매핑 동적화 (document_template_links + link_values)
- 문서 레벨 연결 (document_links)
- 시스템 프리셋 (document_template_field_presets)
- section_items에 field_values JSON 컬럼 추가
- 기존 고정 필드 → 동적 field_values 데이터 마이그레이션
- search_api → source_table 전환 마이그레이션

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 08:37:55 +09:00
김보곤
d012be69eb feat:차량정비이력 테이블 마이그레이션 추가 2026-02-03 19:56:38 +09:00
3d20c6979d feat: 공정 단계(ProcessStep) CRUD API 구현
- process_steps 테이블 마이그레이션 생성 (step_code, sort_order, boolean 플래그 등)
- ProcessStep 모델 생성 (child entity 패턴, HasFactory만 사용)
- ProcessStepService: CRUD + reorder + STP-001 자동채번
- ProcessStepController: DI + ApiResponse::handle 패턴
- FormRequest 3개: Store, Update, Reorder
- Process 모델에 steps() HasMany 관계 추가
- ProcessService eager-load에 steps 추가 (5곳)
- Nested routes: /processes/{processId}/steps

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:59:12 +09:00
김보곤
83f0f69643 feat:홈택스 세금계산서 로컬 저장 테이블 추가
- hometax_invoices 테이블 생성 마이그레이션
- 국세청승인번호 기준 중복 방지 인덱스
- 매출/매입 구분, 금액정보, 거래처정보 저장
- 메모/분류/확인여부 등 자체 관리 필드

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:13:04 +09:00
김보곤
529c587023 feat:차량일지 구분 유형 확장 및 라벨 수정
- 구분 유형 추가: 출퇴근용(왕복), 업무용(왕복), 비업무용(왕복)
- 비업무 라벨을 '비업무용(개인)'으로 변경
- 출발지/도착지 장소명 라벨 수정 (장소명 → 출발지명/도착지명)
- 새 유형별 색상 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-03 13:27:34 +09:00
김보곤
6c2e74d6ce feat:차량일지(운행기록부) 테이블 마이그레이션 추가
- vehicle_logs 테이블 생성
- 운행 정보 (날짜, 부서, 운전자, 구분)
- 출발지/도착지 정보 (분류, 장소명, 주소)
- 주행거리, 비고

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:32:27 +09:00
2779caed6e feat:문서양식 결재라인 user_id 및 연결 필드 마이그레이션 추가
- document_template_approval_lines에 user_id 컬럼 추가
- document_templates에 linked_item_ids(JSON), linked_process_id 컬럼 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:33:37 +09:00
60e2286cec Merge remote-tracking branch 'origin/develop' into develop 2026-02-03 10:10:50 +09:00
김보곤
fe4303f807 feat:바로빌 회원사 마지막 수집 시간 컬럼 추가
- last_sales_fetch_at: 마지막 매출 조회 시간
- last_purchases_fetch_at: 마지막 매입 조회 시간

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:12:30 +09:00
김보곤
c2c19249d7 feat:barobill_members 테이블에 server_mode 컬럼 추가
회원사별로 바로빌 테스트/운영 서버를 개별 설정할 수 있도록 컬럼 추가
- server_mode: enum('test', 'production'), 기본값 'test'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 07:47:56 +09:00
김보곤
c9970d65fd feat:법인차량관리 테이블 생성 (corporate_vehicles)
- 기본 정보: 차량번호, 모델, 종류, 구분, 연식, 운전자, 상태, 주행거리, 메모
- 법인차량 전용: 취득일, 취득가
- 렌트/리스 전용: 계약일자, 회사명, 연락처, 기간, 약정운행거리, 차량가격, 잔존가액, 보증금, 월 렌트료(공급가/세액), 보험사 정보

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:47:54 +09:00
da100ed5ad Merge remote-tracking branch 'origin/develop' into develop 2026-02-02 20:48:01 +09:00
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