2025-09-24 22:30:28 +09:00
|
|
|
# 논리적 데이터베이스 관계 문서
|
|
|
|
|
|
2025-12-04 22:22:46 +09:00
|
|
|
> **자동 생성**: 2025-12-04 20:56:47
|
2025-10-14 22:26:15 +09:00
|
|
|
> **소스**: Eloquent 모델 관계 분석
|
|
|
|
|
|
|
|
|
|
## 📊 모델별 관계 현황
|
|
|
|
|
|
|
|
|
|
### boards
|
|
|
|
|
**모델**: `App\Models\Boards\Board`
|
|
|
|
|
|
|
|
|
|
- **customFields()**: hasMany → `board_settings`
|
|
|
|
|
- **posts()**: hasMany → `posts`
|
|
|
|
|
|
|
|
|
|
### board_comments
|
|
|
|
|
**모델**: `App\Models\Boards\BoardComment`
|
|
|
|
|
|
|
|
|
|
- **post()**: belongsTo → `posts`
|
|
|
|
|
- **user()**: belongsTo → `users`
|
|
|
|
|
- **parent()**: belongsTo → `board_comments`
|
|
|
|
|
- **children()**: hasMany → `board_comments`
|
|
|
|
|
|
|
|
|
|
### board_settings
|
|
|
|
|
**모델**: `App\Models\Boards\BoardSetting`
|
|
|
|
|
|
|
|
|
|
- **board()**: belongsTo → `boards`
|
|
|
|
|
|
|
|
|
|
### posts
|
|
|
|
|
**모델**: `App\Models\Boards\Post`
|
|
|
|
|
|
|
|
|
|
- **board()**: belongsTo → `boards`
|
|
|
|
|
- **comments()**: hasMany → `board_comments`
|
|
|
|
|
- **files()**: morphMany → `files`
|
|
|
|
|
|
|
|
|
|
### post_custom_field_values
|
|
|
|
|
**모델**: `App\Models\Boards\PostCustomFieldValue`
|
|
|
|
|
|
|
|
|
|
- **post()**: belongsTo → `posts`
|
|
|
|
|
- **field()**: belongsTo → `board_settings`
|
|
|
|
|
|
|
|
|
|
### categorys
|
|
|
|
|
**모델**: `App\Models\Commons\Category`
|
|
|
|
|
|
|
|
|
|
- **parent()**: belongsTo → `categories`
|
|
|
|
|
- **children()**: hasMany → `categories`
|
|
|
|
|
- **products()**: hasMany → `products`
|
|
|
|
|
- **categoryFields()**: hasMany → `category_fields`
|
|
|
|
|
|
|
|
|
|
### category_fields
|
|
|
|
|
**모델**: `App\Models\Commons\CategoryField`
|
|
|
|
|
|
|
|
|
|
- **category()**: belongsTo → `categories`
|
|
|
|
|
|
|
|
|
|
### category_logs
|
|
|
|
|
**모델**: `App\Models\Commons\CategoryLog`
|
|
|
|
|
|
|
|
|
|
- **category()**: belongsTo → `categories`
|
|
|
|
|
|
|
|
|
|
### category_templates
|
|
|
|
|
**모델**: `App\Models\Commons\CategoryTemplate`
|
|
|
|
|
|
|
|
|
|
- **category()**: belongsTo → `categories`
|
|
|
|
|
|
|
|
|
|
### files
|
|
|
|
|
**모델**: `App\Models\Commons\File`
|
|
|
|
|
|
2025-11-11 11:30:17 +09:00
|
|
|
- **tenant()**: belongsTo → `tenants`
|
feat: 파일 저장 시스템 DB 마이그레이션
- enhance_files_table: 이중 파일명 시스템 (display_name/stored_name), 폴더 관리, 문서 연결 지원
- create_folders_table: 동적 폴더 관리 시스템 (tenant별 커스터마이징 가능)
- 5개 stub 마이그레이션 생성 (file_share_links, file_deletion_logs, storage_usage_history, add_storage_columns_to_tenants)
- FolderSeeder stub 생성
- CURRENT_WORKS.md에 Phase 1 진행상황 문서화
fix: 파일 공유 및 삭제 기능 버그 수정
- ShareLinkRequest: PATH 파라미터 {id}를 file_id로 자동 병합
- routes/api.php: 공유 링크 다운로드를 auth.apikey 그룹 밖으로 이동 (인증 불필요)
- FileShareLink: File, Tenant 클래스 import 추가
- File 모델: softDeleteFile()에서 SoftDeletes의 delete() 메서드 사용
- FileStorageService: getTrash(), restoreFile(), permanentDelete()에서 onlyTrashed() 사용
- File 모델: Tenant 네임스페이스 수정 (App\Models\Tenants\Tenant)
refactor: Swagger 문서 정리 - File 태그를 Files로 통합
- FileApi.php의 모든 태그를 Files로 변경
- 구 파일 시스템 라우트 삭제 (prefix 'file')
- 구 FileController.php 삭제
- 신규 파일 저장소 시스템으로 완전 통합
fix: 모든 legacy 파일 컬럼 nullable 일괄 처리
- 5개 legacy 컬럼을 한 번에 nullable로 변경
* original_name, file_name, file_name_old (string)
* fileable_id, fileable_type (polymorphic)
- foreach 루프로 반복 작업 자동화
- 신규/기존 시스템 간 완전한 하위 호환성 확보
fix: legacy 파일 컬럼 nullable 처리 완료
- file_name, file_name_old 컬럼도 nullable로 변경
- 기존 시스템과 신규 시스템 간 완전한 하위 호환성 확보
- Legacy: original_name, file_name, file_name_old (nullable)
- New: display_name, stored_name (required)
fix: original_name 컬럼 nullable 처리
- original_name을 nullable로 변경하여 하위 호환성 유지
- 새 시스템에서는 display_name 사용, 기존 시스템은 original_name 사용 가능
fix: 파일 업로드 DB 컬럼 누락 및 메시지 구조 개선
- files 테이블에 감사 컬럼 추가 (created_by, updated_by, uploaded_by)
- ApiResponse::handle() 메시지 로직 개선 (접미사 제거)
- 다국어 지원을 위한 완성된 문장 구조 유지
- FileUploadRequest 파일 검증 규칙 수정
fix: 파일 저장소 버그 수정 및 신규 테넌트 폴더 자동 생성
- FolderSeeder 네임스페이스 수정 (App\Models\Tenant → App\Models\Tenants\Tenant)
- FileStorageController use 문 구문 오류 수정 (/ → \)
- TenantObserver에 신규 테넌트 기본 폴더 자동 생성 로직 추가
- 5개 기본 폴더 (생산관리, 품질관리, 회계, 인사, 일반)
- 에러 처리 및 로깅
- 회원가입 시 자동 실행
2025-11-10 19:08:56 +09:00
|
|
|
- **folder()**: belongsTo → `folders`
|
2025-10-14 22:26:15 +09:00
|
|
|
- **uploader()**: belongsTo → `users`
|
feat: 파일 저장 시스템 DB 마이그레이션
- enhance_files_table: 이중 파일명 시스템 (display_name/stored_name), 폴더 관리, 문서 연결 지원
- create_folders_table: 동적 폴더 관리 시스템 (tenant별 커스터마이징 가능)
- 5개 stub 마이그레이션 생성 (file_share_links, file_deletion_logs, storage_usage_history, add_storage_columns_to_tenants)
- FolderSeeder stub 생성
- CURRENT_WORKS.md에 Phase 1 진행상황 문서화
fix: 파일 공유 및 삭제 기능 버그 수정
- ShareLinkRequest: PATH 파라미터 {id}를 file_id로 자동 병합
- routes/api.php: 공유 링크 다운로드를 auth.apikey 그룹 밖으로 이동 (인증 불필요)
- FileShareLink: File, Tenant 클래스 import 추가
- File 모델: softDeleteFile()에서 SoftDeletes의 delete() 메서드 사용
- FileStorageService: getTrash(), restoreFile(), permanentDelete()에서 onlyTrashed() 사용
- File 모델: Tenant 네임스페이스 수정 (App\Models\Tenants\Tenant)
refactor: Swagger 문서 정리 - File 태그를 Files로 통합
- FileApi.php의 모든 태그를 Files로 변경
- 구 파일 시스템 라우트 삭제 (prefix 'file')
- 구 FileController.php 삭제
- 신규 파일 저장소 시스템으로 완전 통합
fix: 모든 legacy 파일 컬럼 nullable 일괄 처리
- 5개 legacy 컬럼을 한 번에 nullable로 변경
* original_name, file_name, file_name_old (string)
* fileable_id, fileable_type (polymorphic)
- foreach 루프로 반복 작업 자동화
- 신규/기존 시스템 간 완전한 하위 호환성 확보
fix: legacy 파일 컬럼 nullable 처리 완료
- file_name, file_name_old 컬럼도 nullable로 변경
- 기존 시스템과 신규 시스템 간 완전한 하위 호환성 확보
- Legacy: original_name, file_name, file_name_old (nullable)
- New: display_name, stored_name (required)
fix: original_name 컬럼 nullable 처리
- original_name을 nullable로 변경하여 하위 호환성 유지
- 새 시스템에서는 display_name 사용, 기존 시스템은 original_name 사용 가능
fix: 파일 업로드 DB 컬럼 누락 및 메시지 구조 개선
- files 테이블에 감사 컬럼 추가 (created_by, updated_by, uploaded_by)
- ApiResponse::handle() 메시지 로직 개선 (접미사 제거)
- 다국어 지원을 위한 완성된 문장 구조 유지
- FileUploadRequest 파일 검증 규칙 수정
fix: 파일 저장소 버그 수정 및 신규 테넌트 폴더 자동 생성
- FolderSeeder 네임스페이스 수정 (App\Models\Tenant → App\Models\Tenants\Tenant)
- FileStorageController use 문 구문 오류 수정 (/ → \)
- TenantObserver에 신규 테넌트 기본 폴더 자동 생성 로직 추가
- 5개 기본 폴더 (생산관리, 품질관리, 회계, 인사, 일반)
- 에러 처리 및 로깅
- 회원가입 시 자동 실행
2025-11-10 19:08:56 +09:00
|
|
|
- **shareLinks()**: hasMany → `file_share_links`
|
2025-10-14 22:26:15 +09:00
|
|
|
- **fileable()**: morphTo → `(Polymorphic)`
|
|
|
|
|
|
2025-12-02 22:11:25 +09:00
|
|
|
### global_menus
|
|
|
|
|
**모델**: `App\Models\Commons\GlobalMenu`
|
|
|
|
|
|
|
|
|
|
- **parent()**: belongsTo → `global_menus`
|
|
|
|
|
- **children()**: hasMany → `global_menus`
|
|
|
|
|
- **tenantMenus()**: hasMany → `menus`
|
|
|
|
|
|
2025-10-14 22:26:15 +09:00
|
|
|
### menus
|
|
|
|
|
**모델**: `App\Models\Commons\Menu`
|
|
|
|
|
|
|
|
|
|
- **parent()**: belongsTo → `menus`
|
2025-12-02 22:11:25 +09:00
|
|
|
- **globalMenu()**: belongsTo → `global_menus`
|
2025-10-14 22:26:15 +09:00
|
|
|
- **children()**: hasMany → `menus`
|
|
|
|
|
|
|
|
|
|
### tags
|
|
|
|
|
**모델**: `App\Models\Commons\Tag`
|
|
|
|
|
|
|
|
|
|
- **tenant()**: belongsTo → `tenants`
|
|
|
|
|
|
|
|
|
|
### bom_templates
|
|
|
|
|
**모델**: `App\Models\Design\BomTemplate`
|
|
|
|
|
|
|
|
|
|
- **modelVersion()**: belongsTo → `model_versions`
|
|
|
|
|
- **items()**: hasMany → `bom_template_items`
|
|
|
|
|
|
|
|
|
|
### bom_template_items
|
|
|
|
|
**모델**: `App\Models\Design\BomTemplateItem`
|
|
|
|
|
|
|
|
|
|
- **template()**: belongsTo → `bom_templates`
|
|
|
|
|
|
|
|
|
|
### design_models
|
|
|
|
|
**모델**: `App\Models\Design\DesignModel`
|
|
|
|
|
|
|
|
|
|
- **versions()**: hasMany → `model_versions`
|
|
|
|
|
|
|
|
|
|
### model_versions
|
|
|
|
|
**모델**: `App\Models\Design\ModelVersion`
|
|
|
|
|
|
|
|
|
|
- **model()**: belongsTo → `models`
|
|
|
|
|
- **bomTemplates()**: hasMany → `bom_templates`
|
|
|
|
|
|
|
|
|
|
### estimates
|
|
|
|
|
**모델**: `App\Models\Estimate\Estimate`
|
|
|
|
|
|
|
|
|
|
- **modelSet()**: belongsTo → `categories`
|
|
|
|
|
- **items()**: hasMany → `estimate_items`
|
|
|
|
|
|
|
|
|
|
### estimate_items
|
|
|
|
|
**모델**: `App\Models\Estimate\EstimateItem`
|
|
|
|
|
|
|
|
|
|
- **estimate()**: belongsTo → `estimates`
|
|
|
|
|
|
feat: 파일 저장 시스템 DB 마이그레이션
- enhance_files_table: 이중 파일명 시스템 (display_name/stored_name), 폴더 관리, 문서 연결 지원
- create_folders_table: 동적 폴더 관리 시스템 (tenant별 커스터마이징 가능)
- 5개 stub 마이그레이션 생성 (file_share_links, file_deletion_logs, storage_usage_history, add_storage_columns_to_tenants)
- FolderSeeder stub 생성
- CURRENT_WORKS.md에 Phase 1 진행상황 문서화
fix: 파일 공유 및 삭제 기능 버그 수정
- ShareLinkRequest: PATH 파라미터 {id}를 file_id로 자동 병합
- routes/api.php: 공유 링크 다운로드를 auth.apikey 그룹 밖으로 이동 (인증 불필요)
- FileShareLink: File, Tenant 클래스 import 추가
- File 모델: softDeleteFile()에서 SoftDeletes의 delete() 메서드 사용
- FileStorageService: getTrash(), restoreFile(), permanentDelete()에서 onlyTrashed() 사용
- File 모델: Tenant 네임스페이스 수정 (App\Models\Tenants\Tenant)
refactor: Swagger 문서 정리 - File 태그를 Files로 통합
- FileApi.php의 모든 태그를 Files로 변경
- 구 파일 시스템 라우트 삭제 (prefix 'file')
- 구 FileController.php 삭제
- 신규 파일 저장소 시스템으로 완전 통합
fix: 모든 legacy 파일 컬럼 nullable 일괄 처리
- 5개 legacy 컬럼을 한 번에 nullable로 변경
* original_name, file_name, file_name_old (string)
* fileable_id, fileable_type (polymorphic)
- foreach 루프로 반복 작업 자동화
- 신규/기존 시스템 간 완전한 하위 호환성 확보
fix: legacy 파일 컬럼 nullable 처리 완료
- file_name, file_name_old 컬럼도 nullable로 변경
- 기존 시스템과 신규 시스템 간 완전한 하위 호환성 확보
- Legacy: original_name, file_name, file_name_old (nullable)
- New: display_name, stored_name (required)
fix: original_name 컬럼 nullable 처리
- original_name을 nullable로 변경하여 하위 호환성 유지
- 새 시스템에서는 display_name 사용, 기존 시스템은 original_name 사용 가능
fix: 파일 업로드 DB 컬럼 누락 및 메시지 구조 개선
- files 테이블에 감사 컬럼 추가 (created_by, updated_by, uploaded_by)
- ApiResponse::handle() 메시지 로직 개선 (접미사 제거)
- 다국어 지원을 위한 완성된 문장 구조 유지
- FileUploadRequest 파일 검증 규칙 수정
fix: 파일 저장소 버그 수정 및 신규 테넌트 폴더 자동 생성
- FolderSeeder 네임스페이스 수정 (App\Models\Tenant → App\Models\Tenants\Tenant)
- FileStorageController use 문 구문 오류 수정 (/ → \)
- TenantObserver에 신규 테넌트 기본 폴더 자동 생성 로직 추가
- 5개 기본 폴더 (생산관리, 품질관리, 회계, 인사, 일반)
- 에러 처리 및 로깅
- 회원가입 시 자동 실행
2025-11-10 19:08:56 +09:00
|
|
|
### file_share_links
|
|
|
|
|
**모델**: `App\Models\FileShareLink`
|
|
|
|
|
|
2025-11-11 11:30:17 +09:00
|
|
|
- **file()**: belongsTo → `files`
|
|
|
|
|
- **tenant()**: belongsTo → `tenants`
|
feat: 파일 저장 시스템 DB 마이그레이션
- enhance_files_table: 이중 파일명 시스템 (display_name/stored_name), 폴더 관리, 문서 연결 지원
- create_folders_table: 동적 폴더 관리 시스템 (tenant별 커스터마이징 가능)
- 5개 stub 마이그레이션 생성 (file_share_links, file_deletion_logs, storage_usage_history, add_storage_columns_to_tenants)
- FolderSeeder stub 생성
- CURRENT_WORKS.md에 Phase 1 진행상황 문서화
fix: 파일 공유 및 삭제 기능 버그 수정
- ShareLinkRequest: PATH 파라미터 {id}를 file_id로 자동 병합
- routes/api.php: 공유 링크 다운로드를 auth.apikey 그룹 밖으로 이동 (인증 불필요)
- FileShareLink: File, Tenant 클래스 import 추가
- File 모델: softDeleteFile()에서 SoftDeletes의 delete() 메서드 사용
- FileStorageService: getTrash(), restoreFile(), permanentDelete()에서 onlyTrashed() 사용
- File 모델: Tenant 네임스페이스 수정 (App\Models\Tenants\Tenant)
refactor: Swagger 문서 정리 - File 태그를 Files로 통합
- FileApi.php의 모든 태그를 Files로 변경
- 구 파일 시스템 라우트 삭제 (prefix 'file')
- 구 FileController.php 삭제
- 신규 파일 저장소 시스템으로 완전 통합
fix: 모든 legacy 파일 컬럼 nullable 일괄 처리
- 5개 legacy 컬럼을 한 번에 nullable로 변경
* original_name, file_name, file_name_old (string)
* fileable_id, fileable_type (polymorphic)
- foreach 루프로 반복 작업 자동화
- 신규/기존 시스템 간 완전한 하위 호환성 확보
fix: legacy 파일 컬럼 nullable 처리 완료
- file_name, file_name_old 컬럼도 nullable로 변경
- 기존 시스템과 신규 시스템 간 완전한 하위 호환성 확보
- Legacy: original_name, file_name, file_name_old (nullable)
- New: display_name, stored_name (required)
fix: original_name 컬럼 nullable 처리
- original_name을 nullable로 변경하여 하위 호환성 유지
- 새 시스템에서는 display_name 사용, 기존 시스템은 original_name 사용 가능
fix: 파일 업로드 DB 컬럼 누락 및 메시지 구조 개선
- files 테이블에 감사 컬럼 추가 (created_by, updated_by, uploaded_by)
- ApiResponse::handle() 메시지 로직 개선 (접미사 제거)
- 다국어 지원을 위한 완성된 문장 구조 유지
- FileUploadRequest 파일 검증 규칙 수정
fix: 파일 저장소 버그 수정 및 신규 테넌트 폴더 자동 생성
- FolderSeeder 네임스페이스 수정 (App\Models\Tenant → App\Models\Tenants\Tenant)
- FileStorageController use 문 구문 오류 수정 (/ → \)
- TenantObserver에 신규 테넌트 기본 폴더 자동 생성 로직 추가
- 5개 기본 폴더 (생산관리, 품질관리, 회계, 인사, 일반)
- 에러 처리 및 로깅
- 회원가입 시 자동 실행
2025-11-10 19:08:56 +09:00
|
|
|
|
|
|
|
|
### folders
|
|
|
|
|
**모델**: `App\Models\Folder`
|
|
|
|
|
|
|
|
|
|
|
feat: ItemMaster 데이터베이스 구조 구축 (9개 테이블)
- 마이그레이션 9개 생성 (unit_options, section_templates, item_master_fields, item_pages, item_sections, item_fields, item_bom_items, custom_tabs, tab_columns)
- Eloquent 모델 9개 구현 (ItemMaster 네임스페이스)
- ItemMasterSeeder 작성 및 테스트 데이터 생성
주요 특징:
- Multi-tenant 지원 (BelongsToTenant trait)
- Soft Delete 적용 (deleted_at, deleted_by)
- 감사 로그 지원 (created_by, updated_by)
- JSON 필드로 동적 속성 지원 (display_condition, validation_rules, options, properties)
- FK 제약조건 및 Composite Index 설정
- 계층 구조 (ItemPage → ItemSection → ItemField/ItemBomItem)
SAM API Development Rules 준수
2025-11-20 16:36:55 +09:00
|
|
|
### custom_tabs
|
|
|
|
|
**모델**: `App\Models\ItemMaster\CustomTab`
|
|
|
|
|
|
|
|
|
|
- **columnSetting()**: hasOne → `tab_columns`
|
|
|
|
|
|
2025-11-26 14:09:31 +09:00
|
|
|
### entity_relationships
|
|
|
|
|
**모델**: `App\Models\ItemMaster\EntityRelationship`
|
|
|
|
|
|
|
|
|
|
- **parent()**: morphTo → `(Polymorphic)`
|
|
|
|
|
- **child()**: morphTo → `(Polymorphic)`
|
|
|
|
|
|
feat: ItemMaster 데이터베이스 구조 구축 (9개 테이블)
- 마이그레이션 9개 생성 (unit_options, section_templates, item_master_fields, item_pages, item_sections, item_fields, item_bom_items, custom_tabs, tab_columns)
- Eloquent 모델 9개 구현 (ItemMaster 네임스페이스)
- ItemMasterSeeder 작성 및 테스트 데이터 생성
주요 특징:
- Multi-tenant 지원 (BelongsToTenant trait)
- Soft Delete 적용 (deleted_at, deleted_by)
- 감사 로그 지원 (created_by, updated_by)
- JSON 필드로 동적 속성 지원 (display_condition, validation_rules, options, properties)
- FK 제약조건 및 Composite Index 설정
- 계층 구조 (ItemPage → ItemSection → ItemField/ItemBomItem)
SAM API Development Rules 준수
2025-11-20 16:36:55 +09:00
|
|
|
### item_pages
|
|
|
|
|
**모델**: `App\Models\ItemMaster\ItemPage`
|
|
|
|
|
|
2025-11-26 14:09:31 +09:00
|
|
|
- **sectionRelationships()**: hasMany → `entity_relationships`
|
|
|
|
|
- **fieldRelationships()**: hasMany → `entity_relationships`
|
|
|
|
|
- **allRelationships()**: hasMany → `entity_relationships`
|
feat: ItemMaster 데이터베이스 구조 구축 (9개 테이블)
- 마이그레이션 9개 생성 (unit_options, section_templates, item_master_fields, item_pages, item_sections, item_fields, item_bom_items, custom_tabs, tab_columns)
- Eloquent 모델 9개 구현 (ItemMaster 네임스페이스)
- ItemMasterSeeder 작성 및 테스트 데이터 생성
주요 특징:
- Multi-tenant 지원 (BelongsToTenant trait)
- Soft Delete 적용 (deleted_at, deleted_by)
- 감사 로그 지원 (created_by, updated_by)
- JSON 필드로 동적 속성 지원 (display_condition, validation_rules, options, properties)
- FK 제약조건 및 Composite Index 설정
- 계층 구조 (ItemPage → ItemSection → ItemField/ItemBomItem)
SAM API Development Rules 준수
2025-11-20 16:36:55 +09:00
|
|
|
|
|
|
|
|
### item_sections
|
|
|
|
|
**모델**: `App\Models\ItemMaster\ItemSection`
|
|
|
|
|
|
2025-11-26 14:09:31 +09:00
|
|
|
- **fieldRelationships()**: hasMany → `entity_relationships`
|
|
|
|
|
- **bomRelationships()**: hasMany → `entity_relationships`
|
|
|
|
|
- **allChildRelationships()**: hasMany → `entity_relationships`
|
feat: ItemMaster 데이터베이스 구조 구축 (9개 테이블)
- 마이그레이션 9개 생성 (unit_options, section_templates, item_master_fields, item_pages, item_sections, item_fields, item_bom_items, custom_tabs, tab_columns)
- Eloquent 모델 9개 구현 (ItemMaster 네임스페이스)
- ItemMasterSeeder 작성 및 테스트 데이터 생성
주요 특징:
- Multi-tenant 지원 (BelongsToTenant trait)
- Soft Delete 적용 (deleted_at, deleted_by)
- 감사 로그 지원 (created_by, updated_by)
- JSON 필드로 동적 속성 지원 (display_condition, validation_rules, options, properties)
- FK 제약조건 및 Composite Index 설정
- 계층 구조 (ItemPage → ItemSection → ItemField/ItemBomItem)
SAM API Development Rules 준수
2025-11-20 16:36:55 +09:00
|
|
|
|
|
|
|
|
### tab_columns
|
|
|
|
|
**모델**: `App\Models\ItemMaster\TabColumn`
|
|
|
|
|
|
|
|
|
|
- **tab()**: belongsTo → `custom_tabs`
|
|
|
|
|
|
2025-10-14 22:26:15 +09:00
|
|
|
### main_requests
|
|
|
|
|
**모델**: `App\Models\MainRequest`
|
|
|
|
|
|
|
|
|
|
- **flows()**: hasMany → `main_request_flows`
|
|
|
|
|
|
|
|
|
|
### main_request_flows
|
|
|
|
|
**모델**: `App\Models\MainRequestFlow`
|
|
|
|
|
|
|
|
|
|
- **mainRequest()**: belongsTo → `main_requests`
|
|
|
|
|
- **flowable()**: morphTo → `(Polymorphic)`
|
|
|
|
|
|
|
|
|
|
### materials
|
|
|
|
|
**모델**: `App\Models\Materials\Material`
|
|
|
|
|
|
|
|
|
|
- **receipts()**: hasMany → `material_receipts`
|
|
|
|
|
- **lots()**: hasMany → `lots`
|
|
|
|
|
- **files()**: morphMany → `files`
|
|
|
|
|
|
|
|
|
|
### material_inspections
|
|
|
|
|
**모델**: `App\Models\Materials\MaterialInspection`
|
|
|
|
|
|
|
|
|
|
- **receipt()**: belongsTo → `material_receipts`
|
|
|
|
|
- **items()**: hasMany → `material_inspection_items`
|
|
|
|
|
|
|
|
|
|
### material_inspection_items
|
|
|
|
|
**모델**: `App\Models\Materials\MaterialInspectionItem`
|
|
|
|
|
|
|
|
|
|
- **inspection()**: belongsTo → `material_inspections`
|
|
|
|
|
|
|
|
|
|
### material_receipts
|
|
|
|
|
**모델**: `App\Models\Materials\MaterialReceipt`
|
|
|
|
|
|
|
|
|
|
- **material()**: belongsTo → `materials`
|
|
|
|
|
- **inspections()**: hasMany → `material_inspections`
|
|
|
|
|
|
|
|
|
|
### users
|
|
|
|
|
**모델**: `App\Models\Members\User`
|
|
|
|
|
|
|
|
|
|
- **userTenants()**: hasMany → `user_tenants`
|
|
|
|
|
- **userRoles()**: hasMany → `user_roles`
|
|
|
|
|
- **userTenant()**: hasOne → `user_tenants`
|
|
|
|
|
- **userTenantById()**: hasOne → `user_tenants`
|
|
|
|
|
- **tenantsMembership()**: belongsToMany → `tenants`
|
|
|
|
|
- **files()**: morphMany → `files`
|
|
|
|
|
|
|
|
|
|
### user_menu_permissions
|
|
|
|
|
**모델**: `App\Models\Members\UserMenuPermission`
|
|
|
|
|
|
|
|
|
|
- **user()**: belongsTo → `users`
|
|
|
|
|
- **menu()**: belongsTo → `menus`
|
|
|
|
|
|
|
|
|
|
### user_roles
|
|
|
|
|
**모델**: `App\Models\Members\UserRole`
|
|
|
|
|
|
|
|
|
|
- **user()**: belongsTo → `users`
|
|
|
|
|
- **tenant()**: belongsTo → `tenants`
|
|
|
|
|
- **role()**: belongsTo → `roles`
|
|
|
|
|
|
|
|
|
|
### user_tenants
|
|
|
|
|
**모델**: `App\Models\Members\UserTenant`
|
|
|
|
|
|
|
|
|
|
- **user()**: belongsTo → `users`
|
|
|
|
|
- **tenant()**: belongsTo → `tenants`
|
|
|
|
|
|
|
|
|
|
### clients
|
|
|
|
|
**모델**: `App\Models\Orders\Client`
|
|
|
|
|
|
|
|
|
|
- **clientGroup()**: belongsTo → `client_groups`
|
|
|
|
|
- **orders()**: hasMany → `orders`
|
|
|
|
|
|
|
|
|
|
### client_groups
|
|
|
|
|
**모델**: `App\Models\Orders\ClientGroup`
|
|
|
|
|
|
|
|
|
|
- **clients()**: hasMany → `clients`
|
|
|
|
|
|
|
|
|
|
### orders
|
|
|
|
|
**모델**: `App\Models\Orders\Order`
|
|
|
|
|
|
|
|
|
|
- **items()**: hasMany → `order_items`
|
|
|
|
|
- **histories()**: hasMany → `order_histories`
|
|
|
|
|
- **versions()**: hasMany → `order_versions`
|
|
|
|
|
|
|
|
|
|
### order_historys
|
|
|
|
|
**모델**: `App\Models\Orders\OrderHistory`
|
|
|
|
|
|
|
|
|
|
- **order()**: belongsTo → `orders`
|
|
|
|
|
|
|
|
|
|
### order_items
|
|
|
|
|
**모델**: `App\Models\Orders\OrderItem`
|
|
|
|
|
|
|
|
|
|
- **order()**: belongsTo → `orders`
|
|
|
|
|
- **components()**: hasMany → `order_item_components`
|
|
|
|
|
|
|
|
|
|
### order_item_components
|
|
|
|
|
**모델**: `App\Models\Orders\OrderItemComponent`
|
|
|
|
|
|
|
|
|
|
- **orderItem()**: belongsTo → `order_items`
|
|
|
|
|
|
|
|
|
|
### order_versions
|
|
|
|
|
**모델**: `App\Models\Orders\OrderVersion`
|
|
|
|
|
|
|
|
|
|
- **order()**: belongsTo → `orders`
|
|
|
|
|
|
|
|
|
|
### permissions
|
|
|
|
|
**모델**: `App\Models\Permissions\Permission`
|
|
|
|
|
|
|
|
|
|
- **tenant()**: belongsTo → `tenants`
|
|
|
|
|
|
|
|
|
|
### permission_overrides
|
|
|
|
|
**모델**: `App\Models\Permissions\PermissionOverride`
|
|
|
|
|
|
|
|
|
|
- **permission()**: belongsTo → `permissions`
|
|
|
|
|
|
|
|
|
|
### roles
|
|
|
|
|
**모델**: `App\Models\Permissions\Role`
|
|
|
|
|
|
|
|
|
|
- **tenant()**: belongsTo → `tenants`
|
|
|
|
|
- **menuPermissions()**: hasMany → `role_menu_permissions`
|
|
|
|
|
- **userRoles()**: hasMany → `user_roles`
|
|
|
|
|
|
|
|
|
|
### role_menu_permissions
|
|
|
|
|
**모델**: `App\Models\Permissions\RoleMenuPermission`
|
|
|
|
|
|
|
|
|
|
- **role()**: belongsTo → `roles`
|
|
|
|
|
- **menu()**: belongsTo → `menus`
|
|
|
|
|
|
|
|
|
|
### common_codes
|
|
|
|
|
**모델**: `App\Models\Products\CommonCode`
|
|
|
|
|
|
|
|
|
|
- **parent()**: belongsTo → `common_codes`
|
|
|
|
|
- **children()**: hasMany → `common_codes`
|
|
|
|
|
|
|
|
|
|
### parts
|
|
|
|
|
**모델**: `App\Models\Products\Part`
|
|
|
|
|
|
|
|
|
|
- **category()**: belongsTo → `common_codes`
|
|
|
|
|
- **partType()**: belongsTo → `common_codes`
|
|
|
|
|
|
|
|
|
|
### price_historys
|
|
|
|
|
**모델**: `App\Models\Products\PriceHistory`
|
|
|
|
|
|
|
|
|
|
- **clientGroup()**: belongsTo → `client_groups`
|
|
|
|
|
|
|
|
|
|
### products
|
|
|
|
|
**모델**: `App\Models\Products\Product`
|
|
|
|
|
|
|
|
|
|
- **category()**: belongsTo → `categories`
|
|
|
|
|
- **componentLines()**: hasMany → `product_components`
|
|
|
|
|
- **parentLines()**: hasMany → `product_components`
|
|
|
|
|
- **children()**: belongsToMany → `products`
|
|
|
|
|
- **parents()**: belongsToMany → `products`
|
|
|
|
|
- **files()**: morphMany → `files`
|
|
|
|
|
|
|
|
|
|
### product_components
|
|
|
|
|
**모델**: `App\Models\Products\ProductComponent`
|
|
|
|
|
|
|
|
|
|
- **parentProduct()**: belongsTo → `products`
|
|
|
|
|
- **product()**: belongsTo → `products`
|
|
|
|
|
- **material()**: belongsTo → `materials`
|
|
|
|
|
|
|
|
|
|
### lots
|
|
|
|
|
**모델**: `App\Models\Qualitys\Lot`
|
|
|
|
|
|
|
|
|
|
- **material()**: belongsTo → `materials`
|
|
|
|
|
- **sales()**: hasMany → `lot_sales`
|
|
|
|
|
|
|
|
|
|
### lot_sales
|
|
|
|
|
**모델**: `App\Models\Qualitys\LotSale`
|
|
|
|
|
|
|
|
|
|
- **lot()**: belongsTo → `lots`
|
|
|
|
|
|
2025-12-04 22:22:46 +09:00
|
|
|
### quotes
|
|
|
|
|
**모델**: `App\Models\Quote\Quote`
|
|
|
|
|
|
|
|
|
|
- **client()**: belongsTo → `clients`
|
|
|
|
|
- **finalizer()**: belongsTo → `users`
|
|
|
|
|
- **creator()**: belongsTo → `users`
|
|
|
|
|
- **updater()**: belongsTo → `users`
|
|
|
|
|
- **items()**: hasMany → `quote_items`
|
|
|
|
|
- **revisions()**: hasMany → `quote_revisions`
|
|
|
|
|
|
|
|
|
|
### quote_items
|
|
|
|
|
**모델**: `App\Models\Quote\QuoteItem`
|
|
|
|
|
|
|
|
|
|
- **quote()**: belongsTo → `quotes`
|
|
|
|
|
|
|
|
|
|
### quote_revisions
|
|
|
|
|
**모델**: `App\Models\Quote\QuoteRevision`
|
|
|
|
|
|
|
|
|
|
- **quote()**: belongsTo → `quotes`
|
|
|
|
|
- **reviser()**: belongsTo → `users`
|
|
|
|
|
|
2025-10-14 22:26:15 +09:00
|
|
|
### departments
|
|
|
|
|
**모델**: `App\Models\Tenants\Department`
|
|
|
|
|
|
|
|
|
|
- **parent()**: belongsTo → `departments`
|
|
|
|
|
- **children()**: hasMany → `departments`
|
|
|
|
|
- **departmentUsers()**: hasMany → `department_user`
|
|
|
|
|
- **users()**: belongsToMany → `users`
|
|
|
|
|
- **permissionOverrides()**: morphMany → `permission_overrides`
|
|
|
|
|
|
|
|
|
|
### payments
|
|
|
|
|
**모델**: `App\Models\Tenants\Payment`
|
|
|
|
|
|
|
|
|
|
- **subscription()**: belongsTo → `subscriptions`
|
|
|
|
|
|
|
|
|
|
### department_users
|
|
|
|
|
**모델**: `App\Models\Tenants\Pivots\DepartmentUser`
|
|
|
|
|
|
|
|
|
|
- **department()**: belongsTo → `departments`
|
|
|
|
|
- **user()**: belongsTo → `users`
|
|
|
|
|
|
|
|
|
|
### plans
|
|
|
|
|
**모델**: `App\Models\Tenants\Plan`
|
|
|
|
|
|
|
|
|
|
- **subscriptions()**: hasMany → `subscriptions`
|
|
|
|
|
|
|
|
|
|
### setting_field_defs
|
|
|
|
|
**모델**: `App\Models\Tenants\SettingFieldDef`
|
|
|
|
|
|
|
|
|
|
- **tenantSettings()**: hasMany → `tenant_field_settings`
|
|
|
|
|
|
|
|
|
|
### subscriptions
|
|
|
|
|
**모델**: `App\Models\Tenants\Subscription`
|
|
|
|
|
|
|
|
|
|
- **tenant()**: belongsTo → `tenants`
|
|
|
|
|
- **plan()**: belongsTo → `plans`
|
|
|
|
|
- **payments()**: hasMany → `payments`
|
|
|
|
|
|
|
|
|
|
### tenants
|
|
|
|
|
**모델**: `App\Models\Tenants\Tenant`
|
|
|
|
|
|
|
|
|
|
- **plan()**: belongsTo → `plans`
|
|
|
|
|
- **subscription()**: belongsTo → `subscriptions`
|
|
|
|
|
- **userTenants()**: hasMany → `user_tenants`
|
|
|
|
|
- **roles()**: hasMany → `roles`
|
|
|
|
|
- **userRoles()**: hasMany → `user_roles`
|
|
|
|
|
- **users()**: belongsToMany → `users`
|
|
|
|
|
- **files()**: morphMany → `files`
|
|
|
|
|
|
|
|
|
|
### tenant_field_settings
|
|
|
|
|
**모델**: `App\Models\Tenants\TenantFieldSetting`
|
|
|
|
|
|
|
|
|
|
- **fieldDef()**: belongsTo → `setting_field_defs`
|
|
|
|
|
- **optionGroup()**: belongsTo → `tenant_option_groups`
|
|
|
|
|
|
|
|
|
|
### tenant_option_groups
|
|
|
|
|
**모델**: `App\Models\Tenants\TenantOptionGroup`
|
|
|
|
|
|
|
|
|
|
- **values()**: hasMany → `tenant_option_values`
|
|
|
|
|
|
|
|
|
|
### tenant_option_values
|
|
|
|
|
**모델**: `App\Models\Tenants\TenantOptionValue`
|
|
|
|
|
|
|
|
|
|
- **group()**: belongsTo → `tenant_option_groups`
|
|
|
|
|
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
### tenant_stat_fields
|
|
|
|
|
**모델**: `App\Models\Tenants\TenantStatField`
|
|
|
|
|
|
|
|
|
|
- **tenant()**: belongsTo → `tenants`
|
|
|
|
|
|
2025-10-14 22:26:15 +09:00
|
|
|
### tenant_user_profiles
|
|
|
|
|
**모델**: `App\Models\Tenants\TenantUserProfile`
|
|
|
|
|
|
|
|
|
|
- **user()**: belongsTo → `users`
|
|
|
|
|
- **department()**: belongsTo → `departments`
|
2025-09-24 22:30:28 +09:00
|
|
|
|