-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add portfolio, portfolio stock entity #89
Conversation
@Getter | ||
public class PortfolioStock extends BaseEntity { | ||
|
||
private UUID portfolioId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PortfolioStock
같은 경우에는 Portfolio
와 동일한 애그리거트로 보여서 id 참조보다는 값 타입 컬렉션으로 elementCollection 사용해서 객체 참조로 만들어주는 것이 관리하기 더 편할 것 같아요!
생명주기가 동일하니 repository를 따로 만들고 별개로 삭제해주지 않아도 되구요 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 그렇게 관리하는게 더 나을거 같네요!! 수정하겠습니다
this.shares = shares; | ||
} | ||
|
||
public PortfolioStock create(final UUID portfolioId, final UUID stockId, final Integer shares) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
생성 메서드 따로 만들어주신 이유가 있을까요?? 생성자와 동일한 매개변수를 받는 것으로 보여서 생성자를 사용해도 될 것 같아서요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
개인적으로 객체를 생성할 때 정적 팩토리 메서드를 이용하는 편인데, 다른 클래스와의 일관성을 유지하기 위해 생성했어요!! 그냥 생성자를 사용하는게 더 나을까요?! 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 정적 팩터리 메서드는 생성을 위한 로직이 복잡한 경우에 주로 사용하고 아니라면 기본 생성자를 이용하는 편이긴 합니다!!
매개변수 개수가 많지 않고 생성자를 쓰는 것과 동일한 상황같아서 기본 생성자를 쓰는 것도 좋아보여요 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 팩토리 메서드를 경우에 따라 나눠쓰시는군요!! 그 방식이 오히려 더 직관적으로 보일 수도 있을것 같아요! 해당 방향으로 수정하겠습니다!!
@@ -81,7 +81,7 @@ class StockDividendAnalysisServiceTest { | |||
|
|||
Dividend pastDividend = DividendFixture.createDividendWithExDividendDate( | |||
UUID.randomUUID(), | |||
LocalDate.of(now.getYear(), now.getMonth().minus(1), now.getDayOfMonth()) | |||
LocalDate.of(now.getYear(), now.getMonth().minus(1), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋ ㅋ ㅋ 🤯🤯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨슴닷 코멘트 확인 부탁드려요 !-!
+)
호오 티커명이 변경되는 경우가 있군요..?!?? stock 부분은 문제없을 것 같긴 한데 배당금 부분은 스케줄링 주기를 짧게 하던지 이벤트를 보내던지 따로 논의가 필요하겠네용!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다 🫡🫡
* refactor: change dependency direction (#87) * chore: add auto generated qclass to .gitignore * fix: failed test by current time * refactor: apply dip for package dependency * chore: update interface name * test: modify test data * fix: test code * feat: add portfolio, portfolio stock entity (#89) * fix: fix test date time issue * feat: add portfolio, portfolio stock entity * feat: add portfolio, portfolio stock repository * refactor: refactor package structure * test: add test fixture * setting: add db configuration * fix: add @entity annotation * fix: fix portfolio stock to element collection * fix: remove portfolio id from PoltfolioStock * setting: fix db configuration * refactor: delete create method from portfolio entity * feat: implement portfolio batch service (#92) * refactor: divide client package * feat: implement portfolio batch service * test: add test code * test: update test code * chore: update delete query * refactor: refactor portfolio stock domain * feat: implement portfolio api (#93) * chore: remove unnecessary import * feat: add portfolio command service * feat: add portfolio query service * feat: add portfolio controller * docs: add portfolio controller docs * fix: remove portfolio command service * test: add test for create portfolio api * feat: add monthly/yearly dividend api * feat: add monthly/yearly dividend api * docs: add swagger docs * feat: implement dividend repository custom * test: add portfolio query service test * test: add portfolio controller test * feat: add sector-ratio service * feat: update portfolio controller * test: add test code * test: add service test code * feat: update swagger docs --------- Co-authored-by: Songyi Kim <ksl2950@o.cnu.ac.kr> * feat: implement read portfolio event (#95) * feat:wip add portfolio event * feat: add hits to portfolio * feat:wip add portfolio event * feat: add increment hits consumer * feat: add read portfolio event * feat: implement lock for portfolio hits (concurrency) * feat: set version initial value * feat: set version initial value * test: add read portfolio test * test: fix latch * test: fix concurrency test * test: remove event test from portfolio query service test * chore: add event log * chore: fix order of log --------- Co-authored-by: Songyi Kim <ksl2950@o.cnu.ac.kr> --------- Co-authored-by: Songyi Kim <52441906+songyi00@users.noreply.github.com> Co-authored-by: Songyi Kim <ksl2950@o.cnu.ac.kr>
Issue Number
close: #88
작업 내역
변경사항
PR 특이 사항