File tree 1 file changed +9
-6
lines changed
domain/src/main/java/com/lighthouse/domain/model
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -3,37 +3,40 @@ package com.lighthouse.domain.model
3
3
import com.lighthouse.domain.VertexLocation
4
4
import java.util.Date
5
5
6
- sealed class History (open val date : Date , open val gifticonId : String ) {
6
+ sealed interface History {
7
+ val date: Date
8
+ val gifticonId: String
9
+
7
10
data class Init (
8
11
override val date : Date ,
9
12
override val gifticonId : String ,
10
13
val amount : Int? = null ,
11
- ) : History(date, gifticonId)
14
+ ) : History
12
15
13
16
data class Use (
14
17
override val date : Date ,
15
18
override val gifticonId : String ,
16
19
val location : VertexLocation ? = null ,
17
- ) : History(date, gifticonId)
20
+ ) : History
18
21
19
22
data class UseCashCard (
20
23
override val date : Date ,
21
24
override val gifticonId : String ,
22
25
val amount : Int ,
23
26
val balance : Int? = null ,
24
27
val location : VertexLocation ? = null ,
25
- ) : History(date, gifticonId)
28
+ ) : History
26
29
27
30
data class CancelUsage (
28
31
override val date : Date ,
29
32
override val gifticonId : String ,
30
- ) : History(date, gifticonId)
33
+ ) : History
31
34
32
35
data class ModifyAmount (
33
36
override val date : Date ,
34
37
override val gifticonId : String ,
35
38
val balance : Int? = null ,
36
- ) : History(date, gifticonId)
39
+ ) : History
37
40
38
41
companion object {
39
42
fun getType (history : History ): Int = when (history) {
You can’t perform that action at this time.
0 commit comments