-- | 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", IdeaDict -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
section_,
            String -> Sentence
S String
"describes the" Sentence -> Sentence -> Sentence
+: IdeaDict -> Sentence
forall n. NamedIdea n => n -> Sentence
plural IdeaDict
stakeholder, String -> Sentence
S String
"the people who have an",
            IdeaDict -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
interest Sentence -> Sentence -> Sentence
`S.in_` NP -> Sentence
forall n. NounPhrase n => n -> Sentence
phraseNP (IdeaDict -> NP
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 [a -> Sentence -> Contents
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 [NP -> Sentence
forall n. NounPhrase n => n -> Sentence
atStartNP (NP -> Sentence) -> NP -> Sentence
forall a b. (a -> b) -> a -> b
$ IdeaDict -> NP
forall t. NamedIdea t => t -> NP
the IdeaDict
client,
  String -> Sentence
S String
"for", a -> Sentence
forall c. Idea c => c -> Sentence
short a
kWord, String -> Sentence
S String
"is" Sentence -> Sentence -> Sentence
+:+. Sentence
details,
  NP -> Sentence
forall n. NounPhrase n => n -> Sentence
atStartNP (NP -> Sentence) -> NP -> Sentence
forall a b. (a -> b) -> a -> b
$ IdeaDict -> NP
forall t. NamedIdea t => t -> NP
the IdeaDict
client, String -> Sentence
S String
"has the final say on acceptance of the", 
  IdeaDict -> Sentence
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 [a -> Contents
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 [NP -> Sentence
forall n. NounPhrase n => n -> Sentence
atStartNP' (NP -> Sentence) -> NP -> Sentence
forall a b. (a -> b) -> a -> b
$ IdeaDict -> NP
forall t. NamedIdea t => t -> NP
the IdeaDict
customer,
  String -> Sentence
S String
"are the", IdeaDict -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
endUser Sentence -> Sentence -> Sentence
`S.of_` a -> Sentence
forall c. Idea c => c -> Sentence
short a
kWord]