Commit Graph

492 Commits

Author SHA1 Message Date
090c07605e fix(WEB): 수주 등록/수정 옵션 필드 저장 및 담당자 표시 문제 해결
- FormRequest에 options 필드 validation 추가 (StoreOrderRequest, UpdateOrderRequest)
  - shipping_cost_code, receiver, receiver_contact, shipping_address 등
- OrderService.show()에서 client 로드 시 manager_name 필드 추가
- 수주확정/생산지시 되돌리기 기능 추가 (revertOrderConfirmation, revertProductionOrder)
- 견적 calculation_inputs 포함하여 로드

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 21:58:57 +09:00
b86397cbee feat: 견적서 옵션용 공통코드 마이그레이션 추가
- material_type: 제품 종류 (스크린, 슬랫, 벤딩, 조인트바)
- painting_type: 도장 옵션
- motor_type: 모터 옵션
- controller_type: 제어기 옵션
- width_construction_cost: 가로시공비 옵션
- height_construction_cost: 세로시공비 옵션

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 19:35:11 +09:00
7543fd2256 feat(WEB): 작업지시/출근부 기능 개선 및 마이그레이션 추가
- 작업지시 우선순위 필드 추가 (priority 마이그레이션)
- 수주-작업지시 품목 연동 source_order_item_id 컬럼 추가
- 수주 테이블에 account_code 필드 추가
- 작업지시 StoreRequest/UpdateRequest 우선순위 검증 추가
- WorkOrder 모델 priority fillable 추가
- 출근부 StoreRequest/UpdateRequest 검증 규칙 개선
- Employee Request 검증 규칙 수정
- SaleService/ItemService 수정
- WorkResultService 결과 처리 개선
- BankTransactionService 수정
- routes/api.php 엔드포인트 업데이트
- error.php 에러 메시지 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:38:52 +09:00
49d632b16b fix: 견적서 options 필드 저장 누락 문제 해결
- QuoteUpdateRequest에 detail_items, price_adjustment_data validation 규칙 추가
- QuoteService에서 options 병합 시 array_merge 사용하여 기존 데이터 보존
- Laravel FormRequest의 validated()가 규칙 미정의 필드를 필터링하는 이슈 해결

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 15:36:01 +09:00
8bac207274 fix(WEB): 작업지시 품목 수주 연동 및 발주처 표시 수정
- 작업지시 생성 시 수주 품목 자동 복사 기능 추가
- 품목 추적용 source_order_item_id 컬럼 추가
- 발주처 표시를 위해 salesOrder 로딩에 client_id 추가
- 담당자 수정 시 assignee_ids 배열 처리 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 15:30:50 +09:00
a0593a3c12 fix: FormRequest에 process_ids, priority 필드 추가
- CreateProductionOrderRequest에 누락된 필드 추가
- process_id, process_ids, priority 검증 규칙 추가
- $request->validated()에서 필터링되는 문제 해결
- 공정별 다중 작업지시 생성 정상 동작

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 10:59:51 +09:00
a1edd8dcf4 feat(API): 작업지시 목록 process_code 필터 추가
- WorkOrderService.php에 process_code 파라미터 필터 추가
- whereHas('process') 쿼리로 공정 코드 기반 필터링 지원
- 생산 현황판 동적 탭 필터링 API 지원

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 20:35:20 +09:00
e4993e30af fix: 다중 기기 로그인 지원
- 로그인 시 기존 리프레시 토큰 삭제 로직 제거
- 각 기기에서 독립적으로 세션 유지 가능
- 기존 단일 기기 정책으로 인한 강제 로그아웃 문제 해결

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-15 20:23:07 +09:00
fa6e96dcbc fix: clients 테이블 Collation 불일치 수정
- BUG-BANK-20260115-001: 은행거래 테이블 데이터 미표시 오류 해결
- clients 테이블 Collation을 utf8mb4_unicode_ci로 변경
- UNION 쿼리 (deposits, withdrawals, clients) 호환성 확보
- 통계 카드와 테이블 데이터 동기화 완료

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-15 20:06:25 +09:00
a1aa8726af feat: 공통 모듈 추가 (엑셀 내보내기, 계정과목 일괄변경)
Phase 0 - 공통 모듈:
- ExportService.php 생성 (Maatwebsite/Excel 기반 엑셀 내보내기)
- BulkUpdateAccountCodeRequest.php 생성 (계정과목 일괄변경 유효성 검사)

Phase 1 - 계정과목 일괄변경:
- WithdrawalController/Service: bulkUpdateAccountCode 메서드 추가
- DepositController/Service: bulkUpdateAccountCode 메서드 추가
- POST /v1/withdrawals/bulk-update-account-code
- POST /v1/deposits/bulk-update-account-code

Phase 2 - 엑셀 내보내기:
- AttendanceController/Service: export, getExportData 메서드 추가
- SalaryController/Service: export, getExportData 메서드 추가
- GET /v1/attendances/export
- GET /v1/salaries/export

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-15 17:14:04 +09:00
e3630c6196 fix: 수주 선택 모달 필터링 조건 수정
- Order 모델에 workOrders 관계 추가
- OrderService에 for_work_order 파라미터 처리 추가
- DRAFT 상태 & 작업지시 미생성 수주만 조회

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-15 16:13:34 +09:00
f9fa7cfd1e fix: 견적 선택 다이얼로그에서 수주 전환된 견적 제외
- QuoteIndexRequest: for_order 파라미터 추가
- Quote 모델: orders() HasMany 관계 추가 (Order.quote_id 기준)
- QuoteService: for_order 필터링 로직 추가
  - whereNull('order_id') - 빠른 체크
  - whereDoesntHave('orders') - 이중 체크
- OrderService: 수주 생성 시 견적 상태를 converted로 업데이트

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-15 16:13:17 +09:00
566f34a4c9 fix: MES 모델 및 서비스 개선
- WorkOrderItem 모델 관계 정의 추가
- InspectionService, WorkResultService 로직 개선
- ItemReceipt, Inspection 모델 수정
- work_order_items 테이블에 options 컬럼 추가 마이그레이션

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-15 08:52:53 +09:00
12ca2cf4d3 fix: 사원 등록 시 이메일 중복 체크 및 user_id 충돌 방지
- 이메일 중복 체크 추가 (삭제된 사용자 포함)
- generateUniqueUserId() 메서드 추가 (중복 시 최대 10회 재시도)
- email_already_exists 에러 메시지 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 20:29:00 +09:00
b82f9c786b fix: 품목관리 API 응답 및 라우팅 오류 수정
- ItemsController: show/destroy 메서드 파라미터 타입 수정 (int → 동적 캐스팅)
- ItemsController: store/update에서 product_type → item_type 변환 로직 추가
- ItemService: 정렬 순서 수정 (최신 품목이 먼저 표시되도록 desc 추가)
- ItemService: code 키를 item_code로 변경 (ApiResponse::handle의 HTTP 상태 코드 충돌 방지)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 20:04:29 +09:00
3d1dbfc3ca fix: users.password 컬럼 nullable로 변경
- 사원 전용 계정(시스템 로그인 불가) 지원
- 비밀번호 없이 사원 등록 시 500 에러 수정
- EmployeeService.store()에서 password null 허용

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 19:42:56 +09:00
92d39d7294 feat: 작업지시 목록에 assigned_to_me 필터 추가
- 작업자 화면에서 나에게 배정된 작업만 조회하도록 지원
- 주 담당자(assignee_id) 또는 공동 담당자(assignees) 모두 포함
- 프론트엔드 WorkerScreen의 assigned_to_me=1 파라미터 처리

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 19:15:25 +09:00
524f1cf0fc fix(API): 직원 등록 서버 에러 수정
- User 모델 $fillable에 is_active, created_by, updated_by 추가
- EmployeeService 이중 비밀번호 해싱 제거 (모델 hashed 캐스트 활용)
- create_account 플래그 의존성 제거 (password 있으면 계정 생성)

Fixes: employee-register E2E test failure

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 17:32:27 +09:00
a08e155b26 feat(API): Inspection API 구현
- InspectionController 생성 (CRUD + stats + complete)
- InspectionService 생성 (비즈니스 로직)
- FormRequest 생성 (Store/Update/Complete)
- 라우트 등록 (7개 엔드포인트)
- i18n 메시지 추가 (message.php, error.php)

기존 inspections 테이블 및 Inspection 모델 활용

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 17:08:59 +09:00
85542293df fix(API): 작업지시 상태 자동 동기화 - pending 상태도 포함
- syncWorkOrderStatusFromItems()에서 pending 상태도 자동 전환 허용
- 품목 상태가 in_progress로 변경 시 작업지시 상태도 자동 변경
- 미배정(unassigned) 상태만 제외하도록 변경
- 기존: waiting, in_progress, completed만 동기화 대상
- 변경: unassigned만 제외, pending도 동기화 가능

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 15:37:28 +09:00
a8ae5e177f feat: quotes 테이블에 options JSON 컬럼 추가
- 견적요약, 공과상세, 품목 단가조정 데이터를 JSON으로 저장
- Quote 모델에 options 필드 추가 (fillable, casts)
- 중요도가 낮은 필드는 개별 테이블 대신 JSON으로 관리

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:35:21 +09:00
ced89740a3 docs(API): 논리 관계 문서 및 테스트 수정
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:49 +09:00
b37083e168 feat(API): 에러 메시지 다국어 추가
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:44 +09:00
eb3dfb0836 fix(API): Salary FormRequest 수정
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:39 +09:00
be90c351fa chore(API): Seeder 파일 정리
- Dummy Seeder 파일들 정리 및 개선
- ApprovalTestDataSeeder 수정
- PositionSeeder, StockReceivingSeeder 수정

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:28 +09:00
1044b57e15 chore(API): 마이그레이션 파일 정리 및 추가
- 기존 마이그레이션 파일 정리
- handover_reports 테이블 마이그레이션 추가
- site_briefings 테이블 마이그레이션 추가
- work_orders process_id 마이그레이션 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:23 +09:00
4764eeb9d4 fix(API): FormRequest 타입 및 검증 수정
- SendFcmRequest, PositionReorderRequest 수정
- TenantLogoUploadRequest, Salary Requests 수정
- StructureReview Requests 수정
- HandoverReport, SiteBriefing Requests 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:17 +09:00
b7c635fb4f feat(API): Model 및 관계 추가
- HandoverReport, HandoverReportItem, HandoverReportManager 모델 추가
- SiteBriefing 모델 추가
- StructureReview, FcmSendLog, Position, Salary 수정
- Order 모델 정리

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:11 +09:00
8a5c7b5298 feat(API): Service 로직 개선
- EstimateService, ItemService 기능 추가
- OrderService 공정 연동 개선
- SalaryService, ReceivablesService 수정
- HandoverReportService, SiteBriefingService 추가
- Pricing 서비스 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:06 +09:00
ba5f402cd8 fix(API): Controller 타입 및 코드 정리
- FcmController, EstimateController, ItemsController 개선
- LoanController, PositionController 수정
- ReceivablesController, SalaryController 수정
- StructureReviewController 수정

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:49:00 +09:00
e571f8c38e docs(API): Swagger API 문서 업데이트
- AdminFcmApi, BillApi, ExpectedExpenseApi 개선
- PositionApi, ProcessApi, QuoteApi 개선
- ReceivablesApi, ShipmentApi, StockApi, VendorLedgerApi 개선

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:48:54 +09:00
fc6d88bd26 feat(API): 작업지시 공정 연동 개선
- WorkOrder 모델에 process_id 추가
- process 관계 추가 (Process 모델)
- 공정별 다중 작업지시 생성 지원
- WorkOrderStoreRequest/UpdateRequest 수정

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 19:48:48 +09:00
97f22f9b98 refactor(pagination): size 초과 시 오류 대신 자동 조정으로 변경
- config/pagination.php 추가 (기본값 중앙 관리)
- HasPagination Trait 추가 (prepareForValidation에서 자동 조정)
- 22개 IndexRequest에 Trait 적용, max 규칙 제거
- 특수 케이스: Employee($maxSize=500), Audit($maxSize=200)

size/per_page가 최대값 초과 시 422 오류 대신 최대값으로 자동 조정되어
리스트가 빈 화면으로 표시되는 문제 해결

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:45:44 +09:00
38d56aa564 feat(work-order): 품목 상태 변경 및 작업지시 상태 자동 연동
- WorkOrderItem 모델에 status 컬럼 및 상수 추가 (waiting/in_progress/completed)
- 품목 상태 변경 API 엔드포인트 추가 (PATCH /work-orders/{id}/items/{itemId}/status)
- syncWorkOrderStatusFromItems() 메서드로 품목→작업지시 상태 자동 동기화
  - 품목 중 하나라도 in_progress → 작업지시 in_progress
  - 모든 품목 completed → 작업지시 completed
  - 모든 품목 waiting → 작업지시 waiting
- 감사 로그: item_status_changed, status_synced_from_items 액션 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:00:47 +09:00
84ad9e1fc4 feat(quote): quote_type 컬럼 추가 및 건설 견적 필터링 구현
- quotes 테이블에 quote_type 컬럼 추가 (manufacturing/construction)
- Quote 모델에 TYPE 상수 및 스코프 메서드 추가
- QuoteService.index()에 quote_type 필터 적용
- QuoteService.upsertFromSiteBriefing()에 construction 타입 설정
- QuoteIndexRequest에 quote_type 유효성 검증 추가
- 기존 site_briefing_id 있는 데이터는 construction으로 자동 업데이트

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 09:55:22 +09:00
3a40db9444 fix(order): 수주 API 500 에러 수정
- show(): clients 테이블 컬럼명 수정 (business_no,representative → contact_person)
- store/update/createFromQuote(): order_items에 tenant_id, serial_no 필드 추가
- index(): quote eager loading 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 16:14:09 +09:00
f59dd1b9fb feat(labor): 노임관리 API 구현
- Labor 모델 (BelongsToTenant, SoftDeletes)
- LaborController 7개 엔드포인트
- LaborService 비즈니스 로직
- FormRequest 4개 (Index/Store/Update/BulkDelete)
- 마이그레이션 및 라우트 등록

API: GET/POST /labor, GET/PUT/DELETE /labor/{id}, DELETE /labor/bulk, GET /labor/stats

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-11 23:29:32 +09:00
ceb7798c28 feat(pricing): 단가관리 stats, bulkDestroy API 추가
- GET /pricing/stats: 단가 통계 조회 (total, draft, finalized, expired)
- DELETE /pricing/bulk: 단가 일괄 삭제 (확정된 단가 제외)
- PriceBulkDeleteRequest FormRequest 추가
- PricingService.stats(), bulkDestroy() 메서드 구현

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 22:19:11 +09:00
e6a4bf0870 feat(construction): 구조검토관리 API 구현
- Migration: structure_reviews 테이블 생성
- Model: StructureReview (BelongsToTenant, SoftDeletes)
- Service: StructureReviewService (CRUD + 통계 + 일괄삭제)
- Controller: StructureReviewController (7 endpoints)
- FormRequest: Store/Update 검증 규칙

API Endpoints:
- GET    /construction/structure-reviews (목록)
- POST   /construction/structure-reviews (생성)
- GET    /construction/structure-reviews/stats (통계)
- DELETE /construction/structure-reviews/bulk (일괄삭제)
- GET    /construction/structure-reviews/{id} (상세)
- PUT    /construction/structure-reviews/{id} (수정)
- DELETE /construction/structure-reviews/{id} (삭제)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 21:31:27 +09:00
d49dc1d878 fix: 수주관리 Quote eager loading 필드명 수정
- OrderService.php: quote_no → quote_number 수정

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 21:26:54 +09:00
9f8bff2f3d feat(common-codes): order_status/order_type 공용 코드 추가
- common_codes 테이블에 order_status 코드 그룹 추가 (DRAFT, CONFIRMED, IN_PROGRESS, COMPLETED, CANCELLED)
- common_codes 테이블에 order_type 코드 그룹 추가 (ORDER, PURCHASE)
- CommonController index 메서드 구현 (GET /api/v1/settings/common/{group})
- 멀티테넌트 지원 (tenant_id NULL 또는 현재 테넌트)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 17:25:14 +09:00
a71ae2e3d7 feat(items): 품목 통계 API 라우트 추가
- GET /api/v1/items/stats 라우트 추가
- stats 라우트를 /{id} 앞에 배치하여 파라미터 충돌 방지
- Phase 2.3 자재관리 API 연동 지원

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 16:58:41 +09:00
da2eddead4 feat: 거래처 통계 및 일괄삭제 API 추가 (Phase 2.2)
- ClientService: stats(), bulkDestroy() 메서드 추가
- ClientController: stats(), bulkDestroy() 액션 추가
- routes/api.php: /clients/stats, /clients/bulk 라우트 추가
- 악성채권 보유 거래처 통계 계산 (BadDebt 연계)
- 주문 있는 거래처는 삭제 건너뜀

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 16:46:25 +09:00
00f57ce244 feat(시공사): 2.1 현장관리 - Backend API 확장
- 마이그레이션: site_code, client_id, status 컬럼 추가
- Site 모델: 상태 상수, Client 관계 추가
- SiteService: stats(), bulkDestroy(), 필터 확장
- SiteController: stats, bulkDestroy 엔드포인트 추가
- 라우트: /stats, /bulk 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 16:34:59 +09:00
7897ad0479 fix: PushNotificationService 누락된 메서드 복원 및 DI 적용
- Controller: 생성자 DI로 PushNotificationService 주입
- Service: 12/18 커밋에서 삭제된 토큰 관리 메서드 복원
  - registerToken, unregisterToken, getUserTokens
  - getSettings, updateSettings
  - initializeDefaultSettings, getDefaultSound
- 기존 비즈니스 이벤트 푸시 기능(FcmSender) 유지

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 10:39:06 +09:00
3a8af2d7ee feat: [시공관리] 계약관리 API 구현
- Contract 모델, 마이그레이션 추가
- ContractController CRUD 엔드포인트 구현
- ContractService 비즈니스 로직 구현
- ContractStoreRequest, ContractUpdateRequest 검증 추가
- Swagger API 문서 작성
- 라우트 등록 (GET/POST/PUT/DELETE)
- 통계 및 단계별 건수 조회 API 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 10:18:43 +09:00
349917f019 refactor(work-orders): 코드 리뷰 기반 전면 개선
## Critical 수정
- Multi-tenancy: WorkOrderItem, BendingDetail, Issue에 BelongsToTenant 적용
- 감사 로그: 상태변경, 품목수정, 이슈 등록/해결 시 로깅 추가
- 상태 전이 규칙: STATUS_TRANSITIONS + canTransitionTo() 구현

## High 수정
- 다중 담당자: work_order_assignees 피벗 테이블 및 관계 추가
- 부분 수정: 품목 ID 기반 upsert/delete 로직 구현

## 변경 파일
- Models: WorkOrder, WorkOrderAssignee(신규), 하위 모델들
- Services: WorkOrderService (assign, update 메서드 개선)
- Migrations: tenant_id 추가, assignees 테이블 생성

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 08:32:44 +09:00
18aa745518 feat: 공정 관리 API 개선 및 ProcessItem 추가
- ProcessItem 모델 및 마이그레이션 추가
- Process 요청/서비스 로직 수정
- Swagger API 문서 추가

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 20:23:52 +09:00
26c071805a feat: 수주 관리 Phase 3 - 고급 기능 API 구현
- 견적→수주 변환 API (POST /orders/from-quote/{quoteId})
- 생산지시 생성 API (POST /orders/{id}/production-order)
- FormRequest 검증 클래스 추가
- 중복 생성 방지 및 상태 검증 로직

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 20:17:40 +09:00
de19ac97aa feat: 수주관리(Order Management) API Phase 1.1 구현
- OrderService 구현 (index, stats, show, store, update, destroy, updateStatus)
- OrderController 구현 (7개 API 엔드포인트)
- FormRequest 클래스 3개 생성 (Store, Update, UpdateStatus)
- 상태 전환 규칙 검증 (DRAFT → CONFIRMED → IN_PROGRESS → COMPLETED/CANCELLED)
- 수주번호 자동 생성 (ORD{YYYYMMDD}{0001} 형식)
- Swagger API 문서 작성 (OrderApi.php)
- i18n 메시지 키 추가 (ko/en)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 11:11:54 +09:00