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

+36
View File
@@ -86,7 +86,43 @@ async fn every_page_renders_with_demo_data(pool: PgPool) {
.await
.unwrap();
// the originals in our care (phase 12) come with the legal demo data
visa::seed::legal::demo(&pool, Some(store), visa::dates::today())
.await
.unwrap();
let (original, original_code): (i64, String) =
sqlx::query_as("SELECT id, code FROM originals WHERE person_id = $1")
.bind(erika)
.fetch_one(&pool)
.await
.unwrap();
let client: i64 = sqlx::query_scalar("SELECT min(client_id) FROM originals")
.fetch_one(&pool)
.await
.unwrap();
let mut pages = vec![
(
"/originals".to_string(),
"Chiang Mai Immigration".to_string(),
),
("/originals?show=all".to_string(), "Returned".to_string()),
(
format!("/originals/{original_code}"),
"Where it is now".to_string(),
),
(
format!("/originals/{original}/label"),
"Belongs in".to_string(),
),
(
format!("/originals/new?person={erika}"),
"Take in an original".to_string(),
),
(
format!("/originals/new?client={client}"),
"Belongs to the contract".to_string(),
),
("/desk".to_string(), "90-day report".to_string()),
(
"/desk?all=1".to_string(),