| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- namespace Infrastructure.StockData;
- /// <summary>
- /// SEIBro getUnlistCirclInfo(비상장유통추정) 응답 파서 — 순수 C#. 공용 SeibroXml envelope 입력.
- /// ⚠️ 응답엔 STD_DT 가 없다(fixture 확인) — 요청 파라미터(STD_DT)를 수집 배치가 스탬핑한다.
- /// ⚠️ 종목종류명 필드는 SECN_KACD_NM (스펙 xlsx 의 SECN_KACA_NM 은 오기 — docs/SEIBro/주식.md §2).
- /// 자연키(ISIN)·대표명(REP_SECN_NM) 없는 행은 건너뛴다.
- /// </summary>
- public static class SeibroUnlistCirclParser
- {
- public sealed record Row(
- string Isin,
- string? ShotnIsin,
- string RepSecnNm,
- string? SecnKacdNm,
- long? GenDepoQty,
- long? RthingReturnStkqty,
- long? AcnttrQty,
- bool? IsElectronicSecurity
- );
- public static IReadOnlyList<Row> Parse(SeibroXml.Envelope envelope)
- {
- var rows = new List<Row>();
- foreach (var fields in envelope.Rows)
- {
- var isin = SeibroXml.GetOrNull(fields, "ISIN")?.Trim();
- var repSecnNm = SeibroXml.GetOrNull(fields, "REP_SECN_NM")?.Trim();
- if (string.IsNullOrEmpty(isin) || string.IsNullOrEmpty(repSecnNm))
- {
- continue;
- }
- rows.Add(new Row(
- isin,
- SeibroXml.GetOrNull(fields, "SHOTN_ISIN")?.Trim(),
- repSecnNm,
- SeibroXml.GetOrNull(fields, "SECN_KACD_NM")?.Trim(),
- SeibroFieldParse.Long(SeibroXml.GetOrNull(fields, "GEN_DEPO_QTY")),
- SeibroFieldParse.Long(SeibroXml.GetOrNull(fields, "RTHING_RETURN_STKQTY")),
- SeibroFieldParse.Long(SeibroXml.GetOrNull(fields, "ACNTTR_QTY")),
- SeibroFieldParse.Yn(SeibroXml.GetOrNull(fields, "ELTSC_YN"))
- ));
- }
- return rows;
- }
- }
|