module PivotalTrackerApi.Story
    ( Story
    , story_type
    , kind
    , url
    , requested_by_id
    , current_state
    , name
    , updated_at
    , project_id
    , created_at
    , PivotalTrackerApi.Story.id
    , labels
    , owner_ids
    , estimate
    , description
    ) where

import PivotalTrackerApi.Base
import PivotalTrackerApi.Label (Label)

data Story = Story
             { _story_type :: Text
             , _kind :: Text
             , _url :: Text
             , _requested_by_id :: Int
             , _current_state :: Text
             , _name :: Text
             , _updated_at :: Text
             , _project_id :: Int
             , _created_at :: String
             , _id :: Int
             , _labels :: [Label]
             , _owner_ids :: [Int]
             , _estimate :: Maybe Int
             , _description :: Maybe Text
             } deriving (Show, Generic)

makeLenses ''Story

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