Commit Graph

310 Commits

Author SHA1 Message Date
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
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
김보곤
343d7f6256 feat:고객/매출/매입/정산 등 재무 관련 8개 테이블 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:50:44 +09:00
fa07e5b58a feat: 경동기업 품목 기준 데이터 배포용 시더 구현
- ExportItemMasterDataCommand: tenant_id=287 데이터를 JSON으로 추출
- KyungdongItemMasterSeeder: JSON 기반 DELETE+재삽입 시더
  - Phase 1: item_pages/sections/fields + entity_relationships
  - Phase 2: categories(depth순) + items(배치500건)
  - Phase 3: item_details + prices
  - ID 매핑으로 환경별 충돌 없음, 트랜잭션 안전
- 8개 JSON 데이터 파일 포함 (총 약 1.5MB)
- .gitignore에 시더 데이터 예외 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:47:03 +09:00
a6fc537a02 Merge remote-tracking branch 'origin/develop' into develop 2026-02-04 22:40:58 +09:00
김보곤
0d1b088463 feat:환불/해지 관리 테이블 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:37:35 +09:00
김보곤
cee37b3e20 feat:미지급금(payables) 테이블 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:27:13 +09:00
김보곤
0e9f8be423 feat:미수금(receivables) 테이블 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:22:20 +09:00
김보곤
c7029f9eef feat:거래처(trading_partners) 테이블 마이그레이션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:13:26 +09:00
a7975f7270 fix: ItemService update 시 attributes 머지 로직 추가
- 기존: attributes 전체 덮어쓰기 → 수정: 기존 값 보존 후 새 값만 머지
- 품목 수정 시 레거시 속성(sales_price, legacy 정보 등) 유실 방지

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 20:30:07 +09:00
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