-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from Nexters/feature/Boolti-227
Boolti-227 feat: 구매 중 품절 케이스 구현
- Loading branch information
Showing
17 changed files
with
161 additions
and
44 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
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
17 changes: 17 additions & 0 deletions
17
domain/src/main/java/com/nexters/boolti/domain/exception/TicketingException.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,17 @@ | ||
package com.nexters.boolti.domain.exception | ||
|
||
data class TicketingException( | ||
val errorType: TicketingErrorType?, | ||
) : Exception(errorType?.name) | ||
|
||
enum class TicketingErrorType { | ||
Unknown, NoRemainingQuantity, ApprovePaymentFailed; | ||
|
||
companion object { | ||
fun fromString(type: String?) = when (type?.trim()?.uppercase()) { | ||
"NO_REMAINING_QUANTITY" -> NoRemainingQuantity | ||
"APPROVE_PAYMENT_FAILED" -> ApprovePaymentFailed | ||
else -> Unknown | ||
} | ||
} | ||
} |
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
50 changes: 50 additions & 0 deletions
50
...on/src/main/java/com/nexters/boolti/presentation/screen/ticketing/PaymentFailureDialog.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,50 @@ | ||
package com.nexters.boolti.presentation.screen.ticketing | ||
|
||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import com.nexters.boolti.presentation.R | ||
import com.nexters.boolti.presentation.component.BTDialog | ||
import com.nexters.boolti.presentation.theme.BooltiTheme | ||
import com.nexters.boolti.presentation.theme.Grey50 | ||
|
||
@Composable | ||
fun PaymentFailureDialog(modifier: Modifier = Modifier, onClickButton: () -> Unit) { | ||
BTDialog( | ||
modifier = modifier, | ||
enableDismiss = false, | ||
showCloseButton = false, | ||
positiveButtonLabel = stringResource(R.string.ticketing_again), | ||
onClickPositiveButton = onClickButton, | ||
) { | ||
Text( | ||
text = stringResource(R.string.payment_failed), | ||
style = MaterialTheme.typography.titleLarge, | ||
color = MaterialTheme.colorScheme.onSurfaceVariant, | ||
) | ||
Text( | ||
modifier = Modifier.padding(top = 4.dp), | ||
text = stringResource(R.string.payment_failed_description), | ||
textAlign = TextAlign.Center, | ||
style = MaterialTheme.typography.bodySmall, | ||
color = Grey50, | ||
) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun PaymentFailureDialogPreview() { | ||
BooltiTheme { | ||
Surface { | ||
PaymentFailureDialog {} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.