diff --git a/app/Services/RegisterService.php b/app/Services/RegisterService.php index 969cd87..9023ed6 100644 --- a/app/Services/RegisterService.php +++ b/app/Services/RegisterService.php @@ -106,7 +106,14 @@ public static function register(array $params): array // 10. Assign system_manager role to user $user->assignRole($role); - // 11. Return user and tenant data + // 11. Get created menus + $menus = Menu::whereIn('id', $menuIds) + ->orderBy('parent_id') + ->orderBy('sort_order') + ->get(['id', 'parent_id', 'name', 'url', 'icon', 'sort_order', 'is_external', 'external_url']) + ->toArray(); + + // 12. Return user, tenant, and menus data return [ 'user' => [ 'id' => $user->id, @@ -123,6 +130,7 @@ public static function register(array $params): array 'tenant_st_code' => $tenant->tenant_st_code, 'options' => $tenant->options, ], + 'menus' => $menus, ]; }); } diff --git a/app/Swagger/v1/RegisterApi.php b/app/Swagger/v1/RegisterApi.php index f809a90..4d06dcc 100644 --- a/app/Swagger/v1/RegisterApi.php +++ b/app/Swagger/v1/RegisterApi.php @@ -72,6 +72,22 @@ * @OA\Property(property="industry", type="string", example="IT/소프트웨어"), * nullable=true * ) + * ), + * @OA\Property( + * property="menus", + * type="array", + * description="생성된 테넌트의 기본 메뉴 목록 (9개: 대시보드, 기초정보관리, 제품관리, 거래처관리, BOM관리, 시스템관리, 사용자관리, 권한관리, 부서관리)", + * @OA\Items( + * type="object", + * @OA\Property(property="id", type="integer", example=1, description="메뉴 ID"), + * @OA\Property(property="parent_id", type="integer", example=null, nullable=true, description="상위 메뉴 ID (최상위 메뉴는 null)"), + * @OA\Property(property="name", type="string", example="대시보드", description="메뉴명"), + * @OA\Property(property="url", type="string", example="/dashboard", description="메뉴 URL"), + * @OA\Property(property="icon", type="string", example="dashboard", description="메뉴 아이콘"), + * @OA\Property(property="sort_order", type="integer", example=1, description="정렬 순서"), + * @OA\Property(property="is_external", type="integer", example=0, description="외부 링크 여부 (0: 내부, 1: 외부)"), + * @OA\Property(property="external_url", type="string", example=null, nullable=true, description="외부 링크 URL") + * ) * ) * ) * )