1 {-# LANGUAGE DeriveAnyClass #-}
2 {-# LANGUAGE OverloadedStrings #-}
4 module Tests.Organization where
6 import Country.Identifier qualified as Country
7 import Literate.Document qualified as Doc
8 import Literate.Organization
9 import Literate.Prelude
14 [ "3, place du Monument"
17 , addressCity = "Gentioux-Pigerolles"
18 , addressZipCode = "23340"
19 , addressCountry = Country.france
22 -- | Warning: the order of the constructors matters,
23 -- `Enum` being used to generate identifying numbers sent to entities.
28 | EntityNixOSFoundationNGITeam
29 | EntityNixOSFoundation
30 | EntityNixOSFoundationFinance
33 deriving (Eq, Ord, Show, Enum, Generic, NFData)
35 instance Doc.ToInline EntityId where
36 toInline = fromEnum >>> Doc.toInline
38 instance GetEntity EntityId where
39 getEntity entityId = case entityId of
42 { entityName = Just "julminfo"
43 , entityAddress = Just bureau1
44 , entitySIREN = Just "942798083"
48 { ibanCountry = Country.france
49 , ibanCheckDigits = 18
50 , ibanBasicBankAccountNumber = "20041010082037353D02912"
55 { entityName = Just "Julien Moutinho"
56 , entityEmail = Just "julm@sourcephile.fr"
57 -- , entityPhone = Just "+33 7 55 60 42 77"
61 { entityName = Just "Urssaf"
62 , entityAddress = Nothing
63 , entitySIREN = Nothing
64 , entityIBAN = Nothing
66 EntityNixOSFoundation ->
68 { entityName = Just "Stichting NixOS Foundation"
73 [ "Korte Lijnbaanssteeg 1-4318"
75 , addressZipCode = "1012 SL"
76 , addressCity = "Amsterdam"
77 , addressCountry = Country.netherlands
80 EntityNixOSFoundationNGITeam ->
82 { entityName = Just "Nix@NGI Team"
83 , entityEmail = Just "ngi@nixos.org"
85 EntityNixOSFoundationFinance ->
87 { entityEmail = Just "finance@nixos.org"
91 { entityName = Just "Upwork"
92 , entityAddress = Nothing
93 , entitySIREN = Nothing
94 , entityIBAN = Nothing
96 EntityDanielRamirez ->
98 { entityName = Just "Daniel Ramirez"
99 , entityEmail = Just "danielramirez5@protonmail.com"
102 instance GetOrganization EntityId where
103 getOrganization orgEntity = case orgEntity of
108 [ "Admin" := getOrganization EntityJulm
112 Organization{orgEntity, orgParts = []}
114 Organization{orgEntity, orgParts = []}
115 EntityNixOSFoundation ->
119 [ "Admin" := getOrganization EntityNixOSFoundationFinance
120 , "Department" := getOrganization EntityNixOSFoundationNGITeam
123 EntityNixOSFoundationFinance ->
124 Organization{orgEntity, orgParts = []}
125 EntityNixOSFoundationNGITeam ->
127 { orgEntity = EntityNixOSFoundationNGITeam
129 [ "Admin" := getOrganization EntityDanielRamirez
137 EntityDanielRamirez ->
139 { orgEntity = EntityDanielRamirez