@@ -8,20 +8,22 @@ import java.time.Duration
8
8
import java.time.Period
9
9
import java.time.ZonedDateTime
10
10
11
- sealed class ItineraryItem { // <1>
12
- abstract val id: Id <ItineraryItem > // <2>
11
+ sealed class ItineraryItem {
12
+ abstract val id: Id <ItineraryItem >
13
13
abstract val description: String
14
- abstract val costs: List <Money >
15
- abstract val mapOverlay: MapOverlay
14
+ abstract val costs: List <Money > // <1>
16
15
}
17
16
17
+ val ItineraryItem .mapOverlay: MapOverlay // <2>
18
+ get() = TODO (" Not yet implemented" )
19
+
18
20
data class Accommodation (
19
21
override val id : Id <Accommodation >,
20
22
val location : Location ,
21
23
val checkInFrom : ZonedDateTime ,
22
24
val checkOutBefore : ZonedDateTime ,
23
25
val pricePerNight : Money
24
- ) : ItineraryItem() { // <3>
26
+ ) : ItineraryItem() {
25
27
val nights = Period .between(
26
28
checkInFrom.toLocalDate(),
27
29
checkOutBefore.toLocalDate()
@@ -30,11 +32,9 @@ data class Accommodation(
30
32
31
33
override val description
32
34
get() = " $nights nights at ${location.userReadableName} "
33
-
34
35
override val costs
35
36
get() = listOf (totalPrice)
36
-
37
- override val mapOverlay
37
+ override val mapOverlay // <3>
38
38
get() = PointOverlay (
39
39
id = id,
40
40
position = location.position,
@@ -44,20 +44,19 @@ data class Accommodation(
44
44
45
45
}
46
46
47
-
48
47
data class Attraction (
49
48
override val id : Id <Attraction >,
50
49
val location : Location ,
51
50
val notes : String
52
51
) : ItineraryItem() {
53
- override val description
54
- get() = location.userReadableName
52
+ override val description get() =
53
+ location.userReadableName
55
54
56
- override val costs
57
- get() = emptyList<Money >()
55
+ override val costs get() =
56
+ emptyList<Money >()
58
57
59
- override val mapOverlay
60
- get() = PointOverlay (
58
+ override val mapOverlay get() =
59
+ PointOverlay (
61
60
position = location.position,
62
61
text = description,
63
62
icon = StandardIcons .ATTRACTION ,
@@ -101,14 +100,12 @@ data class RestaurantBooking(
101
100
val location : Location ,
102
101
val time : ZonedDateTime
103
102
) : ItineraryItem() {
104
- override val description
105
- get() = location.userReadableName
103
+ override val description get() = location.userReadableName
106
104
107
- override val costs
108
- get() = emptyList<Money >()
105
+ override val costs get() = emptyList<Money >()
109
106
110
- override val mapOverlay
111
- get() = PointOverlay (
107
4F1C
+ override val mapOverlay get() =
108
+ PointOverlay (
112
109
id = id,
113
110
position = location.position,
114
111
text = location.userReadableName,
0 commit comments