module PivotalTrackerApi.Iteration
    ( Iteration
    , number
    , project_id
    , PivotalTrackerApi.Iteration.length
    , team_strength
    , stories
    , start
    , finish
    , velocity
    , kind
    ) where

import PivotalTrackerApi.Base
import PivotalTrackerApi.Story (Story)

data Iteration = Iteration
             { _number :: Int
             , _project_id :: Int
             , _length :: Int
             , _team_strength :: Double
             , _stories :: [Story]
             , _start :: Text
             , _finish :: Text
             , _velocity :: Maybe Double
             , _kind :: Text
             } deriving (Show, Generic)

makeLenses ''Iteration

instance FromJSON Iteration where
  parseJSON = genericParseJSON defaultOptions{fieldLabelModifier = drop 1}
