Skip to content
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

[FIX]: 지원서 생성 시 이벤트에 CaptainId 넘겨주도록 수정 #127

Merged
merged 3 commits into from
Nov 10, 2023

Conversation

twoosky
Copy link
Member

@twoosky twoosky commented Nov 10, 2023

Issue number

작업 사항

  • 기존에는 captainId, applyUserId 모두 지원서를 작성한 userId를 넘겨주도록 되어 있어 수정했습니다.

@twoosky twoosky self-assigned this Nov 10, 2023
@twoosky twoosky added the fix label Nov 10, 2023
applyCreateEvent.getGroupId(),
applyCreateEvent.getUserId(),
applyCreateEvent.getApplyUserId(),
ApplyEventType.APPLY_CREATE
);
}

public static ApplyAdapterEvent mapToApplyAdapterEventFrom(ApplyStatusUpdateEvent applyStatusUpdateEvent) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApplyCreateEvent, ApplyStautsUpdateEvent를 하나의 Event로 사용해도 될거 같은데 어떻게 생각하시나요? @jihwan2da
같은 값을 담고 있기 때문에 ApplyEventType만 이벤트에 따라 전달해주면 하나의 Event로 사용할 수 있을거 같다는 생각입니다. 이벤트명 자체에 행위를 담기 위해 구분하신 건가요?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 행위를 하는 행위자가 다르다.
    지원서를 생성하는 유저와 지원서를 승인/거절하는 유저는 각각 그룹의 지원자, 그룹의 호스트로 성격이 다릅니다. 그리고 생성과 속성 값 변화라는 점에서도 성격이 다르다고 생각했습니다. 현재는 저희가 알림에 의존적으로(알림에서 특정이벤트를 활용할 땐 필요한 필드들을 다 넣음) 이벤트 모델을 구성하여 ApplyCreateEvent 와 ApplyStatusUpdateEvent가 같은 성격으로 보이지만 위의 근거 Application 단에서 처리할 때는 같은 성격으로 가져가는건 아니라고 생각하였습니다.
  2. ApplyEventType은 이벤트 모델을 구성하는 필드로 infra 계층에 해당된다.
    현재 이 서버에서 사용하는 ApplyEventType은 message를 생성하기 위한 이벤트 모델입니다. 즉, 도메인 및 Application 계층이 이 필드를 아는 순간 DIP에 위배되게 됩니다. 따라서 Application 계층은 자기의 행위에 대한 정확한 이벤트만 발행되어야 한다고 생각합니다.

@@ -10,17 +10,17 @@ public class ApplyEventMapper {

public static ApplyAdapterEvent mapToApplyAdapterEventFrom(ApplyCreateEvent applyCreateEvent) {
return new ApplyAdapterEvent(
applyCreateEvent.getUserId(),
applyCreateEvent.getCaptainId(),
Copy link
Member Author

@twoosky twoosky Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존의 userId는 지원서를 작성한 userId인지, 지원서 그룹의 captainId인지 헷갈릴 수 있어 변수명을 captainId로 변경했습니다.

@twoosky twoosky merged commit 82a7a62 into dev Nov 10, 2023
1 check passed
@twoosky
Copy link
Member Author

twoosky commented Nov 10, 2023

일단 프론트 테스트를 위해 머지하겠습니다 !!!!

@jihwan2da jihwan2da deleted the fix/#126 branch February 12, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

지원서 생성 시 해당 그룹의 hostId를 넘겨준다.
2 participants