refactor(selection): drop residual concept-sector surface from sub-industry path
- remove the sector_type parameter from the selection port, adapter, and use case; the adapter now passes SectorType.INDUSTRY directly, deleting the dead concept vocabulary mapping - stop parsing concepts/concept_total/concept_limit from the sector-radar membership response in the web API layer and narrow the response type to industries only - update tests and the task PRD accordingly; backend pyright errors drop from the 16 baseline to 14
This commit is contained in:
@@ -290,12 +290,6 @@ describe("stock sector membership adapter", () => {
|
||||
requested_trade_date: "2026-08-28",
|
||||
trade_date: "2026-08-28",
|
||||
industries: [{ code: "BK0901.DC", name: "银行" }],
|
||||
concepts: [
|
||||
{ code: "BK0001.DC", name: "机器人" },
|
||||
{ code: "BK0002.DC", name: "人工智能" },
|
||||
],
|
||||
concept_total: 2,
|
||||
concept_limit: 20,
|
||||
}
|
||||
|
||||
it("requests the snake-case endpoint and validates the payload", async () => {
|
||||
@@ -316,8 +310,6 @@ describe("stock sector membership adapter", () => {
|
||||
status: "no_data",
|
||||
trade_date: null,
|
||||
industries: [],
|
||||
concepts: [],
|
||||
concept_total: 0,
|
||||
})
|
||||
|
||||
const result = await getStockSectorMembership("000001.SZ", "2026-08-28")
|
||||
|
||||
@@ -153,7 +153,7 @@ export function parseRadarRankingsResponse(
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch one stock's industries and concepts from the last-good build snapshot.
|
||||
* Fetch one stock's sub-industries from the last-good build snapshot.
|
||||
*
|
||||
* @param tsCode - Stock code such as `000001.SZ`.
|
||||
* @param tradeDate - Requested trade date; the backend answers with the
|
||||
@@ -193,19 +193,6 @@ export function parseStockSectorMembershipResponse(
|
||||
),
|
||||
trade_date: readNullableDate(record.trade_date, "membership.trade_date"),
|
||||
industries: readSectorRefs(record.industries, "membership.industries"),
|
||||
concepts: readSectorRefs(record.concepts, "membership.concepts"),
|
||||
concept_total: readIntegerInRange(
|
||||
record.concept_total,
|
||||
0,
|
||||
Number.MAX_SAFE_INTEGER,
|
||||
"membership.concept_total",
|
||||
),
|
||||
concept_limit: readIntegerInRange(
|
||||
record.concept_limit,
|
||||
1,
|
||||
100,
|
||||
"membership.concept_limit",
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ export const stockSectorMembershipQueryKey = (
|
||||
] as const
|
||||
|
||||
/**
|
||||
* Read one stock's point-in-time industries and concepts for a detail view.
|
||||
* Read one stock's point-in-time sub-industries for a detail view.
|
||||
*
|
||||
* Disabled until both the stock code and target trade date are known; the
|
||||
* query stays cached per code-date pair so switching selections refetches
|
||||
|
||||
@@ -128,9 +128,6 @@ export interface StockSectorMembershipResponse {
|
||||
requested_trade_date: string
|
||||
trade_date: string | null
|
||||
industries: StockSectorRef[]
|
||||
concepts: StockSectorRef[]
|
||||
concept_total: number
|
||||
concept_limit: number
|
||||
}
|
||||
|
||||
export interface RadarSectorQuery {
|
||||
|
||||
Reference in New Issue
Block a user