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