Skip to content

Commit e8f6d41

Browse files
committed
Feat: 반복루틴 단일 삭제를 위한 Dto 모델 정의
- RoutineByDayDeletion DTO 및 Mapper 추가
1 parent 83a6d18 commit e8f6d41

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.threegap.bitnagil.data.routine.model.request
2+
3+
import com.threegap.bitnagil.domain.routine.model.RoutineByDayDeletion
4+
import kotlinx.serialization.SerialName
5+
import kotlinx.serialization.Serializable
6+
7+
@Serializable
8+
data class RoutineByDayDeletionRequestDto(
9+
@SerialName("routineCompletionId")
10+
val routineCompletionId: Int?,
11+
@SerialName("routineId")
12+
val routineId: String,
13+
@SerialName("subRoutineInfosForDelete")
14+
val subRoutineInfosForDelete: List<SubRoutineDeletionInfoDto>,
15+
@SerialName("performedDate")
16+
val performedDate: String,
17+
@SerialName("historySeq")
18+
val historySeq: Int,
19+
)
20+
21+
fun RoutineByDayDeletion.toDto() =
22+
RoutineByDayDeletionRequestDto(
23+
routineCompletionId = this.routineCompletionId,
24+
routineId = this.routineId,
25+
subRoutineInfosForDelete = this.subRoutineInfosForDelete.map { it.toDto() },
26+
performedDate = this.performedDate,
27+
historySeq = this.historySeq,
28+
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.threegap.bitnagil.data.routine.model.request
2+
3+
import com.threegap.bitnagil.domain.routine.model.SubRoutineDeletionInfo
4+
import kotlinx.serialization.SerialName
5+
import kotlinx.serialization.Serializable
6+
7+
@Serializable
8+
data class SubRoutineDeletionInfoDto(
9+
@SerialName("routineCompletionId")
10+
val routineCompletionId: Int?,
11+
@SerialName("subRoutineId")
12+
val subRoutineId: String,
13+
)
14+
15+
fun SubRoutineDeletionInfo.toDto() =
16+
SubRoutineDeletionInfoDto(
17+
routineCompletionId = this.routineCompletionId,
18+
subRoutineId = this.subRoutineId,
19+
)

0 commit comments

Comments
 (0)