fix: ItemsFileController 파일 API 오류 수정
- delete() 메서드 타입을 mixed로 변경 + 내부 캐스팅
- userId null 처리 (auth()->id() ?? app('api_user'))
- deleteFile() private 메서드로 삭제 로직 일원화
- getFileUrl()을 file_id 기반으로 변경 (/api/v1/files/{id}/download)
- LOGICAL_RELATIONSHIPS.md items 통합 반영
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# 논리적 데이터베이스 관계 문서
|
||||
|
||||
> **자동 생성**: 2025-12-11 21:54:15
|
||||
> **자동 생성**: 2025-12-15 13:50:25
|
||||
> **소스**: Eloquent 모델 관계 분석
|
||||
|
||||
## 📊 모델별 관계 현황
|
||||
@@ -44,7 +44,6 @@ ### categorys
|
||||
|
||||
- **parent()**: belongsTo → `categories`
|
||||
- **children()**: hasMany → `categories`
|
||||
- **products()**: hasMany → `products`
|
||||
- **categoryFields()**: hasMany → `category_fields`
|
||||
|
||||
### category_fields
|
||||
@@ -163,6 +162,18 @@ ### tab_columns
|
||||
|
||||
- **tab()**: belongsTo → `custom_tabs`
|
||||
|
||||
### items
|
||||
**모델**: `App\Models\Items\Item`
|
||||
|
||||
- **category()**: belongsTo → `categories`
|
||||
- **details()**: hasOne → `item_details`
|
||||
- **files()**: morphMany → `files`
|
||||
|
||||
### item_details
|
||||
**모델**: `App\Models\Items\ItemDetail`
|
||||
|
||||
- **item()**: belongsTo → `items`
|
||||
|
||||
### main_requests
|
||||
**모델**: `App\Models\MainRequest`
|
||||
|
||||
@@ -174,14 +185,6 @@ ### main_request_flows
|
||||
- **mainRequest()**: belongsTo → `main_requests`
|
||||
- **flowable()**: morphTo → `(Polymorphic)`
|
||||
|
||||
### materials
|
||||
**모델**: `App\Models\Materials\Material`
|
||||
|
||||
- **category()**: belongsTo → `categories`
|
||||
- **receipts()**: hasMany → `material_receipts`
|
||||
- **lots()**: hasMany → `lots`
|
||||
- **files()**: morphMany → `files`
|
||||
|
||||
### material_inspections
|
||||
**모델**: `App\Models\Materials\MaterialInspection`
|
||||
|
||||
@@ -196,7 +199,7 @@ ### material_inspection_items
|
||||
### material_receipts
|
||||
**모델**: `App\Models\Materials\MaterialReceipt`
|
||||
|
||||
- **material()**: belongsTo → `materials`
|
||||
- **item()**: belongsTo → `items`
|
||||
- **inspections()**: hasMany → `material_inspections`
|
||||
|
||||
### users
|
||||
@@ -242,6 +245,7 @@ ### client_groups
|
||||
### orders
|
||||
**모델**: `App\Models\Orders\Order`
|
||||
|
||||
- **item()**: belongsTo → `items`
|
||||
- **items()**: hasMany → `order_items`
|
||||
- **histories()**: hasMany → `order_histories`
|
||||
- **versions()**: hasMany → `order_versions`
|
||||
@@ -255,6 +259,7 @@ ### order_items
|
||||
**모델**: `App\Models\Orders\OrderItem`
|
||||
|
||||
- **order()**: belongsTo → `orders`
|
||||
- **item()**: belongsTo → `items`
|
||||
- **components()**: hasMany → `order_item_components`
|
||||
|
||||
### order_item_components
|
||||
@@ -290,53 +295,10 @@ ### role_menu_permissions
|
||||
- **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`
|
||||
|
||||
### prices
|
||||
**모델**: `App\Models\Products\Price`
|
||||
|
||||
- **clientGroup()**: belongsTo → `client_groups`
|
||||
- **product()**: belongsTo → `products`
|
||||
- **material()**: belongsTo → `materials`
|
||||
- **revisions()**: hasMany → `price_revisions`
|
||||
|
||||
### price_revisions
|
||||
**모델**: `App\Models\Products\PriceRevision`
|
||||
|
||||
- **price()**: belongsTo → `prices`
|
||||
- **changedByUser()**: belongsTo → `users`
|
||||
|
||||
### 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`
|
||||
- **item()**: belongsTo → `items`
|
||||
- **sales()**: hasMany → `lot_sales`
|
||||
|
||||
### lot_sales
|
||||
@@ -348,6 +310,7 @@ ### quotes
|
||||
**모델**: `App\Models\Quote\Quote`
|
||||
|
||||
- **client()**: belongsTo → `clients`
|
||||
- **item()**: belongsTo → `items`
|
||||
- **finalizer()**: belongsTo → `users`
|
||||
- **creator()**: belongsTo → `users`
|
||||
- **updater()**: belongsTo → `users`
|
||||
|
||||
Reference in New Issue
Block a user