File tree Expand file tree Collapse file tree
data/src/main/java/com/threegap/bitnagil/data/writeroutine
domain/src/main/java/com/threegap/bitnagil/domain/writeroutine/model
presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com.threegap.bitnagil.data.writeroutine.model.request
22
3+ import com.threegap.bitnagil.domain.writeroutine.model.RepeatDay
34import com.threegap.bitnagil.domain.writeroutine.model.RoutineUpdateType
45import kotlinx.serialization.SerialName
56import kotlinx.serialization.Serializable
@@ -13,7 +14,7 @@ data class EditRoutineRequest(
1314 @SerialName(" routineName" )
1415 val routineName : String ,
1516 @SerialName(" repeatDay" )
16- val repeatDay : List <String >,
17+ val repeatDay : List <RepeatDay >,
1718 @SerialName(" routineStartDate" )
1819 val routineStartDate : String ,
1920 @SerialName(" routineEndDate" )
Original file line number Diff line number Diff line change 11package com.threegap.bitnagil.data.writeroutine.model.request
22
3+ import com.threegap.bitnagil.domain.writeroutine.model.RepeatDay
34import kotlinx.serialization.SerialName
45import kotlinx.serialization.Serializable
56
@@ -8,7 +9,7 @@ data class RegisterRoutineRequest(
89 @SerialName(" routineName" )
910 val routineName : String ,
1011 @SerialName(" repeatDay" )
11- val repeatDay : List <String >,
12+ val repeatDay : List <RepeatDay >,
1213 @SerialName(" routineStartDate" )
1314 val routineStartDate : String ,
1415 @SerialName(" routineEndDate" )
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class WriteRoutineRepositoryImpl @Inject constructor(
2828 ): Result <Unit > {
2929 val request = RegisterRoutineRequest (
3030 routineName = name,
31- repeatDay = repeatDay.map { it.fullName },
31+ repeatDay = repeatDay.map { it },
3232 executionTime = startTime.toString(),
3333 routineStartDate = startDate.toString(),
3434 routineEndDate = endDate.toString(),
@@ -56,7 +56,7 @@ class WriteRoutineRepositoryImpl @Inject constructor(
5656 routineId = routineId,
5757 updateApplyDate = routineUpdateType,
5858 routineName = name,
59- repeatDay = repeatDay.map { it.fullName },
59+ repeatDay = repeatDay.map { it },
6060 executionTime = startTime.toString(),
6161 routineStartDate = startDate.toString(),
6262 routineEndDate = endDate.toString(),
Original file line number Diff line number Diff line change 11package com.threegap.bitnagil.domain.writeroutine.model
22
3- enum class RepeatDay (val fullName : String ) {
4- MON (fullName = " MONDAY" ),
5- TUE (fullName = " TUESDAY" ),
6- WED (fullName = " WEDNESDAY" ),
7- THU (fullName = " THURSDAY" ),
8- FRI (fullName = " FRIDAY" ),
9- SAT (fullName = " SATURDAY" ),
10- SUN (fullName = " SUNDAY" ),
3+ import kotlinx.serialization.Serializable
4+
5+ @Serializable
6+ enum class RepeatDay {
7+ MONDAY ,
8+ TUESDAY ,
9+ WEDNESDAY ,
10+ THURSDAY ,
11+ FRIDAY ,
12+ SATURDAY ,
13+ SUNDAY ,
1114 ;
1215}
Original file line number Diff line number Diff line change @@ -341,13 +341,13 @@ class WriteRoutineViewModel @AssistedInject constructor(
341341
342342 val repeatDay = when (currentState.repeatType) {
343343 RepeatType .DAILY -> listOf (
344- RepeatDay .MON ,
345- RepeatDay .TUE ,
346- RepeatDay .WED ,
347- RepeatDay .THU ,
348- RepeatDay .FRI ,
349- RepeatDay .SAT ,
350- RepeatDay .SUN ,
344+ RepeatDay .MONDAY ,
345+ RepeatDay .TUESDAY ,
346+ RepeatDay .WEDNESDAY ,
347+ RepeatDay .THURSDAY ,
348+ RepeatDay .FRIDAY ,
349+ RepeatDay .SATURDAY ,
350+ RepeatDay .SUNDAY ,
351351 )
352352
353353 RepeatType .DAY ->
Original file line number Diff line number Diff line change @@ -15,13 +15,13 @@ enum class Day(val text: String) {
1515
1616 fun toRepeatDay (): RepeatDay {
1717 return when (this ) {
18- MON -> RepeatDay .MON
19- TUE -> RepeatDay .TUE
20- WED -> RepeatDay .WED
21- THU -> RepeatDay .THU
22- FRI -> RepeatDay .FRI
23- SAT -> RepeatDay .SAT
24- SUN -> RepeatDay .SUN
18+ MON -> RepeatDay .MONDAY
19+ TUE -> RepeatDay .TUESDAY
20+ WED -> RepeatDay .WEDNESDAY
21+ THU -> RepeatDay .THURSDAY
22+ FRI -> RepeatDay .FRIDAY
23+ SAT -> RepeatDay .SATURDAY
24+ SUN -> RepeatDay .SUNDAY
2525 }
2626 }
2727
You can’t perform that action at this time.
0 commit comments