File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
presentation/src/main/java/com/whyranoid/presentation/model Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,18 @@ data class GroupInfoUiModel(
14
14
val leader : UserUiModel
15
15
) : Parcelable
16
16
17
+ fun GroupInfoUiModel.toGroupInfo () =
18
+ GroupInfo (
19
+ name = this .name,
20
+ groupId = this .groupId,
21
+ introduce = this .introduce,
22
+ rules = this .rules.map { rule ->
23
+ rule.toRule()
24
+ },
25
+ headCount = this .headCount,
26
+ leader = this .leader.toUser()
27
+ )
28
+
17
29
fun GroupInfo.toGroupInfoUiModel () =
18
30
GroupInfoUiModel (
19
31
name = this .name,
Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ data class RuleUiModel(
16
16
}
17
17
}
18
18
19
+ fun RuleUiModel.toRule () =
20
+ Rule (
21
+ dayOfWeek = this .dayOfWeek,
22
+ hour = this .hour,
23
+ minute = this .minute
24
+ )
25
+
19
26
fun Rule.toRuleUiModel () =
20
27
RuleUiModel (
21
28
dayOfWeek = this .dayOfWeek,
Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ data class UserUiModel(
11
11
val profileUrl : String?
12
12
) : Parcelable
13
13
14
+ fun UserUiModel.toUser () =
15
+ User (
16
+ uid = this .uid,
17
+ name = this .name,
18
+ profileUrl = this .profileUrl
19
+ )
20
+
14
21
fun User.toUserUiModel () =
15
22
UserUiModel (
16
23
uid = this .uid,
You can’t perform that action at this time.
0 commit comments