diff --git a/BE/src/stock/detail/mockdata/stock-detail-chart.mockdata.ts b/BE/src/stock/detail/mockdata/stock-detail-chart.mockdata.ts new file mode 100644 index 0000000..ef267f9 --- /dev/null +++ b/BE/src/stock/detail/mockdata/stock-detail-chart.mockdata.ts @@ -0,0 +1,1539 @@ +export const STOCK_DETAIL_CHART_MOCK = { + output1: { + prdy_vrss: '-600', + prdy_vrss_sign: '5', + prdy_ctrt: '-1.11', + stck_prdy_clpr: '54200', + acml_vol: '22044867', + acml_tr_pbmn: '1184225188140', + hts_kor_isnm: '삼성전자', + stck_prpr: '53600', + stck_shrn_iscd: '005930', + prdy_vol: '24513532', + stck_mxpr: '70400', + stck_llam: '38000', + stck_oprc: '54300', + stck_hgpr: '54400', + stck_lwpr: '53100', + stck_prdy_oprc: '55100', + stck_prdy_hgpr: '55300', + stck_prdy_lwpr: '53800', + askp: '53700', + bidp: '53600', + prdy_vrss_vol: '-2468665', + vol_tnrt: '0.37', + stck_fcam: '100', + lstn_stcn: '5969782550', + cpfn: '7780', + hts_avls: '3199803', + per: '25.15', + eps: '2131.00', + pbr: '1.03', + 'itewhol_loan_rmnd_ratem name': '0.26', + }, + output2: [ + { + stck_bsop_date: '20241202', + stck_clpr: '53600', + stck_oprc: '54300', + stck_hgpr: '54400', + stck_lwpr: '53100', + acml_vol: '22044868', + acml_tr_pbmn: '1184225188140', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241129', + stck_clpr: '54200', + stck_oprc: '55100', + stck_hgpr: '55300', + stck_lwpr: '53800', + acml_vol: '24513532', + acml_tr_pbmn: '1331023724400', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241128', + stck_clpr: '55500', + stck_oprc: '56000', + stck_hgpr: '56400', + stck_lwpr: '55200', + acml_vol: '20001134', + acml_tr_pbmn: '1114564616052', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-800', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241127', + stck_clpr: '56300', + stck_oprc: '57700', + stck_hgpr: '57800', + stck_lwpr: '56000', + acml_vol: '21808388', + acml_tr_pbmn: '1236109255350', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-2000', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241126', + stck_clpr: '58300', + stck_oprc: '57900', + stck_hgpr: '58900', + stck_lwpr: '57500', + acml_vol: '23209404', + acml_tr_pbmn: '1350434011510', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241125', + stck_clpr: '57900', + stck_oprc: '57400', + stck_hgpr: '57900', + stck_lwpr: '56700', + acml_vol: '36237324', + acml_tr_pbmn: '2086462735928', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1900', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241122', + stck_clpr: '56000', + stck_oprc: '56000', + stck_hgpr: '56700', + stck_lwpr: '55900', + acml_vol: '15281543', + acml_tr_pbmn: '860560563100', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241121', + stck_clpr: '56400', + stck_oprc: '54900', + stck_hgpr: '56900', + stck_lwpr: '54700', + acml_vol: '19096850', + acml_tr_pbmn: '1068199169900', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1100', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241120', + stck_clpr: '55300', + stck_oprc: '56100', + stck_hgpr: '56500', + stck_lwpr: '54800', + acml_vol: '20864668', + acml_tr_pbmn: '1156033483400', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1000', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241119', + stck_clpr: '56300', + stck_oprc: '56500', + stck_hgpr: '57500', + stck_lwpr: '55900', + acml_vol: '31539632', + acml_tr_pbmn: '1786885263500', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241118', + stck_clpr: '56700', + stck_oprc: '57000', + stck_hgpr: '57500', + stck_lwpr: '55900', + acml_vol: '48095232', + acml_tr_pbmn: '2726095349068', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '3200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241115', + stck_clpr: '53500', + stck_oprc: '50300', + stck_hgpr: '54200', + stck_lwpr: '50300', + acml_vol: '46774484', + acml_tr_pbmn: '2464749360200', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '3600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241114', + stck_clpr: '49900', + stck_oprc: '50200', + stck_hgpr: '51800', + stck_lwpr: '49900', + acml_vol: '48510716', + acml_tr_pbmn: '2465304011525', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-700', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241113', + stck_clpr: '50600', + stck_oprc: '52000', + stck_hgpr: '53000', + stck_lwpr: '50500', + acml_vol: '52527996', + acml_tr_pbmn: '2704092634132', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-2400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241112', + stck_clpr: '53000', + stck_oprc: '54600', + stck_hgpr: '54600', + stck_lwpr: '53000', + acml_vol: '37962880', + acml_tr_pbmn: '2037790866499', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-2000', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241111', + stck_clpr: '55000', + stck_oprc: '56700', + stck_hgpr: '56800', + stck_lwpr: '55000', + acml_vol: '29811326', + acml_tr_pbmn: '1654820869900', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-2000', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241108', + stck_clpr: '57000', + stck_oprc: '58000', + stck_hgpr: '58300', + stck_lwpr: '57000', + acml_vol: '13877396', + acml_tr_pbmn: '799664427482', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241107', + stck_clpr: '57500', + stck_oprc: '56900', + stck_hgpr: '58100', + stck_lwpr: '56800', + acml_vol: '17043102', + acml_tr_pbmn: '982114998400', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241106', + stck_clpr: '57300', + stck_oprc: '57600', + stck_hgpr: '58000', + stck_lwpr: '56300', + acml_vol: '22092218', + acml_tr_pbmn: '1262148460900', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241105', + stck_clpr: '57600', + stck_oprc: '57800', + stck_hgpr: '58100', + stck_lwpr: '57200', + acml_vol: '17484474', + acml_tr_pbmn: '1007627262350', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1100', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241104', + stck_clpr: '58700', + stck_oprc: '58600', + stck_hgpr: '59400', + stck_lwpr: '58400', + acml_vol: '15586947', + acml_tr_pbmn: '916941057220', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241101', + stck_clpr: '58300', + stck_oprc: '59000', + stck_hgpr: '59600', + stck_lwpr: '58100', + acml_vol: '19083180', + acml_tr_pbmn: '1121093971420', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-900', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241031', + stck_clpr: '59200', + stck_oprc: '58500', + stck_hgpr: '61200', + stck_lwpr: '58300', + acml_vol: '35809196', + acml_tr_pbmn: '2141845557150', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '100', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241030', + stck_clpr: '59100', + stck_oprc: '59100', + stck_hgpr: '59800', + stck_lwpr: '58600', + acml_vol: '19838512', + acml_tr_pbmn: '1173730435406', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241029', + stck_clpr: '59600', + stck_oprc: '58000', + stck_hgpr: '59600', + stck_lwpr: '57300', + acml_vol: '28369314', + acml_tr_pbmn: '1668409859850', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241028', + stck_clpr: '58100', + stck_oprc: '55700', + stck_hgpr: '58500', + stck_lwpr: '55700', + acml_vol: '27775008', + acml_tr_pbmn: '1597162892050', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '2200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241025', + stck_clpr: '55900', + stck_oprc: '56000', + stck_hgpr: '56900', + stck_lwpr: '55800', + acml_vol: '25829316', + acml_tr_pbmn: '1448167771502', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-700', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241024', + stck_clpr: '56600', + stck_oprc: '58200', + stck_hgpr: '58500', + stck_lwpr: '56600', + acml_vol: '31499922', + acml_tr_pbmn: '1809877767246', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-2500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241023', + stck_clpr: '59100', + stck_oprc: '57500', + stck_hgpr: '60000', + stck_lwpr: '57100', + acml_vol: '27300780', + acml_tr_pbmn: '1598545283036', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241022', + stck_clpr: '57700', + stck_oprc: '58800', + stck_hgpr: '58900', + stck_lwpr: '57700', + acml_vol: '27582528', + acml_tr_pbmn: '1604866816800', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241021', + stck_clpr: '59000', + stck_oprc: '59000', + stck_hgpr: '59600', + stck_lwpr: '58500', + acml_vol: '18514904', + acml_tr_pbmn: '1092561695060', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241018', + stck_clpr: '59200', + stck_oprc: '59900', + stck_hgpr: '60100', + stck_lwpr: '59100', + acml_vol: '14420260', + acml_tr_pbmn: '857377297200', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241017', + stck_clpr: '59700', + stck_oprc: '59400', + stck_hgpr: '60100', + stck_lwpr: '59100', + acml_vol: '23372872', + acml_tr_pbmn: '1391873389950', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241016', + stck_clpr: '59500', + stck_oprc: '59400', + stck_hgpr: '60000', + stck_lwpr: '59200', + acml_vol: '23303268', + acml_tr_pbmn: '1389151960832', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241015', + stck_clpr: '61000', + stck_oprc: '61100', + stck_hgpr: '61400', + stck_lwpr: '60100', + acml_vol: '22715240', + acml_tr_pbmn: '1381789051900', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241014', + stck_clpr: '60800', + stck_oprc: '59500', + stck_hgpr: '61200', + stck_lwpr: '59400', + acml_vol: '20886248', + acml_tr_pbmn: '1262857492687', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241011', + stck_clpr: '59300', + stck_oprc: '59100', + stck_hgpr: '60100', + stck_lwpr: '59000', + acml_vol: '29623968', + acml_tr_pbmn: '1765728518988', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241010', + stck_clpr: '58900', + stck_oprc: '60100', + stck_hgpr: '60200', + stck_lwpr: '58900', + acml_vol: '45262216', + acml_tr_pbmn: '2687253337620', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241008', + stck_clpr: '60300', + stck_oprc: '60000', + stck_hgpr: '61000', + stck_lwpr: '59900', + acml_vol: '27411786', + acml_tr_pbmn: '1652788512596', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-700', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241007', + stck_clpr: '61000', + stck_oprc: '60200', + stck_hgpr: '61900', + stck_lwpr: '59500', + acml_vol: '35066532', + acml_tr_pbmn: '2118597389800', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241004', + stck_clpr: '60600', + stck_oprc: '61000', + stck_hgpr: '61700', + stck_lwpr: '60500', + acml_vol: '24247578', + acml_tr_pbmn: '1480865292580', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-700', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20241002', + stck_clpr: '61300', + stck_oprc: '60500', + stck_hgpr: '61900', + stck_lwpr: '59900', + acml_vol: '28473536', + acml_tr_pbmn: '1737678269615', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240930', + stck_clpr: '61500', + stck_oprc: '64200', + stck_hgpr: '64300', + stck_lwpr: '61500', + acml_vol: '32694164', + acml_tr_pbmn: '2043449921900', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-2700', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240927', + stck_clpr: '64200', + stck_oprc: '64700', + stck_hgpr: '65400', + stck_lwpr: '64200', + acml_vol: '28433030', + acml_tr_pbmn: '1842321896031', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240926', + stck_clpr: '64700', + stck_oprc: '63900', + stck_hgpr: '64900', + stck_lwpr: '63700', + acml_vol: '37566016', + acml_tr_pbmn: '2417513255958', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '2500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240925', + stck_clpr: '62200', + stck_oprc: '63800', + stck_hgpr: '64200', + stck_lwpr: '62200', + acml_vol: '28652438', + acml_tr_pbmn: '1816598498400', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1000', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240924', + stck_clpr: '63200', + stck_oprc: '62800', + stck_hgpr: '63400', + stck_lwpr: '62400', + acml_vol: '26957500', + acml_tr_pbmn: '1695341224952', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240923', + stck_clpr: '62600', + stck_oprc: '62300', + stck_hgpr: '63500', + stck_lwpr: '62200', + acml_vol: '28542376', + acml_tr_pbmn: '1787973967000', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240920', + stck_clpr: '63000', + stck_oprc: '63800', + stck_hgpr: '64700', + stck_lwpr: '63000', + acml_vol: '32746056', + acml_tr_pbmn: '2086233666488', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-100', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240919', + stck_clpr: '63100', + stck_oprc: '64000', + stck_hgpr: '64400', + stck_lwpr: '62200', + acml_vol: '49402712', + acml_tr_pbmn: '3115926466558', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240913', + stck_clpr: '64400', + stck_oprc: '65000', + stck_hgpr: '65500', + stck_lwpr: '64300', + acml_vol: '25045136', + acml_tr_pbmn: '1621747052400', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1900', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240912', + stck_clpr: '66300', + stck_oprc: '66000', + stck_hgpr: '66600', + stck_lwpr: '65200', + acml_vol: '35884104', + acml_tr_pbmn: '2369440968156', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240911', + stck_clpr: '64900', + stck_oprc: '65100', + stck_hgpr: '65500', + stck_lwpr: '64200', + acml_vol: '35809708', + acml_tr_pbmn: '2325181296712', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240910', + stck_clpr: '66200', + stck_oprc: '67000', + stck_hgpr: '67300', + stck_lwpr: '66000', + acml_vol: '30651376', + acml_tr_pbmn: '2041161645484', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240909', + stck_clpr: '67500', + stck_oprc: '66900', + stck_hgpr: '68200', + stck_lwpr: '66600', + acml_vol: '23263298', + acml_tr_pbmn: '1566504915737', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240906', + stck_clpr: '68900', + stck_oprc: '69100', + stck_hgpr: '69700', + stck_lwpr: '68000', + acml_vol: '19022300', + acml_tr_pbmn: '1309833642247', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-100', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240905', + stck_clpr: '69000', + stck_oprc: '70100', + stck_hgpr: '71200', + stck_lwpr: '69000', + acml_vol: '25686768', + acml_tr_pbmn: '1795890039418', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1000', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240904', + stck_clpr: '70000', + stck_oprc: '69800', + stck_hgpr: '71100', + stck_lwpr: '69800', + acml_vol: '27366564', + acml_tr_pbmn: '1923751777154', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-2500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240903', + stck_clpr: '72500', + stck_oprc: '74100', + stck_hgpr: '74300', + stck_lwpr: '72500', + acml_vol: '16314599', + acml_tr_pbmn: '1195017081270', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1900', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240902', + stck_clpr: '74400', + stck_oprc: '74500', + stck_hgpr: '74700', + stck_lwpr: '73500', + acml_vol: '12641376', + acml_tr_pbmn: '938130139986', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '100', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240830', + stck_clpr: '74300', + stck_oprc: '74400', + stck_hgpr: '75000', + stck_lwpr: '74100', + acml_vol: '16358520', + acml_tr_pbmn: '1217838630548', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240829', + stck_clpr: '74000', + stck_oprc: '73600', + stck_hgpr: '74700', + stck_lwpr: '73500', + acml_vol: '16884480', + acml_tr_pbmn: '1250517121400', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-2400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240828', + stck_clpr: '76400', + stck_oprc: '75800', + stck_hgpr: '76400', + stck_lwpr: '75400', + acml_vol: '9794514', + acml_tr_pbmn: '743267480799', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240827', + stck_clpr: '75800', + stck_oprc: '75700', + stck_hgpr: '76500', + stck_lwpr: '75600', + acml_vol: '11130145', + acml_tr_pbmn: '845521021636', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240826', + stck_clpr: '76100', + stck_oprc: '78100', + stck_hgpr: '78200', + stck_lwpr: '76000', + acml_vol: '15655938', + acml_tr_pbmn: '1200212317200', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240823', + stck_clpr: '77700', + stck_oprc: '77700', + stck_hgpr: '78400', + stck_lwpr: '77500', + acml_vol: '9420306', + acml_tr_pbmn: '733115152500', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240822', + stck_clpr: '78300', + stck_oprc: '78700', + stck_hgpr: '78900', + stck_lwpr: '77800', + acml_vol: '8149101', + acml_tr_pbmn: '637688676000', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '3', + prdy_vrss: '0', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240821', + stck_clpr: '78300', + stck_oprc: '77900', + stck_hgpr: '78600', + stck_lwpr: '77800', + acml_vol: '7805598', + acml_tr_pbmn: '610445256200', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240820', + stck_clpr: '78900', + stck_oprc: '79500', + stck_hgpr: '79800', + stck_lwpr: '78700', + acml_vol: '10683836', + acml_tr_pbmn: '846450905406', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240819', + stck_clpr: '78300', + stck_oprc: '80100', + stck_hgpr: '80100', + stck_lwpr: '78000', + acml_vol: '14146565', + acml_tr_pbmn: '1112867011200', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1900', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240816', + stck_clpr: '80200', + stck_oprc: '79400', + stck_hgpr: '80200', + stck_lwpr: '78700', + acml_vol: '22061478', + acml_tr_pbmn: '1749786266068', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '3000', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240814', + stck_clpr: '77200', + stck_oprc: '77400', + stck_hgpr: '77800', + stck_lwpr: '77000', + acml_vol: '13246168', + acml_tr_pbmn: '1023945760936', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1100', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240813', + stck_clpr: '76100', + stck_oprc: '76500', + stck_hgpr: '76600', + stck_lwpr: '75500', + acml_vol: '10716261', + acml_tr_pbmn: '814879344944', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240812', + stck_clpr: '75500', + stck_oprc: '75200', + stck_hgpr: '75900', + stck_lwpr: '74800', + acml_vol: '9839259', + acml_tr_pbmn: '742667828012', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '800', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240809', + stck_clpr: '74700', + stck_oprc: '75700', + stck_hgpr: '75800', + stck_lwpr: '74200', + acml_vol: '16388222', + acml_tr_pbmn: '1226725116766', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240808', + stck_clpr: '73400', + stck_oprc: '73200', + stck_hgpr: '73900', + stck_lwpr: '72500', + acml_vol: '28414728', + acml_tr_pbmn: '2079007355535', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240807', + stck_clpr: '74700', + stck_oprc: '73000', + stck_hgpr: '76000', + stck_lwpr: '72800', + acml_vol: '32710428', + acml_tr_pbmn: '2439049835003', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '2200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240806', + stck_clpr: '72500', + stck_oprc: '74900', + stck_hgpr: '75300', + stck_lwpr: '72300', + acml_vol: '47295224', + acml_tr_pbmn: '3482608290900', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1100', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240805', + stck_clpr: '71400', + stck_oprc: '76700', + stck_hgpr: '76900', + stck_lwpr: '70200', + acml_vol: '54608792', + acml_tr_pbmn: '4028468177890', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-8200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240802', + stck_clpr: '79600', + stck_oprc: '81000', + stck_hgpr: '81400', + stck_lwpr: '79500', + acml_vol: '25800276', + acml_tr_pbmn: '2072583435468', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-3500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240801', + stck_clpr: '83100', + stck_oprc: '86000', + stck_hgpr: '86100', + stck_lwpr: '83100', + acml_vol: '20900338', + acml_tr_pbmn: '1761066086600', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-800', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240731', + stck_clpr: '83900', + stck_oprc: '81200', + stck_hgpr: '83900', + stck_lwpr: '80900', + acml_vol: '20744324', + acml_tr_pbmn: '1709905651240', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '2900', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240730', + stck_clpr: '81000', + stck_oprc: '80400', + stck_hgpr: '81000', + stck_lwpr: '80000', + acml_vol: '13169636', + acml_tr_pbmn: '1058509976884', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240729', + stck_clpr: '81200', + stck_oprc: '81600', + stck_hgpr: '82000', + stck_lwpr: '81100', + acml_vol: '12797136', + acml_tr_pbmn: '1042595012848', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240726', + stck_clpr: '80900', + stck_oprc: '80700', + stck_hgpr: '81300', + stck_lwpr: '80400', + acml_vol: '14508334', + acml_tr_pbmn: '1171301827600', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240725', + stck_clpr: '80400', + stck_oprc: '80400', + stck_hgpr: '81000', + stck_lwpr: '80100', + acml_vol: '20323812', + acml_tr_pbmn: '1634938043600', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1600', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240724', + stck_clpr: '82000', + stck_oprc: '82900', + stck_hgpr: '83300', + stck_lwpr: '81900', + acml_vol: '16939084', + acml_tr_pbmn: '1397137102450', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1900', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240723', + stck_clpr: '83900', + stck_oprc: '84200', + stck_hgpr: '84700', + stck_lwpr: '83400', + acml_vol: '15766389', + acml_tr_pbmn: '1325673625798', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '900', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240722', + stck_clpr: '83000', + stck_oprc: '84400', + stck_hgpr: '84900', + stck_lwpr: '82600', + acml_vol: '18987560', + acml_tr_pbmn: '1581559180516', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240719', + stck_clpr: '84400', + stck_oprc: '85600', + stck_hgpr: '86100', + stck_lwpr: '84100', + acml_vol: '18569122', + acml_tr_pbmn: '1574018492068', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-2500', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240718', + stck_clpr: '86900', + stck_oprc: '83800', + stck_hgpr: '86900', + stck_lwpr: '83800', + acml_vol: '24721790', + acml_tr_pbmn: '2104104629510', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240717', + stck_clpr: '86700', + stck_oprc: '87100', + stck_hgpr: '88000', + stck_lwpr: '86400', + acml_vol: '18186490', + acml_tr_pbmn: '1585140028938', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-1000', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240716', + stck_clpr: '87700', + stck_oprc: '86900', + stck_hgpr: '88000', + stck_lwpr: '86700', + acml_vol: '16166688', + acml_tr_pbmn: '1413744130426', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '1000', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240715', + stck_clpr: '86700', + stck_oprc: '84700', + stck_hgpr: '87300', + stck_lwpr: '84100', + acml_vol: '25193080', + acml_tr_pbmn: '2151182147147', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '2300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240712', + stck_clpr: '84400', + stck_oprc: '85900', + stck_hgpr: '86100', + stck_lwpr: '84100', + acml_vol: '26344386', + acml_tr_pbmn: '2234914589643', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-3200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240711', + stck_clpr: '87600', + stck_oprc: '88500', + stck_hgpr: '88800', + stck_lwpr: '86700', + acml_vol: '24677608', + acml_tr_pbmn: '2164539095066', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '5', + prdy_vrss: '-200', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240710', + stck_clpr: '87800', + stck_oprc: '87600', + stck_hgpr: '88000', + stck_lwpr: '87100', + acml_vol: '17813848', + acml_tr_pbmn: '1560911761680', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '3', + prdy_vrss: '0', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240709', + stck_clpr: '87800', + stck_oprc: '87800', + stck_hgpr: '88200', + stck_lwpr: '86900', + acml_vol: '21336200', + acml_tr_pbmn: '1869414925283', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '400', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240708', + stck_clpr: '87400', + stck_oprc: '87900', + stck_hgpr: '88600', + stck_lwpr: '86900', + acml_vol: '24035808', + acml_tr_pbmn: '2105162327800', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '300', + revl_issu_reas: '', + }, + { + stck_bsop_date: '20240705', + stck_clpr: '87100', + stck_oprc: '85600', + stck_hgpr: '87100', + stck_lwpr: '85200', + acml_vol: '45791192', + acml_tr_pbmn: '3951280237696', + flng_cls_code: '00', + prtt_rate: '0.00', + mod_yn: 'N', + prdy_vrss_sign: '2', + prdy_vrss: '2500', + revl_issu_reas: '', + }, + ], + rt_cd: '0', + msg_cd: 'MCA00000', + msg1: '정상처리 되었습니다.', +}; diff --git a/BE/src/stock/detail/mockdata/stock-detail.mockdata.ts b/BE/src/stock/detail/mockdata/stock-detail.mockdata.ts new file mode 100644 index 0000000..3da8228 --- /dev/null +++ b/BE/src/stock/detail/mockdata/stock-detail.mockdata.ts @@ -0,0 +1,86 @@ +export const STOCK_DETAIL_MOCK = { + output: { + iscd_stat_cls_code: '55', + marg_rate: '20.00', + rprs_mrkt_kor_name: 'KOSPI200', + bstp_kor_isnm: '전기.전자', + temp_stop_yn: 'N', + oprc_rang_cont_yn: 'N', + clpr_rang_cont_yn: 'N', + crdt_able_yn: 'Y', + grmn_rate_cls_code: '40', + elw_pblc_yn: 'Y', + stck_prpr: '53600', + prdy_vrss: '-600', + prdy_vrss_sign: '5', + prdy_ctrt: '-1.11', + acml_tr_pbmn: '1184225188140', + acml_vol: '22044867', + prdy_vrss_vol_rate: '89.93', + stck_oprc: '54300', + stck_hgpr: '54400', + stck_lwpr: '53100', + stck_mxpr: '70400', + stck_llam: '38000', + stck_sdpr: '54200', + wghn_avrg_stck_prc: '53721.32', + hts_frgn_ehrt: '51.30', + frgn_ntby_qty: '-3321712', + pgtr_ntby_qty: '-2256632', + pvt_scnd_dmrs_prc: '55933', + pvt_frst_dmrs_prc: '55066', + pvt_pont_val: '54433', + pvt_frst_dmsp_prc: '53566', + pvt_scnd_dmsp_prc: '52933', + dmrs_val: '54750', + dmsp_val: '53250', + cpfn: '7780', + rstc_wdth_prc: '16200', + stck_fcam: '100', + stck_sspr: '42270', + aspr_unit: '100', + hts_deal_qty_unit_val: '1', + lstn_stcn: '5969782550', + hts_avls: '3199803', + per: '25.15', + pbr: '1.03', + stac_month: '12', + vol_tnrt: '0.37', + eps: '2131.00', + bps: '52002.00', + d250_hgpr: '88800', + d250_hgpr_date: '20240711', + d250_hgpr_vrss_prpr_rate: '-39.64', + d250_lwpr: '49900', + d250_lwpr_date: '20241114', + d250_lwpr_vrss_prpr_rate: '7.41', + stck_dryy_hgpr: '88800', + dryy_hgpr_vrss_prpr_rate: '-39.64', + dryy_hgpr_date: '20240711', + stck_dryy_lwpr: '49900', + dryy_lwpr_vrss_prpr_rate: '7.41', + dryy_lwpr_date: '20241114', + w52_hgpr: '88800', + w52_hgpr_vrss_prpr_ctrt: '-39.64', + w52_hgpr_date: '20240711', + w52_lwpr: '49900', + w52_lwpr_vrss_prpr_ctrt: '7.41', + w52_lwpr_date: '20241114', + whol_loan_rmnd_rate: '0.26', + ssts_yn: 'N', + stck_shrn_iscd: '005930', + fcam_cnnm: '100', + cpfn_cnnm: '7,780 억', + frgn_hldn_qty: '3062328623', + vi_cls_code: 'N', + ovtm_vi_cls_code: 'N', + last_ssts_cntg_qty: '50856', + invt_caful_yn: 'N', + mrkt_warn_cls_code: '00', + short_over_yn: 'N', + sltr_yn: 'N', + }, + rt_cd: '0', + msg_cd: 'MCA00000', + msg1: '정상처리 되었습니다.', +}; diff --git a/BE/src/stock/detail/stock-detail.service.spec.ts b/BE/src/stock/detail/stock-detail.service.spec.ts new file mode 100644 index 0000000..cf8d5b1 --- /dev/null +++ b/BE/src/stock/detail/stock-detail.service.spec.ts @@ -0,0 +1,100 @@ +import { Test } from '@nestjs/testing'; +import { KoreaInvestmentDomainService } from '../../common/koreaInvestment/korea-investment.domain-service'; +import { StockDetailService } from './stock-detail.service'; +import { StockDetailRepository } from './stock-detail.repository'; +import { STOCK_DETAIL_MOCK } from './mockdata/stock-detail.mockdata'; +import { STOCK_DETAIL_CHART_MOCK } from './mockdata/stock-detail-chart.mockdata'; +import { Stocks } from './stock-detail.entity'; + +describe('stock detail test', () => { + let stockDetailService: StockDetailService; + let koreaInvestmentDomainService: KoreaInvestmentDomainService; + let stockDetailRepository: StockDetailRepository; + + beforeEach(async () => { + const module = await Test.createTestingModule({ + providers: [ + StockDetailService, + KoreaInvestmentDomainService, + { + provide: StockDetailRepository, + useValue: { + findOneByCode: jest.fn(), + }, + }, + ], + }).compile(); + + stockDetailService = module.get(StockDetailService); + koreaInvestmentDomainService = module.get(KoreaInvestmentDomainService); + stockDetailRepository = module.get(StockDetailRepository); + + jest + .spyOn(koreaInvestmentDomainService, 'getAccessToken') + .mockResolvedValue('accessToken'); + }); + + it('특정 주식의 현재가 체결 데이터를 반환한다.', async () => { + jest + .spyOn(koreaInvestmentDomainService, 'requestApi') + .mockResolvedValueOnce(STOCK_DETAIL_MOCK); + + jest + .spyOn(stockDetailRepository, 'findOneByCode') + .mockImplementation((code: string) => { + const stock = new Stocks(); + stock.code = code; + stock.name = '삼성전자'; + stock.market = 'KOSPI'; + + return Promise.resolve(stock); + }); + + const response = await stockDetailService.getInquirePrice('005930'); + + const expected = { + hts_kor_isnm: '삼성전자', + stck_shrn_iscd: '005930', + stck_prpr: '53600', + prdy_vrss: '-600', + prdy_vrss_sign: '5', + prdy_ctrt: '-1.11', + hts_avls: '3199803', + per: '25.15', + stck_mxpr: '70400', + stck_llam: '38000', + is_bookmarked: false, + }; + + expect(response).toEqual(expected); + }); + + it('특정 주식의 차트 데이터를 반환한다.', async () => { + jest + .spyOn(koreaInvestmentDomainService, 'requestApi') + .mockResolvedValueOnce(STOCK_DETAIL_CHART_MOCK); + + const response = await stockDetailService.getInquirePriceChart( + '005930', + 'D', + 30, + ); + + const expected = { + stck_bsop_date: '20241022', + stck_clpr: '57700', + stck_oprc: '58800', + stck_hgpr: '58900', + stck_lwpr: '57700', + acml_vol: '27582528', + prdy_vrss_sign: '5', + mov_avg_5: '59020.00', + mov_avg_20: '60985.00', + }; + + expect(response[0]).toEqual(expected); + expect(response[0].stck_bsop_date).toEqual('20241022'); + expect(response[1].stck_bsop_date).toEqual('20241023'); + expect(response[2].stck_bsop_date).toEqual('20241024'); + }); +});