# LANGUAGE DataKinds          #
# LANGUAGE DerivingVia #
# LANGUAGE InstanceSigs       #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell    #
# LANGUAGE TypeApplications   #
{-# LANGUAGE TypeFamilies      #-}
{-# LANGUAGE TypeOperators     #-}
# LANGUAGE StandaloneDeriving #
module Futurice.Integrations.Types where

import Futurice.Prelude
import Prelude ()

import Futurice.Generics
import Futurice.Report.Columns (ToColumns)
import Futurice.Tribe          (Tribe)

-- | Employee information often used in reports
--
-- /TODO/ lensify
data Employee = Employee
    { employeeName     :: !Text
    , employeeTribe    :: !Tribe
    , employeeContract :: !Text
    }
  deriving stock (Eq, Show, Typeable, Generic)
  deriving anyclass (NFData)

deriveGeneric ''Employee
deriving anyclass instance  ToColumns Employee
instance ToSchema Employee where declareNamedSchema = sopDeclareNamedSchema
deriving via Sopica Employee instance ToJSON Employee
deriving via Sopica Employee instance FromJSON Employee

# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies      #
# LANGUAGE TypeOperators     #
 | Employee information often used in reports

 /TODO/ lensify
# LANGUAGE DataKinds          #
# LANGUAGE DerivingVia #
# LANGUAGE InstanceSigs       #
# LANGUAGE TemplateHaskell    #
# LANGUAGE TypeApplications   #
# LANGUAGE StandaloneDeriving #
module Futurice.Integrations.Types where

import Futurice.Prelude
import Prelude ()

import Futurice.Generics
import Futurice.Report.Columns (ToColumns)
import Futurice.Tribe          (Tribe)

data Employee = Employee
    { employeeName     :: !Text
    , employeeTribe    :: !Tribe
    , employeeContract :: !Text
    }
  deriving stock (Eq, Show, Typeable, Generic)
  deriving anyclass (NFData)

deriveGeneric ''Employee
deriving anyclass instance  ToColumns Employee
instance ToSchema Employee where declareNamedSchema = sopDeclareNamedSchema
deriving via Sopica Employee instance ToJSON Employee
deriving via Sopica Employee instance FromJSON Employee
