Profile picture in participations
continuous-integration/drone/push Build is passing Details

pull/5/head
avalin 11 months ago
parent bcc735f713
commit 98c9351d8f

@ -155,7 +155,7 @@ class BetStatusBottomSheetBetDisplayer(
BetStatusParticipant( BetStatusParticipant(
username = it.username, username = it.username,
allCoinsAmount = it.stake, allCoinsAmount = it.stake,
image = getImageUrl(it.id) image = getImageUrl(it.userId)
) )
HorizontalDivider( HorizontalDivider(
color = AllInTheme.colors.border, color = AllInTheme.colors.border,
@ -168,7 +168,7 @@ class BetStatusBottomSheetBetDisplayer(
BetStatusParticipant( BetStatusParticipant(
username = it.username, username = it.username,
allCoinsAmount = it.stake, allCoinsAmount = it.stake,
image = getImageUrl(it.id) image = getImageUrl(it.userId)
) )
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
} }

@ -129,7 +129,7 @@ class MainViewModel @Inject constructor(
selectedBet.value?.let { selectedBet.value?.let {
val participation = Participation( val participation = Participation(
betId = it.bet.id, betId = it.bet.id,
id = user.id, userId = user.id,
username = user.username, username = user.username,
response = response, response = response,
stake = stake stake = stake

@ -86,14 +86,14 @@ class BetDetailPreviewProvider : PreviewParameterProvider<BetDetail> {
participations = listOf( participations = listOf(
Participation( Participation(
betId = it.id, betId = it.id,
id = "1", userId = "1",
username = "User1", username = "User1",
response = answers.first().response, response = answers.first().response,
stake = 100 stake = 100
), ),
Participation( Participation(
betId = it.id, betId = it.id,
id = "2", userId = "2",
username = "User 2", username = "User 2",
response = answers.last().response, response = answers.last().response,
stake = 150 stake = 150
@ -101,14 +101,14 @@ class BetDetailPreviewProvider : PreviewParameterProvider<BetDetail> {
), ),
userParticipation = Participation( userParticipation = Participation(
betId = it.id, betId = it.id,
id = "1", userId = "1",
username = "User1", username = "User1",
response = answers.first().response, response = answers.first().response,
stake = 100 stake = 100
), ),
wonParticipation = Participation( wonParticipation = Participation(
betId = it.id, betId = it.id,
id = "1", userId = "1",
username = "User1", username = "User1",
response = answers.first().response, response = answers.first().response,
stake = 100 stake = 100

@ -359,6 +359,7 @@ class MockAllInApi : AllInApi {
mockParticipations.add( mockParticipations.add(
ResponseParticipation( ResponseParticipation(
id = "", id = "",
userId = "",
betId = body.betId, betId = body.betId,
username = it.first.username, username = it.first.username,
answer = body.answer, answer = body.answer,
@ -446,6 +447,7 @@ class MockAllInApi : AllInApi {
private val mockParticipations = mutableListOf( private val mockParticipations = mutableListOf(
ResponseParticipation( ResponseParticipation(
id = "", id = "",
userId = "",
betId = "UUID1", betId = "UUID1",
username = mockUsers[1].first.username, username = mockUsers[1].first.username,
answer = NO_VALUE, answer = NO_VALUE,
@ -453,6 +455,7 @@ class MockAllInApi : AllInApi {
), ),
ResponseParticipation( ResponseParticipation(
id = "", id = "",
userId = "",
betId = "UUID1", betId = "UUID1",
username = mockUsers[6].first.username, username = mockUsers[6].first.username,
answer = YES_VALUE, answer = YES_VALUE,
@ -460,6 +463,7 @@ class MockAllInApi : AllInApi {
), ),
ResponseParticipation( ResponseParticipation(
id = "", id = "",
userId = "",
betId = "UUID2", betId = "UUID2",
username = mockUsers[0].first.username, username = mockUsers[0].first.username,
answer = "Answer 1", answer = "Answer 1",
@ -467,6 +471,7 @@ class MockAllInApi : AllInApi {
), ),
ResponseParticipation( ResponseParticipation(
id = "", id = "",
userId = "",
betId = "UUID2", betId = "UUID2",
username = mockUsers[2].first.username, username = mockUsers[2].first.username,
answer = "Answer 1", answer = "Answer 1",
@ -474,6 +479,7 @@ class MockAllInApi : AllInApi {
), ),
ResponseParticipation( ResponseParticipation(
id = "", id = "",
userId = "",
betId = "UUID2", betId = "UUID2",
username = mockUsers[6].first.username, username = mockUsers[6].first.username,
answer = "Answer 1", answer = "Answer 1",
@ -481,6 +487,7 @@ class MockAllInApi : AllInApi {
), ),
ResponseParticipation( ResponseParticipation(
id = "", id = "",
userId = "",
betId = "UUID3", betId = "UUID3",
username = mockUsers[1].first.username, username = mockUsers[1].first.username,
answer = "The Monarchs", answer = "The Monarchs",

@ -9,6 +9,7 @@ import kotlinx.serialization.Serializable
data class ResponseParticipation( data class ResponseParticipation(
val id: String, val id: String,
val betId: String, val betId: String,
val userId: String,
val username: String, val username: String,
val answer: String, val answer: String,
val stake: Int val stake: Int
@ -16,7 +17,7 @@ data class ResponseParticipation(
fun toParticipation() = fun toParticipation() =
Participation( Participation(
betId = betId, betId = betId,
id = id, userId = userId,
username = username, username = username,
response = answer, response = answer,
stake = stake stake = stake

@ -4,7 +4,7 @@ import fr.iut.alldev.allin.data.api.model.RequestParticipation
data class Participation( data class Participation(
val betId: String, val betId: String,
val id: String, val userId: String,
val username: String, val username: String,
val response: String, val response: String,
val stake: Int val stake: Int

Loading…
Cancel
Save