]> Git — Sourcephile - tmp/julm/literate-invoice.git/blob - src/Literate/Accounting/PlanComptableGénéral/PCG.hs
maint/correctness(Entity): use sum type for EntityId
[tmp/julm/literate-invoice.git] / src / Literate / Accounting / PlanComptableGénéral / PCG.hs
1 {-# LANGUAGE DeriveAnyClass #-}
2
3 module Literate.Accounting.PlanComptableGénéral.PCG where
4
5 import Literate.Prelude
6
7 data PCG = PCG
8 { pcgId :: PCGId
9 , pcgParent :: Maybe PCGId
10 , pcgSystem :: PCGSystem
11 , pcgDescription :: ShortText
12 }
13 deriving (Eq, Ord, Show, Generic, NFData)
14
15 newtype PCGId = PCGId Natural
16 deriving (Eq, Ord, Show, Generic)
17 deriving newtype (NFData)
18 instance FromInteger PCGId where
19 fromInteger = PCGId . fromInteger
20
21 data PCGSystem
22 = PCGSystemCondensed
23 | PCGSystemBase
24 | PCGSystemDeveloped
25 deriving (Eq, Ord, Show, Generic, NFData)