-
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.
Browse files
Browse the repository at this point in the history
* feat: ticket type 상수 생성 * feat: TicketType 도메인 객체 생성 * feat: 티켓 타입 전달 객체 생성 * refactor: 티켓 타입이 string 으로 번역되도록 변경 * feat: ReservationTickets 정의 * feat: Response 가 ReservationTickets 를 반환한다 * refactor: 레포지토리에서 ReservationTickets 로 도매인 객체로 반환 * refactor: 티켓 타입이 정렬되게 변경 * fix: Response 타입 맞추기 * feat: 축제 상세 보기 실패 상수 의미 변경 * refactor: 테스트 코드 객체 포장 제거 * refactor: ReservationTickets 캡슐화
- Loading branch information
1 parent
251babc
commit 73666ec
Showing
19 changed files
with
107 additions
and
26 deletions.
There are no files selected for viewing
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
6 changes: 4 additions & 2 deletions
6
android/festago/app/src/main/java/com/festago/festago/data/dto/ReservationTicketsResponse.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,11 +1,13 @@ | ||
package com.festago.festago.data.dto | ||
|
||
import com.festago.festago.model.ReservationTicket | ||
import com.festago.festago.model.ReservationTickets | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ReservationTicketsResponse( | ||
val tickets: List<ReservationTicketResponse>, | ||
) { | ||
fun toDomain(): List<ReservationTicket> = tickets.map { it.toDomain() } | ||
fun toDomain(): ReservationTickets = ReservationTickets( | ||
tickets.map { it.toDomain() }, | ||
) | ||
} |
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
19 changes: 19 additions & 0 deletions
19
...com/festago/festago/presentation/ui/ticketreserve/bottomsheet/BottomSheetTicketTypeArg.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.festago.festago.presentation.ui.ticketreserve.bottomsheet | ||
|
||
import android.os.Parcelable | ||
import com.festago.festago.model.TicketType | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
enum class BottomSheetTicketTypeArg : Parcelable { | ||
STUDENT, VISITOR, OTHER | ||
; | ||
|
||
companion object { | ||
fun from(ticketType: TicketType): BottomSheetTicketTypeArg = when (ticketType) { | ||
TicketType.STUDENT -> STUDENT | ||
TicketType.VISITOR -> VISITOR | ||
TicketType.OTHER -> OTHER | ||
} | ||
} | ||
} |
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
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
9 changes: 9 additions & 0 deletions
9
android/festago/domain/src/main/java/com/festago/festago/model/ReservationTickets.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.festago.festago.model | ||
|
||
class ReservationTickets(private val tickets: List<ReservationTicket>) { | ||
|
||
fun sortedByTicketTypes(): List<ReservationTicket> { | ||
val ticketTypes = TicketType.values().toList() | ||
return tickets.sortedBy { ticketTypes.indexOf(it.ticketType) } | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
android/festago/domain/src/main/java/com/festago/festago/model/TicketType.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.festago.festago.model | ||
|
||
enum class TicketType { | ||
STUDENT, VISITOR, OTHER | ||
} |
4 changes: 2 additions & 2 deletions
4
...estago/domain/src/main/java/com/festago/festago/repository/ReservationTicketRepository.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,7 +1,7 @@ | ||
package com.festago.festago.repository | ||
|
||
import com.festago.festago.model.ReservationTicket | ||
import com.festago.festago.model.ReservationTickets | ||
|
||
interface ReservationTicketRepository { | ||
suspend fun loadTicketTypes(stageId: Int): Result<List<ReservationTicket>> | ||
suspend fun loadTicketTypes(stageId: Int): Result<ReservationTickets> | ||
} |