-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AN/USER] refactor: 티켓 목록 화면 presentation model 을 사용하지 않도록 변경 (#420)
* refactor: 티켓 아이템 UiState 팩토리 메서드 생성 * refactor: TicketListItemUiState 변경 사항 화면에 반영
- Loading branch information
1 parent
4bface8
commit 0b73941
Showing
5 changed files
with
47 additions
and
51 deletions.
There are no files selected for viewing
41 changes: 29 additions & 12 deletions
41
...rc/main/java/com/festago/festago/presentation/ui/home/ticketlist/TicketListItemUiState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
package com.festago.festago.presentation.ui.home.ticketlist | ||
|
||
import com.festago.festago.presentation.model.StageUiModel | ||
import com.festago.festago.presentation.model.TicketConditionUiModel | ||
import com.festago.festago.model.Stage | ||
import com.festago.festago.model.Ticket | ||
import com.festago.festago.model.TicketCondition | ||
import java.time.LocalDateTime | ||
|
||
data class TicketListItemUiState( | ||
val id: Long = -1, | ||
val number: Int = -1, | ||
val entryTime: LocalDateTime = LocalDateTime.MIN, | ||
val reserveAt: LocalDateTime = LocalDateTime.MIN, | ||
val condition: TicketConditionUiModel = TicketConditionUiModel.BEFORE_ENTRY, | ||
val stage: StageUiModel = StageUiModel(), | ||
val festivalId: Int = -1, | ||
val festivalName: String = "", | ||
val festivalThumbnail: String = "", | ||
val id: Long, | ||
val number: Int, | ||
val entryTime: LocalDateTime, | ||
val reserveAt: LocalDateTime, | ||
val condition: TicketCondition, | ||
val stage: Stage, | ||
val festivalId: Int, | ||
val festivalName: String, | ||
val festivalThumbnail: String, | ||
val canEntry: Boolean, | ||
val onTicketEntry: (ticketId: Long) -> Unit, | ||
) | ||
) { | ||
companion object { | ||
fun of(ticket: Ticket, onTicketEntry: (ticketId: Long) -> Unit) = TicketListItemUiState( | ||
id = ticket.id, | ||
number = ticket.number, | ||
entryTime = ticket.entryTime, | ||
reserveAt = ticket.reserveAt, | ||
condition = ticket.condition, | ||
stage = ticket.stage, | ||
festivalId = ticket.festivalTicket.id, | ||
festivalName = ticket.festivalTicket.name, | ||
festivalThumbnail = ticket.festivalTicket.thumbnail, | ||
canEntry = LocalDateTime.now().isAfter(ticket.entryTime), | ||
onTicketEntry = onTicketEntry, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters