Skip to content

[✨feat] InternshipTitle 구현 #55

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 3 commits into
base: feat/#52
Choose a base branch
from
Open

[✨feat] InternshipTitle 구현 #55

wants to merge 3 commits into from

Conversation

jsoonworld
Copy link
Member

📄 Work Description

  • 인턴십 공고 제목을 도메인 객체로 표현하기 위해 InternshipTitle VO(Value Object)를 구현했습니다.
  • 유효성 검증을 통해 비어 있는 값이나 64자를 초과하는 제목에 대해 예외를 발생시키도록 설계했습니다.
  • 예외 처리는 InternshipExceptionInternshipErrorCode를 활용하여 명확하게 구분했습니다.
  • @Embeddable 어노테이션을 활용해 JPA 내장 타입으로 매핑되며, DB와의 연동을 고려한 설계입니다.

💭 Thoughts

  • 인턴십 제목은 단순한 String이지만, 도메인 개념상 의미가 분명하다고 판단되어 VO로 분리했습니다.
  • 특히 공백만 있는 문자열도 유효하지 않도록 isBlank()를 사용해 체크했습니다.
  • 입력값에서 trim() 처리를 하지 않은 이유는, 제목에 양끝 공백이 의도적으로 포함될 가능성도 고려했기 때문입니다.
  • VO 내에서 출력 포맷이나 가공은 하지 않고 순수하게 상태만 표현하도록 설계했습니다.

✅ Testing Result

스크린샷 2025-05-19 오후 10 46 36


🗂 Related Issue

- 인턴십 제목이 비어있는 경우를 처리하는 INVALID_INTERNSHIP_TITLE_EMPTY 코드 추가
- 인턴십 제목이 64자를 초과하는 경우를 처리하는 INVALID_INTERNSHIP_TITLE_TOO_LONG 코드 추가
- 인턴십 제목을 관리하는 값 객체(VO) `InternshipTitle` 구현
- 제목이 비어있거나 64자를 초과할 경우 예외 발생
- `equals`, `hashCode`, `toString` 재정의
- from 메서드가 유효한 값에서 정상 생성되는 경우 테스트
- 비어 있거나 공백뿐인 입력에 대한 예외 처리 테스트
- 64자를 초과하는 입력에 대한 예외 처리 테스트
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the InternshipTitle value object to encapsulate internship title logic and enforce domain-specific validations. Key changes include:

  • Implementation of the InternshipTitle VO with validations for non-blank and maximum length constraints.
  • Addition of unit tests covering valid, blank, and overly long title scenarios.
  • Extension of the InternshipErrorCode enum to include error codes for invalid internship titles.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/test/kotlin/com/terning/server/kotlin/domain/internshipAnnouncement/InternshipTitleTest.kt Added unit tests for the new InternshipTitle validations
src/main/kotlin/com/terning/server/kotlin/domain/internshipAnnouncement/InternshipTitle.kt Implemented the InternshipTitle VO with appropriate validations
src/main/kotlin/com/terning/server/kotlin/domain/internshipAnnouncement/InternshipErrorCode.kt Added new error codes for internship title validation failures

Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

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

확인했습니다! 어프루브 드릴게요!!🚀

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

Successfully merging this pull request may close these issues.

2 participants