연금계좌 (22) 및 퇴직연금 (29) 지원 - #52
Open
ssethj wants to merge 12 commits into
Open
Conversation
ssethj
force-pushed
the
feat/pension
branch
2 times, most recently
from
August 4, 2026 12:00
a21956a to
85c471b
Compare
unohee
requested changes
Aug 10, 2026
unohee
left a comment
Owner
There was a problem hiding this comment.
리뷰 중 머지를 막아야 하는 문제가 확인됐습니다.
changeTREnv()의 상품코드22/29분기에서_cfg.get("my_acct__stock", "")를 읽고 있는데, 실제 설정 키는my_acct_stock입니다. 현재 구현대로면 개인연금/IRP 인증 환경의my_acct가 빈 문자열이 됩니다. 두 분기 모두 기존 주식 계좌와 같은 키를 사용해야 합니다.- 일반계좌
inquire_psbl_order()파라미터가 기존OVRS_ICLD_YN에서OVRS_JCLD_YN으로 바뀌었습니다. 저장소의 나머지 구현과 테스트도OVRS_ICLD_YN을 사용하므로 일반계좌 요청이 잘못된 필드로 전송됩니다. IRP 분기 추가와 무관한 회귀이므로 원래 키로 복원해 주세요. black --check kis_agent/core/auth.py kis_agent/account/balance_query_api.py에서balance_query_api.py포맷 실패가 재현됩니다.
참고로 기존 관련 단위 테스트 62개는 통과했지만, 새 22/29 분기 자체를 검증하는 테스트가 없어 위 두 오타를 잡지 못하고 있습니다. 계좌 코드별 endpoint/TR_ID/params와 changeTREnv() 계좌 매핑 회귀 테스트를 함께 추가해 주시면 다시 확인하겠습니다.
Update parameter handling for balance query based on IRP status.
…to feat/pension
unohee
requested changes
Aug 12, 2026
unohee
left a comment
Owner
There was a problem hiding this comment.
이전 리뷰에서 지적한 세 가지 코드 문제는 최신 HEAD에서 모두 수정된 것을 확인했습니다.
changeTREnv()의 22/29 분기가 이제my_acct_stock을 사용합니다.- 일반계좌
inquire_psbl_order()가OVRS_ICLD_YN을 다시 전송합니다. - 수정 파일의 Black/Ruff 검사도 통과합니다.
- IRP 잔고/매수가능조회 endpoint, TR ID, 필수 파라미터는 한국투자증권 공식 샘플(잔고조회, 매수가능조회)과 일치합니다.
다만 아직 승인하기 어려운 차단점이 하나 남았습니다. 이전 리뷰에서 요청한 22/29 분기 회귀 테스트가 추가되지 않았고, 실제 diff도 소스 두 파일만 변경되어 있습니다. 로컬 전체 테스트는 2136 passed, 99 skipped였지만 100% 커버리지 게이트는 99.90%로 실패했고, 이번 PR에서 추가된 balance_query_api.py:53,226과 auth.py:367,369가 미실행 경로로 확인됐습니다. GitHub의 Coverage Boost도 같은 네 줄을 미커버로 보고하며 실패 중입니다.
최초 오타들도 기존 테스트를 모두 통과했기 때문에, 이번에는 아래 계약을 테스트로 고정해야 안전합니다.
changeTREnv(): product22와29가my_acct_stock을 읽고 해당 product를 유지하는지get_account_balance(): 일반계좌와 IRP 각각의 endpoint/TR ID/전체 params 및 상대 분기 전용 키가 섞이지 않는지inquire_psbl_order(): 일반계좌의OVRS_ICLD_YN과 IRP의ACCA_DVSN_CD, endpoint/TR ID가 정확한지
위 테스트를 추가하고 Coverage Boost를 통과시키면 다시 확인하겠습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개인연금 (22)
기존 API endpoint 를 그대로 사용가능합니다.
auth()가 호출하는changeTREnv()에서 계좌코드가22인 경우도 처리하도록 변경했습니다.overseas등Agent가 노출하는 API 중 개인연금계좌에서 불가능한 동작에 대해서는 코드수준에서 막지 않고 서버로부터 거절응답을 받습니다.퇴직연금 (29)
별도의 API 들에 대한 구현이 필요합니다.
전체 API 및 구현여부:
최대한 기존에 노출된
Agent의 API 들에 녹이는게 좋을 것 같아서, 잔고조회 (Agent.get_account_balance()) 와 매수가능조회 (Agent.inquire_psbl_order()) 함수 내부에서 계좌 종류에 따라endpoint,tr_id,params를 다르게 설정하도록 했습니다.그 외 기존에 노출된
Agent의 API 들은 코드수준에서 막지 않고 서버로부터 거절응답을 받습니다.나머지 3개 API 에 대해서는 기존에 노출된 API 들 중 의미적으로 동일/유사하고 반환값 형식이 호환가능한 API 에 추후 통합해보도록 하겠습니다.