feat: 병원 방문 이벤트에 비용(costKrw) 입력·추세 연결 (v0.7.1) - #42
Merged
Conversation
Event.costKrw 컬럼은 최초 스키마부터 DB에 있었지만 웹 UI 어디에도 연결된 적이 없었다. vet_visit 이벤트에 비용 입력란을 추가하고, 상세/타임라인 표시와 analytics 페이지의 병원비 추세 그래프·기간 합계 타일까지 연결한다. 병원(Contact)별 집계는 계획대로 Phase 2(P2-11)에 남겨둔다. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- 병원비 입력에 콤마("30,000")를 넣으면 파싱이 거절되던 문제 수정.
제출 전 콤마를 벗기고, 음수도 클라이언트에서 먼저 막는다
- costKrw에 Postgres INTEGER 상한(2,147,483,647) 검증 추가 — 넘으면
기존엔 Prisma가 500을 냈는데 이제 400으로 떨어진다
- POST/PATCH /api/events가 costKrw를 저장·반환·삭제하는지 확인하는
API 테스트 5개 추가 (음수·상한 초과 거절 포함)
- 병원비 추세 그래프 Y축에 compact 포맷터 — 큰 금액이 안 잘리게
- WORKPLAN.md P2-11/Phase 3에 이번 작업 반영, api.md에 costKrw 필드 문서화
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Owner
Author
|
리뷰의 Should-fix 2건 + 몇 가지 nit을 반영했습니다 (f3bfa37). Should fix
Nit 중 처리한 것
남겨둔 것 (지적대로 이번 PR 범위 밖으로 판단)
🤖 Generated with Claude Code |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
Event.costKrw컬럼은 최초 스키마(P1-03)부터 DB에 있었지만 웹 UI 어디에도 연결된 적이 없었다.vet_visit이벤트에 비용 입력란을 추가하고, 상세/타임라인 표시와/analytics페이지의 병원비 추세 그래프·기간 합계 타일까지 연결한다.packages/shared의createEventSchema/updateEventSchema에costKrw추가, APIcreateEvent()·POST/PATCH /api/events가 값을 받고 돌려준다 (K-4 위반 없음 — 여전히createEvent()단일 진입점만 통과).Contact)별로 나눠 집계하는 것(WORKPLAN.mdP2-11)은 이번엔 손대지 않고 Phase 2로 남겨뒀다 — 이벤트 자체에 비용 값을 붙이는 것까지만.Test plan
npm run build:shared && npm run test -w packages/shared(31 tests)npm run --workspace apps/api build && npm run --workspace apps/api test(130 tests)npm run --workspace apps/web build && npm run --workspace apps/web test(112 tests,next build타입체크 포함)docs/WORKLOG.md에 남겨둠.🤖 Generated with Claude Code