seibro.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. // SEIBro 데이터 도메인 타입 — Backend Application/Features/Api/Stocks/{GetDividendCalendar,GetStockDividends,
  2. // GetLendingHistory,GetLockupCalendar,GetMeetingCalendar,GetCbExercises,GetBondDetail,GetElsRiskBoard,
  3. // GetForeignCustody}/Response.cs 대응.
  4. // 직렬화 주의: 필드명은 camelCase. Web.Api 는 JsonStringEnumConverter 미등록이나, 아래 응답들의 코드값은
  5. // 전부 C# string(원문 코드 문자열)이므로 문자열로 옴 → 라벨맵으로 표시.
  6. // DateOnly 는 "yyyy-MM-dd" 문자열, decimal 은 number 로 직렬화됨.
  7. // ── 코드 라벨맵 (SEIBro 원문 코드 문자열 → 한글 라벨) ──
  8. // 배당 세부유형 (SORT_CODE) — 01주식 02현금 03동시 04무배당
  9. export const DIVIDEND_SORT_LABEL: Record<string, string> = {
  10. '01': '주식',
  11. '02': '현금',
  12. '03': '동시',
  13. '04': '무배당'
  14. };
  15. // 확정구분 (FIX_TYPE / FIX_TPCD) — 1확정 2예고 3미정
  16. export const DIVIDEND_FIX_LABEL: Record<string, string> = {
  17. '1': '확정',
  18. '2': '예고',
  19. '3': '미정'
  20. };
  21. // 결산구분 (SETTLE_TYPE) — 1결산 2반기 3분기
  22. export const DIVIDEND_SETTLE_LABEL: Record<string, string> = {
  23. '1': '결산',
  24. '2': '반기',
  25. '3': '분기'
  26. };
  27. // 락업 업무구분 (OCCR_SEQ) — 1예수 2반환
  28. export const LOCKUP_OCCR_LABEL: Record<string, string> = {
  29. '1': '예수',
  30. '2': '반환'
  31. };
  32. // 보호예수 사유코드 (DUTY_SAFEDP_RACD) — SEIBro 원본 전체 코드표 (미매칭 시 원문 코드 노출)
  33. export const LOCKUP_REASON_LABEL: Record<string, string> = {
  34. '00': '해당없음', '01': '일반', '02': '모집(전매제한)', '03': '최대주주(상장)', '04': '최대주주(코스닥)',
  35. '05': '투자회사(상장)', '06': '초과유상증자', '07': '지정취소', '08': '질권담보', '09': '등록주선인',
  36. '10': '외국인양수(변동제한)', '11': '벤처금융', '12': '기관투자가', '13': '합병(상장)', '14': '합병(코스닥)',
  37. '15': '부동산(상장)', '16': '부동산(코스닥)', '17': '법원M&A', '18': '주식교환(코스닥)', '19': '벤처금융(주식교환)',
  38. '20': '벤처금융(합병)', '21': '기관투자가(합병)', '22': '기관투자가(주식교환)', '23': '제3자배정최대주주(코스닥)', '24': '선박(상장)',
  39. '25': '채권기관협의회', '26': '주식교환(상장)', '27': '영업자산양도&제3자배정(상장)', '28': '영업자산양도&제3자배정(코스닥)', '29': '제3자배정유상증자(상장)',
  40. '30': '제3자배정유상증자(코스닥)', '31': '최대주주(제3자배정)', '32': 'SPAC(상장)', '33': 'SPAC(코스닥)', '34': 'SPAC 합병(상장)',
  41. '35': 'SPAC 합병(코스닥)', '36': '명목회사(상장)', '37': '명목회사(코스닥)', '38': '자발적보호예수', '39': '우회상장',
  42. '40': '상장주선인(국내기업)', '41': '전매제한', '42': '기타(특정금전신탁편입 등)', '43': '최대주주(기술성장기업)', '44': '기관투자가(코넥스)',
  43. '45': '크라우드펀딩', '46': '크라우드펀딩(최대주주)', '47': '주관회사(금투협)', '48': '상장주선인(외국기업)', '49': '모집(전매제한)-크라우드펀딩전문투자자',
  44. '50': '상장주선인(50%미만)', '51': '상장주선인(50%이상)', '52': '최대주주변경(법인 또는 조합)', '53': '상장적격성 실질심사', '54': '기타 보호예수 필요 주주',
  45. '55': '주식매수선택권', '90': '기타의무예수', '99': '기타'
  46. };
  47. // 주총 종류코드 (GMET_KACD) — 001정기 002임시 003종류 009기타
  48. export const MEETING_KIND_LABEL: Record<string, string> = {
  49. '001': '정기',
  50. '002': '임시',
  51. '003': '종류',
  52. '009': '기타'
  53. };
  54. // ELS/DLS 종목구분코드 (SECN_TPCD)
  55. export const ELS_SECN_TPCD_LABEL: Record<string, string> = {
  56. '41': 'ELS',
  57. '43': 'DLS'
  58. };
  59. // 외화증권 종목구분코드 (SECN_TPCD) — SEIBro 스펙 코드표 (docs/SEIBro/외화증권.md)
  60. export const FOREIGN_SECN_TPCD_LABEL: Record<string, string> = {
  61. '71': '외화주식',
  62. '72': '외화DR',
  63. '73': '외화WRTS',
  64. '74': '외화RGTS',
  65. '75': '외화채권',
  66. '76': '외화CD',
  67. '77': '외화CP',
  68. '78': '외화수익증권'
  69. };
  70. // 국가코드 (NATION_CD) — 주요국 (미매칭 시 원문 코드 노출)
  71. export const NATION_LABEL: Record<string, string> = {
  72. US: '미국',
  73. JP: '일본',
  74. HK: '홍콩',
  75. CN: '중국',
  76. GB: '영국',
  77. DE: '독일',
  78. FR: '프랑스',
  79. VN: '베트남',
  80. SG: '싱가포르',
  81. CH: '스위스',
  82. E1: '유로클리어(ICSD)'
  83. };
  84. // 채권 옵션구분코드 (OPTION_TPCD) — 9401CALL 9402PUT 9403CALL+PUT 9404NOTE 0000해당없음
  85. export const BOND_OPTION_LABEL: Record<string, string> = {
  86. '9401': 'Call',
  87. '9402': 'Put',
  88. '9403': 'Call+Put',
  89. '9404': 'Note',
  90. '0000': '해당없음'
  91. };
  92. // 채권 금리변동구분코드 (MR_CHG_TPCD) — 1고정 2변동 3고정+변동
  93. export const BOND_RATE_CHG_LABEL: Record<string, string> = {
  94. '1': '고정금리',
  95. '2': '변동금리',
  96. '3': '고정+변동'
  97. };
  98. // 채권 보증구분코드 (GRTY_TPCD) — 1보증 2무보증 3담보부 4일반
  99. export const BOND_GUARANTEE_LABEL: Record<string, string> = {
  100. '1': '보증',
  101. '2': '무보증',
  102. '3': '담보부',
  103. '4': '일반'
  104. };
  105. // 채권 순위구분코드 (RANK_TPCD) — 1선순위 2후순위 3중순위 9해당없음
  106. export const BOND_RANK_LABEL: Record<string, string> = {
  107. '1': '선순위',
  108. '2': '후순위',
  109. '3': '중순위',
  110. '9': '해당없음'
  111. };
  112. // 채권 이자지급방법구분코드 (INT_PAY_WAY_TPCD) — 1이표 2할인 3복리 4단리
  113. export const BOND_INT_PAY_WAY_LABEL: Record<string, string> = {
  114. '1': '이표채',
  115. '2': '할인채',
  116. '3': '복리채',
  117. '4': '단리채'
  118. };
  119. // 채권 이자지급주기구분코드 (INT_PAY_CYCLE_TPCD) — 23개월 24분기 25반기 26년
  120. export const BOND_INT_CYCLE_LABEL: Record<string, string> = {
  121. '23': '월',
  122. '24': '분기',
  123. '25': '반기',
  124. '26': '년'
  125. };
  126. // 채권 이자지급시기구분코드 (INT_PAY_TIMS_TPCD) — 01후급 02선급
  127. export const BOND_INT_TIMING_LABEL: Record<string, string> = {
  128. '01': '후급',
  129. '02': '선급'
  130. };
  131. // 특이채권종류구분코드 (PARTICUL_BOND_KIND_TPCD) — 1전환 2교환 3신주인수권 4분리형신주인수권 6이익참가 9해당없음
  132. export const BOND_PARTICUL_KIND_LABEL: Record<string, string> = {
  133. '1': '전환사채(CB)',
  134. '2': '교환사채(EB)',
  135. '3': '신주인수권부사채(BW)',
  136. '4': '분리형 신주인수권부사채',
  137. '6': '이익참가부사채',
  138. '9': '해당없음'
  139. };
  140. // 종목종류코드 (SECN_KACD) — 대표값 (미매칭 시 원문 코드 노출)
  141. export const BOND_SECN_KACD_LABEL: Record<string, string> = {
  142. '1108': '일반회사채',
  143. '1105': '국채',
  144. '1106': '지방채',
  145. '1107': '특수채',
  146. '1110': '금융채'
  147. };
  148. // ── GET /api/market/dividend-calendar ──
  149. export interface DividendCalendarRow {
  150. issucoCustno: number;
  151. name: string;
  152. rgtStdDt: string;
  153. xrgtDt: string|null;
  154. sortCode: string;
  155. fixType: string|null;
  156. settleType: string|null;
  157. }
  158. export interface DividendCalendarResponse {
  159. total: number;
  160. list: DividendCalendarRow[];
  161. }
  162. // ── GET /api/market/lockup-calendar ──
  163. export interface LockupCalendarRow {
  164. issucoCustno: number;
  165. shortCode: string;
  166. name: string;
  167. occrSeq: string;
  168. safedpDt: string;
  169. safedpQty: number|null;
  170. reasonCode: string;
  171. returnDt: string|null;
  172. returnQty: number|null;
  173. totalStkCnt: number|null;
  174. }
  175. export interface LockupCalendarResponse {
  176. total: number;
  177. list: LockupCalendarRow[];
  178. }
  179. // ── GET /api/market/meeting-calendar ──
  180. export interface MeetingCalendarRow {
  181. issucoCustno: number;
  182. name: string|null;
  183. code: string|null;
  184. rgtStdDt: string;
  185. gmetDt: string|null;
  186. gmetTtm: string|null;
  187. meetingKind: string;
  188. place: string|null;
  189. evote: boolean|null;
  190. deferred: boolean|null;
  191. agendaCount: number;
  192. }
  193. export interface MeetingCalendarResponse {
  194. total: number;
  195. list: MeetingCalendarRow[];
  196. }
  197. // ── GET /api/market/els-risk ──
  198. export interface ElsRiskPoint {
  199. stdDt: string;
  200. unredeemedCount: number|null;
  201. unredeemedRemaining: number|null;
  202. }
  203. export interface ElsRiskSeries {
  204. bassetCd: string;
  205. bassetContent: string|null;
  206. secnTpcd: string;
  207. points: ElsRiskPoint[];
  208. }
  209. export interface ElsRiskResponse {
  210. assets: ElsRiskSeries[];
  211. }
  212. // ── GET /api/market/foreign-custody ──
  213. export interface ForeignCustodyPoint {
  214. stdDt: string;
  215. custodyAmount: number;
  216. }
  217. export interface ForeignCustodySeries {
  218. nationCd: string;
  219. secnTpcd: string|null;
  220. points: ForeignCustodyPoint[];
  221. }
  222. export interface ForeignCustodyResponse {
  223. nations: ForeignCustodySeries[];
  224. }
  225. // ── GET /api/stocks/{code}/dividends ──
  226. export interface StockDividendRow {
  227. rgtStdDt: string;
  228. name: string;
  229. securityKind: string|null;
  230. faceValue: number|null;
  231. cashPerShare: number|null;
  232. stockAllocRatio: number|null;
  233. marketDividendRate: number|null;
  234. cashPayDate: string|null;
  235. xrgtDt: string|null;
  236. fixType: string|null;
  237. }
  238. export interface StockDividendsResponse {
  239. isin: string;
  240. total: number;
  241. list: StockDividendRow[];
  242. }
  243. // ── GET /api/stocks/{code}/lending ──
  244. export interface LendingHistoryRow {
  245. stdDt: string;
  246. lendingBalanceQty: number|null;
  247. matchedQty: number|null;
  248. redeemedQty: number|null;
  249. tradeQty: number|null;
  250. foreignLendRatio: number|null;
  251. nativeLendRatio: number|null;
  252. foreignBorrowRatio: number|null;
  253. nativeBorrowRatio: number|null;
  254. }
  255. export interface LendingHistoryResponse {
  256. isin: string;
  257. total: number;
  258. list: LendingHistoryRow[];
  259. }
  260. // ── GET /api/stocks/{code}/cb-exercises ──
  261. export interface CbExerciseRow {
  262. bondIsin: string;
  263. bondName: string|null;
  264. bondKind: string|null;
  265. exerciseStockIsin: string|null;
  266. exerciseStockName: string|null;
  267. rgtStdDt: string;
  268. exercisePrice: number|null;
  269. exerciseQty: number|null;
  270. exerciseAmt: number|null;
  271. listDt: string|null;
  272. }
  273. export interface CbExercisesResponse {
  274. isin: string;
  275. total: number;
  276. list: CbExerciseRow[];
  277. }
  278. // ── GET /api/stocks/bonds/{isin} ──
  279. export interface BondDetailMaster {
  280. name: string|null;
  281. issucoCustno: number|null;
  282. secnKacd: string|null;
  283. issueDate: string|null;
  284. maturityDate: string|null;
  285. currency: string|null;
  286. firstIssueAmount: number|null;
  287. issueRemaining: number|null;
  288. couponRate: number|null;
  289. optionTpcd: string|null;
  290. forcedEarlyRedemption: boolean|null;
  291. rateChangeTpcd: string|null;
  292. guaranteeTpcd: string|null;
  293. rankTpcd: string|null;
  294. intPayWayTpcd: string|null;
  295. particularBondKindTpcd: string|null;
  296. kisGrade: string|null;
  297. niceGrade: string|null;
  298. sciGrade: string|null;
  299. krGrade: string|null;
  300. isElectronicSecurity: boolean|null;
  301. }
  302. export interface BondDetailInterest {
  303. couponRate: number|null;
  304. intPayWayTpcd: string|null;
  305. cycleTerms: number|null;
  306. cycleTpcd: string|null;
  307. payTimingTpcd: string|null;
  308. beforeCouponDate: string|null;
  309. afterCouponDate: string|null;
  310. }
  311. export interface BondDetailMarket {
  312. tradeDate: string;
  313. close: number;
  314. yieldToMaturity: number|null;
  315. volume: number;
  316. }
  317. export interface BondDetailResponse {
  318. isin: string;
  319. master: BondDetailMaster|null;
  320. interest: BondDetailInterest|null;
  321. market: BondDetailMarket|null;
  322. }