3dd9ab60e897ccec19820c10fec4182c34feb313
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3dd9ab60e8 |
One shared draft a contract, locked when all agree (phase 13, step 2)
Until a contract is set, it is one open text for every side, as Alex asked: our team edits it in the app, each other party on its link. Edits are tracked changes in the author's color (crossed out, added, highlighted with a comment) until the other side accepts or rejects them. When no change or highlight is open and Lanna Desk and every party agree, the text becomes a contract version that never changes, and the draft locks. - One side edits at a time: Edit takes the draft for 45 seconds, which every save renews; Done editing, leaving the page or silence gives it up. The editor saves 0.7 s after the last keystroke; the other pages ask for news every 3 s, so each side sees edits, who edits, agreements and the lock without reloading. - A save may only touch the saver's own marks (reviews::check_save); accept, reject (or withdraw) and resolve are their own steps, journaled with the text concerned. A later change voids the agreements given. - Notices: the other side's edits (one a half hour of editing), settled changes, agreements, the lock. The bell in the top bar counts the unseen (every 15 s); Notices lists them and marks them seen. - The draft as a diff: the standing text against every open change taken. - Migration 0015: contract_drafts, draft_saves and draft_agreements (both kept unchanged by a trigger), notices, notice_reads; drops step 1's review_rounds (only the demo held any). The review links stay as each party's way in. - Property tests for the save rule and settling, the fuzz text target runs the parser, the save check and settling; integration tests play both sides to the lock. The demo's recording agreement has an open draft with the label's changes and a notice. - PLAN: phase 13 rewritten; step 3 is the PDF and signing. |
||
|
|
a4155548b8 |
The other side reviews a draft (phase 13, step 1)
A lawyer sends a contract version to one of its parties with a link. On it the other side marks the text up in an editor that keeps every change visible, as tracked changes do: deleting our text crosses it out in red, typing is marked as added in green, and the highlighter marks a passage in yellow with a comment. Restore and Undo take marks back. They send it back once a round; each later version comes on the same link. - Migration 0014: review_links (token kept as a SHA-256, one open link a party) and review_rounds (the reply written once: their pieces, text, SHA-256, name, message; a trigger refuses any other change and every delete). Journal entries "sent for review", "review returned" (with the fingerprint of their text) and "review link closed"; audit entity "review". - The reply is a list of pieces (same, ins, del, mark). The server checks that the pieces without the added ones are exactly the version sent, so nothing changes unseen (reviews::check). - Our review page: their message, the changes numbered with the words around them and a box each, the highlights with comments, a git-style diff (line numbers, - and + lines, the changed words marked, three lines of context per hunk) and their markup. "Take the ticked changes" opens the contract page with the version form filled with our text plus those changes. - static/review-editor.js: edits work on the pieces and redraw, so our text cannot vanish; keyboard compositions and edits the browser will not cancel are compared with the text and taken as edits. - Property tests (any markup is accepted and taken back exactly; markup that changes our text unseen is refused), the fuzz text target runs reviews::check, integration tests, and the demo has the label's review of the recording agreement. - PLAN: phase 13. |
||
|
|
9ae4d7bd07 |
Phase 11, step 1: the parties of a contract and the conflict check
A contract's other side was one line of text. Now each other party is a row with its names in English and Thai, an ID, passport or registration number and its role (migration 0010; the old line became the first party). Parties are never deleted or rewritten: taking one off marks it removed, and both are in the journal. The conflict check (src/conflicts.rs) looks for the name or number among the clients, the other parties, the visa people and the employers. Names match regardless of case, word order, punctuation and company words in English and Thai (Co., Ltd., บริษัท ... จำกัด), or when every word of the shorter name, at least two, is in the longer one. A new party that is a client, a visa client or an employer is a conflict; a new or renamed client that was on the other side of a contract is one too; a client's name or number again is perhaps the same client. Those stop the save (409) until a lawyer ticks that they looked, with what they checked; the matches and the note go into the journal entry. /conflicts runs the check alone before a first meeting and saves nothing. Tests: 119 unit, 63 integration. |
||
|
|
16e4cdc73d |
The legal practice: clients, lawyers, contracts, papers, the journal
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. |