- ItemsBomApi: {code} → {id} (10개 경로)
- BomCalculationApi: snake_case → camelCase 파라미터
- PermissionApi: {id} → 구체적 파라미터명 (dept_id, role_id, user_id)
- FieldProfileApi: opt-groups → settings/options, 중복 Fields 엔드포인트 제거
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
524 lines
19 KiB
PHP
524 lines
19 KiB
PHP
<?php
|
|
|
|
namespace App\Swagger\v1;
|
|
|
|
use OpenApi\Annotations as OA;
|
|
|
|
/**
|
|
* 전역 태그 선언
|
|
*
|
|
* @OA\Tag(name="Tenant.Option Groups", description="테넌트 관리형 옵션 그룹")
|
|
* @OA\Tag(name="Tenant.Option Values", description="옵션 그룹의 항목(값) 관리")
|
|
* @OA\Tag(name="Tenant.Profiles", description="테넌트별 회원 프로필 조회/수정")
|
|
*/
|
|
class FieldProfileApi
|
|
{
|
|
/**
|
|
* Option Group/Value 스키마
|
|
*
|
|
* @OA\Schema(
|
|
* schema="OptionGroup",
|
|
* type="object",
|
|
* required={"id","group_key","name"},
|
|
*
|
|
* @OA\Property(property="id", type="integer", example=3),
|
|
* @OA\Property(property="tenant_id", type="integer", example=1),
|
|
* @OA\Property(property="group_key", type="string", example="position"),
|
|
* @OA\Property(property="name", type="string", example="직급표(2025)"),
|
|
* @OA\Property(property="description", type="string", nullable=true, example="본사 기준")
|
|
* )
|
|
*
|
|
* @OA\Schema(
|
|
* schema="OptionGroupCreateRequest",
|
|
* type="object",
|
|
* required={"group_key","name"},
|
|
*
|
|
* @OA\Property(property="group_key", type="string", example="job_title"),
|
|
* @OA\Property(property="name", type="string", example="직책"),
|
|
* @OA\Property(property="description", type="string", nullable=true, example="영업조직용")
|
|
* )
|
|
*
|
|
* @OA\Schema(
|
|
* schema="OptionGroupUpdateRequest",
|
|
* type="object",
|
|
*
|
|
* @OA\Property(property="group_key", type="string", example="job_title"),
|
|
* @OA\Property(property="name", type="string", example="직책(개정)"),
|
|
* @OA\Property(property="description", type="string", nullable=true, example="영업/CS 통합")
|
|
* )
|
|
*
|
|
* @OA\Schema(
|
|
* schema="OptionValue",
|
|
* type="object",
|
|
* required={"id","group_id","value_key","value_label"},
|
|
*
|
|
* @OA\Property(property="id", type="integer", example=10),
|
|
* @OA\Property(property="group_id", type="integer", example=3),
|
|
* @OA\Property(property="value_key", type="string", example="manager"),
|
|
* @OA\Property(property="value_label", type="string", example="과장"),
|
|
* @OA\Property(property="sort_order", type="integer", example=30),
|
|
* @OA\Property(property="is_active", type="boolean", example=true)
|
|
* )
|
|
*
|
|
* @OA\Schema(
|
|
* schema="OptionValueCreateRequest",
|
|
* type="object",
|
|
* required={"value_key","value_label"},
|
|
*
|
|
* @OA\Property(property="value_key", type="string", example="director"),
|
|
* @OA\Property(property="value_label", type="string", example="이사"),
|
|
* @OA\Property(property="sort_order", type="integer", example=40),
|
|
* @OA\Property(property="is_active", type="boolean", example=true)
|
|
* )
|
|
*
|
|
* @OA\Schema(
|
|
* schema="OptionValueUpdateRequest",
|
|
* type="object",
|
|
*
|
|
* @OA\Property(property="value_key", type="string", example="director"),
|
|
* @OA\Property(property="value_label", type="string", example="이사"),
|
|
* @OA\Property(property="sort_order", type="integer", example=45),
|
|
* @OA\Property(property="is_active", type="boolean", example=false)
|
|
* )
|
|
*
|
|
* @OA\Schema(
|
|
* schema="OptionValueReorderRequest",
|
|
* type="object",
|
|
* required={"items"},
|
|
*
|
|
* @OA\Property(
|
|
* property="items",
|
|
* type="array",
|
|
* description="정렬 대상 목록",
|
|
*
|
|
* @OA\Items(
|
|
* type="object",
|
|
* required={"id","sort_order"},
|
|
*
|
|
* @OA\Property(property="id", type="integer", example=10),
|
|
* @OA\Property(property="sort_order", type="integer", example=100)
|
|
* )
|
|
* )
|
|
* )
|
|
*/
|
|
public function _optionSchemasNoop() {}
|
|
|
|
/**
|
|
* Profiles 스키마
|
|
*
|
|
* @OA\Schema(
|
|
* schema="Profile",
|
|
* type="object",
|
|
* description="테넌트별 사용자 프로필",
|
|
* required={"tenant_id","user_id"},
|
|
*
|
|
* @OA\Property(property="id", type="integer", example=101),
|
|
* @OA\Property(property="tenant_id", type="integer", example=1),
|
|
* @OA\Property(property="user_id", type="integer", example=55),
|
|
* @OA\Property(property="department_id", type="integer", nullable=true, example=12),
|
|
* @OA\Property(property="position_key", type="string", nullable=true, example="manager"),
|
|
* @OA\Property(property="job_title_key", type="string", nullable=true, example="lead_pm"),
|
|
* @OA\Property(property="work_location_key", type="string", nullable=true, example="seoul_hq"),
|
|
* @OA\Property(property="employment_type_key", type="string", nullable=true, example="regular"),
|
|
* @OA\Property(property="manager_user_id", type="integer", nullable=true, example=77),
|
|
* @OA\Property(property="display_name", type="string", nullable=true, example="김철수(영업1팀)"),
|
|
* @OA\Property(property="profile_photo_path", type="string", nullable=true, example="/uploads/tenant/1/avatar/55.png"),
|
|
* @OA\Property(property="json_extra", type="object", nullable=true,
|
|
* example={"employee_no":"A-001","entry_date":"2023-01-02","work_type":"hybrid"})
|
|
* )
|
|
*
|
|
* @OA\Schema(
|
|
* schema="ProfileUpdateRequest",
|
|
* type="object",
|
|
* description="프로필 수정 시, field_key: value 형태",
|
|
* example={
|
|
* "position":"manager",
|
|
* "employee_no":"A-001",
|
|
* "entry_date":"2023-01-02",
|
|
* "work_type":"hybrid"
|
|
* }
|
|
* )
|
|
* @OA\Schema(
|
|
* schema="ProfilePagination",
|
|
* type="object",
|
|
* description="LengthAwarePaginator 구조",
|
|
*
|
|
* @OA\Property(property="current_page", type="integer", example=1),
|
|
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/Profile")),
|
|
* @OA\Property(property="total", type="integer", example=3),
|
|
* @OA\Property(property="per_page", type="integer", example=20),
|
|
* @OA\Property(property="path", type="string", example="/api/v1/profiles")
|
|
* )
|
|
*/
|
|
public function _profileSchemasNoop() {}
|
|
|
|
/* =========================
|
|
====== Endpoints ========
|
|
========================= */
|
|
|
|
/**
|
|
* @OA\Get(
|
|
* path="/api/v1/settings/options",
|
|
* summary="옵션 그룹 목록",
|
|
* description="해당 테넌트의 옵션 그룹 목록을 페이징으로 반환합니다.",
|
|
* tags={"Tenant.Option Groups"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(ref="#/components/parameters/Page"),
|
|
* @OA\Parameter(ref="#/components/parameters/Size"),
|
|
* @OA\Parameter(name="q", in="query", required=false, description="검색어(그룹키/이름)", @OA\Schema(type="string", example="position")),
|
|
*
|
|
* @OA\Response(
|
|
* response=200,
|
|
* description="성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", type="object",
|
|
*
|
|
* @OA\Property(property="current_page", type="integer", example=1),
|
|
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/OptionGroup")),
|
|
* @OA\Property(property="total", type="integer", example=3)
|
|
* ))
|
|
* })
|
|
* ),
|
|
*
|
|
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
|
|
* )
|
|
*/
|
|
public function optGroupsIndex() {}
|
|
|
|
/**
|
|
* @OA\Post(
|
|
* path="/api/v1/settings/options",
|
|
* summary="옵션 그룹 생성",
|
|
* description="옵션 그룹을 생성합니다.",
|
|
* tags={"Tenant.Option Groups"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/OptionGroupCreateRequest")),
|
|
*
|
|
* @OA\Response(response=200, description="생성 성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/OptionGroup"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optGroupsStore() {}
|
|
|
|
/**
|
|
* @OA\Get(
|
|
* path="/api/v1/settings/options/{id}",
|
|
* summary="옵션 그룹 단건 조회",
|
|
* tags={"Tenant.Option Groups"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer", example=3)),
|
|
*
|
|
* @OA\Response(response=200, description="성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/OptionGroup"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optGroupsShow() {}
|
|
|
|
/**
|
|
* @OA\Patch(
|
|
* path="/api/v1/settings/options/{id}",
|
|
* summary="옵션 그룹 수정",
|
|
* tags={"Tenant.Option Groups"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer", example=3)),
|
|
*
|
|
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/OptionGroupUpdateRequest")),
|
|
*
|
|
* @OA\Response(response=200, description="수정 성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/OptionGroup"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optGroupsUpdate() {}
|
|
|
|
/**
|
|
* @OA\Delete(
|
|
* path="/api/v1/settings/options/{id}",
|
|
* summary="옵션 그룹 삭제",
|
|
* tags={"Tenant.Option Groups"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer", example=3)),
|
|
*
|
|
* @OA\Response(response=200, description="삭제 성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", type="object", nullable=true, example=null))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optGroupsDestroy() {}
|
|
|
|
/**
|
|
* @OA\Get(
|
|
* path="/api/v1/settings/options/{gid}/values",
|
|
* summary="옵션 값 목록",
|
|
* tags={"Tenant.Option Values"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="gid", in="path", required=true, @OA\Schema(type="integer", example=3)),
|
|
* @OA\Parameter(name="active_only", in="query", required=false, @OA\Schema(type="boolean", example=true)),
|
|
*
|
|
* @OA\Response(response=200, description="성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/OptionValue")))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optionValuesIndex() {}
|
|
|
|
/**
|
|
* @OA\Post(
|
|
* path="/api/v1/settings/options/{gid}/values",
|
|
* summary="옵션 값 생성",
|
|
* tags={"Tenant.Option Values"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="gid", in="path", required=true, @OA\Schema(type="integer", example=3)),
|
|
*
|
|
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/OptionValueCreateRequest")),
|
|
*
|
|
* @OA\Response(response=200, description="생성 성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/OptionValue"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optionValuesStore() {}
|
|
|
|
/**
|
|
* @OA\Get(
|
|
* path="/api/v1/settings/options/{gid}/values/{id}",
|
|
* summary="옵션 값 단건 조회",
|
|
* tags={"Tenant.Option Values"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="gid", in="path", required=true, @OA\Schema(type="integer", example=3)),
|
|
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer", example=10)),
|
|
*
|
|
* @OA\Response(response=200, description="성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/OptionValue"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optionValuesShow() {}
|
|
|
|
/**
|
|
* @OA\Patch(
|
|
* path="/api/v1/settings/options/{gid}/values/{id}",
|
|
* summary="옵션 값 수정",
|
|
* tags={"Tenant.Option Values"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="gid", in="path", required=true, @OA\Schema(type="integer", example=3)),
|
|
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer", example=10)),
|
|
*
|
|
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/OptionValueUpdateRequest")),
|
|
*
|
|
* @OA\Response(response=200, description="수정 성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/OptionValue"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optionValuesUpdate() {}
|
|
|
|
/**
|
|
* @OA\Delete(
|
|
* path="/api/v1/settings/options/{gid}/values/{id}",
|
|
* summary="옵션 값 삭제",
|
|
* tags={"Tenant.Option Values"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="gid", in="path", required=true, @OA\Schema(type="integer", example=3)),
|
|
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer", example=10)),
|
|
*
|
|
* @OA\Response(response=200, description="삭제 성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", type="object", nullable=true, example=null))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optionValuesDestroy() {}
|
|
|
|
/**
|
|
* @OA\Patch(
|
|
* path="/api/v1/settings/options/{gid}/values/reorder",
|
|
* summary="옵션 값 정렬 순서 일괄 변경",
|
|
* tags={"Tenant.Option Values"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="gid", in="path", required=true, @OA\Schema(type="integer", example=3)),
|
|
*
|
|
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/OptionValueReorderRequest")),
|
|
*
|
|
* @OA\Response(response=200, description="변경 성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", type="object", example={"reordered":true}))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function optionValuesReorder() {}
|
|
|
|
/**
|
|
* @OA\Get(
|
|
* path="/api/v1/profiles",
|
|
* summary="프로필 목록",
|
|
* description="테넌트 내 회원 프로필 목록을 페이징으로 반환합니다.",
|
|
* tags={"Tenant.Profiles"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(ref="#/components/parameters/Page"),
|
|
* @OA\Parameter(ref="#/components/parameters/Size"),
|
|
* @OA\Parameter(name="q", in="query", required=false, description="검색어(표기명/사번 등)", @OA\Schema(type="string", example="A-001")),
|
|
*
|
|
* @OA\Response(response=200, description="성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/ProfilePagination"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function profilesIndex() {}
|
|
|
|
/**
|
|
* @OA\Get(
|
|
* path="/api/v1/profiles/{userId}",
|
|
* summary="프로필 단건 조회",
|
|
* tags={"Tenant.Profiles"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="userId", in="path", required=true, @OA\Schema(type="integer", example=55)),
|
|
*
|
|
* @OA\Response(response=200, description="성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Profile"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function profilesShow() {}
|
|
|
|
/**
|
|
* @OA\Patch(
|
|
* path="/api/v1/profiles/{userId}",
|
|
* summary="프로필 수정(관리자)",
|
|
* description="관리자 권한으로 해당 사용자의 프로필을 수정합니다. 테넌트에서 enabled된 필드만 반영됩니다.",
|
|
* tags={"Tenant.Profiles"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Parameter(name="userId", in="path", required=true, @OA\Schema(type="integer", example=55)),
|
|
*
|
|
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/ProfileUpdateRequest")),
|
|
*
|
|
* @OA\Response(response=200, description="수정 성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Profile"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function profilesUpdate() {}
|
|
|
|
/**
|
|
* @OA\Get(
|
|
* path="/api/v1/profiles/me",
|
|
* summary="내 프로필 조회",
|
|
* tags={"Tenant.Profiles"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\Response(response=200, description="성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Profile"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function profilesMe() {}
|
|
|
|
/**
|
|
* @OA\Patch(
|
|
* path="/api/v1/profiles/me",
|
|
* summary="내 프로필 수정",
|
|
* tags={"Tenant.Profiles"},
|
|
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
|
|
*
|
|
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/ProfileUpdateRequest")),
|
|
*
|
|
* @OA\Response(response=200, description="수정 성공",
|
|
*
|
|
* @OA\JsonContent(allOf={
|
|
*
|
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
|
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Profile"))
|
|
* })
|
|
* )
|
|
* )
|
|
*/
|
|
public function profilesUpdateMe() {}
|
|
}
|