Phase 5: the Immigration Bureau's forms, filled in from the records
CI / secret scan (push) Successful in 5s
CI / fmt, clippy, tests (push) Successful in 39s

A Forms tab on each person fills in TM.7, STM.2, STM.9, STM.11 and STM.1
for an extension of stay, TM.47 for a 90-day report and TM.8 for a re-entry
permit. The Bureau's blank pages (forms/, with their sources and checksums)
go unchanged into a new PDF, and the values are written on the dotted lines
in Sarabun; boxes are ticked and the title circled where a form asks.
scripts/gen_layout.py measures the blanks into src/papers/layout.rs.

The tab says what would stay blank and links to where it is added. What only
the application says (the date, the office, the reason, the days, a trip) is
carried in the links and never stored. The extension's five forms also come
in one PDF. Opening or downloading a form is audited as entity "form" with
the forms' codes, never their values.

Migration 0005 adds what STM.1 and STM.11 ask of the company (capital,
revenue, equity, staff, a coordinator), a work permit's salary and contract
dates, and where an arrival came from. The Nix package now takes forms/.
This commit is contained in:
grabowski committed 2026-11-18 12:30:03 +07:00
1 parent 2a6e972b68
commit a2cedcdd7e
40 files changed
+3404 -35

No files matched your search

+43 -5
View File
@@ -1,9 +1,10 @@
# visa.buildfor.life: plan
> Phases 1 to 3 built on November 17, 2026, and phase 4's app side on
> November 18, 2026; the app is live at https://visa.buildfor.life. **Resume
> here: phase 5, the filled-in forms.** Task 4.6, the fleet side of the
> documents, waits in cnx-network-clan PR #126.
> Phases 1 to 3 built on November 17, 2026, phase 4's app side and phase 5
> on November 18, 2026. The live app at https://visa.buildfor.life has phases
> 1 to 3 until cnx-network-clan PR #126 (task 4.6) is deployed and the fleet's
> `visa` input is updated to the newest commit. **Resume here: phase 6, the
> Non-B extension pack.**
visa.buildfor.life keeps the immigration records of the foreigners that B4L
looks after: their passports, addresses in Thailand, arrivals with the Thailand
@@ -170,7 +171,7 @@ dark at desktop and phone width, a commit and a push.
| 2 | Companies; stays: visas, arrivals with TDAC, extensions, re-entry permits, 90-day reports, work permits; deadlines | built Nov 17, 2026 |
| 3 | On cnx01: flake package, fleet module, Kanidm client and group, bkk01 site, backups; real data from here on | live Nov 17, 2026 |
| 4 | Documents: encrypted uploads (passport pages, TDAC, receipts, photo) on the dataset `zroot/visa` with a key var, viewing and download, all audited; the office's GPS position and photo | app built Nov 18, 2026; fleet in PR #126 |
| 5 | Filled-in forms: TM.7, STM.2, the overstay acknowledgment, TM.47, TM.8 and STM.1 as PDF | |
| 5 | Filled-in forms: TM.7, STM.2, the overstay acknowledgment (STM.9), STM.11, STM.1, TM.47 and TM.8 as PDF | built Nov 18, 2026 |
| 6 | The Non-B extension pack: B4L's company documents, the checklist, one PDF to print | |
| 7 | Reminders by Matrix room message and by email | |
| later | Thai user interface, agency cases and fees, a view for clients, other visa categories' packs | |
@@ -275,6 +276,43 @@ one `Kind`.
The photos are documents of the kind "Photo of the office", so they
are encrypted and audited like every other file.
### Phase 5: filled-in forms
- [x] 5.1 The blank forms as the Immigration Bureau publishes them, in
`forms/` with their sources and checksums in `forms/README.md`: TM.7,
STM.2, STM.9 (the acknowledgment of the penalties for overstay),
STM.11, STM.1, TM.47 and TM.8. Each page goes unchanged into a new PDF
and the values are written on its dotted lines in Sarabun, the font of
the forms; a box is ticked and the person's title circled where the
form asks for that. Signatures, the photo and the officers' parts stay
blank.
- [x] 5.2 Where each value goes: `scripts/gen_layout.py` finds the dotted
lines in the blank PDFs and writes `src/papers/layout.rs`. TM.47 has no
dotted lines, so its blanks are measured from the lines drawn on it. A
new version of a form needs the script run again and every page checked.
- [x] 5.3 The values (`src/papers/values.rs`) come from the person, the
passport that runs longest, the current address, the last arrival with
its visa and permission to stay, the work permit and the employer, and
the date of the company certificate from the company's documents. They
are written in capitals with the Western year, as the passport has
them. What only the application says (the date, the office, the reason,
the days asked for, which yearly extension it is, a trip for TM.8) is
on the tab, with defaults from the records, and travels in the links as
query parameters, so none of it is stored.
- [x] 5.4 A Forms tab on each person: every form with what it is for, Open
and Download, and what would stay blank, each with a link to where it
is added. "The extension's five forms" gives TM.7, STM.2, STM.9, STM.11
and STM.1 in one PDF, in the order the officer reads them.
- [x] 5.5 New fields for the forms (`migrations/0005_forms.sql`): a
company's registered and paid-up capital, the year of its latest
financial statements with the revenue and the owners' equity, the
foreign staff's pay for the next year, its Thai and foreign staff, and
a coordinator for immigration; a work permit's monthly salary and
contract dates; where an arrival came from. A Thai year such as 2568 is
taken as 2025.
- [x] 5.6 Audit: opening or downloading a form is logged as `form` with the
codes of the forms, never their values.
## Open questions
1. B4L's BOI application: once B4L is promoted, its staff extend their stay