1 {-# LANGUAGE DeriveAnyClass #-}
2 {-# LANGUAGE OverloadedStrings #-}
4 module Tests.Organization where
6 import Country.Identifier qualified as Country
8 import Literate.Database
9 import Literate.Document qualified as Doc
10 import Literate.Organization
11 import Literate.Prelude
16 [ "3, place du Monument"
19 , addressCity = "Gentioux-Pigerolles"
20 , addressZipCode = "23340"
21 , addressCountry = Country.france
24 -- | Warning: the order of the constructors matters,
25 -- `Enum` being used to generate identifying numbers sent to entities.
30 | EntityNixOSFoundationNGITeam
31 | EntityNixOSFoundation
32 | EntityNixOSFoundationFinance
35 deriving (Eq, Ord, Show, Enum, Generic, NFData)
37 instance Doc.ToInline EntityId where
38 toInline = fromEnum >>> Doc.toInline
40 instance Get (Entity EntityId) EntityId where
41 get entityId = case entityId of
44 { entityName = Just "julminfo"
45 , entityAddress = Just bureau1
46 , entitySIREN = Just "942798083"
50 { ibanCountry = Country.france
51 , ibanCheckDigits = 18
52 , ibanBasicBankAccountNumber = "20041010082037353D02912"
57 { entityName = Just "Julien Moutinho"
58 , entityEmail = Just "julm@sourcephile.fr"
59 -- , entityPhone = Just "+33 7 55 60 42 77"
63 { entityName = Just "Urssaf"
64 , entityAddress = Nothing
65 , entitySIREN = Nothing
66 , entityIBAN = Nothing
68 EntityNixOSFoundation ->
70 { entityName = Just "Stichting NixOS Foundation"
75 [ "Korte Lijnbaanssteeg 1-4318"
77 , addressZipCode = "1012 SL"
78 , addressCity = "Amsterdam"
79 , addressCountry = Country.netherlands
82 EntityNixOSFoundationNGITeam ->
84 { entityName = Just "Nix@NGI Team"
85 , entityEmail = Just "ngi@nixos.org"
87 EntityNixOSFoundationFinance ->
89 { entityEmail = Just "finance@nixos.org"
93 { entityName = Just "Upwork"
94 , entityAddress = Nothing
95 , entitySIREN = Nothing
96 , entityIBAN = Nothing
98 EntityDanielRamirez ->
100 { entityName = Just "Daniel Ramirez"
101 , entityEmail = Just "danielramirez5@protonmail.com"
104 instance Get (Organization EntityId) EntityId where
105 get orgEntity = case orgEntity of
110 [ "Admin" := EntityJulm & get
114 Organization{orgEntity, orgParts = []}
116 Organization{orgEntity, orgParts = []}
117 EntityNixOSFoundation ->
121 [ "Admin" := EntityNixOSFoundationFinance & get
122 , "Department" := EntityNixOSFoundationNGITeam & get
125 EntityNixOSFoundationFinance ->
126 Organization{orgEntity, orgParts = []}
127 EntityNixOSFoundationNGITeam ->
129 { orgEntity = EntityNixOSFoundationNGITeam
131 [ "Admin" := EntityDanielRamirez & get
139 EntityDanielRamirez ->
141 { orgEntity = EntityDanielRamirez