]> Git — Sourcephile - tmp/julm/literate-invoice.git/blob - tests/Tests/Invoice.hs
feat/role(Database): init
[tmp/julm/literate-invoice.git] / tests / Tests / Invoice.hs
1 {-# LANGUAGE DeriveAnyClass #-}
2 {-# LANGUAGE OverloadedLists #-}
3 {-# LANGUAGE OverloadedStrings #-}
4
5 module Tests.Invoice where
6
7 import Data.List qualified as List
8 import Data.Text.Lazy qualified as Text.Lazy
9 import Data.Time.Clock qualified as Time
10 import Data.Time.LocalTime qualified as Time
11 import Test.Syd (Spec, describe, goldenByteStringBuilderFile, it)
12 import Tests.Organization qualified as Orga
13 import Tests.Utils.Tests (goldenPath)
14 import Text.Blaze.Renderer.Text qualified as Blaze.Text
15 import Text.Blaze.Renderer.Utf8 qualified as Blaze
16 import Prelude ((*))
17
18 import Literate.Accounting (Amount, Unit (UnitName))
19 import Literate.Database
20 import Literate.Document qualified as Doc
21 import Literate.Document.HTML qualified as HTML
22 import Literate.Invoice
23 import Literate.Invoice.HTML (invoiceIdInline)
24 import Literate.Invoice.HTML qualified as HTML
25 import Literate.Prelude
26
27 spec :: HasCallStack => Spec
28 spec =
29 -- aroundAll readDicts do
30 describe "Invoice" do
31 forM_ invoices \invId -> do
32 let
33 inv = invId & get @(Invoice Orga.EntityId InvoiceId)
34 idS =
35 inv
36 & invoiceIdInline
37 & HTML.toHtml
38 & Blaze.Text.renderMarkup
39 & Text.Lazy.unpack
40 outPath <- goldenPath idS "html"
41 it idS do
42 goldenByteStringBuilderFile outPath do
43 inv & HTML.htmlIO <&> Blaze.renderMarkupBuilder
44
45 works_NGIpkgs :: [Work]
46 works_NGIpkgs =
47 [ Work
48 { workDate = "2025-11-06"
49 , workDuration = 0.5
50 , workAction = ["organization"]
51 , workScope = ["NGIpkgs"]
52 , workReferences = ["https://meet.google.com/hii-druc-tjp"]
53 , workDescription = "first meeting"
54 }
55 , Work
56 { workDate = "2025-11-06"
57 , workDuration = 4
58 , workAction = ["development"]
59 , workScope = ["NGIpkgs", "Bonfire"]
60 , workReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"]
61 , workDescription = "focus on the hardest part first"
62 }
63 , Work
64 { workDate = "2025-11-07"
65 , workDuration = 8
66 , workAction = ["development"]
67 , workScope = ["NGIpkgs", "Bonfire"]
68 , workReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"]
69 , workDescription = "continuing to package Bonfire deps"
70 }
71 , Work
72 { workDate = "2025-11-08"
73 , workDuration = 0.1
74 , workAction = ["development"]
75 , workScope = ["Nixpkgs", "opencv"]
76 , workReferences = ["https://github.com/NixOS/nixpkgs/pull/459592"]
77 , workDescription = "fix opencv in nixpkgs"
78 }
79 , Work
80 { workDate = "2025-11-09"
81 , workDuration = 8
82 , workAction = ["development"]
83 , workScope = ["NGIpkgs", "Bonfire"]
84 , workReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"]
85 , workDescription = "continue to fix deps"
86 }
87 , Work
88 { workDate = "2025-11-09"
89 , workDuration = 4
90 , workAction = ["development"]
91 , workScope = ["NGIpkgs", "Bonfire"]
92 , workReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"]
93 , workDescription = "continue to fix deps"
94 }
95 , Work
96 { workDate = "2025-11-11"
97 , workDuration = 6
98 , workAction = ["development"]
99 , workScope = ["NGIpkgs", "Bonfire"]
100 , workReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"]
101 , workDescription = "continue to fix deps"
102 }
103 , Work
104 { workDate = "2025-11-12"
105 , workDuration = 4
106 , workAction = ["development"]
107 , workScope = ["NGIpkgs", "Bonfire"]
108 , workReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"]
109 , workDescription = "continue to fix deps"
110 }
111 , Work
112 { workDate = "2025-11-14"
113 , workDuration = 5
114 , workAction = ["development"]
115 , workScope = ["NGIpkgs", "Bonfire"]
116 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1812"]
117 , workDescription = "continue to fix deps and move into ngipkgs"
118 }
119 , Work
120 { workDate = "2025-11-14"
121 , workDuration = 1
122 , workAction = ["organization"]
123 , workScope = ["NGIpkgs"]
124 , workReferences = ["https://www.notion.so/nixos-foundation/Nix-NGI-weekly-review-34-2ab59d49e1be80939503c655b009e934"]
125 , workDescription = "weekly meeting"
126 }
127 , Work
128 { workDate = "2025-11-15"
129 , workDuration = 6
130 , workAction = ["development"]
131 , workScope = ["NGIpkgs", "Bonfire"]
132 , workReferences = []
133 , workDescription = "finish to build Bonfire and start to fix runtime bugs"
134 }
135 , Work
136 { workDate = "2025-11-16"
137 , workDuration = 4
138 , workAction = ["development"]
139 , workScope = ["NGIpkgs", "Bonfire"]
140 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1812#issuecomment-3537609170"]
141 , workDescription = "workaround and contribute upstream"
142 }
143 , Work
144 { workDate = "2025-11-17"
145 , workDuration = 8
146 , workAction = ["development"]
147 , workScope = ["NGIpkgs", "Bonfire"]
148 , workReferences = []
149 , workDescription = "add updateScript and fix opencv"
150 }
151 , Work
152 { workDate = "2025-11-19"
153 , workDuration = 8
154 , workAction = ["development"]
155 , workScope = ["NGIpkgs", "Bonfire"]
156 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1812#issuecomment-3554376221"]
157 , workDescription = "continue to fix startup crashes"
158 }
159 , Work
160 { workDate = "2025-11-21"
161 , workDuration = 4
162 , workAction = ["development"]
163 , workScope = ["NGIpkgs", "Bonfire"]
164 , workReferences = []
165 , workDescription = "begin to package yarn assets. Upstream likes convoluted code and fake libraries."
166 }
167 , Work
168 { workDate = "2025-11-21"
169 , workDuration = 1
170 , workAction = ["organization"]
171 , workScope = ["NGIpkgs"]
172 , workReferences = []
173 , workDescription = "weekly meeting"
174 }
175 , Work
176 { workDate = "2025-11-21"
177 , workDuration = 4
178 , workAction = ["development"]
179 , workScope = ["NGIpkgs", "Bonfire"]
180 , workReferences = []
181 , workDescription = "continue to package assets"
182 }
183 , Work
184 { workDate = "2025-11-23"
185 , workDuration = 4
186 , workAction = ["development"]
187 , workScope = ["NGIpkgs", "Bonfire"]
188 , workReferences = []
189 , workDescription = "continue to package assets and try to get Bonfire to work"
190 }
191 , Work
192 { workDate = "2025-11-24"
193 , workDuration = 10
194 , workAction = ["development"]
195 , workScope = ["NGIpkgs", "Bonfire"]
196 , workReferences = ["https://github.com/surface-ui/surface/issues/762#issuecomment-3577030748"]
197 , workDescription = "continue to solve problems with Bonfire packaging"
198 }
199 , Work
200 { workDate = "2025-11-27"
201 , workDuration = 8
202 , workAction = ["development"]
203 , workScope = ["NGIpkgs", "Bonfire"]
204 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1812#issuecomment-3584319056"]
205 , workDescription = "successfully auto-update and build Bonfire"
206 }
207 , Work
208 { workDate = "2025-11-28"
209 , workDuration = 1
210 , workAction = ["organization"]
211 , workScope = ["NGIpkgs"]
212 , workReferences = ["https://www.notion.so/nixos-foundation/Nix-NGI-weekly-review-36-2b959d49e1be80fa823cd4d83581fda5#2b959d49e1be80fc85eed38c9a9dca86"]
213 , workDescription = "weekly meeting"
214 }
215 , Work
216 { workDate = "2025-11-29"
217 , workDuration = 5
218 , workAction = ["development"]
219 , workScope = ["NGIpkgs", "Bonfire"]
220 , workReferences = []
221 , workDescription = "begin the service module"
222 }
223 , Work
224 { workDate = "2025-12-02"
225 , workDuration = 4
226 , workAction = ["development"]
227 , workScope = ["NGIpkgs", "Bonfire"]
228 , workReferences = []
229 , workDescription = "continue the service module"
230 }
231 , Work
232 { workDate = "2025-12-03"
233 , workDuration = 8
234 , workAction = ["development"]
235 , workScope = ["NGIpkgs", "Bonfire"]
236 , workReferences = []
237 , workDescription = "first working service module"
238 }
239 , Work
240 { workDate = "2025-12-04"
241 , workDuration = 5
242 , workAction = ["development"]
243 , workScope = ["NGIpkgs", "Bonfire"]
244 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1871"]
245 , workDescription = "improve service module"
246 }
247 , Work
248 { workDate = "2025-12-05"
249 , workDuration = 1
250 , workAction = ["organization"]
251 , workScope = ["NGIpkgs"]
252 , workReferences = ["https://www.notion.so/nixos-foundation/Nix-NGI-weekly-review-36-2b959d49e1be80fa823cd4d83581fda5"]
253 , workDescription = "weekly meeting"
254 }
255 , Work
256 { workDate = "2025-12-05"
257 , workDuration = 0.5
258 , workAction = ["documentation"]
259 , workScope = ["NGIpkgs", "Manuals"]
260 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1954"]
261 , workDescription = "meeting"
262 }
263 , Work
264 { workDate = "2025-12-06"
265 , workDuration = 2
266 , workAction = ["documentation"]
267 , workScope = ["NGIpkgs", "Manuals"]
268 , workReferences = []
269 , workDescription = "prepare wednesday meeting"
270 }
271 , Work
272 { workDate = "2025-12-07"
273 , workDuration = 4
274 , workAction = ["documentation"]
275 , workScope = ["NGIpkgs", "Manuals"]
276 , workReferences = []
277 , workDescription = "prepare demo for wednesday meeting"
278 }
279 , Work
280 { workDate = "2025-12-08"
281 , workDuration = 4
282 , workAction = ["documentation"]
283 , workScope = ["NGIpkgs", "Manuals"]
284 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1891"]
285 , workDescription = "prepare demo for wednesday meeting"
286 }
287 , Work
288 { workDate = "2025-12-09"
289 , workDuration = 4
290 , workAction = ["documentation"]
291 , workScope = ["NGIpkgs", "Manuals"]
292 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1891"]
293 , workDescription = "continue to document"
294 }
295 , Work
296 { workDate = "2025-12-10"
297 , workDuration = 2
298 , workAction = ["review"]
299 , workScope = ["NGIpkgs"]
300 , workReferences = ["https://www.notion.so/nixos-foundation/Nix-NGI-best-practices-for-NixOS-modules-implementation-2c559d49e1be80a8a499f21abb203d6f"]
301 , workDescription = "visio on “best practices”"
302 }
303 , Work
304 { workDate = "2025-12-12"
305 , workDuration = 1
306 , workAction = ["organization"]
307 , workScope = ["NGIpkgs"]
308 , workReferences = []
309 , workDescription = "weekly visio meeting"
310 }
311 , Work
312 { workDate = "2025-12-11"
313 , workDuration = 8
314 , workAction = ["documentation"]
315 , workScope = ["NGIpkgs", "Manuals"]
316 , workReferences = []
317 , workDescription = "continue to document"
318 }
319 , Work
320 { workDate = "2025-12-12"
321 , workDuration = 4
322 , workAction = ["documentation"]
323 , workScope = ["NGIpkgs", "Manuals"]
324 , workReferences = []
325 , workDescription = "continue to document"
326 }
327 , Work
328 { workDate = "2025-12-13"
329 , workDuration = 2
330 , workAction = ["documentation"]
331 , workScope = ["NGIpkgs", "Manuals"]
332 , workReferences = []
333 , workDescription =
334 [ "setup sphinx like "
335 , Doc.InlineLink
336 { Doc.inlineLinkTarget = "https://nix.dev"
337 , Doc.inlineLinkText = "nix.dev"
338 }
339 , " for the manuals"
340 ]
341 }
342 , Work
343 { workDate = "2025-12-13"
344 , workDuration = 5
345 , workAction = ["development"]
346 , workScope = ["NGIpkgs", "Bonfire"]
347 , workReferences = ["https://github.com/bonfire-networks/bonfire-app/issues/1670#issuecomment-3650762914"]
348 , workDescription = "update to latest; overcoming new bugs introduced by upstream"
349 }
350 , Work
351 { workDate = "2025-12-15"
352 , workDuration = 4
353 , workAction = ["development"]
354 , workScope = ["NGIpkgs", "Bonfire"]
355 , workReferences = []
356 , workDescription = "improving the update script and still overcoming upstream bugs"
357 }
358 , Work
359 { workDate = "2025-12-16"
360 , workDuration = 3
361 , workAction = ["development"]
362 , workScope = ["NGIpkgs", "Bonfire"]
363 , workReferences = []
364 , workDescription = "overcoming bugs, again"
365 }
366 , Work
367 { workDate = "2025-12-16"
368 , workDuration = 2
369 , workAction = ["review"]
370 , workScope = ["NGIpkgs"]
371 , workReferences = []
372 , workDescription = "visio to review PRs"
373 }
374 , Work
375 { workDate = "2025-12-16"
376 , workDuration = 2
377 , workAction = ["review"]
378 , workScope = ["NGIpkgs"]
379 , workReferences = []
380 , workDescription = "visio to review PRs"
381 }
382 , Work
383 { workDate = "2025-12-17"
384 , workDuration = 1.5
385 , workAction = ["review"]
386 , workScope = ["NGIpkgs"]
387 , workReferences = []
388 , workDescription = "visio to review PRs"
389 }
390 , Work
391 { workDate = "2025-12-18"
392 , workDuration = 1
393 , workAction = ["review"]
394 , workScope = ["NGIpkgs", "dnsvizor"]
395 , workReferences = []
396 , workDescription = "review linj’s PR"
397 }
398 , Work
399 { workDate = "2025-12-19"
400 , workDuration = 1.5
401 , workAction = ["organization"]
402 , workScope = ["NGIpkgs"]
403 , workReferences = []
404 , workDescription = "weekly meeting"
405 }
406 , Work
407 { workDate = "2025-12-21"
408 , workDuration = 4
409 , workAction = ["development"]
410 , workScope = ["NGIpkgs", "Bonfire"]
411 , workReferences = []
412 , workDescription =
413 [ "fix bug using "
414 , "__structuredAttrs" & Doc.InlineCode
415 ]
416 }
417 , Work
418 { workDate = "2025-12-23"
419 , workDuration = 4
420 , workAction = ["documentation"]
421 , workScope = ["NGIpkgs", "Manuals"]
422 , workReferences = []
423 , workDescription = "improve building the manuals"
424 }
425 , Work
426 { workDate = "2025-12-23"
427 , workDuration = 2
428 , workAction = ["development"]
429 , workScope = ["NGIpkgs", "Bonfire"]
430 , workReferences = []
431 , workDescription = "address reviewers’ concerns"
432 }
433 , Work
434 { workDate = "2025-12-24"
435 , workDuration = 4
436 , workAction = ["development"]
437 , workScope = ["NGIpkgs", "Bonfire"]
438 , workReferences = []
439 , workDescription = "update Bonfire and report issues upstream"
440 }
441 , Work
442 { workDate = "2025-12-24"
443 , workDuration = 4
444 , workAction = ["documentation"]
445 , workScope = ["NGIpkgs", "Manuals"]
446 , workReferences = []
447 , workDescription = "document"
448 }
449 , Work
450 { workDate = "2025-12-24"
451 , workDuration = 2
452 , workAction = ["development"]
453 , workScope = ["NGIpkgs", "Bonfire"]
454 , workReferences = []
455 , workDescription = "update Bonfire to fix bugs"
456 }
457 , Work
458 { workDate = "2025-12-25"
459 , workDuration = 2
460 , workAction = ["documentation"]
461 , workScope = ["NGIpkgs", "Manuals"]
462 , workReferences = []
463 , workDescription = "document"
464 }
465 , Work
466 { workDate = "2025-12-25"
467 , workDuration = 6
468 , workAction = ["development"]
469 , workScope = ["NGIpkgs", "Bonfire"]
470 , workReferences = ["https://github.com/bonfire-networks/bonfire-app/issues/1698#issuecomment-3692147409"]
471 , workDescription = "update and fix bugs"
472 }
473 , Work
474 { workDate = "2025-12-26"
475 , workDuration = 1
476 , workAction = ["development"]
477 , workScope = ["NGIpkgs", "Bonfire"]
478 , workReferences = []
479 , workDescription = "update to fix bugs"
480 }
481 , Work
482 { workDate = "2025-12-28"
483 , workDuration = 6
484 , workAction = ["documentation"]
485 , workScope = ["NGIpkgs", "Manuals"]
486 , workReferences = []
487 , workDescription = "document"
488 }
489 , Work
490 { workDate = "2025-12-29"
491 , workDuration = 2
492 , workAction = ["development"]
493 , workScope = ["NGIpkgs", "Bonfire"]
494 , workReferences = []
495 , workDescription = "add more tests"
496 }
497 , Work
498 { workDate = "2025-12-29"
499 , workDuration = 0.5
500 , workAction = ["review"]
501 , workScope = ["NGIpkgs", "Funkwhale"] -- goes into NGI Review
502 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1707#discussion_r2651644145"]
503 , workDescription = ""
504 }
505 , Work
506 { workDate = "2025-12-30"
507 , workDuration = 4
508 , workAction = ["development"]
509 , workScope = ["NGIpkgs", "BEAM"]
510 , workReferences = []
511 , workDescription = ["improve ", Doc.InlineCode "buildMix", " & ", Doc.InlineCode "mixRelease", " for packaging Elixir software"]
512 }
513 , Work
514 { workDate = "2026-01-01"
515 , workDuration = 4
516 , workAction = ["development"]
517 , workScope = ["NGIpkgs", "Bonfire"]
518 , workReferences = []
519 , workDescription = "support other flavours"
520 }
521 , Work
522 { workDate = "2026-01-03"
523 , workDuration = 4
524 , workAction = ["development"]
525 , workScope = ["NGIpkgs", "Bonfire"]
526 , workReferences = []
527 , workDescription = "support other flavours, and make update more resilient"
528 }
529 , Work
530 { workDate = "2026-01-04"
531 , workDuration = 2
532 , workAction = ["development"]
533 , workScope = ["NGIpkgs", "Bonfire"]
534 , workReferences = []
535 , workDescription = "provide upstream with reproducers"
536 }
537 , Work
538 { workDate = "2026-01-05"
539 , workDuration = 2
540 , workAction = ["development"]
541 , workScope = ["NGIpkgs", "Bonfire"]
542 , workReferences = []
543 , workDescription = "update to latest version"
544 }
545 , Work
546 { workDate = "2026-01-07"
547 , workDuration = 5
548 , workAction = ["development"]
549 , workScope = ["NGIpkgs", "Bonfire"]
550 , workReferences = []
551 , workDescription = "fix updating"
552 }
553 , Work
554 { workDate = "2026-01-07"
555 , workDuration = 1
556 , workAction = ["documentation"]
557 , workScope = ["NGIpkgs", "Manuals"] -- goes into NGI Core
558 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1891"]
559 , workDescription = "address reviewer’s comment"
560 }
561 , Work
562 { workDate = "2026-01-09"
563 , workDuration = 2
564 , workAction = ["documentation"]
565 , workScope = ["NGIpkgs", "Manuals"] -- goes into NGI Core
566 , workReferences = []
567 , workDescription = "address reviewer’s comments"
568 }
569 , Work
570 { workDate = "2026-01-09"
571 , workDuration = 2
572 , workAction = ["development"]
573 , workScope = ["NGIpkgs", "Bonfire"]
574 , workReferences = ["https://github.com/bonfire-networks/bonfire-app/issues/1730"]
575 , workDescription = "answer upstream’s questions"
576 }
577 , Work
578 { workDate = "2026-01-11"
579 , workDuration = 5
580 , workAction = ["development"]
581 , workScope = ["NGIpkgs", "dnsvizor"]
582 , workReferences = []
583 , workDescription = ["replace ", Doc.InlineCode "hillingar", " to package MirageOS unikernels"]
584 }
585 , Work
586 { workDate = "2026-01-09"
587 , workDuration = 2
588 , workAction = ["organization"]
589 , workScope = ["NGIpkgs"]
590 , workReferences = []
591 , workDescription = "weekly meeting"
592 }
593 , Work
594 { workDate = "2026-01-12"
595 , workDuration = 5
596 , workAction = ["development"]
597 , workScope = ["NGIpkgs", "dnsvizor"]
598 , workReferences = ["https://github.com/ju1m/ngipkgs/commits/dnsvizor/"]
599 , workDescription = ["remove the need for ", Doc.InlineCode "--allow-import-from-derivation"]
600 }
601 , Work
602 { workDate = "2026-01-12"
603 , workDuration = 6
604 , workAction = ["documentation"]
605 , workScope = ["NGIpkgs", "Manuals"] -- goes into NGI Core
606 , workReferences = []
607 , workDescription = "render options"
608 }
609 , Work
610 { workDate = "2026-01-13"
611 , workDuration = 1
612 , workAction = ["documentation"]
613 , workScope = ["NGIpkgs", "Manuals"] -- goes into NGI Core
614 , workReferences = []
615 , workDescription = "update"
616 }
617 , Work
618 { workDate = "2026-01-16"
619 , workDuration = 2
620 , workAction = ["organization"]
621 , workScope = ["NGIpkgs"]
622 , workReferences = []
623 , workDescription = "weekly meeting"
624 }
625 , Work
626 { workDate = "2026-01-19"
627 , workDuration = 2
628 , workAction = ["documentation"]
629 , workScope = ["NGIpkgs", "Manuals"] -- goes into NGI Core
630 , workReferences = []
631 , workDescription = "split into several PDF"
632 }
633 , Work
634 { workDate = "2026-01-22"
635 , workDuration = 4
636 , workAction = ["development"]
637 , workScope = ["NGIpkgs", "Manuals"] -- goes into NGI Core
638 , workReferences = ["https://github.com/ngi-nix/ngipkgs/pull/2010"]
639 , workDescription = "address reviewers’ concerns"
640 }
641 , Work
642 { workDate = "2026-01-23"
643 , workDuration = 1.5
644 , workAction = ["organization"]
645 , workScope = ["NGIpkgs"]
646 , workReferences = []
647 , workDescription = "weekly meeting"
648 }
649 , Work
650 { workDate = "2026-01-25"
651 , workDuration = 4
652 , workAction = ["development"]
653 , workScope = ["NGIpkgs", "Seppo"]
654 , workReferences = []
655 , workDescription = "begin packaging"
656 }
657 , Work
658 { workDate = "2026-01-26"
659 , workDuration = 5
660 , workAction = ["development"]
661 , workScope = ["NGIpkgs", "Seppo"]
662 , workReferences = []
663 , workDescription = "continue packaging"
664 }
665 , Work
666 { workDate = "2026-01-27"
667 , workDuration = 5
668 , workAction = ["development"]
669 , workScope = ["NGIpkgs", "Seppo"]
670 , workReferences = []
671 , workDescription = "continue packaging"
672 }
673 ]
674
675 data InvoiceId
676 = Invoice_0
677 | Invoice_org3sale1
678 | Invoice_org3sale2
679 | Invoice_org3sale3
680 deriving (Eq, Ord, Show, Generic, Enum, NFData)
681
682 invoiceRate_NGIpkgs =
683 [ ["organization"] := 31.25
684 , ["development"] := 31.25
685 , ["documentation"] := 31.25
686 , ["review"] := 31.25
687 ]
688
689 instance Get (Invoice Orga.EntityId InvoiceId) InvoiceId where
690 get invoiceId = case invoiceId of
691 Invoice_0 ->
692 Invoice
693 { invoiceId
694 , invoiceType = InvoiceTypeSale
695 , invoiceOrders = []
696 , invoiceEmittedOn
697 , invoicePaymentDueBefore = invoiceEmittedOn & Time.addLocalTime (31 * Time.nominalDay)
698 , invoiceIssuer = Orga.EntityJulmInfo
699 , invoiceRecipient = Orga.EntityJulmInfo
700 , invoiceRates = [["development"] := 0]
701 , invoiceMentions =
702 [ InvoiceMentionTVANonApplicable
703 , InvoiceMentionIndemnitéForfaitaire
704 , InvoiceMentionIndemnitéTaux (12.15 :: Amount 100 (UnitName "%"))
705 ]
706 , invoiceWorks =
707 [ Work
708 { workDate = "2000-01-01"
709 , workDuration = 1
710 , workAction = ["development"]
711 , workScope = []
712 , workReferences = []
713 , workDescription = ""
714 }
715 ]
716 }
717 where
718 invoiceEmittedOn = "2026-01-22"
719 Invoice_org3sale1 ->
720 Invoice
721 { invoiceId
722 , invoiceType = InvoiceTypeSale
723 , invoiceOrders = ["Contract n°2025-24"]
724 , invoiceEmittedOn
725 , invoicePaymentDueBefore = invoiceEmittedOn & Time.addLocalTime (31 * Time.nominalDay)
726 , invoiceIssuer = Orga.EntityJulmInfo
727 , invoiceRecipient = Orga.EntityNixOSFoundationNGITeam
728 , invoiceRates = invoiceRate_NGIpkgs
729 , invoiceMentions =
730 [ InvoiceMentionTVANonApplicable
731 , InvoiceMentionIndemnitéForfaitaire
732 , InvoiceMentionIndemnitéTaux (12.15 :: Amount 100 (UnitName "%"))
733 ]
734 , invoiceWorks =
735 works_NGIpkgs
736 & List.filter \work ->
737 and $
738 list
739 [ work & workDate & (>= "2025-11-06")
740 , work & workDate & (<= "2025-12-22")
741 , work & workScope & (/= ["NGIpkgs", "Manuals"])
742 ]
743 }
744 where
745 invoiceEmittedOn = "2026-01-22"
746 Invoice_org3sale2 ->
747 Invoice
748 { invoiceId
749 , invoiceType = InvoiceTypeSale
750 , invoiceOrders = ["contract n°2026-03"]
751 , invoiceEmittedOn
752 , invoicePaymentDueBefore = invoiceEmittedOn & Time.addLocalTime (31 * Time.nominalDay)
753 , invoiceIssuer = Orga.EntityJulmInfo
754 , invoiceRecipient = Orga.EntityNixOSFoundationNGITeam
755 , invoiceRates = invoiceRate_NGIpkgs
756 , invoiceMentions =
757 [ InvoiceMentionTVANonApplicable
758 , InvoiceMentionIndemnitéForfaitaire
759 , InvoiceMentionIndemnitéTaux (12.15 :: Amount 100 (UnitName "%"))
760 ]
761 , invoiceWorks =
762 works_NGIpkgs
763 & List.filter \work ->
764 and $
765 [ work & workDate & (>= "2025-12-23")
766 , work & workDate & (<= "2026-12-31")
767 , work & workScope & (/= ["NGIpkgs", "Manuals"])
768 , work & workScope & (/= ["NGIpkgs", "Funkwhale"])
769 , not $
770 and $
771 [ work & workDate & (>= "2026-01-09")
772 , work & workDate & (<= "2026-01-28")
773 , work & workAction & (== ["organization"])
774 , work & workScope & (== ["NGIpkgs"])
775 ]
776 & list
777 ]
778 & list
779 }
780 where
781 invoiceEmittedOn = "2026-01-27"
782 Invoice_org3sale3 ->
783 Invoice
784 { invoiceId
785 , invoiceType = InvoiceTypeSale
786 , invoiceOrders = ["contract n°2026-FixMe"]
787 , invoiceEmittedOn
788 , invoicePaymentDueBefore = invoiceEmittedOn & Time.addLocalTime (31 * Time.nominalDay)
789 , invoiceIssuer = Orga.EntityJulmInfo
790 , invoiceRecipient = Orga.EntityNixOSFoundationNGITeam
791 , invoiceRates = invoiceRate_NGIpkgs
792 , invoiceMentions =
793 [ InvoiceMentionTVANonApplicable
794 , InvoiceMentionIndemnitéForfaitaire
795 , InvoiceMentionIndemnitéTaux (12.15 :: Amount 100 (UnitName "%"))
796 ]
797 , invoiceWorks =
798 works_NGIpkgs
799 & List.filter \work ->
800 or $
801 [ and $
802 [ work & workDate & (>= "2026-01-21")
803 , work & workDate & (<= "2026-12-31")
804 , work & workScope & (== ["NGIpkgs", "Manuals"])
805 ]
806 & list
807 , and $
808 [ work & workDate & (>= "2025-12-29")
809 , work & workDate & (<= "2026-12-31")
810 , work & workScope & (== ["NGIpkgs", "Funkwhale"])
811 ]
812 & list
813 , and $
814 [ work & workDate & (>= "2026-01-09")
815 , work & workDate & (<= "2026-01-28")
816 , work & workAction & (== ["organization"])
817 , work & workScope & (== ["NGIpkgs"])
818 ]
819 & list
820 ]
821 & list
822 }
823 where
824 invoiceEmittedOn = "2026-01-28"
825
826 invoices :: [InvoiceId]
827 invoices = enumAll