module Drasil.Metadata.TraceabilityGraphs (
    GraphInfo(..),
    NodeFamily(..),
    Label, Colour
) where

import Drasil.Database (UID)

-- * Types

-- | Type synonym for clarity.
type Colour = String
-- | Type synonym for clarity.
type Label = String

-- | A node family contains a list of 'UID's, their display labels, general subgraph label, and colour.
data NodeFamily = NF {
    -- | Node 'UID's.
    NodeFamily -> [UID]
nodeUIDs :: [UID]
    -- | Display labels for nodes. We use the reference addresses from the 'UID's.
    , NodeFamily -> [Label]
nodeLabels :: [Label]
    -- | Individual subgraph labels. These labels do not show on the
    -- final generated pdf or png files.
    , NodeFamily -> Label
nfLabel :: Label
    -- | Gives the ability to change colours of bubbles within the graph.
    , NodeFamily -> Label
nfColour :: Colour
}

-- | Holds all important and relevant information for generating a traceability graph.
-- Includes nodes, graph edges, and node family information.
data GraphInfo = GI {
    --------------- graph node families -------------------------------
    -- | Assumptions.
    GraphInfo -> NodeFamily
assumpNF :: NodeFamily
    -- | Data definitions.
    , GraphInfo -> NodeFamily
ddNF :: NodeFamily
    -- | General definitions.
    , GraphInfo -> NodeFamily
gdNF :: NodeFamily
    -- | Theory models.
    , GraphInfo -> NodeFamily
tmNF :: NodeFamily
    -- | Instance models.
    , GraphInfo -> NodeFamily
imNF :: NodeFamily
    -- | Requirements (both functional and non-functional).
    , GraphInfo -> NodeFamily
reqNF :: NodeFamily
    -- | Goal statement.
    , GraphInfo -> NodeFamily
gsNF :: NodeFamily
    -- | Changes (both likely and unlikely).
    , GraphInfo -> NodeFamily
chgNF :: NodeFamily

    -------------- graph edges  ---------------------------
    -- | Assumptions dependent on assumptions.
    , GraphInfo -> [(UID, [UID])]
edgesAvsA     :: [(UID, [UID])]
    -- | Definitions, models, requirements, and changes dependent on assumptions.
    , GraphInfo -> [(UID, [UID])]
edgesAvsAll   :: [(UID, [UID])]
    -- | Definitions and models that are dependent on other definitions and models.
    , GraphInfo -> [(UID, [UID])]
edgesRefvsRef :: [(UID, [UID])]
    -- | Goals and requirements dependent on definitions, models, and other requirements.
    , GraphInfo -> [(UID, [UID])]
edgesAllvsR   :: [(UID, [UID])]
    -- | Definitions, models, requirements, goals, and changes that are dependent on one another.
    , GraphInfo -> [(UID, [UID])]
edgesAllvsAll :: [(UID, [UID])]

    -- may need more information regarding ranking & ordering, but for now I'm just keeping it simple
}