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