The back office now looks like lannadesk.com:
- Light theme as a printed letterhead (warm paper, navy ink, thin gold
rules, a gold line across the top), and the default; the dark theme is
the same navy and gold and stays a click away.
- Trirong for headings and names, Sarabun for text: the website's
fonts, self-hosted in static/fonts/ (latin and Thai subsets, OFL),
since the CSP allows fonts from this origin only.
- The header reads "Lanna Desk, back office"; primary buttons are navy
on paper and gold on navy; corners are squarer.
People are record cards, like the example record on the website: a
monogram, the name in Trirong, nationality and province, the most
urgent deadline's chip, the stay today, the next four dated deadlines
with how far away they are, the passport and the employer. The filter
works on the cards; "Table" shows the table as before (?view=table),
and the switch keeps the employer and archive filters.
Checks: fmt, clippy, 109 unit and 57 integration tests (the cards show
the stay, the next dates and the monogram; the table view and the
switch keep their filters); screenshots of People (light, dark, phone),
a person, the deadlines and a client link.
Logo: a Lanna gable whose crossed kalae horns stand over a desk, gold on
navy, with "Lanna Desk" and "Visas · stays · contracts" in Sarabun drawn
as outlines. static/brand/ has the mark, the logo for light and for dark
backgrounds and a one-color version; scripts/gen_logo.py makes them, the
favicon and the header's mark from forms/fonts/Sarabun-Bold/SemiBold
(SIL Open Font License, next to the Regular already there).
`/` is now lannadesk.com's public page (templates/landing.html,
static/landing.css): what Lanna Desk takes care of, how a client starts
(write, open the link, sign first, we keep the dates), how the data is
kept, contact@lannadesk.com and "Staff sign-in". It needs no session and
shows no records. The back office's first page, the deadlines, moves to
`/desk` (web::HOME): the header, the nav, the filter, the login's default
target and the messages' links follow.
Signing out now ends the session at id.cnx.network too. Kanidm names no
end_session_endpoint, but its GET /ui/logout ends the session and clears
its cookies (SameSite=Lax, so they come along on a top-level navigation).
The logout form may only lead to this site (CSP form-action 'self'), so
/signed-out sends the browser on with a refresh and offers the link as
well; providers that are not Kanidm keep the old page.
Checks: fmt, clippy, 109 unit and 57 integration tests (the public page
open and free of records, /desk behind the sign-in, the sign-out page
leading to the provider); the page at 1280 and 390 px; the header's mark
in both themes; the style check on the README, PLAN and the page.
Companies become records of their own, and the stay in Thailand is
recorded in full; from these records the app works out each person's
deadlines (docs/PLAN.md, phase 2).
- Companies: list, page, form, archive; Thai name, the 13-digit
registration number with its check digit verified, address and the
director who signs. The employer is chosen from them on the person form
and on work permits; a company's page adds people to it; the people
list and the Deadlines page filter by employer. Migration 0002 turns
the free-text employers into companies.
- Stay records, each one `Kind` in src/records.rs with one form, one set
of routes and the same audit entries: arrivals and departures with the
TDAC, extensions of stay (approved, under consideration, refused),
90-day reports with the receipt's next date, visas, re-entry permits and
work permits. Passports, visas and companies are chosen from the
person's own records; the server checks the choice.
- The deadline engine (src/deadlines.rs, a pure function with a unit
test per rule): the 90-day report from day 1 of each arrival, reset by
a report or an extension, with the in-person and online windows and the
in-person rule after a new passport or an extension; the extension
window from 30 days before to the last working day; the decision to
collect; overstay with its fine; TM.30 after each arrival; passport and
work permit expiry; re-entry permits; visas still to be used.
- The Deadlines page at /, the person's status and deadlines on the
Overview and the new "Visa and stay" tab, the person's Activity tab,
and the next deadline in the people list.
- The online 90-day window ends 7 days before the due date (the plan
said 8; the Immigration Bureau's TM.47 manual says 7).
- 69 tests: 45 unit tests and 24 integration tests.