Originals in our care (phase 12, step 1)
CI / secret scan (push) Successful in 8s
CI / fmt, clippy, tests (push) Successful in 1m23s
CI / release (push) Skipped

What clients hand Lanna Desk for a while (a passport for an extension, a
signed contract, a title deed) gets a code and a label (OR-2026-0001), and
a record of where it is: held at a place in the office, out with someone
such as Chiang Mai Immigration until a date, or returned.

- Migration 0013: table originals, owned by a client or a person; the
  database refuses a delete and a change of what it is, whose it is and
  how it came.
- Every intake and move is a journal entry starting with the code; the
  item's page reads its history from there. The audit log has the new
  entity "original", with a view when a person's original is shown.
- Pages: Legal, Originals (in our care, out, held, returned, all; a find
  box for a typed or scanned code), the item's page with the move form,
  intake from a client's or a person's page, and the label with a QR code
  to the item's page. Cards on the client's and the person's pages.
- A field can show only for some choices of a selection
  (data-shown-when), so the move form asks "Where it lies", "With whom"
  or "Returned to" as fits.
- Demo data: a passport out at Immigration, a title deed and a house
  registration held, a company certificate returned.
- PLAN: phase 12, with step 2 (the inbox that files a pile of scans) and
  step 3 planned.
This commit is contained in:
grabowski committed 2026-11-23 14:06:50 +07:00
1 parent 329b181c4f
commit ff716eb9d3
23 files changed
+1815 -3

No files matched your search

+65
View File
@@ -247,6 +247,7 @@ dark at desktop and phone width, a commit and a push.
| 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 |
| 11 | The conflict check and the other parties of a contract; the journal's last hash sent outside the server each day | built Nov 22, 2026 |
| 12 | Originals in our care (passports, signed contracts, deeds: where each one is) and the inbox that files a pile of scans | step 1 built Nov 23, 2026 |
| later | Thai user interface, agency cases and fees, other visa categories' packs | |
### Phase 1: app, login, people
@@ -778,6 +779,70 @@ service `visa-demo` on port 8042 runs the live release, its own database
`visa_demo` and files, and `visa-demo-reset` at 04:00 drops and recreates
the database. Test: `tests/demo.rs`.
## Phase 12: originals in our care, and the inbox (planned Nov 23, 2026)
Alex: the inventory is of the originals clients hand Lanna Desk (passports
for an extension, signed contracts, title deeds) and where each one is; the
sorting takes a pile of scans and files each one to the right client, kind
and record, with a suggestion to confirm.
### Step 1: the originals register (built)
- Table `originals` (migration 0013): a code on the label (`OR-2026-0001`,
Bangkok year and a sequence, like the contracts' codes), whose it is (a
client of the legal practice or a person of the visa side, exactly one),
its kind (passport, ID card, house registration, title deed, contract,
certificate, bank book, work permit, other), what it is in words, the
contract it belongs to (optional), when and from whom it came and who
took it in, and where it is now: `held` (a place in the office), `out`
(with someone, such as Chiang Mai Immigration, and when it should be
back) or `returned` (to whom). A date when it is due back with the client
is optional too. The database refuses a delete and a change of what an
original is, whose it is and how it came: like the paper copies, it stays
on record.
- Every intake and every move is an entry in the journal (the hash chain),
with the code first, so the item's page shows its history from there.
- Pages: Legal, Originals (`/originals`: held, out, returned, all; due and
overdue chips; a box that finds a code, as a scanner types it), the
item's page (`/originals/{code}`, the address in the label's QR code,
with the move form and the history), intake from the client's or the
person's page (`/originals/new?client=` or `?person=`), and the label
(90 x 50 mm, as for paper copies). Cards on the client's and the
person's pages list theirs.
- Demo data: a passport out at Chiang Mai Immigration, a title deed and a
signed contract held, one returned.
### Step 2: the inbox (planned)
- Staff drop many scans or photos at once into Office, Inbox (no owner
yet; stored encrypted like every document; the demo takes none). Each
waits as a row with its picture and a suggestion: whose it is, its kind,
the record it goes with. One click files it as a document of that
person, company or client (the documents' own rules apply: the type by
its first bytes, no duplicate, the same audit and journal entries);
"not this" leaves it for a choice by hand.
- Suggestions, each with the reason shown, strongest first:
1. a cover sheet: the app prints a sheet per client or person with a QR
code (`/inbox/sheet?client=`); pages scanned after it in one stack are
theirs until the next sheet;
2. a passport's zone, read in the browser by the reader the passport
form already has (Tesseract.js), matched by number and name;
3. a PDF's own text (scans from an office scanner with OCR, e-documents):
names and numbers matched like the conflict check (Thai ID, passport,
registration number), and words of a kind (TM.30, ใบอนุญาตทำงาน,
โฉนด);
4. the file name ("erika passport.jpg").
- A suggestion is never filed by itself: someone confirms, and the journal
or the audit log says who.
### Step 3: later
- A receipt PDF for the client at intake and at return, with their
signature on the phone (the agreements' drawing pad).
- Originals out past their date on the Deadlines page, and in the
reminders once phase 8 sends them.
- Phase 10 (one client list) turns an original's person into a client.
## Open questions
1. B4L's BOI application: once B4L is promoted, its staff extend their stay