🐛 Fix status update
continuous-integration/drone/push Build is passing Details

pull/12/head
Arthur VALIN 1 year ago
parent 62aa1bbf9b
commit 30c4cf199f

@ -37,9 +37,9 @@ class MockBetDataSource(mockData: MockDataSource.MockData) : BetDataSource {
if (bet.status != CANCELLED && bet.status != FINISHED) { if (bet.status != CANCELLED && bet.status != FINISHED) {
if (date >= bet.endRegistration) { if (date >= bet.endRegistration) {
if (date >= bet.endBet) { if (date >= bet.endBet) {
bets[idx] = bet.copy(status = WAITING)
} else {
bets[idx] = bet.copy(status = CLOSING) bets[idx] = bet.copy(status = CLOSING)
} else {
bets[idx] = bet.copy(status = WAITING)
} }
} }
} }

@ -214,7 +214,9 @@ class PostgresBetDataSource(private val database: Database) : BetDataSource {
set(BetsEntity.status, BetStatus.CLOSING) set(BetsEntity.status, BetStatus.CLOSING)
where { where {
(date.toInstant() greaterEq BetsEntity.endRegistration) and (date.toInstant() greaterEq BetsEntity.endRegistration) and
(date.toInstant() greaterEq BetsEntity.endBet) (date.toInstant() greaterEq BetsEntity.endBet) and
(BetsEntity.status notEq BetStatus.FINISHED) and
(BetsEntity.status notEq BetStatus.CANCELLED)
} }
} }
} }

Loading…
Cancel
Save