Originals in our care (phase 12, step 1)
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:
1 parent
329b181c4f
commit
ff716eb9d3
23 files changed
+1815
-3
No files matched your search
+4
-3
@@ -568,7 +568,7 @@ async fn contract_rows(st: &AppState, f: &Filter) -> anyhow::Result<Vec<Contract
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct JournalView {
|
||||
pub(crate) struct JournalView {
|
||||
seq: i64,
|
||||
at: String,
|
||||
actor: String,
|
||||
@@ -579,7 +579,7 @@ struct JournalView {
|
||||
contract_id: Option<i64>,
|
||||
}
|
||||
|
||||
fn journal_views(entries: Vec<journal::Entry>) -> Vec<JournalView> {
|
||||
pub(crate) fn journal_views(entries: Vec<journal::Entry>) -> Vec<JournalView> {
|
||||
entries
|
||||
.into_iter()
|
||||
.map(|e| JournalView {
|
||||
@@ -612,6 +612,7 @@ pub async fn client_page(
|
||||
};
|
||||
let contracts = contract_rows(&st, &f).await?;
|
||||
let entries = journal_views(journal::list(&st.db, Some(id), None, 30).await?);
|
||||
let originals = super::originals::card(&st, crate::originals::Owner::Client(id)).await?;
|
||||
let name = r.get("name").to_string();
|
||||
audit::record(
|
||||
&st.db,
|
||||
@@ -626,7 +627,7 @@ pub async fn client_page(
|
||||
"clients",
|
||||
StatusCode::OK,
|
||||
context! {
|
||||
id, name, shown, contracts, entries,
|
||||
id, name, shown, contracts, entries, originals,
|
||||
initials => initials(&name),
|
||||
name_th => r.get("name_th"),
|
||||
known_as => r.get("known_as"),
|
||||
|
||||
Reference in new issue
Block a user