@@ -0,0 +1,9 @@
+package com.sirekanyan.knigopis.model
+
+data class ProfileModel(
+ val id: String,
+ val name: String,
+ val imageUrl: String?,
+ val profileUrl: String,
+ val shareUrl: String
+)
@@ -4,7 +4,7 @@ class User(
val id: String,
val nickname: String?,
val photo: String?,
- private val profile: String?,
+ val profile: String?,
private val identity: String?,
val booksCount: Int
) {
@@ -87,4 +87,10 @@ fun EditBookModel.toFinishedBook(): FinishedBookToSend =
date.month,
date.year,
notes
- )
+ )
+fun User.toProfileModel(): ProfileModel =
+ ProfileModel(id, name, photo, profile.orEmpty(), fixedProfile)
+fun ProfileModel.toProfile(): Profile =
+ Profile(name, profileUrl)