k-skill/.changeset/add-court-auction-property-search.md
Jeffrey (Dongkyu) Kim f527515932
Enable property search by free auction conditions (#213)
Add Workflow C for court-auction-notice-search with direct PGJ151 property search payload mapping, representative frozen code tables, CLI/docs coverage, and normalized item rows.

Constraint: Issue #184 requires Workflow C region/usage/price/date/area/flbd filters and release automation requires a Changeset.

Rejected: Proxy route | courtauction.go.kr property search is a public site endpoint and does not require an API key.

Confidence: high

Scope-risk: moderate

Directive: Keep code-table lookups fail-open and avoid tests that pin package versions or changeset file presence.

Tested: npm test --workspace court-auction-notice-search; npm run lint --workspace court-auction-notice-search; npm run ci

Not-tested: Live courtauction.go.kr property search, to avoid unnecessary upstream calls and potential anti-bot blocking.
2026-05-08 10:14:33 +09:00

1.9 KiB

court-auction-notice-search
minor

Add Workflow C property free-condition search via searchProperties() (POST /pgj/pgjsearch/searchControllerMain.on).

The request body matches the canonical PGJ151M01 submission captured from a real browser session — numeric pageNo/pageSize/statNum, full dma_pageInfo shape, and the upstream-correct field names (mvprpArtclKndCd/mvprpAtchmPlcTypCd, not the previously-guessed mvprpArtclKnd/mvrpDspslPlcTyp).

The static usage/region codetables come from upstream discovery captures: 4 대분류 (10000=토지, 20000=건물, 30000=차량및운송장비, 40000=기타) plus representative mid/small classes; 19 시도 with their official codes. Sigungu/dong cascade XHRs are not reliable so callers pass raw codes (e.g. "11680") directly.

searchProperties() automatically falls back to the Playwright client only for WAF-style raw HTTP UPSTREAM_ERROR 400 responses. Confirmed BLOCKED / ipcheck=false responses stop by default to avoid extending an IP block; retrying that condition requires explicit fallbackOnBlocked:true. Disable fallback entirely with { fallback: false }.

Other fixes:

  • resolveUsageCode(name, level) now refuses to silently return a wrong-level code for ambiguous names (e.g. "아파트" exists at multiple levels) — returns the input unchanged so the upstream rejects it instead of producing a wrong query.
  • resolveRegionCodes({}) no longer accidentally maps "no region" to the first row's sido.
  • flbdCount is integer-only; pageSize is restricted to the observed PGJ151 dropdown values 10/20/50/100 to avoid unsupported upstream requests.
  • Endpoint-aware HTTP/Playwright warmup (PGJ151F00 for property search instead of PGJ143M01).
  • CLI search accepts --region 시도:시군구:읍면동 and --usage 대:중:소 colon shorthand alongside the existing split flags.