Commit Graph
6 Commits
Author SHA1 Message Date
grabowski 3dd9ab60e8 One shared draft a contract, locked when all agree (phase 13, step 2)
CI / secret scan (push) Successful in 6s
CI / fmt, clippy, tests (push) Successful in 1m27s
CI / release (push) Skipped
Until a contract is set, it is one open text for every side, as Alex
asked: our team edits it in the app, each other party on its link. Edits
are tracked changes in the author's color (crossed out, added,
highlighted with a comment) until the other side accepts or rejects
them. When no change or highlight is open and Lanna Desk and every party
agree, the text becomes a contract version that never changes, and the
draft locks.

- One side edits at a time: Edit takes the draft for 45 seconds, which
  every save renews; Done editing, leaving the page or silence gives it
  up. The editor saves 0.7 s after the last keystroke; the other pages
  ask for news every 3 s, so each side sees edits, who edits, agreements
  and the lock without reloading.
- A save may only touch the saver's own marks (reviews::check_save);
  accept, reject (or withdraw) and resolve are their own steps, journaled
  with the text concerned. A later change voids the agreements given.
- Notices: the other side's edits (one a half hour of editing), settled
  changes, agreements, the lock. The bell in the top bar counts the
  unseen (every 15 s); Notices lists them and marks them seen.
- The draft as a diff: the standing text against every open change taken.
- Migration 0015: contract_drafts, draft_saves and draft_agreements (both
  kept unchanged by a trigger), notices, notice_reads; drops step 1's
  review_rounds (only the demo held any). The review links stay as each
  party's way in.
- Property tests for the save rule and settling, the fuzz text target
  runs the parser, the save check and settling; integration tests play
  both sides to the lock. The demo's recording agreement has an open
  draft with the label's changes and a notice.
- PLAN: phase 13 rewritten; step 3 is the PDF and signing.
2026-11-23 16:14:14 +07:00
grabowski 329b181c4f Demo mode (VISA_DEMO=1) for demoapp.lannadesk.com
CI / secret scan (push) Successful in 8s
CI / fmt, clippy, tests (push) Successful in 1m23s
CI / release (push) Skipped
For a public demo: no login on any address, everyone is "Demo visitor"
(actor demo), a note at the top of every page, the back office's and the
client's (#demo-note), and the invented demo data added at start when
the database is empty (the server drops it every night). Every file
upload is refused with a message (documents, the office photo, the
client's uploads; a contract version keeps its text without the file),
a mail server in its settings is refused, so nothing leaves it, and it
needs a place for the files and their key (the demo's own files and the
signed copies). seed-demo also runs in it. Sign out leads home.

Checked: config test (address, files, no mail), tests/demo.rs (the note,
an upload refused and nothing kept, a version with text only, the
journal's actor), a local run on an empty database (seeds itself: 27
documents, the clients and contracts) and screenshots light and dark,
desk and phone (PROBLEMS: 0).
2026-11-23 11:03:40 +07:00
grabowski 424f212b23 Client texts name Lanna Desk, not B4L
CI / secret scan (push) Successful in 8s
CI / fmt, clippy, tests (push) Successful in 43s
CI / release (push) Skipped
Lanna Desk is the legal side of buildfor.life (B4L), and the client link,
its agreements, the demo agreement and the messages now name Lanna Desk:
"Lanna Desk looks after your visa ...", "Send to Lanna Desk", "Lanna
Desk keeps the signed copy". B4L stays where it is the company itself:
the employer in the Non-B pack and its BOI application.

README and PLAN say the same.

Checks: fmt, clippy, 109 unit and 57 integration tests.
2026-11-21 22:49:21 +07:00
grabowski 3d2d8fa30b Back office in the website's style; People as record cards
CI / secret scan (push) Successful in 10s
CI / fmt, clippy, tests (push) Successful in 44s
CI / release (push) Skipped
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.
2026-11-21 21:27:09 +07:00
grabowski e5e30c977c Lanna Desk: the app's name, for its move to lannadesk.com
CI / secret scan (push) Successful in 9s
CI / fmt, clippy, tests (push) Successful in 46s
CI / release (push) Skipped
The header (staff pages, messages and the client link), page titles,
footer, messages, the pack's cover line and the PDFs' creator now say
Lanna Desk (lannadesk.com) instead of visa.buildfor.life. The company
named in the client's texts and agreements stays B4L. Nothing depends on
the name the app is reached under: VISA_PUBLIC_URL comes from the fleet,
which moves it to https://lannadesk.com and redirects visa.buildfor.life
there with the path, so links already sent keep working.

README, AGENTS, PLAN and the release notes name the new address.

Checks: fmt, clippy, 108 unit and 57 integration tests; the header at
360 and 390 px and on a desktop.
2026-11-21 19:28:34 +07:00
grabowski 43ed75d81b Phase 7: the client link
CI / secret scan (push) Successful in 6s
CI / fmt, clippy, tests (push) Successful in 59s
CI / release (push) Skipped
Staff make a link for a person (or "+ New client": a record with only the
name they know, and its link); the client fills in their own record from
their phone without a login, and presses Send.

- Links (src/links.rs, migrations/0006): the table keeps the SHA-256 of
  the token only, as sessions do; the link is shown once, to copy, to email
  (mailto with the person's address) or as a QR code (qrcode crate, inline
  SVG). It is open 14 days, until Send, or until staff close it; a new
  link closes the earlier one. States open, opened, sent, closed, expired.
- The client's pages at /c/<token> (src/web/client.rs, client_*.html in a
  frame of their own, phone first): About you, Passport (the photo reader;
  a zone fills in the personal details still empty), Address in Thailand,
  Contact, Documents, Send. Each part is saved on its own, straight into
  the record. Forms carry the link's own token plus the same-site check.
  A passport with the same number is changed; an address unlike the
  current one is added beside it, so the current one and its TM.30 receipt
  stay; a second save changes what the link added. Uploads (passport page,
  photo, visa, arrival stamp, TDAC, work permit, other) go through the
  same checks and encrypted store as staff uploads, tied to the person's
  newest record of their kind.
- Audit: the client's views and changes carry the actor `link <id>`;
  actions send and close and entity link are new. The person's page shows
  the newest links, when they were opened and sent, and each record the
  client changed, with the fields, to check.
- Demo data: Erika sent her link an hour ago (phone and email changed),
  Jane opened hers.
- documents::read_upload returns why it refused, so the client's pages
  answer in their own words.

Checks: fmt, clippy; 101 unit and 54 integration tests (tests/client.rs:
the link shown once and kept as a hash, a new client, the whole client
flow with the login on, forged, closed, expired and made-up links);
layout check light/dark desk/phone on the client pages, the person page
and the new client form: no problems; the camera reader on the client's
passport page with a fake camera filled the form and Send closed the link.
2026-11-20 19:48:34 +07:00