diff --git a/app/Services/ItemMaster/ItemMasterService.php b/app/Services/ItemMaster/ItemMasterService.php index b70394f..fbd61c5 100644 --- a/app/Services/ItemMaster/ItemMasterService.php +++ b/app/Services/ItemMaster/ItemMasterService.php @@ -18,6 +18,7 @@ class ItemMasterService extends Service * * - pages (linkedSections 기반 중첩) * - sections (모든 독립 섹션) + * - fields (모든 독립 필드) * - customTabs (columnSetting 포함) * - unitOptions */ @@ -67,9 +68,15 @@ public function init(): array // 5. 단위 옵션 $unitOptions = UnitOption::where('tenant_id', $tenantId)->get(); + // 6. 모든 필드 목록 (재사용 가능 목록) + $fields = ItemField::where('tenant_id', $tenantId) + ->orderBy('created_at', 'desc') + ->get(); + return [ 'pages' => $pagesWithSections, 'sections' => $sections, + 'fields' => $fields, 'customTabs' => $customTabs, 'unitOptions' => $unitOptions, ]; diff --git a/app/Swagger/v1/ItemMasterApi.php b/app/Swagger/v1/ItemMasterApi.php index 3b7c71f..1cb1d73 100644 --- a/app/Swagger/v1/ItemMasterApi.php +++ b/app/Swagger/v1/ItemMasterApi.php @@ -412,6 +412,14 @@ * ), * * @OA\Property( + * property="fields", + * type="array", + * description="모든 독립 필드 목록 (재사용 가능)", + * + * @OA\Items(ref="#/components/schemas/ItemField") + * ), + * + * @OA\Property( * property="customTabs", * type="array", *