-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
175 additions
and
155 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
12 changes: 12 additions & 0 deletions
12
...c/main/kotlin/com/depromeet/whatnow/domains/notification/domain/EndSharingNotification.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.depromeet.whatnow.domains.notification.domain | ||
|
||
import javax.persistence.DiscriminatorValue | ||
import javax.persistence.Entity | ||
|
||
@Entity | ||
@DiscriminatorValue("END_SHARING") | ||
class EndSharingNotification( | ||
var promiseId: Long, | ||
|
||
override var targetUserId: Long, | ||
) : Notification(targetUserId) |
22 changes: 22 additions & 0 deletions
22
...in/src/main/kotlin/com/depromeet/whatnow/domains/notification/domain/ImageNotification.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.depromeet.whatnow.domains.notification.domain | ||
|
||
import com.depromeet.whatnow.domains.promiseuser.domain.PromiseUserType | ||
import javax.persistence.DiscriminatorValue | ||
import javax.persistence.Entity | ||
import javax.persistence.EnumType | ||
import javax.persistence.Enumerated | ||
|
||
@Entity | ||
@DiscriminatorValue("IMAGE") | ||
class ImageNotification( | ||
@Enumerated(EnumType.STRING) | ||
var senderUserPromiseUserType: PromiseUserType, | ||
|
||
var senderUserId: Long, | ||
|
||
var promiseId: Long, | ||
|
||
var imageKey: String, | ||
|
||
override var targetUserId: Long, | ||
) : Notification(targetUserId) |
17 changes: 17 additions & 0 deletions
17
...in/com/depromeet/whatnow/domains/notification/domain/InteractionAttainmentNotification.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.depromeet.whatnow.domains.notification.domain | ||
|
||
import com.depromeet.whatnow.domains.interaction.domain.InteractionType | ||
import javax.persistence.DiscriminatorValue | ||
import javax.persistence.Entity | ||
|
||
@Entity | ||
@DiscriminatorValue("INTERACTION_ATTAINMENT") | ||
class InteractionAttainmentNotification( | ||
var promiseId: Long, | ||
|
||
var senderUserId: Long, | ||
|
||
var interactionType: InteractionType, | ||
|
||
override var targetUserId: Long, | ||
) : Notification(targetUserId) |
17 changes: 17 additions & 0 deletions
17
.../main/kotlin/com/depromeet/whatnow/domains/notification/domain/InteractionNotification.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.depromeet.whatnow.domains.notification.domain | ||
|
||
import com.depromeet.whatnow.domains.interaction.domain.InteractionType | ||
import javax.persistence.DiscriminatorValue | ||
import javax.persistence.Entity | ||
|
||
@Entity | ||
@DiscriminatorValue("INTERACTION") | ||
class InteractionNotification( | ||
var promiseId: Long, | ||
|
||
var senderUserId: Long, | ||
|
||
var interactionType: InteractionType, | ||
|
||
override var targetUserId: Long, | ||
) : Notification(targetUserId) |
105 changes: 10 additions & 95 deletions
105
...-Domain/src/main/kotlin/com/depromeet/whatnow/domains/notification/domain/Notification.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,111 +1,26 @@ | ||
package com.depromeet.whatnow.domains.notification.domain | ||
|
||
import com.depromeet.whatnow.common.BaseTimeEntity | ||
import com.depromeet.whatnow.domains.interaction.domain.InteractionType | ||
import com.depromeet.whatnow.domains.promiseuser.domain.PromiseUserType | ||
import javax.persistence.Column | ||
import javax.persistence.ElementCollection | ||
import javax.persistence.DiscriminatorColumn | ||
import javax.persistence.DiscriminatorType | ||
import javax.persistence.Entity | ||
import javax.persistence.EnumType | ||
import javax.persistence.Enumerated | ||
import javax.persistence.GeneratedValue | ||
import javax.persistence.GenerationType | ||
import javax.persistence.Id | ||
import javax.persistence.Inheritance | ||
import javax.persistence.InheritanceType | ||
import javax.persistence.Table | ||
|
||
@Entity | ||
@Table(name = "tbl_notification") | ||
class Notification( | ||
@Enumerated(EnumType.STRING) | ||
var notificationType: NotificationType, | ||
|
||
@Enumerated(EnumType.STRING) | ||
var interactionType: InteractionType?, | ||
|
||
@Enumerated(EnumType.STRING) | ||
var promiseUserType: PromiseUserType?, | ||
|
||
var userId: Long?, | ||
|
||
@ElementCollection | ||
var targetUserIds: Set<Long>, | ||
|
||
var targetId: Long?, | ||
@Inheritance(strategy = InheritanceType.SINGLE_TABLE) | ||
@DiscriminatorColumn(name = "notification_type", discriminatorType = DiscriminatorType.STRING) | ||
abstract class Notification( | ||
open val targetUserId: Long, | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "notification_id") | ||
val id: Long? = null, | ||
) : BaseTimeEntity() { | ||
companion object { | ||
fun createForImage(userId: Long, targetUserId: Set<Long>, promiseImageId: Long): Notification { | ||
return Notification( | ||
notificationType = NotificationType.IMAGE, | ||
userId = userId, | ||
targetUserIds = targetUserId, | ||
targetId = promiseImageId, | ||
interactionType = null, | ||
promiseUserType = null, | ||
) | ||
} | ||
|
||
fun createForStartSharing(targetUserIds: Set<Long>, promiseId: Long): Notification { | ||
return Notification( | ||
notificationType = NotificationType.START_SHARING, | ||
userId = null, | ||
targetUserIds = targetUserIds, | ||
targetId = promiseId, | ||
interactionType = null, | ||
promiseUserType = null, | ||
) | ||
} | ||
|
||
fun createForEndSharing(targetUserIds: Set<Long>, promiseId: Long): Notification { | ||
return Notification( | ||
notificationType = NotificationType.END_SHARING, | ||
userId = null, | ||
targetUserIds = targetUserIds, | ||
targetId = promiseId, | ||
interactionType = null, | ||
promiseUserType = null, | ||
) | ||
} | ||
|
||
fun createForTimeOver(targetUserIds: Set<Long>, promiseId: Long): Notification { | ||
return Notification( | ||
notificationType = NotificationType.TIMEOVER, | ||
userId = null, | ||
targetUserIds = targetUserIds, | ||
targetId = promiseId, | ||
interactionType = null, | ||
promiseUserType = null, | ||
) | ||
} | ||
|
||
fun createForInteraction(userId: Long, targetUserId: Long, interactionType: InteractionType): Notification { | ||
return Notification( | ||
notificationType = NotificationType.INTERACTION, | ||
userId = userId, | ||
targetUserIds = mutableSetOf(targetUserId), | ||
targetId = null, | ||
interactionType = interactionType, | ||
promiseUserType = null, | ||
) | ||
} | ||
|
||
fun createForInteractionAttainment( | ||
userId: Long, | ||
senderUserIds: Set<Long>, | ||
interactionType: InteractionType, | ||
): Notification { | ||
return Notification( | ||
notificationType = NotificationType.INTERACTION_ATTAINMENT, | ||
userId = userId, | ||
targetUserIds = senderUserIds, | ||
targetId = null, | ||
interactionType = interactionType, | ||
promiseUserType = null, | ||
) | ||
} | ||
} | ||
} | ||
open val id: Long? = null, | ||
) : BaseTimeEntity() |
12 changes: 12 additions & 0 deletions
12
...main/kotlin/com/depromeet/whatnow/domains/notification/domain/StartSharingNotification.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.depromeet.whatnow.domains.notification.domain | ||
|
||
import javax.persistence.DiscriminatorValue | ||
import javax.persistence.Entity | ||
|
||
@Entity | ||
@DiscriminatorValue("START_SHARING") | ||
class StartSharingNotification( | ||
var promiseId: Long, | ||
|
||
override var targetUserId: Long, | ||
) : Notification(targetUserId) |
15 changes: 15 additions & 0 deletions
15
...src/main/kotlin/com/depromeet/whatnow/domains/notification/domain/TimeOverNotification.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.depromeet.whatnow.domains.notification.domain | ||
|
||
import com.depromeet.whatnow.domains.promiseuser.domain.PromiseUserType | ||
import javax.persistence.DiscriminatorValue | ||
import javax.persistence.Entity | ||
|
||
@Entity | ||
@DiscriminatorValue("TIMEOVER") | ||
class TimeOverNotification( | ||
var promiseId: Long, | ||
|
||
var promiseUserType: PromiseUserType, | ||
|
||
override var targetUserId: Long, | ||
) : Notification(targetUserId) |
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
23 changes: 0 additions & 23 deletions
23
...epromeet/whatnow/domains/progresshistory/handler/PromiseUserRegisterHistoryInitHandler.kt
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.