refactor(lps): job_type 명칭 정리 — 출처 기반(레거시 negowiz 제거)
레거시 용어(negowiz)와 모호한 이름(new/single)을 출처 기반으로 변경. 우선순위 1~4는 유지, 기본값 single→manual. - new_product(1) / manual(2, 기본) / partner(3) / batch(4) - lps_service 우선순위 맵 + protocol 기본값/설명 + docs/api.md 표 + 테스트 갱신 - 전체 54/54 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8bf34ea346
commit
4863425ca5
@ -27,7 +27,7 @@
|
||||
"model": "모카골드", // (선택) 모델명
|
||||
"company": "동서식품", // (선택) 제조사/브랜드
|
||||
"price": "25000", // (선택) 현재가 — 있으면 가격 범위 필터 기준
|
||||
"job_type": "single" // (선택) 요청 유형 → 우선순위
|
||||
"job_type": "manual" // (선택) 요청 유형 → 우선순위
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -35,7 +35,15 @@
|
||||
|
||||
> **specification은 나눌 필요 없이** "1박스, 160개입"처럼 통째로 넣으면 AI가 해석합니다.
|
||||
|
||||
**`job_type` → 우선순위** (낮을수록 먼저): `new`(1) · `single`(2, 기본) · `negowiz`(3) · `batch`(4)
|
||||
**`job_type` → 우선순위** (낮을수록 먼저):
|
||||
| 값 | 우선순위 | 의미 |
|
||||
|----|:---:|------|
|
||||
| `new_product` | 1 (최우선) | 신규 상품 등록 시 |
|
||||
| `manual` | 2 (기본) | 담당자 수동 요청 |
|
||||
| `partner` | 3 | 외부 시스템/파트너 연동 |
|
||||
| `batch` | 4 (최하위) | 정기 배치 |
|
||||
|
||||
(알 수 없는 값은 batch와 동급으로 처리)
|
||||
|
||||
**응답**
|
||||
```json
|
||||
|
||||
@ -12,7 +12,7 @@ class SearchItem(BaseModel):
|
||||
|
||||
product_code: str = Field(description="상품 식별 코드(커머스 기준). dedupe 키로도 사용")
|
||||
product_name: str = Field(description="상품명")
|
||||
job_type: str = Field("single", description="요청 유형: new|single|negowiz|batch → 우선순위 매핑")
|
||||
job_type: str = Field("manual", description="요청 유형(우선순위): new_product|manual|partner|batch")
|
||||
model: str = Field("", description="모델명")
|
||||
specification: str = Field("", description="규격(용량/개입/수량 등)")
|
||||
company: str = Field("", description="제조사/브랜드")
|
||||
|
||||
@ -22,7 +22,7 @@ from router.v1.lps.protocol import (
|
||||
)
|
||||
|
||||
# 요청 유형 → 우선순위(낮을수록 우선). 알 수 없는 유형은 가장 낮은 우선순위(배치와 동급).
|
||||
_PRIORITY = {"new": 1, "single": 2, "negowiz": 3, "batch": 4}
|
||||
_PRIORITY = {"new_product": 1, "manual": 2, "partner": 3, "batch": 4}
|
||||
|
||||
|
||||
class LpsService:
|
||||
|
||||
@ -12,7 +12,7 @@ async def clean_jobs(db_engine):
|
||||
|
||||
async def test_search_enqueues_jobs(client, clean_jobs):
|
||||
body = {"data": [
|
||||
{"product_code": "P1", "product_name": "커피", "job_type": "new"},
|
||||
{"product_code": "P1", "product_name": "커피", "job_type": "new_product"},
|
||||
{"product_code": "P2", "product_name": "무선마우스", "specification": "M170"},
|
||||
]}
|
||||
r = await client.post("/v1/lps/search", json=body)
|
||||
@ -24,7 +24,7 @@ async def test_search_enqueues_jobs(client, clean_jobs):
|
||||
|
||||
|
||||
async def test_search_dedupes_active_product(client, clean_jobs):
|
||||
body = {"data": [{"product_code": "P1", "product_name": "커피", "job_type": "new"}]}
|
||||
body = {"data": [{"product_code": "P1", "product_name": "커피", "job_type": "new_product"}]}
|
||||
await client.post("/v1/lps/search", json=body)
|
||||
r2 = await client.post("/v1/lps/search", json=body) # 같은 product_code 재요청
|
||||
item = r2.json()["items"][0]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user