Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7fb2c7af4 | ||
|
|
684dd27bad | ||
|
|
e9066c0445 |
No files matched your search
+82
-1
@@ -19,7 +19,8 @@
|
||||
> its `/` now leads to the back office, and the texts clients read name Lanna
|
||||
> Desk rather than B4L. Phase 9, the legal practice
|
||||
> (clients, lawyers, contracts with versions, paper copies, the journal),
|
||||
> followed that night. **Resume here: phase 8, reminders.**
|
||||
> followed that night, and phase 10, one client list, was planned. **Resume
|
||||
> here: phase 8, reminders, or phase 10, whose questions are decided.**
|
||||
|
||||
Lanna Desk keeps the immigration records of the foreigners that it
|
||||
looks after: their passports, addresses in Thailand, arrivals with the Thailand
|
||||
@@ -244,6 +245,7 @@ dark at desktop and phone width, a commit and a push.
|
||||
| 7 | The client link: a client fills in their own record on a phone, the MRZ read from a photo, and signs Lanna Desk's agreements | built Nov 20, 2026 |
|
||||
| 8 | Reminders by Matrix room message and by email | |
|
||||
| 9 | The legal practice: lawyers, clients (Thai and foreign, people and organizations), general and artist contracts with versions that never change, paper copies with ids and places, the journal as a hash-chained ledger | built Nov 21, 2026 |
|
||||
| 10 | One client list: a visa record becomes part of a client; People becomes the visa clients | planned Nov 21, 2026 |
|
||||
| later | Thai user interface, agency cases and fees, other visa categories' packs | |
|
||||
|
||||
### Phase 1: app, login, people
|
||||
@@ -581,6 +583,85 @@ message, the backup); contract templates; signing contracts on the client
|
||||
link; reminders of notice days and ends (phase 8); links between a client
|
||||
and their visa record.
|
||||
|
||||
### Phase 10: one client list (planned)
|
||||
|
||||
Since phase 9 there are two lists of the people Lanna Desk works for:
|
||||
Clients (the legal practice) and People (the visa records), and nothing ties
|
||||
Erika's visa record to a client. Alex asked on November 21, 2026 whether
|
||||
People should become Clients; the plan is one list in which a visa record is
|
||||
part of a client. Not started: build it when Alex says so.
|
||||
|
||||
**The model.** `clients` is everyone Lanna Desk works for. `people` stays as
|
||||
the visa record of a person client, so passports, addresses, stays,
|
||||
documents, client links, signatures, the deadlines, the forms, the pack and
|
||||
the audit log keep their `person_id` and work as they do.
|
||||
|
||||
- `people.client_id` references `clients`, unique and, once filled, not
|
||||
null: a client has at most one visa record, every visa record has a client.
|
||||
- One place for each fact. The passport-style name (surname, first and
|
||||
middle name, title, sex, date and place of birth) stays on the visa record,
|
||||
since the forms need it as printed. Phone and email move to the client
|
||||
(`people.phone` and `people.email` go after the copy); the client link's
|
||||
Contact page and the forms read them there. A visa client's name on the
|
||||
client list is taken from the visa record ("Erika Mustermann") and is not
|
||||
edited on the client form.
|
||||
- Nationality becomes an ISO alpha-3 code on clients too, with the country
|
||||
list the person form uses, so both say "Germany" the same way.
|
||||
- Archiving is the client's: a former client's visa record is archived with
|
||||
it, and restoring the client restores it.
|
||||
- The audit log keeps the visa side (views and changes of a person); the
|
||||
journal keeps the client, contracts and papers, and adds an entry when a
|
||||
visa record is opened for a client or the client's contact changes.
|
||||
|
||||
**Migration 0010** creates a client for every person (kind person, the name,
|
||||
nationality, phone and email from the person, status from `archived_at`, no
|
||||
lawyer), sets `client_id`, then the constraint, and writes one journal entry
|
||||
per client ("client added from the visa record of person N"). It runs by
|
||||
itself at the first start after cnx01 fetches the release, on the live
|
||||
records, and a rollback does not undo it, so it needs a test that loads
|
||||
people through the migrations up to 0009, applies 0010 and checks every
|
||||
person has its client with the same name and contact.
|
||||
|
||||
**The pages.**
|
||||
|
||||
- Clients: every client; a chip on the cards of those with a visa record and
|
||||
their next deadline; tabs All, With contracts, With a visa record.
|
||||
- A client's page: a "Visa and stay" card with the stay and the next dates,
|
||||
linking to the visa record's pages, which keep their `/people/{id}/...`
|
||||
addresses (client links, bookmarks and audit rows point there). A client
|
||||
without one gets "Open a visa record", which asks for the passport-style
|
||||
name.
|
||||
- The visa record's pages show "Clients / name" above the tabs and a link
|
||||
to the client's contracts.
|
||||
- The sidebar: under Visas and stays, People becomes "Visa clients", the
|
||||
same clients filtered to those with a visa record; Deadlines stays the
|
||||
start page.
|
||||
- "+ New client" on the visa side opens the client and the visa record in
|
||||
one step, as `/people/new-client` does now.
|
||||
|
||||
**Steps.**
|
||||
|
||||
1. Migration 0010, the backfill test, contact read from the client.
|
||||
2. The client page's visa card, the visa pages' crumb, the list filters and
|
||||
the sidebar.
|
||||
3. The client link writes the contact to the client; the journal entries.
|
||||
4. Docs, screenshots, release; on cnx01, `visa-admin` checks that the
|
||||
number of people equals the number of clients with a visa record.
|
||||
|
||||
**Decided with Alex (November 21, 2026).**
|
||||
|
||||
1. A visa client's name reads as on the visa side: "MUSTERMANN, Erika".
|
||||
2. Companies and organization clients become one list too: the company
|
||||
record (registration, address, director, the pack's documents) becomes
|
||||
part of an organization client, as the visa record is part of a person
|
||||
client. Employees stay linked to the company record, so the forms and the
|
||||
pack keep working. This adds a step after step 3: migration 0011 creates
|
||||
an organization client per company, and the company pages move as the
|
||||
visa pages do.
|
||||
3. Every lawyer and staff member sees every client for now. The model leaves
|
||||
room for finer access later (a client's team of lawyers, a role per
|
||||
section), so no page should assume more than the queries enforce.
|
||||
|
||||
## Open questions
|
||||
|
||||
1. B4L's BOI application: once B4L is promoted, its staff extend their stay
|
||||
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# The demo instance: the app with invented data on its own database
|
||||
# (visa_demo) and files (.dev/demo-files) on :8041, beside the dev server,
|
||||
# so the dev data stays as it is. Used for the pitch deck's screenshots.
|
||||
# The first start creates the database; dev.sh seeds the demo data (it
|
||||
# adds only what is missing). Start over: drop visa_demo, rm -rf .dev/demo-files.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
export PATH="$HOME/.cargo/bin:/c/Program Files/Git/cmd:$PATH"
|
||||
docker exec visa-pg psql -U visa -d postgres -Atc "SELECT 1 FROM pg_database WHERE datname='visa_demo'" | grep -q 1 ||
|
||||
docker exec visa-pg psql -U visa -d postgres -qc "CREATE DATABASE visa_demo OWNER visa"
|
||||
base=$(sed -n 's/^export VISA_DATABASE_URL=\${VISA_DATABASE_URL:-\(.*\)}$/\1/p' scripts/dev.sh)
|
||||
export VISA_DATABASE_URL="${base%/visa}/visa_demo"
|
||||
export VISA_LISTEN=127.0.0.1:8041
|
||||
export VISA_FILES_DIR=.dev/demo-files
|
||||
exec bash scripts/dev.sh
|
||||
Reference in new issue
Block a user