Skip to content

Case study 11 · Identity and documents

Invoices frozen at issue and coupons that pay out only once

Three products had to store when a record was created apart from when it became valid. On the customs system, none of 50,000 invoices changed after issue.

EngagementThree engagements · customs invoicing, 2020 · remittance terminals, 2022 · meeting platform, 2023Published

Customs invoicing: validated on 50,000 invoices

none of which changed after issue

The story in 5 steps

Stack

  • Node.js
  • PostgreSQL
  • Kotlin
  • Fabric.js

01 · Context

A customs authority needed invoices that could never change after issue.

The three products were unrelated and built in different years, but each needed the same answer: the stored data had to distinguish a record that exists from a record that is binding.

02 · Could not change

Every system that issues documents eventually has to decide what an old document shows after its template changes, and most decide too late.

Templates change: a layout is corrected, a legal notice updated or a logo replaced.
No error is raised when a template change alters an old document, and from that point the archive no longer shows what was actually issued.
Creation and validity can drift apart in other systems too: a coupon printed with no network, or a whiteboard that only exists as a screenshot.

03 · What I did

Customs invoicing (2020). The customs authority required that an issued invoice never change.

The system kept the definition of a document separate from the issued document, so the template could keep evolving while the history stayed intact.
Remittance terminals (2022)A recipient collected cash at a filling station using a coupon code.
The terminal printed each coupon as not yet valid, because a coupon that could not be used yet was an acceptable price for never paying one out twice.

04 · Result

In all three products the record stayed intact through the event that usually breaks it: a template change, a lost connection or the end of a session.

Customs invoicing: validated on 50,000 invoicesnone of which changed after issue

05 · Differently

On the customs system, freezing the issued document was correct but incomplete, because the template itself was never versioned.

Related services

The services that draw on this work.

Related writing

Posts that came out of this project.

Case study 11

Working on a similar problem? We reply within one business day.

The first call takes 30 minutes, and you’re under no obligation.

Tell us about your projectcontact@microtech.consulting