- -- | We convert from XML to the database by dropping the line field.
- --
- from_xml OddsGameCasinoXml{..} =
- OddsCasino {
- casino_client_id = xml_casino_client_id,
- casino_name = xml_casino_name }
-
-
--- | This allows us to insert the XML representation 'OddsGameCasinoXml'
--- directly.
---
-instance XmlImport OddsGameCasinoXml
-
-
--- * OddsGameHomeTeamXml / OddsGameAwayTeamXml
-
--- | The XML representation of a \<HomeTeam\>, as found in \<Game\>s.
--- This is basically the same as 'OddsGameAwayTeamXml', but the two
--- types have different picklers.
---
--- The starter id/name could perhaps be combined into an embedded
--- type, but can you make an entire embedded type optional with
--- Maybe? I doubt it works.
---
-data OddsGameHomeTeamXml =
- OddsGameHomeTeamXml {
- xml_home_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_home_team_rotation_number :: Int,
- xml_home_team_abbr :: String,
- xml_home_team_name :: String,
- xml_home_team_starter :: Maybe (Int, String), -- ^ (id, name)
- xml_home_team_casinos :: [OddsGameCasinoXml] }
- deriving (Eq, Show)
-
-instance ToDb OddsGameHomeTeamXml where
- -- | The database representation of an 'OddsGameHomeTeamXml' is an
- -- 'OddsGameTeam'.