Skip to content

feat : course, session 로직 구현 #745

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

Open
wants to merge 1 commit into
base: jhm9595
Choose a base branch
from

Conversation

jhm9595
Copy link

@jhm9595 jhm9595 commented Apr 17, 2025

유료 강의의 경우 결제는 이미 완료한 것으로 가정하고 이후 과정을 구현한다.
결제를 완료한 결제 정보는 payments 모듈을 통해 관리되며, 결제 정보는 Payment 객체에 담겨 반한된다.
이 내용이 무슨말인지 몰라 구현을 하진 못했습니다.

Copy link
Member

@Hyeon9mak Hyeon9mak left a comment

Choose a reason for hiding this comment

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

안녕하세요 형민님! 도메인 모델링 잘 진행해주셨습니다 👍
질문주신 payments 는 기존에 구현되어 있는 pojo 객체를 그대로 활용하고,
session, course 모델링에 집중하라는 의미로 생각됩니다 😄
몇 가지 간단한 코멘트 남겼습니다.

Comment on lines +3 to +5
public interface Conditional {
public boolean test(int currentNum);
}
Copy link
Member

Choose a reason for hiding this comment

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

@FunctionalInterface 어노테이션을 명세하는 것과 하지 않는 것에는 어떤 차이가 있을까요?

Comment on lines +12 to +21
private int classNo;
private Sessions sessions;

public int getClassNo() {
return classNo;
}

public Sessions getSessions() {
return this.sessions;
}
Copy link
Member

Choose a reason for hiding this comment

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

과정(Course)은 기수 단위로 운영하며, 여러 개의 강의(Session)를 가질 수 있다.

요구사항 속 기수는 하나의 과정에서 생성되는 N 개의 강의를 나타내는 걸로 보이네요. 😄

  • 과정: TDD, 클린 코드 with Java
  • 강의: TDD, 클린 코드 with Java 19기
  • 강의: TDD, 클린 코드 with Java 18기
  • 강의: TDD, 클린 코드 with Java 17기

Comment on lines +10 to +12
CoverImage(){

}
Copy link
Member

Choose a reason for hiding this comment

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

기본 생성자를 default package private 접근제한자로 만드신 이유가 있을까요?

Comment on lines +5 to +12
public enum ImageType {

GIF("GIF"),
JPG("JPG"),
JPEG("JPEG"),
PNG("PNG"),
SVG("SVG");

Copy link
Member

Choose a reason for hiding this comment

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

상수의 나열을 enum 으로 풀어내기 💯 👍

Comment on lines +22 to +33
public Session() {
this(new CoverImage(), LocalDate.now(), LocalDate.now());
}

public Session(CoverImage coverImage, LocalDate startDt, LocalDate endDt) {
this.coverImage = coverImage;
this.startDt = startDt;
this.endDt = endDt;
this.status = SessionStatus.READY;
this.students = new ArrayList<>();
}

Copy link
Member

Choose a reason for hiding this comment

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

생성자 체이닝 활용 👍

Comment on lines +109 to +111
public boolean isNotOwner(NsUser loginUser) {
return !this.isOwner(loginUser);
}
Copy link
Member

Choose a reason for hiding this comment

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

부정형 질의문 제공 👍 👍

Comment on lines +34 to +43
public void asFree() {
this.capacity = Integer.MAX_VALUE;
this.cost = BigDecimal.ZERO;
conditional = (currentNum) -> true;
}

public void asPaid(int capacity, BigDecimal cost) {
this.capacity = capacity;
this.cost = cost;
conditional = (currentNum) -> currentNum < this.capacity;
Copy link
Member

Choose a reason for hiding this comment

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

처음 Session 이 생성될 때부터 유/무료가 나뉠 수 있도록 팩터리 메서드를 제공하는 것도 방법일거 같네요 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants