-- | Defines helper functions for the Stakeholders section.
module Drasil.Sections.Stakeholders (stakeholderIntro, tClientF, tCustomerF) where

import Language.Drasil
import Language.Drasil.Chunk.Concept.NamedCombinators
import qualified Language.Drasil.Sentence.Combinators as S

import qualified Drasil.DocLang.SRS as SRS
import Data.Drasil.Concepts.Documentation (client, customer, endUser, interest,
  product_, section_, stakeholder)

-- | General stakeholders introduction.
stakeholderIntro :: Contents
stakeholderIntro :: Contents
stakeholderIntro = [Sentence] -> Contents
foldlSP [String -> Sentence
S String
"This", forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
section_,
            String -> Sentence
S String
"describes the" Sentence -> Sentence -> Sentence
+: forall n. NamedIdea n => n -> Sentence
plural IdeaDict
stakeholder, String -> Sentence
S String
"the people who have an",
            forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
interest Sentence -> Sentence -> Sentence
`S.in_` forall n. NounPhrase n => n -> Sentence
phraseNP (forall t. NamedIdea t => t -> NP
the IdeaDict
product_)]

-- | Constructor for making a client. Takes in the system name and details regarding the client for the specific program.
tClientF :: (Idea a) => a -> Sentence ->  Section
tClientF :: forall a. Idea a => a -> Sentence -> Section
tClientF a
kWord Sentence
details = [Contents] -> [Section] -> Section
SRS.theClient [forall a. Idea a => a -> Sentence -> Contents
clientIntro a
kWord Sentence
details] []

-- | General clients introduction. Takes in the system name and details regarding the client for the specific program.
clientIntro :: (Idea a) => a -> Sentence -> Contents
clientIntro :: forall a. Idea a => a -> Sentence -> Contents
clientIntro a
kWord  Sentence
details = [Sentence] -> Contents
foldlSP [forall n. NounPhrase n => n -> Sentence
atStartNP forall a b. (a -> b) -> a -> b
$ forall t. NamedIdea t => t -> NP
the IdeaDict
client,
  String -> Sentence
S String
"for", forall c. Idea c => c -> Sentence
short a
kWord, String -> Sentence
S String
"is" Sentence -> Sentence -> Sentence
+:+. Sentence
details,
  forall n. NounPhrase n => n -> Sentence
atStartNP forall a b. (a -> b) -> a -> b
$ forall t. NamedIdea t => t -> NP
the IdeaDict
client, String -> Sentence
S String
"has the final say on acceptance of the", 
  forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
product_]

-- | Constructor for making a customer. Takes in the system name.
tCustomerF :: (Idea a) => a -> Section
tCustomerF :: forall a. Idea a => a -> Section
tCustomerF a
kWord = [Contents] -> [Section] -> Section
SRS.theCustomer [forall a. Idea a => a -> Contents
customerIntro a
kWord] []

-- | General customer introduction. Takes in the system name.
customerIntro :: (Idea a) => a -> Contents
customerIntro :: forall a. Idea a => a -> Contents
customerIntro a
kWord = [Sentence] -> Contents
foldlSP [forall n. NounPhrase n => n -> Sentence
atStartNP' forall a b. (a -> b) -> a -> b
$ forall t. NamedIdea t => t -> NP
the IdeaDict
customer,
  String -> Sentence
S String
"are the", forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
endUser Sentence -> Sentence -> Sentence
`S.of_` forall c. Idea c => c -> Sentence
short a
kWord]