{-# LANGUAGE OverloadedLists #-} {-# LANGUAGE OverloadedStrings #-} module Tests.Invoice where import Data.List qualified as List import Data.Map.Strict qualified as Map import Data.Text.Lazy qualified as Text.Lazy import Data.Time.Clock qualified as Time import Data.Time.LocalTime qualified as Time import Literate.Accounting.Math import Literate.Document qualified as Doc import Literate.Document.HTML qualified as HTML import Literate.Invoice.HTML qualified as HTML import Literate.Invoice.Invoice import Literate.Prelude import Test.Syd import Tests.Organization qualified import Tests.Utils.Tests import Text.Blaze.Renderer.Text qualified as Blaze.Text import Text.Blaze.Renderer.Utf8 qualified as Blaze import Prelude (undefined, (*)) spec :: HasCallStack => Spec spec = -- aroundAll readDicts do describe "Invoice" do forM_ (invoices & Map.toList) \(invId, inv) -> do let idS = invId & Doc.toInline & HTML.toHtml & Blaze.Text.renderMarkup & Text.Lazy.unpack outPath <- goldenPath idS "html" it idS do goldenByteStringBuilderFile outPath do HTML.htmlIO (invId, inv) <&> Blaze.renderMarkupBuilder ngipkgsLog :: [InvoiceLog] ngipkgsLog = [ InvoiceLog { invoiceLogDate = "2025-11-06" , invoiceLogDuration = 0.5 , invoiceLogAction = ["organization"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = ["https://meet.google.com/hii-druc-tjp"] , invoiceLogDescription = "first meeting" } , InvoiceLog { invoiceLogDate = "2025-11-06" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"] , invoiceLogDescription = "focus on the hardest part first" } , InvoiceLog { invoiceLogDate = "2025-11-07" , invoiceLogDuration = 8 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"] , invoiceLogDescription = "continuing to package Bonfire deps" } , InvoiceLog { invoiceLogDate = "2025-11-08" , invoiceLogDuration = 0.1 , invoiceLogAction = ["development"] , invoiceLogScope = ["Nixpkgs", "opencv"] , invoiceLogReferences = ["https://github.com/NixOS/nixpkgs/pull/459592"] , invoiceLogDescription = "fix opencv in nixpkgs" } , InvoiceLog { invoiceLogDate = "2025-11-09" , invoiceLogDuration = 8 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"] , invoiceLogDescription = "continue to fix deps" } , InvoiceLog { invoiceLogDate = "2025-11-09" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"] , invoiceLogDescription = "continue to fix deps" } , InvoiceLog { invoiceLogDate = "2025-11-11" , invoiceLogDuration = 6 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"] , invoiceLogDescription = "continue to fix deps" } , InvoiceLog { invoiceLogDate = "2025-11-12" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ju1m/bonfire-app/commits/nix"] , invoiceLogDescription = "continue to fix deps" } , InvoiceLog { invoiceLogDate = "2025-11-14" , invoiceLogDuration = 5 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1812"] , invoiceLogDescription = "continue to fix deps and move into ngipkgs" } , InvoiceLog { invoiceLogDate = "2025-11-14" , invoiceLogDuration = 1 , invoiceLogAction = ["organization"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = ["https://www.notion.so/nixos-foundation/Nix-NGI-weekly-review-34-2ab59d49e1be80939503c655b009e934"] , invoiceLogDescription = "weekly meeting" } , InvoiceLog { invoiceLogDate = "2025-11-15" , invoiceLogDuration = 6 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "finish to build Bonfire and start to fix runtime bugs" } , InvoiceLog { invoiceLogDate = "2025-11-16" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1812#issuecomment-3537609170"] , invoiceLogDescription = "workaround and contribute upstream" } , InvoiceLog { invoiceLogDate = "2025-11-17" , invoiceLogDuration = 8 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "add updateScript and fix opencv" } , InvoiceLog { invoiceLogDate = "2025-11-19" , invoiceLogDuration = 8 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1812#issuecomment-3554376221"] , invoiceLogDescription = "continue to fix startup crashes" } , InvoiceLog { invoiceLogDate = "2025-11-21" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "begin to package yarn assets. Upstream likes convoluted code and fake libraries." } , InvoiceLog { invoiceLogDate = "2025-11-21" , invoiceLogDuration = 1 , invoiceLogAction = ["organization"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = [] , invoiceLogDescription = "weekly meeting" } , InvoiceLog { invoiceLogDate = "2025-11-21" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "continue to package assets" } , InvoiceLog { invoiceLogDate = "2025-11-23" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "continue to package assets and try to get Bonfire to work" } , InvoiceLog { invoiceLogDate = "2025-11-24" , invoiceLogDuration = 10 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/surface-ui/surface/issues/762#issuecomment-3577030748"] , invoiceLogDescription = "continue to solve problems with bonfire packaging" } , InvoiceLog { invoiceLogDate = "2025-11-27" , invoiceLogDuration = 8 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1812#issuecomment-3584319056"] , invoiceLogDescription = "successfully auto-update and build bonfire" } , InvoiceLog { invoiceLogDate = "2025-11-28" , invoiceLogDuration = 1 , invoiceLogAction = ["organization"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = ["https://www.notion.so/nixos-foundation/Nix-NGI-weekly-review-36-2b959d49e1be80fa823cd4d83581fda5#2b959d49e1be80fc85eed38c9a9dca86"] , invoiceLogDescription = "weekly meeting" } , InvoiceLog { invoiceLogDate = "2025-11-29" , invoiceLogDuration = 5 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "begin the service module" } , InvoiceLog { invoiceLogDate = "2025-12-02" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "continue the service module" } , InvoiceLog { invoiceLogDate = "2025-12-03" , invoiceLogDuration = 8 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "first working service module" } , InvoiceLog { invoiceLogDate = "2025-12-04" , invoiceLogDuration = 5 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1871"] , invoiceLogDescription = "improve service module" } , InvoiceLog { invoiceLogDate = "2025-12-05" , invoiceLogDuration = 1 , invoiceLogAction = ["organization"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = ["https://www.notion.so/nixos-foundation/Nix-NGI-weekly-review-36-2b959d49e1be80fa823cd4d83581fda5"] , invoiceLogDescription = "weekly meeting" } , InvoiceLog { invoiceLogDate = "2025-12-05" , invoiceLogDuration = 0.5 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1954"] , invoiceLogDescription = "meeting" } , InvoiceLog { invoiceLogDate = "2025-12-06" , invoiceLogDuration = 2 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "prepare wednesday meeting" } , InvoiceLog { invoiceLogDate = "2025-12-07" , invoiceLogDuration = 4 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "prepare demo for wednesday meeting" } , InvoiceLog { invoiceLogDate = "2025-12-08" , invoiceLogDuration = 4 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1891"] , invoiceLogDescription = "prepare demo for wednesday meeting" } , InvoiceLog { invoiceLogDate = "2025-12-09" , invoiceLogDuration = 4 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1891"] , invoiceLogDescription = "continue to document" } , InvoiceLog { invoiceLogDate = "2025-12-10" , invoiceLogDuration = 2 , invoiceLogAction = ["review"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = ["https://www.notion.so/nixos-foundation/Nix-NGI-best-practices-for-NixOS-modules-implementation-2c559d49e1be80a8a499f21abb203d6f"] , invoiceLogDescription = "visio on “best practices”" } , InvoiceLog { invoiceLogDate = "2025-12-12" , invoiceLogDuration = 1 , invoiceLogAction = ["organization"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = [] , invoiceLogDescription = "weekly visio meeting" } , InvoiceLog { invoiceLogDate = "2025-12-11" , invoiceLogDuration = 8 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "continue to document" } , InvoiceLog { invoiceLogDate = "2025-12-12" , invoiceLogDuration = 4 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "continue to document" } , InvoiceLog { invoiceLogDate = "2025-12-13" , invoiceLogDuration = 2 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = [ "setup sphinx like " , Doc.InlineLink { Doc.inlineLinkTarget = "https://nix.dev" , Doc.inlineLinkText = "nix.dev" } , " for the manuals" ] } , InvoiceLog { invoiceLogDate = "2025-12-13" , invoiceLogDuration = 5 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/bonfire-networks/bonfire-app/issues/1670#issuecomment-3650762914"] , invoiceLogDescription = "update to latest; overcoming new bugs introduced by upstream" } , InvoiceLog { invoiceLogDate = "2025-12-15" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "improving the update script and still overcoming upstream bugs" } , InvoiceLog { invoiceLogDate = "2025-12-16" , invoiceLogDuration = 3 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "overcoming bugs, again" } , InvoiceLog { invoiceLogDate = "2025-12-16" , invoiceLogDuration = 2 , invoiceLogAction = ["review"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = [] , invoiceLogDescription = "visio to review PRs" } , InvoiceLog { invoiceLogDate = "2025-12-16" , invoiceLogDuration = 2 , invoiceLogAction = ["review"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = [] , invoiceLogDescription = "visio to review PRs" } , InvoiceLog { invoiceLogDate = "2025-12-17" , invoiceLogDuration = 1.5 , invoiceLogAction = ["review"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = [] , invoiceLogDescription = "visio to review PRs" } , InvoiceLog { invoiceLogDate = "2025-12-18" , invoiceLogDuration = 1 , invoiceLogAction = ["review"] , invoiceLogScope = ["NGIpkgs", "dnsvizor"] , invoiceLogReferences = [] , invoiceLogDescription = "review linj’s PR" } , InvoiceLog { invoiceLogDate = "2025-12-19" , invoiceLogDuration = 1.5 , invoiceLogAction = ["organization"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = [] , invoiceLogDescription = "weekly meeting" } , InvoiceLog { invoiceLogDate = "2025-12-21" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = [ "fix bug using " , "__structuredAttrs" & Doc.InlineCode ] } , InvoiceLog { invoiceLogDate = "2025-12-23" , invoiceLogDuration = 4 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "improve building the manuals" } , InvoiceLog { invoiceLogDate = "2025-12-23" , invoiceLogDuration = 2 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "address reviewers’ concerns" } , InvoiceLog { invoiceLogDate = "2025-12-24" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "update bonfire and report issues upstream" } , InvoiceLog { invoiceLogDate = "2025-12-24" , invoiceLogDuration = 4 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "document" } , InvoiceLog { invoiceLogDate = "2025-12-24" , invoiceLogDuration = 2 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "update bonfire to fix bugs" } , InvoiceLog { invoiceLogDate = "2025-12-25" , invoiceLogDuration = 2 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "document" } , InvoiceLog { invoiceLogDate = "2025-12-25" , invoiceLogDuration = 6 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/bonfire-networks/bonfire-app/issues/1698#issuecomment-3692147409"] , invoiceLogDescription = "update and fix bugs" } , InvoiceLog { invoiceLogDate = "2025-12-26" , invoiceLogDuration = 1 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "update to fix bugs" } , InvoiceLog { invoiceLogDate = "2025-12-28" , invoiceLogDuration = 6 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "document" } , InvoiceLog { invoiceLogDate = "2025-12-29" , invoiceLogDuration = 2 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "add more tests" } , InvoiceLog { invoiceLogDate = "2025-12-29" , invoiceLogDuration = 0.5 , invoiceLogAction = ["review"] , invoiceLogScope = ["NGIpkgs", "Funkwhale"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1707#discussion_r2651644145"] , invoiceLogDescription = "" } , InvoiceLog { invoiceLogDate = "2025-12-30" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Beam"] , invoiceLogReferences = [] , invoiceLogDescription = "improve buildMix & mixRelease" } , InvoiceLog { invoiceLogDate = "2026-01-01" , invoiceLogDuration = 4 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "support other flavours" } , InvoiceLog { invoiceLogDate = "2026-01-03" , invoiceLogDuration = 2 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "support other flavours" } , InvoiceLog { invoiceLogDate = "2026-01-04" , invoiceLogDuration = 2 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "provide upstream with reproducers" } , InvoiceLog { invoiceLogDate = "2026-01-05" , invoiceLogDuration = 2 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "update to latest version" } , InvoiceLog { invoiceLogDate = "2026-01-07" , invoiceLogDuration = 5 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = [] , invoiceLogDescription = "fix updating" } , InvoiceLog { invoiceLogDate = "2026-01-07" , invoiceLogDuration = 1 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/1891"] , invoiceLogDescription = "address reviewer’s comment" } , InvoiceLog { invoiceLogDate = "2026-01-09" , invoiceLogDuration = 2 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "address reviewer’s comments" } , InvoiceLog { invoiceLogDate = "2026-01-09" , invoiceLogDuration = 2 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Bonfire"] , invoiceLogReferences = ["https://github.com/bonfire-networks/bonfire-app/issues/1730"] , invoiceLogDescription = "answer upstream’s questions" } , InvoiceLog { invoiceLogDate = "2026-01-11" , invoiceLogDuration = 5 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "dnsvizor"] , invoiceLogReferences = [] , invoiceLogDescription = "replace hillingar" } , InvoiceLog { invoiceLogDate = "2026-01-09" , invoiceLogDuration = 2 , invoiceLogAction = ["organization"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = [] , invoiceLogDescription = "weekly meeting" } , InvoiceLog { invoiceLogDate = "2026-01-12" , invoiceLogDuration = 5 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "dnsvizor"] , invoiceLogReferences = ["https://github.com/ju1m/ngipkgs/commits/dnsvizor/"] , invoiceLogDescription = "remove IFD" } , InvoiceLog { invoiceLogDate = "2026-01-12" , invoiceLogDuration = 6 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "render options" } , InvoiceLog { invoiceLogDate = "2026-01-13" , invoiceLogDuration = 1 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "update" } , InvoiceLog { invoiceLogDate = "2026-01-16" , invoiceLogDuration = 2 , invoiceLogAction = ["organization"] , invoiceLogScope = ["NGIpkgs"] , invoiceLogReferences = [] , invoiceLogDescription = "weekly meeting" } , InvoiceLog { invoiceLogDate = "2026-01-19" , invoiceLogDuration = 2 , invoiceLogAction = ["documentation"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = [] , invoiceLogDescription = "split into several PDF" } , InvoiceLog { invoiceLogDate = "2026-01-22" , invoiceLogDuration = 2 , invoiceLogAction = ["development"] , invoiceLogScope = ["NGIpkgs", "Manuals"] , invoiceLogReferences = ["https://github.com/ngi-nix/ngipkgs/pull/2010"] , invoiceLogDescription = "address reviewers’ concerns" } ] invoiceRateNGIpkgs = [ ["organization"] := 31.25 , ["development"] := 31.25 , ["review"] := 31.25 ] invoices :: Invoices invoices = traceShowId [ InvoiceId { invoiceIdRecipient = Tests.Organization.nixosFoundationNGITeam , invoiceIdType = InvoiceTypeSale , invoiceIdCount = 1 } := let invoiceEmittedOn = "2026-01-22" in invoice { invoiceOrders = ["Contract n°2025-24"] , invoiceEmittedOn , invoicePaymentDueBefore = invoiceEmittedOn & Time.addLocalTime (31 * Time.nominalDay) , invoiceIssuer = Tests.Organization.julmInfo , invoiceRecipient = Tests.Organization.nixosFoundationNGITeam , invoiceRates = invoiceRateNGIpkgs , invoiceMentions = [ InvoiceMentionTVANonApplicable , InvoiceMentionIndemnitéForfaitaire , InvoiceMentionIndemnitéTaux (12.15 :: Amount 100 (UnitName "%")) ] , invoiceLogs = ngipkgsLog & List.filter \inv -> and $ list [ inv & invoiceLogDate & (>= "2025-11-06") , inv & invoiceLogDate & (<= "2025-12-22") , inv & invoiceLogScope & (/= ["NGIpkgs", "Manuals"]) ] } , InvoiceId { invoiceIdRecipient = Tests.Organization.nixosFoundationNGITeam , invoiceIdType = InvoiceTypeSale , invoiceIdCount = 2 } := let invoiceEmittedOn = "2026-01-22" in invoice { invoiceOrders = ["contract n°2026-FixMe"] , invoiceEmittedOn , invoicePaymentDueBefore = invoiceEmittedOn & Time.addLocalTime (31 * Time.nominalDay) , invoiceIssuer = Tests.Organization.julmInfo , invoiceRecipient = Tests.Organization.nixosFoundationNGITeam , invoiceRates = invoiceRateNGIpkgs , invoiceMentions = [ InvoiceMentionTVANonApplicable , InvoiceMentionIndemnitéForfaitaire , InvoiceMentionIndemnitéTaux (12.15 :: Amount 100 (UnitName "%")) ] , invoiceLogs = ngipkgsLog & List.filter \inv -> and $ [ inv & invoiceLogDate & (>= "2025-12-23") , inv & invoiceLogDate & (<= "2026-12-31") , not $ and $ [ inv & invoiceLogScope & (/= ["NGIpkgs", "Manuals"]) , inv & invoiceLogDate & (<= "2026-01-21") ] & list ] & list } ] & Map.fromListWith undefined