seibro.ts 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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) — 주요 사유 (미매칭 시 원문 코드 노출)
  33. export const LOCKUP_REASON_LABEL: Record<string, string> = {
  34. '01': '유상증자',
  35. '02': '무상증자',
  36. '03': '기업공개(IPO)',
  37. '04': '주식분할',
  38. '05': '합병',
  39. '06': '주식교환',
  40. '07': '전환사채',
  41. '08': '신주인수권',
  42. '09': '스톡옵션',
  43. '99': '기타'
  44. };
  45. // 주총 종류코드 (GMET_KACD) — 001정기 002임시 003종류 009기타
  46. export const MEETING_KIND_LABEL: Record<string, string> = {
  47. '001': '정기',
  48. '002': '임시',
  49. '003': '종류',
  50. '009': '기타'
  51. };
  52. // ELS/DLS 종목구분코드 (SECN_TPCD)
  53. export const ELS_SECN_TPCD_LABEL: Record<string, string> = {
  54. '41': 'ELS',
  55. '43': 'DLS'
  56. };
  57. // 외화증권 종목구분코드 (SECN_TPCD) — 71외화주식~78 (합산은 null)
  58. export const FOREIGN_SECN_TPCD_LABEL: Record<string, string> = {
  59. '71': '외화주식',
  60. '72': '외화채권',
  61. '73': '외화수익증권',
  62. '74': '외화ETF',
  63. '75': '외화DR',
  64. '76': '외화ETN',
  65. '77': '외화워런트',
  66. '78': '기타 외화증권'
  67. };
  68. // 국가코드 (NATION_CD) — 주요국 (미매칭 시 원문 코드 노출)
  69. export const NATION_LABEL: Record<string, string> = {
  70. US: '미국',
  71. JP: '일본',
  72. HK: '홍콩',
  73. CN: '중국',
  74. GB: '영국',
  75. DE: '독일',
  76. FR: '프랑스',
  77. VN: '베트남',
  78. SG: '싱가포르',
  79. CH: '스위스',
  80. E1: '유럽(유로존)'
  81. };
  82. // 채권 옵션구분코드 (OPTION_TPCD) — 9401CALL 9402PUT 9403CALL+PUT 9404NOTE 0000해당없음
  83. export const BOND_OPTION_LABEL: Record<string, string> = {
  84. '9401': 'Call',
  85. '9402': 'Put',
  86. '9403': 'Call+Put',
  87. '9404': 'Note',
  88. '0000': '해당없음'
  89. };
  90. // 채권 금리변동구분코드 (MR_CHG_TPCD) — 1고정 2변동 3고정+변동
  91. export const BOND_RATE_CHG_LABEL: Record<string, string> = {
  92. '1': '고정금리',
  93. '2': '변동금리',
  94. '3': '고정+변동'
  95. };
  96. // 채권 보증구분코드 (GRTY_TPCD) — 1보증 2무보증 3담보부 4일반
  97. export const BOND_GUARANTEE_LABEL: Record<string, string> = {
  98. '1': '보증',
  99. '2': '무보증',
  100. '3': '담보부',
  101. '4': '일반'
  102. };
  103. // 채권 순위구분코드 (RANK_TPCD) — 1선순위 2후순위 3중순위 9해당없음
  104. export const BOND_RANK_LABEL: Record<string, string> = {
  105. '1': '선순위',
  106. '2': '후순위',
  107. '3': '중순위',
  108. '9': '해당없음'
  109. };
  110. // 채권 이자지급방법구분코드 (INT_PAY_WAY_TPCD) — 1이표 2할인 3복리 4단리
  111. export const BOND_INT_PAY_WAY_LABEL: Record<string, string> = {
  112. '1': '이표채',
  113. '2': '할인채',
  114. '3': '복리채',
  115. '4': '단리채'
  116. };
  117. // 채권 이자지급주기구분코드 (INT_PAY_CYCLE_TPCD) — 23개월 24분기 25반기 26년
  118. export const BOND_INT_CYCLE_LABEL: Record<string, string> = {
  119. '23': '월',
  120. '24': '분기',
  121. '25': '반기',
  122. '26': '년'
  123. };
  124. // 채권 이자지급시기구분코드 (INT_PAY_TIMS_TPCD) — 01후급 02선급
  125. export const BOND_INT_TIMING_LABEL: Record<string, string> = {
  126. '01': '후급',
  127. '02': '선급'
  128. };
  129. // 특이채권종류구분코드 (PARTICUL_BOND_KIND_TPCD) — 1전환 2교환 3신주인수권 4분리형신주인수권 6이익참가 9해당없음
  130. export const BOND_PARTICUL_KIND_LABEL: Record<string, string> = {
  131. '1': '전환사채(CB)',
  132. '2': '교환사채(EB)',
  133. '3': '신주인수권부사채(BW)',
  134. '4': '분리형 신주인수권부사채',
  135. '6': '이익참가부사채',
  136. '9': '해당없음'
  137. };
  138. // 종목종류코드 (SECN_KACD) — 대표값 (미매칭 시 원문 코드 노출)
  139. export const BOND_SECN_KACD_LABEL: Record<string, string> = {
  140. '1108': '일반회사채',
  141. '1105': '국채',
  142. '1106': '지방채',
  143. '1107': '특수채',
  144. '1110': '금융채'
  145. };
  146. // ── GET /api/market/dividend-calendar ──
  147. export interface DividendCalendarRow {
  148. issucoCustno: number;
  149. name: string;
  150. rgtStdDt: string;
  151. xrgtDt: string|null;
  152. sortCode: string;
  153. fixType: string|null;
  154. settleType: string|null;
  155. }
  156. export interface DividendCalendarResponse {
  157. total: number;
  158. list: DividendCalendarRow[];
  159. }
  160. // ── GET /api/market/lockup-calendar ──
  161. export interface LockupCalendarRow {
  162. issucoCustno: number;
  163. shortCode: string;
  164. name: string;
  165. occrSeq: string;
  166. safedpDt: string;
  167. safedpQty: number|null;
  168. reasonCode: string;
  169. returnDt: string|null;
  170. returnQty: number|null;
  171. totalStkCnt: number|null;
  172. }
  173. export interface LockupCalendarResponse {
  174. total: number;
  175. list: LockupCalendarRow[];
  176. }
  177. // ── GET /api/market/meeting-calendar ──
  178. export interface MeetingCalendarRow {
  179. issucoCustno: number;
  180. name: string|null;
  181. code: string|null;
  182. rgtStdDt: string;
  183. gmetDt: string|null;
  184. gmetTtm: string|null;
  185. meetingKind: string;
  186. place: string|null;
  187. evote: boolean|null;
  188. deferred: boolean|null;
  189. agendaCount: number;
  190. }
  191. export interface MeetingCalendarResponse {
  192. total: number;
  193. list: MeetingCalendarRow[];
  194. }
  195. // ── GET /api/market/els-risk ──
  196. export interface ElsRiskPoint {
  197. stdDt: string;
  198. unredeemedCount: number|null;
  199. unredeemedRemaining: number|null;
  200. }
  201. export interface ElsRiskSeries {
  202. bassetCd: string;
  203. bassetContent: string|null;
  204. secnTpcd: string;
  205. points: ElsRiskPoint[];
  206. }
  207. export interface ElsRiskResponse {
  208. assets: ElsRiskSeries[];
  209. }
  210. // ── GET /api/market/foreign-custody ──
  211. export interface ForeignCustodyPoint {
  212. stdDt: string;
  213. custodyAmount: number;
  214. }
  215. export interface ForeignCustodySeries {
  216. nationCd: string;
  217. secnTpcd: string|null;
  218. points: ForeignCustodyPoint[];
  219. }
  220. export interface ForeignCustodyResponse {
  221. nations: ForeignCustodySeries[];
  222. }
  223. // ── GET /api/stocks/{code}/dividends ──
  224. export interface StockDividendRow {
  225. rgtStdDt: string;
  226. name: string;
  227. securityKind: string|null;
  228. faceValue: number|null;
  229. cashPerShare: number|null;
  230. stockAllocRatio: number|null;
  231. marketDividendRate: number|null;
  232. cashPayDate: string|null;
  233. xrgtDt: string|null;
  234. fixType: string|null;
  235. }
  236. export interface StockDividendsResponse {
  237. isin: string;
  238. total: number;
  239. list: StockDividendRow[];
  240. }
  241. // ── GET /api/stocks/{code}/lending ──
  242. export interface LendingHistoryRow {
  243. stdDt: string;
  244. lendingBalanceQty: number|null;
  245. matchedQty: number|null;
  246. redeemedQty: number|null;
  247. tradeQty: number|null;
  248. foreignLendRatio: number|null;
  249. nativeLendRatio: number|null;
  250. foreignBorrowRatio: number|null;
  251. nativeBorrowRatio: number|null;
  252. }
  253. export interface LendingHistoryResponse {
  254. isin: string;
  255. total: number;
  256. list: LendingHistoryRow[];
  257. }
  258. // ── GET /api/stocks/{code}/cb-exercises ──
  259. export interface CbExerciseRow {
  260. bondIsin: string;
  261. bondName: string|null;
  262. bondKind: string|null;
  263. exerciseStockIsin: string|null;
  264. exerciseStockName: string|null;
  265. rgtStdDt: string;
  266. exercisePrice: number|null;
  267. exerciseQty: number|null;
  268. exerciseAmt: number|null;
  269. listDt: string|null;
  270. }
  271. export interface CbExercisesResponse {
  272. isin: string;
  273. total: number;
  274. list: CbExerciseRow[];
  275. }
  276. // ── GET /api/stocks/bonds/{isin} ──
  277. export interface BondDetailMaster {
  278. name: string|null;
  279. issucoCustno: number|null;
  280. secnKacd: string|null;
  281. issueDate: string|null;
  282. maturityDate: string|null;
  283. currency: string|null;
  284. firstIssueAmount: number|null;
  285. issueRemaining: number|null;
  286. couponRate: number|null;
  287. optionTpcd: string|null;
  288. forcedEarlyRedemption: boolean|null;
  289. rateChangeTpcd: string|null;
  290. guaranteeTpcd: string|null;
  291. rankTpcd: string|null;
  292. intPayWayTpcd: string|null;
  293. particularBondKindTpcd: string|null;
  294. kisGrade: string|null;
  295. niceGrade: string|null;
  296. sciGrade: string|null;
  297. krGrade: string|null;
  298. isElectronicSecurity: boolean|null;
  299. }
  300. export interface BondDetailInterest {
  301. couponRate: number|null;
  302. intPayWayTpcd: string|null;
  303. cycleTerms: number|null;
  304. cycleTpcd: string|null;
  305. payTimingTpcd: string|null;
  306. beforeCouponDate: string|null;
  307. afterCouponDate: string|null;
  308. }
  309. export interface BondDetailMarket {
  310. tradeDate: string;
  311. close: number;
  312. yieldToMaturity: number|null;
  313. volume: number;
  314. }
  315. export interface BondDetailResponse {
  316. isin: string;
  317. master: BondDetailMaster|null;
  318. interest: BondDetailInterest|null;
  319. market: BondDetailMarket|null;
  320. }