The legal practice: clients, lawyers, contracts, papers, the journal
CI / secret scan (push) Successful in 7s
CI / fmt, clippy, tests (push) Successful in 45s
CI / release (push) Skipped

Lanna Desk's larger work is contracts, general ones and artists', for
clients who are Thai or foreign, people or organizations, with several
lawyers in the team. The back office gets a Legal section (phase 9 in
docs/PLAN.md):

- Lawyers: license number, contact, the login of one who uses the app
  (then "My contracts"), in the team or left.
- Clients, as record cards: person or organization, names in English and
  Thai, stage name or brand, a Thai ID number (checked), a passport or a
  registration number, the lawyer in charge.
- Contracts: code LD-<year>-<n>, the general kinds and the artist kinds
  (recording, management, publishing, performance, license,
  merchandise), other party, status, lawyer, dates and value; a contract
  in force shows its notice day and its end ahead. Filters: general or
  artists, a lawyer, mine, those over.
- Versions: a text kept here, a file (PDF or scan, encrypted as the
  client's document) or both. They never change: the database refuses
  UPDATE and DELETE, a version's file cannot be deleted and no document's
  checksum can change. Any version reads against the one before as a
  line diff.
- Paper copies: the id <code>-P<n> to write on the paper or print as a
  90 x 50 mm label with a QR code; where it lies, its state and holder,
  each move journaled; found again by its id.
- The journal: every change in words, in the change's transaction, each
  entry chained to the one before by SHA-256. The database refuses to
  change, delete or truncate it; /journal checks the chain and every
  version's text and fingerprints against its entry, shows the last hash
  and exports CSV.

The sidebar groups its sections: Legal, Visas and stays, Office. Demo data
(seed-demo) adds three lawyers, six clients and seven contracts with
versions, papers and moves. Documents take a third owner, the client
(migration 0009).

Checks: fmt, clippy, 115 unit and 62 integration tests (new: versions and
the journal, the database refusing changes, a change around the app
breaking the chain, paper ids and moves, the demo checking whole);
screenshots of the new pages in light, dark and on a phone.
This commit is contained in:
grabowski committed 2026-11-21 23:20:20 +07:00
1 parent 424f212b23
commit 16e4cdc73d
32 files changed
+4758 -45

No files matched your search

+293
View File
@@ -248,6 +248,18 @@ h2 {
font-weight: 600;
box-shadow: inset 3px 0 0 var(--label);
}
/* the groups of sections, in the small gold capitals of the website */
.nav .navh {
margin: 14px 12px 4px;
color: var(--label);
font-size: 11px;
font-weight: 600;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.nav .navh:first-child {
margin-top: 0;
}
.who {
margin-top: auto;
font-size: 13px;
@@ -1274,6 +1286,19 @@ textarea.mrz {
.nav::-webkit-scrollbar {
display: none;
}
/* the groups' names fit no row: a thin rule parts them instead */
.nav .navh {
width: 1px;
margin: 6px 4px;
padding: 0;
overflow: hidden;
color: transparent;
background: var(--line);
flex: 0 0 1px;
}
.nav .navh:first-child {
display: none;
}
.nav a {
padding: 6px 8px;
font-size: 14px;
@@ -1791,3 +1816,271 @@ html[data-theme="dark"] .rc-mono {
grid-template-columns: minmax(0, 1fr);
}
}
/* ---- The legal practice: clients, contracts, versions, paper copies and
the journal */
.rc-mono.org {
border-radius: 2px;
}
.rc-mono.big {
width: 52px;
height: 52px;
font-size: 20px;
}
.titled {
display: flex;
align-items: center;
gap: 14px;
}
.titled .meta {
margin: 2px 0 0;
}
.rc-th {
margin: 10px 0 0;
color: var(--mute);
font-size: 14px;
}
.tag.gold {
background: var(--accent-s);
color: var(--hd);
border-color: transparent;
}
.sechead {
margin: 26px 0 8px;
}
.sechead.first {
margin-top: 6px;
}
.cols + .card {
margin-top: 18px;
}
.cols + .sechead,
.sechead.first + .card,
.sechead.first + .card.flush {
margin-bottom: 18px;
}
.tbl td.nowrap {
white-space: nowrap;
}
.ccode {
color: var(--label);
font-size: 13px;
font-weight: 600;
letter-spacing: 0.06em;
}
.findpaper {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 14px;
margin: 0 0 14px;
padding: 12px 16px;
font-size: 14px;
}
.findpaper .inline {
display: flex;
gap: 8px;
}
.findpaper input {
width: 15em;
}
.vlinks {
display: flex;
flex-wrap: wrap;
gap: 4px 12px;
margin: 4px 0;
}
.pcode {
color: var(--hd);
font-weight: 600;
white-space: nowrap;
}
.pacts {
text-align: right;
white-space: nowrap;
}
details.move {
position: relative;
display: inline-block;
text-align: left;
}
details.move summary {
list-style: none;
cursor: pointer;
}
details.move summary::-webkit-details-marker {
display: none;
}
details.move[open] .mini {
position: absolute;
right: 0;
z-index: 5;
display: grid;
gap: 8px;
width: min(360px, 80vw);
margin-top: 6px;
padding: 14px;
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow);
white-space: normal;
}
.mini label {
display: grid;
gap: 3px;
font-size: 13px;
color: var(--mute);
}
.diff {
font-size: 14.5px;
line-height: 1.55;
border: 1px solid var(--line);
border-radius: var(--radius);
overflow: hidden;
}
.diff .dl {
padding: 1px 12px;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.diff .dl.added {
background: color-mix(in srgb, var(--ok) 14%, transparent);
box-shadow: inset 3px 0 0 var(--ok);
}
.diff .dl.removed {
background: color-mix(in srgb, var(--bad) 12%, transparent);
box-shadow: inset 3px 0 0 var(--bad);
}
.diff ins {
text-decoration: none;
}
.diff del {
color: var(--mute);
}
.jlist {
margin: 0;
padding: 0;
list-style: none;
}
.jlist li {
padding: 10px 0;
border-bottom: 1px dashed var(--line);
}
.jlist li:last-child {
border-bottom: 0;
}
.jhead {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 4px 10px;
}
.jseq {
color: var(--label);
font-size: 12.5px;
font-weight: 600;
}
.jdetail {
margin: 3px 0 2px;
font-size: 14px;
overflow-wrap: anywhere;
}
.jhash {
color: var(--mute);
font-size: 11.5px;
}
.hashline {
overflow-wrap: anywhere;
font-size: 12.5px;
}
/* A paper's label: 90 x 50 mm, printed alone */
.labelpage {
padding: 24px;
}
.labelbar {
display: flex;
align-items: center;
gap: 16px;
margin-bottom: 18px;
}
.plabel {
display: flex;
gap: 4mm;
align-items: center;
width: 90mm;
height: 50mm;
box-sizing: border-box;
padding: 3mm 4mm;
background: #ffffff;
color: #071323;
border: 0.3mm solid #071323;
border-top: 1.4mm solid #f5c000;
overflow: hidden;
}
.pl-qr {
flex: none;
width: 30mm;
}
.pl-qr svg {
display: block;
width: 30mm;
height: 30mm;
}
.pl-text {
min-width: 0;
line-height: 1.25;
}
.pl-brand {
color: #9a7500;
font-size: 7pt;
font-weight: 600;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.pl-code {
font-size: 12.5pt;
font-weight: 700;
margin: 0.5mm 0 1mm;
white-space: nowrap;
}
.pl-title {
font-family: var(--serif);
font-size: 9pt;
font-weight: 600;
overflow-wrap: anywhere;
}
.pl-line,
.pl-where {
font-size: 7pt;
overflow-wrap: anywhere;
}
.pl-where {
margin-top: 1mm;
font-weight: 600;
}
.labelhint {
max-width: 90mm;
color: var(--mute);
font-size: 13px;
}
@media print {
@page {
size: 90mm 50mm;
margin: 0;
}
body.labelpage {
padding: 0;
border: 0;
background: #ffffff;
}
.labelbar,
.labelhint {
display: none;
}
.plabel {
border: 0;
border-top: 1.4mm solid #f5c000;
}
}