,
@SerializedName("invitationImageCategory")
val invitationCategory: String,
)
data class HomeWappleEntity(
val id: Int,
val title: String,
val date: String = "토핑이 원하는 날짜와 ",
val time: String = "시간",
val comment: String = "약속에 대한 간략한 정보나 토핑 멤버에게 보내고 싶은 메시지를 작성해 보세요",
val location: String = "토핑이 원하는 위치",
val members: Listdata class ReponseHomeWapple (
@SerializedName("invitationId")
val invitationId: Int,
@SerializedName("title")
val title: String,
@SerializedName("date")
val date: String?,
@SerializedName("time")
val time: String?,
@SerializedName("comment")
val comment: String?,
@SerializedName("invitationPlace")
val invitationPlace: String?,
@SerializedName("invitationMemberDto")
val invitationMemberDto:List<WappleMemberEntity>,
@SerializedName("invitationImageCategory")
val invitationCategory: String,
)
data class HomeWappleEntity(
val id: Int,
val title: String,
val date: String = "토핑이 원하는 날짜와 ",
val time: String = "시간",
val comment: String = "약속에 대한 간략한 정보나 토핑 멤버에게 보내고 싶은 메시지를 작성해 보세요",
val location: String = "토핑이 원하는 위치",
val members: List<WappleMemberEntity>,
val category: WappleCard,
)
data class WappleMemberEntity(
val id: Int,
val nickname: String,
val profileImage: String,
)
class GetWappleCardEntityUseCase @Inject constructor(
private val repository: HomeRepository,
) {
operator fun invoke(): Flow<List<WappleCardEntity>> {
return repository.getHomeCard().map { wapples ->
wapples.map {
WappleCardEntity(
id = it.invitationId,
title = it.title,
date = it.date ?: "토핑이 원하는 날짜와",
time = it.time ?: "시간",
comment = it.comment ?: "약속에 대한 간략한 정보나 토핑 멤버에게 보내고 싶은 메시지를 작성해 보세요",
location = it.invitationPlace ?: "토핑이 원하는 위치",
members = it.invitationMemberDto,
category = WappleCard.valueOf(it.invitationCategory)
)
}
}
}
}