diff --git a/CLAUDE.md b/CLAUDE.md index 2b6924c..402eac7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -509,6 +509,7 @@ ### 2. Multi-tenancy & Models - SoftDeletes by default - Common columns: tenant_id, created_by, updated_by, deleted_by (COMMENT required) - FK constraints: Created during design, minimal in production +- **πŸ”΄ 쿼리 μˆ˜μ • μ‹œ λͺ¨λΈ μŠ€μ½”ν”„ μš°μ„ **: `where('컬럼', 'κ°’')` ν•˜λ“œμ½”λ”© 전에 λ°˜λ“œμ‹œ λͺ¨λΈμ— μ •μ˜λœ μŠ€μ½”ν”„(scopeActive λ“±)λ₯Ό λ¨Όμ € ν™•μΈν•˜κ³ , μŠ€μ½”ν”„κ°€ 있으면 `Model::active()` ν˜•νƒœλ‘œ μ‚¬μš©ν•  것 ### 3. Middleware Stack - ApiKeyMiddleware, CheckSwaggerAuth, CorsMiddleware, CheckPermission, PermMapper diff --git a/LOGICAL_RELATIONSHIPS.md b/LOGICAL_RELATIONSHIPS.md index 3f6f735..0e95e5b 100644 --- a/LOGICAL_RELATIONSHIPS.md +++ b/LOGICAL_RELATIONSHIPS.md @@ -1,6 +1,6 @@ # 논리적 λ°μ΄ν„°λ² μ΄μŠ€ 관계 λ¬Έμ„œ -> **μžλ™ 생성**: 2026-02-21 16:28:35 +> **μžλ™ 생성**: 2026-03-07 02:57:21 > **μ†ŒμŠ€**: Eloquent λͺ¨λΈ 관계 뢄석 ## πŸ“Š λͺ¨λΈλ³„ 관계 ν˜„ν™© @@ -580,17 +580,10 @@ ### roles **λͺ¨λΈ**: `App\Models\Permissions\Role` - **tenant()**: belongsTo β†’ `tenants` -- **menuPermissions()**: hasMany β†’ `role_menu_permissions` - **userRoles()**: hasMany β†’ `user_roles` - **users()**: belongsToMany β†’ `users` - **permissions()**: belongsToMany β†’ `permissions` -### role_menu_permissions -**λͺ¨λΈ**: `App\Models\Permissions\RoleMenuPermission` - -- **role()**: belongsTo β†’ `roles` -- **menu()**: belongsTo β†’ `menus` - ### popups **λͺ¨λΈ**: `App\Models\Popups\Popup` @@ -637,6 +630,7 @@ ### work_orders - **stepProgress()**: hasMany β†’ `work_order_step_progress` - **materialInputs()**: hasMany β†’ `work_order_material_inputs` - **shipments()**: hasMany β†’ `shipments` +- **inspections()**: hasMany β†’ `inspections` - **bendingDetail()**: hasOne β†’ `work_order_bending_details` - **documents()**: morphMany β†’ `documents` @@ -743,6 +737,7 @@ ### push_notification_settings ### inspections **λͺ¨λΈ**: `App\Models\Qualitys\Inspection` +- **workOrder()**: belongsTo β†’ `work_orders` - **item()**: belongsTo β†’ `items` - **inspector()**: belongsTo β†’ `users` - **creator()**: belongsTo β†’ `users` @@ -758,6 +753,38 @@ ### lot_sales - **lot()**: belongsTo β†’ `lots` +### performance_reports +**λͺ¨λΈ**: `App\Models\Qualitys\PerformanceReport` + +- **qualityDocument()**: belongsTo β†’ `quality_documents` +- **confirmer()**: belongsTo β†’ `users` +- **creator()**: belongsTo β†’ `users` + +### quality_documents +**λͺ¨λΈ**: `App\Models\Qualitys\QualityDocument` + +- **client()**: belongsTo β†’ `clients` +- **inspector()**: belongsTo β†’ `users` +- **creator()**: belongsTo β†’ `users` +- **documentOrders()**: hasMany β†’ `quality_document_orders` +- **locations()**: hasMany β†’ `quality_document_locations` +- **performanceReport()**: hasOne β†’ `performance_reports` + +### quality_document_locations +**λͺ¨λΈ**: `App\Models\Qualitys\QualityDocumentLocation` + +- **qualityDocument()**: belongsTo β†’ `quality_documents` +- **qualityDocumentOrder()**: belongsTo β†’ `quality_document_orders` +- **orderItem()**: belongsTo β†’ `order_items` +- **document()**: belongsTo β†’ `documents` + +### quality_document_orders +**λͺ¨λΈ**: `App\Models\Qualitys\QualityDocumentOrder` + +- **qualityDocument()**: belongsTo β†’ `quality_documents` +- **order()**: belongsTo β†’ `orders` +- **locations()**: hasMany β†’ `quality_document_locations` + ### quotes **λͺ¨λΈ**: `App\Models\Quote\Quote` @@ -836,6 +863,7 @@ ### approvals - **steps()**: hasMany β†’ `approval_steps` - **approverSteps()**: hasMany β†’ `approval_steps` - **referenceSteps()**: hasMany β†’ `approval_steps` +- **linkable()**: morphTo β†’ `(Polymorphic)` ### approval_forms **λͺ¨λΈ**: `App\Models\Tenants\ApprovalForm` @@ -933,6 +961,16 @@ ### expense_accounts - **vendor()**: belongsTo β†’ `clients` +### journal_entrys +**λͺ¨λΈ**: `App\Models\Tenants\JournalEntry` + +- **lines()**: hasMany β†’ `journal_entry_lines` + +### journal_entry_lines +**λͺ¨λΈ**: `App\Models\Tenants\JournalEntryLine` + +- **journalEntry()**: belongsTo β†’ `journal_entries` + ### leaves **λͺ¨λΈ**: `App\Models\Tenants\Leave` @@ -961,7 +999,10 @@ ### leave_policys ### loans **λͺ¨λΈ**: `App\Models\Tenants\Loan` +- **user()**: belongsTo β†’ `users` - **withdrawal()**: belongsTo β†’ `withdrawals` +- **creator()**: belongsTo β†’ `users` +- **updater()**: belongsTo β†’ `users` ### payments **λͺ¨λΈ**: `App\Models\Tenants\Payment` @@ -1043,6 +1084,7 @@ ### shipments - **creator()**: belongsTo β†’ `users` - **updater()**: belongsTo β†’ `users` - **items()**: hasMany β†’ `shipment_items` +- **vehicleDispatches()**: hasMany β†’ `shipment_vehicle_dispatches` ### shipment_items **λͺ¨λΈ**: `App\Models\Tenants\ShipmentItem` @@ -1050,6 +1092,11 @@ ### shipment_items - **shipment()**: belongsTo β†’ `shipments` - **stockLot()**: belongsTo β†’ `stock_lots` +### shipment_vehicle_dispatchs +**λͺ¨λΈ**: `App\Models\Tenants\ShipmentVehicleDispatch` + +- **shipment()**: belongsTo β†’ `shipments` + ### sites **λͺ¨λΈ**: `App\Models\Tenants\Site` @@ -1147,6 +1194,8 @@ ### tenant_user_profiles ### today_issues **λͺ¨λΈ**: `App\Models\Tenants\TodayIssue` +- **reader()**: belongsTo β†’ `users` +- **targetUser()**: belongsTo β†’ `users` ### withdrawals **λͺ¨λΈ**: `App\Models\Tenants\Withdrawal` diff --git a/config/logging.php b/config/logging.php index 4ed83fc..7955199 100644 --- a/config/logging.php +++ b/config/logging.php @@ -67,6 +67,7 @@ 'daily' => [ 'driver' => 'daily', + 'permission' => 0664, 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'debug'), 'days' => env('LOG_DAILY_DAYS', 14), @@ -138,6 +139,7 @@ */ 'api' => [ 'driver' => 'daily', + 'permission' => 0664, 'path' => storage_path('logs/api/api.log'), 'level' => 'info', 'days' => env('API_LOG_DAYS', 14), diff --git a/config/services.php b/config/services.php index 3865719..6a99ace 100644 --- a/config/services.php +++ b/config/services.php @@ -43,7 +43,7 @@ */ 'gemini' => [ 'api_key' => env('GEMINI_API_KEY'), - 'model' => env('GEMINI_MODEL', 'gemini-2.0-flash'), + 'model' => env('GEMINI_MODEL', 'gemini-2.5-flash'), 'base_url' => env('GEMINI_BASE_URL', 'https://generativelanguage.googleapis.com/v1beta'), ], diff --git a/docs/INDEX.md b/docs/INDEX.md index 948fb65..b80a841 100644 --- a/docs/INDEX.md +++ b/docs/INDEX.md @@ -37,7 +37,7 @@ ## πŸ”— ν”„λ‘œμ νŠΈ λ¬Έμ„œ (SAM/docs둜 이동됨) | 이전 μœ„μΉ˜ | μƒˆ μœ„μΉ˜ | μ„€λͺ… | |-----------|---------|------| -| `analysis/` | `docs/data/analysis/` | Item DB 뢄석 λ¬Έμ„œ | +| `analysis/` | `docs/dev/data/analysis/` | Item DB 뢄석 λ¬Έμ„œ | | `front/` | `docs/front/` | ν”„λ‘ νŠΈμ—”λ“œ μš”μ²­ λ¬Έμ„œ | | `specs/` | `docs/specs/` | κΈ°λŠ₯ μŠ€νŽ™ λ¬Έμ„œ | @@ -49,6 +49,6 @@ ## πŸ“ λ¬Έμ„œ μΆ”κ°€ κ°€μ΄λ“œ |-----------|-----------| | Swagger μŠ€νŽ™ | `api/docs/swagger/` | | API Flow ν…ŒμŠ€νŠΈ | `api/docs/api-flows/` λ˜λŠ” `flow-tests/` | -| ν”„λ‘œμ νŠΈ 뢄석 | `SAM/docs/data/` | +| ν”„λ‘œμ νŠΈ 뢄석 | `SAM/docs/dev/data/` | | κΈ°λŠ₯ μŠ€νŽ™ | `SAM/docs/specs/` | | ν”„λ‘ νŠΈ μš”μ²­ | `SAM/docs/front/` | diff --git a/docs/changes/20251230_2339_quote_calculation_mng_logic.md b/docs/changes/20251230_2339_quote_calculation_mng_logic.md index ba01653..7571199 100644 --- a/docs/changes/20251230_2339_quote_calculation_mng_logic.md +++ b/docs/changes/20251230_2339_quote_calculation_mng_logic.md @@ -74,5 +74,5 @@ ## ⚠️ 배포 μ‹œ μ£Όμ˜μ‚¬ν•­ - ν…Œλ„ŒνŠΈλ³„ 초기 데이터 μ„€μ • ν•„μš” ## πŸ”— κ΄€λ ¨ λ¬Έμ„œ -- `docs/plans/quote-calculation-api-plan.md` +- `docs/dev/dev_plans/quote-calculation-api-plan.md` - `mng/app/Services/Quote/FormulaEvaluatorService.php` (원본) diff --git a/docs/changes/20260102_1300_quote_bom_bulk_calculation.md b/docs/changes/20260102_1300_quote_bom_bulk_calculation.md index a2fdb9c..8f5f65a 100644 --- a/docs/changes/20260102_1300_quote_bom_bulk_calculation.md +++ b/docs/changes/20260102_1300_quote_bom_bulk_calculation.md @@ -2,7 +2,7 @@ # λ³€κ²½ λ‚΄μš© μš”μ•½ **λ‚ μ§œ:** 2026-01-02 13:00 **μž‘μ—…λͺ…:** Phase 1.2 μž…λ ₯ λ³€μˆ˜ 처리 - React QuoteItem λ§€ν•‘ -**κ³„νš λ¬Έμ„œ:** docs/plans/quote-calculation-api-plan.md +**κ³„νš λ¬Έμ„œ:** docs/dev/dev_plans/quote-calculation-api-plan.md ## λ³€κ²½ κ°œμš” @@ -151,4 +151,4 @@ ## API μ‚¬μš© μ˜ˆμ‹œ ## κ΄€λ ¨ λ¬Έμ„œ - Phase 1.1: `20251230_2339_quote_calculation_mng_logic.md` (BOM 단건 μ‚°μΆœ) -- κ³„νš λ¬Έμ„œ: `docs/plans/quote-calculation-api-plan.md` \ No newline at end of file +- κ³„νš λ¬Έμ„œ: `docs/dev/dev_plans/quote-calculation-api-plan.md` \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6898565..bb18a55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "api", + "name": "sam-api", "lockfileVersion": 3, "requires": true, "packages": {