-- | 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 "This", NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase NamedChunk
section_,
            String -> Sentence
S "describes the" Sentence -> Sentence -> Sentence
+: NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
plural NamedChunk
stakeholder, String -> Sentence
S "the people who have an",
            NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase NamedChunk
interest Sentence -> Sentence -> Sentence
`S.in_` NP -> Sentence
forall n. NounPhrase n => n -> Sentence
phraseNP (NamedChunk -> NP
forall t. NamedIdea t => t -> NP
the NamedChunk
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 :: a -> Sentence -> Section
tClientF kWord :: a
kWord details :: 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 :: a -> Sentence -> Contents
clientIntro kWord :: a
kWord  details :: 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
$ NamedChunk -> NP
forall t. NamedIdea t => t -> NP
the NamedChunk
client,
  String -> Sentence
S "for", a -> Sentence
forall c. (Idea c, HasUID c) => c -> Sentence
short a
kWord, String -> Sentence
S "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
$ NamedChunk -> NP
forall t. NamedIdea t => t -> NP
the NamedChunk
client, String -> Sentence
S "has the final say on acceptance of the", 
  NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase NamedChunk
product_]

-- | Constructor for making a customer. Takes in the system name.
tCustomerF :: (Idea a) => a -> Section
tCustomerF :: a -> Section
tCustomerF kWord :: 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 :: a -> Contents
customerIntro kWord :: 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
$ NamedChunk -> NP
forall t. NamedIdea t => t -> NP
the NamedChunk
customer,
  String -> Sentence
S "are the", NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase NamedChunk
endUser Sentence -> Sentence -> Sentence
`S.of_` a -> Sentence
forall c. (Idea c, HasUID c) => c -> Sentence
short a
kWord]