--- | The XML representation of a \<AwayTeam\>, as found in \<Game\>s.
--- This is basically the same as 'OddsGameHomeTeamXml', but the two
--- types have different picklers.
---
-data OddsGameAwayTeamXml =
- OddsGameAwayTeamXml {
- xml_away_team_id :: String, -- ^ The home/away team IDs are
- -- three characters but Postgres
- -- imposes no performance penalty
- -- on lengthless text fields, so
- -- we ignore the probable upper
- -- bound of three characters
- xml_away_team_rotation_number :: Int,
- xml_away_team_abbr :: String,
- xml_away_team_name :: String,
- xml_away_team_starter :: Maybe (Int, String), -- ^ (id, name)
- xml_away_team_casinos :: [OddsGameCasinoXml] }
- deriving (Eq, Show)
-
-instance ToDb OddsGameAwayTeamXml where
- -- | The database representation of an 'OddsGameAwayTeamXml' is a
- -- 'Team'.
- --
- type Db OddsGameAwayTeamXml = Team
-
-instance FromXml OddsGameAwayTeamXml where
- -- | We convert from XML to the database by dropping the lines and
- -- rotation number (which are specific to the games, not the teams
- -- themselves).
- --
- from_xml OddsGameAwayTeamXml{..} = Team
- xml_away_team_id
- (Just xml_away_team_abbr)
- (Just xml_away_team_name)
-
--- | This allows us to insert the XML representation
--- 'OddsGameAwayTeamXml' directly.
---
-instance XmlImport OddsGameAwayTeamXml where
-
-
--- * OddsGame_OddsGameTeam
-
--- | Database mapping between games and their home/away teams.
---
-data OddsGame_Team =
- OddsGame_Team {
- ogt_odds_games_id :: DefaultKey OddsGame,
- ogt_away_team_id :: DefaultKey Team,
- ogt_home_team_id :: DefaultKey Team }
-