Commit Graph

332 Commits

Author SHA1 Message Date
김보곤
6958be1fd8 feat:E-Sign 전자계약 서명 솔루션 백엔드 구현
- 마이그레이션 4개 (esign_contracts, esign_signers, esign_sign_fields, esign_audit_logs)
- 모델 4개 (EsignContract, EsignSigner, EsignSignField, EsignAuditLog)
- 서비스 4개 (EsignContractService, EsignSignService, EsignPdfService, EsignAuditService)
- 컨트롤러 2개 (EsignContractController, EsignSignController)
- FormRequest 4개 (ContractStore, FieldConfigure, SignSubmit, SignReject)
- Mail 1개 (EsignRequestMail + 이메일 템플릿)
- API 라우트 (인증 계약 관리 + 토큰 기반 서명 프로세스)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 07:02:39 +09:00
김보곤
818f764aa5 fix:사진대지 감사 로그 트리거 재생성 (삭제된 컬럼 참조 제거)
컬럼 삭제 후 트리거가 before_photo_path 등을 참조하여 UPDATE 시 에러 발생 수정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 19:28:24 +09:00
김보곤
eade587135 feat:공사현장 사진대지 멀티행 테이블 마이그레이션
construction_site_photo_rows 테이블 생성 + 기존 데이터 마이그레이션 + 부모 테이블 사진 컬럼 삭제

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 18:05:06 +09:00
a3a4e18e8a feat(API): 문서 템플릿 기본필드 field_key $fillable 추가
- DocumentTemplateBasicField 모델에 field_key 필드 추가
- Mass Assignment 보호로 field_key 저장 누락 방지

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:58:37 +09:00
8b78d62068 feat(API): 공정 options JSON 컬럼 마이그레이션
- needs_work_log 개별 컬럼 → options JSON 구조로 전환
- StoreProcessRequest, UpdateProcessRequest 유효성 규칙 갱신
- Process 모델 $fillable, $casts 갱신

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:58:35 +09:00
12053386f6 Merge remote-tracking branch 'origin/develop' into develop 2026-02-11 11:03:58 +09:00
김보곤
bf3ee24314 feat:법인카드 선불결제 테이블 마이그레이션 추가
corporate_card_prepayments 테이블 생성 (tenant_id, year_month, amount, memo)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 10:24:28 +09:00
1d7ef66d19 feat: 작업일지/중간검사 설정을 ProcessStep → Process 레벨로 이동
- Process 모델에 document_template_id, needs_work_log, work_log_template_id 추가
- ProcessStep에서 해당 필드 제거
- WorkOrderService의 검사 관련 3개 메서드(getInspectionTemplate, resolveInspectionDocument, createInspectionDocument) 공정 레벨 참조로 변경
- ProcessService eager loading에 documentTemplate, workLogTemplateRelation 추가
- FormRequest 검증 규칙 이동 (ProcessStep → Process)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 09:51:35 +09:00
김보곤
d0418eeb85 feat:journal_entries에 source_type, source_key 컬럼 추가
- 원본 거래 추적용 source_type(bank_transaction, hometax_invoice, manual) 컬럼 추가
- 원본 거래 고유키 source_key 컬럼 추가
- tenant_id + source_type + source_key 복합 인덱스 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:58:20 +09:00
d8fd221278 Merge remote-tracking branch 'origin/develop' into develop 2026-02-10 10:27:26 +09:00
김보곤
ac83d0bddc Merge branch 'develop' of http://114.203.209.83:3000/SamProject/sam-api into develop 2026-02-10 10:02:16 +09:00
김보곤
6c186c91ab feat:회의록 테이블 마이그레이션 추가 (meeting_minutes, meeting_minute_segments)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 09:50:14 +09:00
e885b1ca45 feat(API): 중간검사 문서 템플릿 동적 연동 - process_steps ↔ document_templates 연결
- process_steps 테이블에 document_template_id FK 추가 (migration)
- ProcessStep 모델에 documentTemplate BelongsTo 관계 추가
- ProcessStepService에서 documentTemplate eager loading
- StoreProcessStepRequest/UpdateProcessStepRequest에 document_template_id 유효성 검증
- WorkOrderService에 getInspectionTemplate(), createInspectionDocument() 메서드 추가
- WorkOrderController에 inspection-template/inspection-document 엔드포인트 추가
- DocumentService.formatTemplateForReact() 접근자 public으로 변경
- i18n 메시지 키 추가 (inspection_document_created, no_inspection_template)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 08:35:57 +09:00
7adfc6d536 Merge remote-tracking branch 'origin/develop' into develop 2026-02-09 21:32:54 +09:00
김보곤
4c02ff64f1 feat:공사현장 사진대지 테이블 마이그레이션 추가
construction_site_photos 테이블 생성 (현장명, 작업일자, 작업전/작업중/작업후 사진 GCS 경로)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 21:25:03 +09:00
61c70b6fd1 Merge remote-tracking branch 'origin/develop' into develop 2026-02-09 18:03:59 +09:00
김보곤
0bd470a6f8 feat:홈택스 세금계산서 분개 테이블 마이그레이션 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 17:13:26 +09:00
9bae7fccae feat: 트리거 감사 로그 Swagger 문서 추가 및 api_request_logs 제외
- TriggerAuditLogApi.php Swagger 파일 생성 (6개 엔드포인트 문서화)
  - 목록 조회, 통계, 상세, 레코드 이력, 롤백 미리보기, 롤백 실행
- api_request_logs를 트리거 제외 테이블 목록에 추가
- Pint 포매팅 적용

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 16:55:34 +09:00
f9de25257f Merge remote-tracking branch 'origin/develop' into develop 2026-02-09 10:46:09 +09:00
김보곤
e9faac5c9d feat:AI 토큰 단가 설정 기능 추가 (DB 기반)
- ai_pricing_configs 테이블 마이그레이션 생성 (기본 시드 데이터 포함)
- AiPricingConfig 모델 추가 (캐시 적용 단가/환율 조회)
- AiReportService 하드코딩 단가를 DB 조회로 변경

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:33:49 +09:00
d07bad16df feat:DB 트리거 기반 데이터 변경 추적 시스템 구현
Phase 1: DB 기반 구축
- trigger_audit_logs 테이블 (RANGE 파티셔닝 15개, 3개 인덱스)
- 789개 MySQL AFTER 트리거 (263 테이블 × INSERT/UPDATE/DELETE)
- SetAuditSessionVariables 미들웨어 (@sam_actor_id, @sam_session_info)

Phase 2: 복구 메커니즘
- TriggerAuditLog 모델, TriggerAuditLogService, AuditRollbackService
- 6개 API 엔드포인트 (index, show, stats, history, rollback-preview, rollback)
- FormRequest 검증 (TriggerAuditLogIndexRequest, TriggerAuditRollbackRequest)

Phase 3: 관리 도구
- v_unified_audit VIEW (APP + TRIGGER 통합, COLLATE 처리)
- audit:partitions 커맨드 (파티션 추가/삭제, dry-run)
- audit:triggers 커맨드 (트리거 재생성, 테이블별/전체)
- 월 1회 파티션 자동 관리 스케줄러 등록

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:17:15 +09:00
김보곤
b9137c93b0 feat:AI 음성녹음 테이블 마이그레이션 및 모델 추가
- ai_voice_recordings 테이블 마이그레이션 생성
- AiVoiceRecording 모델 추가 (Tenants 네임스페이스)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 12:52:28 +09:00
김보곤
f45f91967f feat:AI 토큰 사용량 추적 기능 추가
- ai_token_usages 테이블 마이그레이션 생성
- AiTokenUsage 모델 생성
- AiReportService에 usageMetadata 추출 및 저장 로직 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 10:27:20 +09:00
78851ec04a feat: 테넌트별 채번 규칙 시스템 구현
- numbering_rules 테이블: JSON 패턴 기반 채번 규칙 저장 (tenant별)
- numbering_sequences 테이블: MySQL UPSERT 기반 atomic 시퀀스 관리
- NumberingService: generate/preview/nextSequence 핵심 서비스
- QuoteNumberService: NumberingService 우선, 폴백 QT{YYYYMMDD}{NNNN}
- OrderService: NumberingService 우선 (pair_code 지원), 폴백 ORD{YYYYMMDD}{NNNN}
- StoreOrderRequest: pair_code 필드 추가
- NumberingRuleSeeder: tenant_id=287 견적(KD-PR)/수주(KD-{pairCode}) 규칙

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 09:50:52 +09:00
487e651845 feat: 견적확정 밸리데이션, 작업지시 통계 공정별 카운트, 입고/재고 개선
- 견적확정 시 업체명/현장명/담당자/연락처 필수 검증 추가 (QuoteService)
- 작업지시 stats API에 by_process 공정별 카운트 반환 추가
- 작업지시 목록/상세 쿼리에 수주 개소(rootNodes) 연관 로딩
- 작업지시 품목에 sourceOrderItem.node 관계 추가
- 입고관리 완료건 수정 허용 및 재고 차이 조정
- work_order_step_progress 테이블 마이그레이션
- receivings 테이블 options 컬럼 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 03:27:07 +09:00
6b3e5c3e87 Merge remote-tracking branch 'origin/develop' into develop 2026-02-06 22:16:36 +09:00
김보곤
3a62a2a6e6 feat:인터뷰 시나리오 마이그레이션/모델 추가
- interview_categories, interview_templates, interview_questions 테이블 생성
- interview_sessions, interview_answers 테이블 생성
- InterviewCategory, InterviewTemplate, InterviewQuestion 모델 추가
- InterviewSession, InterviewAnswer 모델 추가
- 멀티테넌트(tenant_id) 지원, 감사 로깅(Auditable) 적용

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 21:01:24 +09:00
874bf97b8f feat: [수주관리] order_nodes 테이블 및 모델 생성 (N-depth 트리 구조)
- order_nodes 마이그레이션: 자기참조 parent_id, 고정코어(통계용) + options JSON(하이브리드)
- order_items에 order_node_id nullable FK 추가
- OrderNode 모델: BelongsToTenant, Auditable, SoftDeletes, 트리 관계(parent/children)
- Order 모델: nodes(), rootNodes() HasMany 관계 추가
- OrderItem 모델: order_node_id fillable + node() BelongsTo 관계 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 20:06:14 +09:00
김보곤
bdf6bcc480 feat:일반전표입력 마이그레이션 추가 (journal_entries, journal_entry_lines)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:23:37 +09:00
김보곤
edbd95053c feat:계좌 입출금 분개 테이블 마이그레이션 추가
- barobill_bank_transaction_splits 테이블 생성
- 계좌 입출금 거래를 여러 계정과목으로 분개하여 저장

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 14:43:10 +09:00
김보곤
28bf445844 feat:계좌 입출금내역 수동입력용 is_manual 컬럼 추가
barobill_bank_transactions 테이블에 is_manual boolean 컬럼 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 11:03:08 +09:00
김보곤
3406b12260 feat:바로빌 계좌 거래내역 오버라이드 테이블 마이그레이션 추가
- barobill_bank_transaction_overrides 테이블 생성
- tenant_id + unique_key 복합 유니크 인덱스
- modified_summary, modified_cast 필드로 수정값 저장

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 11:03:08 +09:00
김보곤
70aab06364 feat:holidays 테이블 마이그레이션 생성
달력 휴일 관리를 위한 holidays 테이블 추가 (시작일/종료일, 유형, 반복 여부)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 19:59:31 +09:00
김보곤
44079f0f0e feat:재무관리 컬럼 추가 마이그레이션 (tax_type, tax_invoice_issued, deduction_type)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 18:26:47 +09:00
bc23debb26 Merge remote-tracking branch 'origin/develop' into develop 2026-02-05 17:37:54 +09:00
김보곤
a94c68ea91 feat:바로빌 카드 거래 숨김 테이블 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 17:27:14 +09:00
김보곤
f941ca17b9 feat:분개 테이블에 공급가액/부가세 컬럼 추가
- split_supply_amount (decimal 18,2, nullable) 컬럼 추가
- split_tax (decimal 18,2, nullable) 컬럼 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 15:44:28 +09:00
229ebc7483 feat:문서 resolve/upsert API 추가- React 연동용 resolve API (GET /documents/resolve)
- Upsert API (POST /documents/upsert)
- ResolveRequest, UpsertRequest FormRequest 생성
- DocumentService에 resolve/upsert 로직 추가
- document_category common_codes 마이그레이션
- 에러/성공 메시지 i18n 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:45:53 +09:00
83d12a8ca2 Merge remote-tracking branch 'origin/develop' into develop 2026-02-05 12:46:38 +09:00
김보곤
bc4a41263a feat:카드 사용내역 수동입력 is_manual 컬럼 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 11:24:32 +09:00
김보곤
49d68e3b3e fix:이력 테이블 마이그레이션 기존 테이블 충돌 방지
- 이전 실행에서 테이블만 생성되고 FK 추가 실패한 상태 대응
- dropIfExists 추가하여 재실행 가능하도록 수정

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:50:18 +09:00
김보곤
98ab3dac9a fix:이력 테이블 외래키 이름 길이 초과 수정
- MySQL 64자 제한으로 자동생성 외래키명 실패
- foreignId()->constrained() → 수동 foreign() + 짧은 이름(bb_amount_log_trans_fk)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:49:53 +09:00
5118c364ef Merge remote-tracking branch 'origin/develop' into develop 2026-02-05 10:49:28 +09:00
김보곤
ba34fb09df feat:카드 사용내역 금액 수정 마이그레이션 추가
- modified_supply_amount, modified_tax 컬럼 추가 (사용자 수정 공급가액/부가세)
- barobill_card_transaction_amount_logs 이력 테이블 생성

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:02:46 +09:00
김보곤
9626bca7eb feat:purchases 테이블에 MNG용 컬럼 추가 마이그레이션
- date, vendor, item, category, amount, vat, invoice_no, memo 컬럼 추가
- MNG 매입관리 페이지 500 에러 수정용

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 09:35:04 +09:00
김보곤
2b5ac4c54d feat:법인카드 거래내역(card_transactions) 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 07:44:09 +09:00
김보곤
00470b7d30 feat:일일자금일보 마이그레이션 추가 (daily_fund_transactions, daily_fund_memos)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 07:43:55 +09:00
김보곤
422bad7dfc feat:부가세 관리 vat_records 테이블 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 06:14:18 +09:00
e364239572 feat: 견적 참조 데이터 API, 수주 전환 로직 개선, 검사기준서 필드 통합
- 견적 참조 데이터(현장명, 부호) 조회 API 추가 (GET /quotes/reference-data)
- 수주 전환 시 floor_code/symbol_code를 quoteItem.note에서 파싱하도록 변경
- 수주 전환 시 note에 formula_category 저장
- 검사기준서 프리셋: standard + standard_criteria → text_with_criteria로 통합
- tolerance 컬럼 width 조정 (120px → 85px)
- LOGICAL_RELATIONSHIPS.md 문서 갱신

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 23:07:08 +09:00
김보곤
9c276ed8c3 fix:기존 테이블 충돌 방지를 위한 hasTable 체크 추가 (sales_records, purchases, subscriptions)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:53:02 +09:00