-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Target과 Feedback을 어그리거트루트로 설정한다
- Loading branch information
Showing
11 changed files
with
61 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 6 additions & 18 deletions
24
survey/src/main/kotlin/me/nalab/survey/domain/feedback/FormQuestionFeedbackable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,25 @@ | ||
package me.nalab.survey.domain.feedback | ||
|
||
import java.time.Instant | ||
import javax.persistence.* | ||
|
||
@Entity | ||
@Table(name = "form_feedback") | ||
abstract class FormQuestionFeedbackable( | ||
@Id | ||
@Column(name = "form_feedback_id") | ||
protected open var id: Long? = null, | ||
open val id: Long, | ||
|
||
@Column(name = "form_question_id") | ||
@JoinColumn(name = "form_question_id", nullable = false) | ||
protected open val formQuestionId: Long, | ||
open val formQuestionId: Long, | ||
|
||
@Column(name = "is_read") | ||
protected open var isRead: Boolean = false, | ||
open var isRead: Boolean = false, | ||
|
||
@Embedded | ||
protected open val bookmark: Bookmark, | ||
open val bookmark: Bookmark, | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "feedback_id") | ||
private var feedback: Feedback, | ||
) { | ||
|
||
fun bookmark() { | ||
bookmark.isBookmarked = true | ||
bookmark.bookmarkedAt = Instant.now() | ||
} | ||
|
||
fun cancel() { | ||
bookmark.isBookmarked = false | ||
bookmark.bookmarkedAt = Instant.now() | ||
} | ||
} | ||
val feedback: Feedback, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
survey/src/main/kotlin/me/nalab/survey/domain/survey/FormQuestionable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters