11 Diagramme de classes du domaine (client)
Arthur VALIN edited this page 1 year ago

Modèle

@startuml
left to right direction
title Modèle - Diagramme de classes

package "Model" {
  class User {
    -id : String
    -username : String
    -email : String
    -coins : Int
  }
  enum BetStatus{
    WAITING
    IN_PROGRESS
	CLOSING
    FINISHED
	CANCELLED
  }
  enum BetType{
    CUSTOM
	MATCH
	BINARY
  }
  
  abstract class Bet {
    -id : String
    -theme : String
    -phrase : String
    -endRegistration : Date
    -endBet : Date
    -isPrivate : Bool
    -status : BetStatus
	-type : BetType
  }
  class YesNoBet
  class CustomBet {
    -possibleResponses : List<String>
  }
  class MatchBet {
    -nameTeam1 : String
    -nameTeam2 : String
  }
  class BetDetail
  class BetResult {
    -result : String
  }
  class BetResultDetail {
    amount: Int
    won: Boolean
  }
  class Participation {
    -response : String
    -stake : Int
  }
  class AnswerDetail {
    -response : String
    -totalParticipants : Int
    -totalStakes : Int
    -highestStake : Int
    -odds : Float
  }
  
  Bet <|-- YesNoBet
  Bet <|-- CustomBet
  Bet <|-- MatchBet
  
  Bet --> "1" User : author
  
  Participation ..> "1" Bet : betId: String
  Participation --> "1" User : user
  
  BetDetail --> "1" Bet : bet
  BetDetail --> "*" Participation : participations
  BetDetail --> "*" AnswerDetail : answers
  
  BetResult ..> "1" Bet : betId: String
  
  BetResultDetail --> "1" BetResult : result
  BetResultDetail --> "1" Bet : bet
  BetResultDetail --> "1" Participation : participation
}


@enduml