이슈 본연: API 레퍼런스의 미채움 마커 5종(실측 제외/TODO/필드 없음/대표 에러 없음)
1,194건을 코드에서 읽어 전수 채우고(0건), api:docgen 재생성이 사람이 채운 내용을
손실·열화시키던 멱등성 결함 4종(CRLF, 표 파이프 이스케이프, 에러 서술 보존, 중복
라우트명 키)을 근본 수정. --check 를 실측 제외와 드리프트가 구분되도록 재정의.
ParameterDescriber/ResourceFieldDescriber 에 leaf 폴백·SEO 스코프·공통 사전 확장.
파생 결함(문서 실측 중 발견): ResponseHelper 기본 메시지 키 6종이 존재하지 않는
messages.* 를 가리켜 응답 message 가 번역문 대신 키 문자열로 노출되던 문제를 common.*
으로 정정하고, 코어 7 + gdpr/marketing/pay_kginicis/verification/ecommerce 확장의
호출부와 누락 lang 키(게시판 10키 + 이커머스 category_images 4키 포함)를 ko/en/ja
전수 정정. 중복 그룹 키 2건은 기존 키로 호출부 통합.
보안: GET /api/identity/challenges/{id} 는 권한 가드 없는 공개 폴링 엔드포인트인데
Service::getStatus 가 attempts/max_attempts 를 응답에 담아 남은 시도 횟수를 추론할 수
있었다. 두 필드를 제거하고, 챌린지 화면(admin_basic/basic)의 서버 attempts 참조를
제거(남은 횟수 UI 는 query fallback + verify 실패 시 로컬 증가로 유지).
부수 정리(변경셋에 들어온 board 컨트롤러의 audit 사전 결함): FormRequest 4개 신설로
base Request 주입 제거, CommentController 의 Board 직접 호출을 BoardService 위임으로
전환, PHPDoc @return 보강. board 스위트에서 발견한 stale test 3건(seed SSoT 불일치,
admin 계정 user 역할 누락)도 같은 세션에서 정정.
버전 정렬(공개 release 기준): 코어 7.0.3→7.0.4, sirsoft-board 1.0.1→1.0.2,
verification_kginicis 1.0.0→1.0.1, admin_basic 1.0.1→1.0.4.
21 KiB
Brands API 레퍼런스
소유: module
sirsoft-ecommerce· 생성:php artisan api:docgen(실측 기반). @generated 블록은 재생성 시 갱신되며, 사람이 작성한 설명은 보존됩니다.
TL;DR (5초 요약)
1. 이 문서는 실제 API 호출로 실측한 Brands 엔드포인트 레퍼런스입니다
2. 각 엔드포인트: 메서드/URI/권한 + 요청 파라미터 표 + 요청 예시(curl) + 실측 응답 필드 표 + 응답 예시(envelope)
3. 응답 필드의 예시값·응답 예시 JSON 은 실제 호출 응답에서 관측된 값입니다
4. 갱신: 코드 변경 후 php artisan api:docgen 재실행
5. 설명(TODO) 칸은 사람이 채웁니다
GET /api/modules/sirsoft-ecommerce/admin/brands
- 라우트명:
api.modules.sirsoft-ecommerce.admin.brands.index - 컨트롤러:
Modules\Sirsoft\Ecommerce\Http\Controllers\Admin\BrandController@index - 인증/권한:
auth:sanctum+permission:sirsoft-ecommerce.brands.read
요청 파라미터
| 이름 | 위치 | 타입 | 필수 | 허용값 | 용도 |
|---|---|---|---|---|---|
| is_active | query | boolean | 아니오 | — | 활성 여부 (true 활성 / false 비활성) |
| search | query | string | 아니오 | max 100 | 검색어 (지정한 검색 대상 필드에서 부분 일치) |
| sort | query | string | 아니오 | name_asc, name_desc, created_asc, created_desc |
정렬 기준 (필드명, - 접두 시 내림차순) |
| sort_by | query | string | 아니오 | name, sort_order |
정렬 기준 필드명 |
| sort_order | query | string | 아니오 | asc, desc |
정렬 방향 (asc 오름차순 / desc 내림차순) |
| locale | query | string | 아니오 | ko, en |
로케일 코드 (표시 언어/지역) |
요청 예시
GET /api/modules/sirsoft-ecommerce/admin/brands?is_active=1&search=%EC%98%88%EC%8B%9C%EA%B0%92&sort=name_asc&sort_by=name&sort_order=asc&locale=ko HTTP/1.1
Host: api.example.com
Accept: application/json
Authorization: Bearer {YOUR_TOKEN}
응답 필드 (data 내부)
목록 응답: data.data[] 배열 항목의 필드.
| 필드 | 타입 | 실측 예시값 | 용도/설명 |
|---|---|---|---|
| number | integer | 42 |
목록에서의 순번 (페이지네이션 반영 행 번호 — HasRowNumber 파생) |
| id | integer | 20 |
기본 키 (내부 식별자) |
| name | object | {"ko":"ASUS","en":"ASUS"} |
대상의 이름/명칭 (다국어 필드는 로케일별 값 객체) |
| localized_name | string | ASUS |
name 의 현재 로케일 해석 값 (다국어 필드를 표시용 문자열로 해석) |
| slug | string | asus |
URL 친화 식별자 (slug) |
| url | string | asus |
SortableMenuItem 표시용 URL (slug 값을 그대로 노출) |
| website | string | https://www.asus.com |
브랜드 공식 웹사이트 URL |
| sort_order | integer | 20 |
표시 정렬 순서 값 (작을수록 우선) |
| is_active | boolean | true |
active 여부 |
| icon | string | tag |
아이콘 식별자 (아이콘 클래스/이름) |
| created_at | string | 2026-07-30 23:35:46 |
생성 일시 |
| updated_at | string | 2026-07-30 23:35:46 |
최종 수정 일시 |
| creator | array | [] |
생성자 정보 객체 (uuid/name/email — creator 관계 파생) |
| updater | array | [] |
수정자 정보 객체 (id/name — updater 관계 파생, 로드 시에만 포함) |
| products_count | integer | 1 |
products 개수 (집계) |
| abilities | object | {"can_create":true,"can_update":true,"can_delete":true} |
현재 사용자가 이 리소스에 수행 가능한 작업 불리언 맵 (can_update, can_delete 등 — 권한 맵 기반) |
응답 예시
HTTP/1.1 200
{
"success": true,
"message": "브랜드 목록을 조회했습니다.",
"data": {
"data": [
{
"number": 42,
"id": 20,
"name": {
"ko": "ASUS",
"en": "ASUS"
},
"localized_name": "ASUS",
"slug": "asus",
"url": "asus",
"website": "https://www.asus.com",
"sort_order": 20,
"is_active": true,
"icon": "tag",
"created_at": "2026-07-30 23:35:46",
"updated_at": "2026-07-30 23:35:46",
"creator": [],
"updater": [],
"products_count": 1,
"abilities": {
"can_create": true,
"can_update": true,
"can_delete": true
}
},
{
"number": 41,
"id": 26,
"name": {
"ko": "CJ제일제당",
"en": "CJ CheilJedang"
},
"localized_name": "CJ제일제당",
"slug": "cj",
"url": "cj",
"website": "https://www.cj.co.kr",
"sort_order": 26,
"is_active": true,
"icon": "tag",
"created_at": "2026-07-30 23:35:46",
"updated_at": "2026-07-30 23:35:46",
"creator": [],
"updater": [],
"products_count": 0,
"abilities": {
"can_create": true,
"can_update": true,
"can_delete": true
}
},
"... (총 42건 중 2건 표시)"
],
"abilities": {
"can_create": true,
"can_update": true,
"can_delete": true
}
}
}
에러 응답
| 상태코드 | 의미 | 발생 조건 |
|---|---|---|
| 401 | Unauthenticated | 유효한 Bearer 토큰이 없거나 만료된 경우 |
| 403 | Forbidden | 요구 권한(sirsoft-ecommerce.brands.read)이 없는 경우 |
| 422 | Unprocessable Entity | 요청 파라미터가 검증 규칙을 위반한 경우 (error.errors 에 필드별 메시지) |
설명 관리자용 브랜드 목록을 조회합니다. auth:sanctum + sirsoft-ecommerce.brands.read 권한이 필요하며, BrandService::getAllBrands()가 검증된 필터를 받아 조회합니다. is_active·search로 필터링하고 sort(name_asc/desc, created_asc/desc) 또는 sort_by+sort_order 조합으로 정렬하며, locale로 표시 언어를 지정할 수 있습니다. 각 항목에는 products_count 집계와 현재 사용자의 abilities 맵이 포함됩니다.
POST /api/modules/sirsoft-ecommerce/admin/brands
- 라우트명:
api.modules.sirsoft-ecommerce.admin.brands.store - 컨트롤러:
Modules\Sirsoft\Ecommerce\Http\Controllers\Admin\BrandController@store - 인증/권한:
auth:sanctum+permission:sirsoft-ecommerce.brands.create
요청 파라미터
| 이름 | 위치 | 타입 | 필수 | 허용값 | 용도 |
|---|---|---|---|---|---|
| name | body | array | 예 | — | 대상의 이름/명칭 |
| slug | body | string | 예 | max 200 | URL 친화 식별자 (slug) |
| website | body | string | 아니오 | max 500 | 브랜드 공식 웹사이트 URL |
| sort_order | body | integer | 아니오 | min 0 | 표시 정렬 순서 값 (작을수록 우선) |
| is_active | body | boolean | 아니오 | — | 활성 여부 (true 활성 / false 비활성) |
이 엔드포인트는 확장이 파라미터를 추가할 수 있습니다 (
sirsoft-ecommerce.brand.create_validation_rules).
요청 예시
POST /api/modules/sirsoft-ecommerce/admin/brands HTTP/1.1
Host: api.example.com
Accept: application/json
Authorization: Bearer {YOUR_TOKEN}
Content-Type: application/json
{
"name": [
"예시 이름"
],
"slug": "example-key",
"website": "예시값",
"sort_order": 1,
"is_active": true
}
응답 필드 (data 내부)
단건 응답: data 객체의 필드 (BrandResource).
| 필드 | 타입 | 실측 예시값 | 용도/설명 |
|---|---|---|---|
| id | integer | 1 |
생성된 브랜드의 기본 키 (내부 식별자) |
| name | object | {"ko":"API 문서 샘플 브랜드","en":"API Doc Sample Brand"} |
브랜드 이름 (로케일별 값 객체) |
| localized_name | string | API 문서 샘플 브랜드 |
name 의 현재 로케일 해석 값 (표시용 문자열) |
| slug | string | apidoc-sample-brand |
URL 친화 식별자 (slug) |
| url | string | apidoc-sample-brand |
SortableMenuItem 표시용 URL (slug 값을 그대로 노출) |
| website | string | null | null |
브랜드 공식 웹사이트 URL (미입력 시 null) |
| sort_order | integer | 0 |
표시 정렬 순서 값 (작을수록 우선) |
| is_active | boolean | true |
활성 여부 |
| icon | string | tag |
SortableMenuList 컴포넌트용 아이콘 식별자 (고정값 tag) |
| created_at | string | 2026-07-08 10:44:49 |
생성 일시 (사용자 타임존 기준 문자열) |
| updated_at | string | 2026-07-08 10:44:49 |
최종 수정 일시 (사용자 타임존 기준 문자열) |
| products_count | integer | 0 |
브랜드에 연결된 상품 수 (생성 직후이므로 0) |
| abilities | object | {"can_create":true,"can_update":true,"can_delete":true} |
현재 사용자가 이 리소스에 수행 가능한 작업 불리언 맵 |
생성 직후에는
creator/updater관계가 로드되지 않으므로(whenLoaded) 응답에서 생략됩니다.
응답 예시
HTTP/1.1 201
{
"success": true,
"message": "브랜드가 등록되었습니다.",
"data": {
"id": 1,
"name": {
"ko": "API 문서 샘플 브랜드",
"en": "API Doc Sample Brand"
},
"localized_name": "API 문서 샘플 브랜드",
"slug": "apidoc-sample-brand",
"url": "apidoc-sample-brand",
"website": null,
"sort_order": 0,
"is_active": true,
"icon": "tag",
"created_at": "2026-07-08 10:44:49",
"updated_at": "2026-07-08 10:44:49",
"products_count": 0,
"abilities": {
"can_create": true,
"can_update": true,
"can_delete": true
}
}
}
에러 응답
| 상태코드 | 의미 | 발생 조건 |
|---|---|---|
| 401 | Unauthenticated | 유효한 Bearer 토큰이 없거나 만료된 경우 |
| 403 | Forbidden | 요구 권한(sirsoft-ecommerce.brands.create)이 없는 경우 |
| 422 | Unprocessable Entity | 요청 파라미터가 검증 규칙을 위반한 경우 (error.errors 에 필드별 메시지) |
설명 새 브랜드를 생성합니다. auth:sanctum + sirsoft-ecommerce.brands.create 권한이 필요하며, BrandService::createBrand()가 트랜잭션 내에서 저장하고 생성자/수정자(created_by/updated_by)를 현재 사용자로 기록한 뒤 BrandResource를 201로 반환합니다. name(다국어 배열)과 slug가 필수이며 website·sort_order·is_active는 선택입니다. sirsoft-ecommerce.brand.create_validation_rules 필터로 확장이 검증 규칙을 추가할 수 있습니다.
DELETE /api/modules/sirsoft-ecommerce/admin/brands/{brand}
- 라우트명:
api.modules.sirsoft-ecommerce.admin.brands.destroy - 컨트롤러:
Modules\Sirsoft\Ecommerce\Http\Controllers\Admin\BrandController@destroy - 인증/권한:
auth:sanctum+permission:sirsoft-ecommerce.brands.delete
요청 파라미터
| 이름 | 위치 | 타입 | 필수 | 허용값 | 용도 |
|---|---|---|---|---|---|
| brand | path | string | 예 | — | 대상 brand의 식별자 |
요청 예시
DELETE /api/modules/sirsoft-ecommerce/admin/brands/{brand} HTTP/1.1
Host: api.example.com
Accept: application/json
Authorization: Bearer {YOUR_TOKEN}
응답 필드 (data 내부)
응답 예시
에러 응답
| 상태코드 | 의미 | 발생 조건 |
|---|---|---|
| 401 | Unauthenticated | 유효한 Bearer 토큰이 없거나 만료된 경우 |
| 403 | Forbidden | 요구 권한(sirsoft-ecommerce.brands.delete)이 없는 경우 |
| 404 | Not Found | path 파라미터에 해당하는 리소스가 없는 경우 |
설명 브랜드 1건을 삭제합니다. auth:sanctum + sirsoft-ecommerce.brands.delete 권한이 필요하며, BrandService::deleteBrand()가 삭제 전 연결된 상품 수를 확인합니다. 연결된 상품이 1개 이상이면 예외가 발생해 삭제가 차단되고 400 오류가 반환되므로, 해당 브랜드의 상품을 먼저 정리하거나 다른 브랜드로 이전해야 삭제할 수 있습니다. 대상이 없으면 404를 반환합니다.
PUT /api/modules/sirsoft-ecommerce/admin/brands/{brand}
- 라우트명:
api.modules.sirsoft-ecommerce.admin.brands.update - 컨트롤러:
Modules\Sirsoft\Ecommerce\Http\Controllers\Admin\BrandController@update - 인증/권한:
auth:sanctum+permission:sirsoft-ecommerce.brands.update
요청 파라미터
| 이름 | 위치 | 타입 | 필수 | 허용값 | 용도 |
|---|---|---|---|---|---|
| brand | path | string | 예 | — | 대상 brand의 식별자 |
| name | body | array | 예 | — | 대상의 이름/명칭 |
| slug | body | string | 아니오 | — | URL 친화 식별자 (slug) |
| website | body | string | 아니오 | max 500 | 브랜드 공식 웹사이트 URL |
| sort_order | body | integer | 아니오 | min 0 | 표시 정렬 순서 값 (작을수록 우선) |
| is_active | body | boolean | 아니오 | — | 활성 여부 (true 활성 / false 비활성) |
이 엔드포인트는 확장이 파라미터를 추가할 수 있습니다 (
sirsoft-ecommerce.brand.update_validation_rules).
요청 예시
PUT /api/modules/sirsoft-ecommerce/admin/brands/{brand} HTTP/1.1
Host: api.example.com
Accept: application/json
Authorization: Bearer {YOUR_TOKEN}
Content-Type: application/json
{
"name": [
"예시 이름"
],
"slug": "example-key",
"website": "예시값",
"sort_order": 1,
"is_active": true
}
응답 필드 (data 내부)
단건 응답: data 객체의 필드 (BrandResource).
| 필드 | 타입 | 실측 예시값 | 용도/설명 |
|---|---|---|---|
| id | integer | 1 |
수정된 브랜드의 기본 키 (내부 식별자) |
| name | object | {"ko":"API 문서 샘플 브랜드","en":"API Doc Sample Brand"} |
브랜드 이름 (로케일별 값 객체) |
| localized_name | string | API 문서 샘플 브랜드 |
name 의 현재 로케일 해석 값 (표시용 문자열) |
| slug | string | apidoc-sample-brand |
URL 친화 식별자 (slug) |
| url | string | apidoc-sample-brand |
SortableMenuItem 표시용 URL (slug 값을 그대로 노출) |
| website | string | null | https://www.asus.com |
브랜드 공식 웹사이트 URL (미입력 시 null) |
| sort_order | integer | 0 |
표시 정렬 순서 값 (작을수록 우선) |
| is_active | boolean | true |
활성 여부 |
| icon | string | tag |
SortableMenuList 컴포넌트용 아이콘 식별자 (고정값 tag) |
| created_at | string | 2026-07-08 10:44:49 |
생성 일시 (사용자 타임존 기준 문자열) |
| updated_at | string | 2026-07-08 15:00:16 |
최종 수정 일시 (이번 수정 시각으로 갱신) |
| products_count | integer | 0 |
브랜드에 연결된 상품 수 |
| abilities | object | {"can_create":true,"can_update":true,"can_delete":true} |
현재 사용자가 이 리소스에 수행 가능한 작업 불리언 맵 |
수정 직후에는
creator/updater관계가 로드되지 않으므로(whenLoaded) 응답에서 생략됩니다.
응답 예시
HTTP/1.1 200
{
"success": true,
"message": "브랜드가 수정되었습니다.",
"data": {
"id": 1,
"name": {
"ko": "API 문서 샘플 브랜드",
"en": "API Doc Sample Brand"
},
"localized_name": "API 문서 샘플 브랜드",
"slug": "apidoc-sample-brand",
"url": "apidoc-sample-brand",
"website": "https://www.asus.com",
"sort_order": 0,
"is_active": true,
"icon": "tag",
"created_at": "2026-07-08 10:44:49",
"updated_at": "2026-07-08 15:00:16",
"products_count": 0,
"abilities": {
"can_create": true,
"can_update": true,
"can_delete": true
}
}
}
에러 응답
| 상태코드 | 의미 | 발생 조건 |
|---|---|---|
| 401 | Unauthenticated | 유효한 Bearer 토큰이 없거나 만료된 경우 |
| 403 | Forbidden | 요구 권한(sirsoft-ecommerce.brands.update)이 없는 경우 |
| 404 | Not Found | path 파라미터에 해당하는 리소스가 없는 경우 |
| 422 | Unprocessable Entity | 요청 파라미터가 검증 규칙을 위반한 경우 (error.errors 에 필드별 메시지) |
설명 기존 브랜드(path의 brand)를 수정합니다. auth:sanctum + sirsoft-ecommerce.brands.update 권한이 필요하며, BrandService::updateBrand()가 검증된 데이터로 갱신한 뒤 BrandResource를 반환합니다. name은 필수이고 slug·website·sort_order·is_active는 선택입니다. 대상이 없거나 처리 중 예외가 발생하면 404 또는 400을 반환하며, sirsoft-ecommerce.brand.update_validation_rules 필터로 확장이 검증 규칙을 추가할 수 있습니다.
GET /api/modules/sirsoft-ecommerce/admin/brands/{id}
- 라우트명:
api.modules.sirsoft-ecommerce.admin.brands.show - 컨트롤러:
Modules\Sirsoft\Ecommerce\Http\Controllers\Admin\BrandController@show - 인증/권한:
auth:sanctum+permission:sirsoft-ecommerce.brands.read
요청 파라미터
| 이름 | 위치 | 타입 | 필수 | 허용값 | 용도 |
|---|---|---|---|---|---|
| id | path | string | 예 | — | 대상 리소스의 식별자 |
요청 예시
GET /api/modules/sirsoft-ecommerce/admin/brands/{id} HTTP/1.1
Host: api.example.com
Accept: application/json
Authorization: Bearer {YOUR_TOKEN}
응답 필드 (data 내부)
응답 예시
에러 응답
| 상태코드 | 의미 | 발생 조건 |
|---|---|---|
| 401 | Unauthenticated | 유효한 Bearer 토큰이 없거나 만료된 경우 |
| 403 | Forbidden | 요구 권한(sirsoft-ecommerce.brands.read)이 없는 경우 |
| 404 | Not Found | path 파라미터에 해당하는 리소스가 없는 경우 |
설명 브랜드 1건의 상세 정보를 조회합니다. auth:sanctum + sirsoft-ecommerce.brands.read 권한이 필요하며, path의 id로 BrandService::getBrand()를 호출해 단건을 BrandResource로 반환합니다. 응답에는 다국어 이름, 로컬라이즈된 이름(localized_name), website, products_count 집계, 현재 사용자의 abilities 맵이 포함됩니다. 대상 브랜드가 없으면 404를 반환합니다.
PATCH /api/modules/sirsoft-ecommerce/admin/brands/{id}/toggle-status
- 라우트명:
api.modules.sirsoft-ecommerce.admin.brands.toggle-status - 컨트롤러:
Modules\Sirsoft\Ecommerce\Http\Controllers\Admin\BrandController@toggleStatus - 인증/권한:
auth:sanctum+permission:sirsoft-ecommerce.brands.update
요청 파라미터
| 이름 | 위치 | 타입 | 필수 | 허용값 | 용도 |
|---|---|---|---|---|---|
| id | path | string | 예 | — | 대상 리소스의 식별자 |
요청 예시
PATCH /api/modules/sirsoft-ecommerce/admin/brands/{id}/toggle-status HTTP/1.1
Host: api.example.com
Accept: application/json
Authorization: Bearer {YOUR_TOKEN}
응답 필드 (data 내부)
응답 예시
에러 응답
| 상태코드 | 의미 | 발생 조건 |
|---|---|---|
| 401 | Unauthenticated | 유효한 Bearer 토큰이 없거나 만료된 경우 |
| 403 | Forbidden | 요구 권한(sirsoft-ecommerce.brands.update)이 없는 경우 |
| 404 | Not Found | path 파라미터에 해당하는 리소스가 없는 경우 |
설명 브랜드의 활성 상태를 토글합니다. auth:sanctum + sirsoft-ecommerce.brands.update 권한이 필요하며, path의 id로 BrandService::toggleStatus()를 호출해 트랜잭션 내에서 현재 is_active 값을 반전시킨 뒤 갱신된 BrandResource를 반환합니다. 관리자 목록에서 브랜드 노출/비노출을 빠르게 전환할 때 사용하며, 대상이 없거나 처리 중 예외가 발생하면 404 또는 400을 반환합니다.