Skip to content

Commit

Permalink
refactor: 초대코드 주선자/후보자 구분, 주선자-후보자 관계를 나타낼수있게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
unanchoi committed Dec 10, 2024
1 parent 82353ac commit d097181
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class InvitationService(
// TODO : 초대코드 검증 성공하면, 초대코드 삭제
}

// TODO: 주선자를 초대하는 경우와 후보자를 초대하는 경우 구분
@Transactional
fun generateInvitationCode(memberId: Long, request: InvitationCodeGenerateRequest) : InvitationCodeResponse {
val member = memberJpaRepository.findByIdOrNull(memberId) ?: throw InvalidRequestException("잘못된 사용자 id 요청 : $memberId")
Expand All @@ -48,6 +47,7 @@ class InvitationService(
val invitation = invitationJpaRepository.save(
Invitation(
code = invitationCode,
relationType = request.relationType,
memberId = member.id!!
))
return InvitationCodeResponse(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.official.cufitapi.domain.infrastructure.entity

import com.official.cufitapi.domain.enums.MatchMakerCandidateRelationType
import jakarta.persistence.Entity
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
Expand All @@ -12,8 +13,17 @@ import jakarta.persistence.Id
class Invitation(
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long? = null,
/*
초대 code
*/
val code: String,
// 사용자 id
/*
초대한 사람과의 관계
*/
val relationType: MatchMakerCandidateRelationType,
/*
초대한 사용자 ID
*/
val memberId: Long
) : BaseTimeEntity() {
}

0 comments on commit d097181

Please sign in to comment.