수정 팝업을 다시 열면 선수금 금액이 「null」로 뜨던 것 - #291
Merged
Merged
Conversation
기준을 비율로 되돌리고 저장하면 `down_payment_amount` 에 `null` 이 남는다. 그런데 화면이
`!== undefined` 로 판정해 그 `null` 을 **「금액으로 정했다」로 읽었다** — 그래서 다시 열면
금액 칸에 `String(null)` 인 **「null」이라는 글자가 그대로 찍히고** 비율 칸이 잠겼다(실제 제보).
계산 쪽에서는 이미 `!= null` 로 막아 두었는데 **화면 세 곳을 놓쳤다.**
`DownPaymentFields`(모드 판정·초기값)·`ConfirmQuoteModal`·`QuoteEditModal` 전부 고친다.
실제 컴포넌트로 확인 — 저장값이 `{rate: 0.3, amount: null}` 일 때:
전: 금액 칸 「null」, 비율 잠김, 안내 「금액으로 정했습니다」
후: 비율 30 · 금액 15,017,550(자동), 안내 「비율로 정했습니다」
회귀 가드는 **값을 읽는 다섯 파일 전부**를 훑는다. 한 곳만 보게 두면 이번처럼
계산은 고치고 화면은 놓친다. 다섯 파일을 하나씩 되돌려 실제로 잡히는 것을 확인했다.
Closes #290
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.
Closes #290
무엇이 잘못됐나
기준을 비율로 되돌리고 저장하면
down_payment_amount에null이 남는다. 화면이 이걸!== undefined로 판정해 「금액으로 정했다」로 읽었다.계산 쪽은 이미
!= null로 막아 뒀는데 화면 세 곳을 놓쳤다.확인한 것
실제 컴포넌트를 띄워 저장값
{rate: 0.3, amount: null}로 열어 봤다:0(잠김)null3015,017,550(자동)금액 기준(
amount: 12345678)과 비율 기준(amount: undefined)도 함께 확인 — 각각 정상이다.회귀 가드
값을 읽는 다섯 파일 전부를 훑는다. 한 곳만 보게 두면 이번처럼 계산은 고치고 화면은 놓친다.
다섯 파일을 하나씩 되돌려 각각 실패하는 것을 확인했다:
DownPaymentFields.tsxConfirmQuoteModal.tsxQuoteEditModal.tsxshared/pricing/quote.tsbackend/src/services/quote-calc.ts검사는 주석을 걷어내고 실제 코드만 본다 — 왜
!= null인지를 코드 옆에 적어 둘 수 있어야 다음 사람이 되돌리지 않는다.기존 실패 9건은 이 브랜치와 무관.