Closed tomatophobia closed 2 years ago
AccountEvent에 Instant
필드 추가 되어서 Picker[Instant]
없어서 컴파일 안되던 부분 해결 방법
https://gist.github.com/vpavkin/6c4bef79cc54688befdaeb82af427636
implicit val instantPickler: boopickle.Pickler[Instant] = boopickle.DefaultBasic.longPickler.xmap(Instant.ofEpochMilli)(_.toEpochMilli)
import 는 항상 필요한 곳보다 상단에 있어야 한다. implicit value여서 아래쪽에 놓을까 하고 아래로 내렸다가 컴파일 안되어서 섬뜩했음
테스트 하면서 /를 *로 잘못 쓰는 엄청 멍청한 문제 발견... 테스트 열심히 하자
새로운 이슈
BigDecimal#setScale
을 사용하는 경우 숫자의 scale이 변경되어버림. 즉 side effect 존재 => 스칼라에서는 BigDecimal 연산을 할 때마다 새로운 인스턴스가 생성되어서 큰 문제는 아니어보임
주식을 매매할 때 매매가 일어난 시각 표시할 때 Instant, LocalDateTime 고민하다 차이점 정리한 글