feat: init API 응답에 fields 목록 추가

- ItemMasterService: 모든 독립 필드 목록 반환 추가
- Swagger: ItemMasterInitResponse 스키마에 fields 속성 추가
This commit is contained in:
2025-11-27 17:33:23 +09:00
parent c5eee5561f
commit ebd59f220f
2 changed files with 15 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ class ItemMasterService extends Service
* *
* - pages (linkedSections 기반 중첩) * - pages (linkedSections 기반 중첩)
* - sections (모든 독립 섹션) * - sections (모든 독립 섹션)
* - fields (모든 독립 필드)
* - customTabs (columnSetting 포함) * - customTabs (columnSetting 포함)
* - unitOptions * - unitOptions
*/ */
@@ -67,9 +68,15 @@ public function init(): array
// 5. 단위 옵션 // 5. 단위 옵션
$unitOptions = UnitOption::where('tenant_id', $tenantId)->get(); $unitOptions = UnitOption::where('tenant_id', $tenantId)->get();
// 6. 모든 필드 목록 (재사용 가능 목록)
$fields = ItemField::where('tenant_id', $tenantId)
->orderBy('created_at', 'desc')
->get();
return [ return [
'pages' => $pagesWithSections, 'pages' => $pagesWithSections,
'sections' => $sections, 'sections' => $sections,
'fields' => $fields,
'customTabs' => $customTabs, 'customTabs' => $customTabs,
'unitOptions' => $unitOptions, 'unitOptions' => $unitOptions,
]; ];

View File

@@ -412,6 +412,14 @@
* ), * ),
* *
* @OA\Property( * @OA\Property(
* property="fields",
* type="array",
* description="모든 독립 필드 목록 (재사용 가능)",
*
* @OA\Items(ref="#/components/schemas/ItemField")
* ),
*
* @OA\Property(
* property="customTabs", * property="customTabs",
* type="array", * type="array",
* *