Auction status change and confirmation
This commit is contained in:
+11
-1
@@ -8,7 +8,17 @@ case class User(id: Option[Int], username: String, gid: String, passwordDigest:
|
||||
|
||||
case class AuthToken(id: Option[Int], userId: Int, token: String, createdAt: Instant, expiresAt: Instant)
|
||||
|
||||
case class Auction(id: Option[Int], name: String, gid: String, authorId: Int,
|
||||
enum AuctionStatus(val value: Short) {
|
||||
case Created extends AuctionStatus(0)
|
||||
case Ready extends AuctionStatus(10)
|
||||
case Finished extends AuctionStatus(10000)
|
||||
}
|
||||
|
||||
object AuctionStatus {
|
||||
lazy val byValue: Map[Short, AuctionStatus] = Map.from(AuctionStatus.values.map{it => (it.value, it)})
|
||||
}
|
||||
|
||||
case class Auction(id: Option[Int], name: String, status: AuctionStatus, gid: String, authorId: Int,
|
||||
startingPrice: BigDecimal, currentBid: Option[BigDecimal],
|
||||
currentBidderId: Option[Int], currentBidAt: Option[Instant],
|
||||
createdAt: Instant)
|
||||
|
||||
Reference in New Issue
Block a user