From f82aba9a02aedc80d8384da261450d9f21ecfdef Mon Sep 17 00:00:00 2001 From: luevard <99143550+saucepommefrite@users.noreply.github.com> Date: Wed, 22 May 2024 11:19:42 +0200 Subject: [PATCH] :sparkles: Refactor and add PopularityScore for Mocking Data Source --- .../main/kotlin/allin/data/postgres/PostgresBetDataSource.kt | 1 + .../src/main/kotlin/allin/data/postgres/entities/BetEntity.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/src/main/kotlin/allin/data/postgres/PostgresBetDataSource.kt b/Sources/src/main/kotlin/allin/data/postgres/PostgresBetDataSource.kt index 08f94fd..d243f00 100644 --- a/Sources/src/main/kotlin/allin/data/postgres/PostgresBetDataSource.kt +++ b/Sources/src/main/kotlin/allin/data/postgres/PostgresBetDataSource.kt @@ -141,6 +141,7 @@ class PostgresBetDataSource(private val database: Database) : BetDataSource { this.createdBy = bet.createdBy this.status = bet.status this.type = bet.type + this.popularityscore = 0 } ) diff --git a/Sources/src/main/kotlin/allin/data/postgres/entities/BetEntity.kt b/Sources/src/main/kotlin/allin/data/postgres/entities/BetEntity.kt index 8c0e964..31949eb 100644 --- a/Sources/src/main/kotlin/allin/data/postgres/entities/BetEntity.kt +++ b/Sources/src/main/kotlin/allin/data/postgres/entities/BetEntity.kt @@ -41,7 +41,8 @@ interface BetEntity : Entity { } else { database.responses.filter { it.betId eq id }.map { it.response } }, - createdBy = createdBy + createdBy = createdBy, + popularityscore = popularityscore, ) fun toBetDetail(database: Database, username: String): BetDetail {