Copy from Spouse: scaffold a partner client from their spouse #53

Merged
parkerhdavis merged 2 commits from copy-from-spouse into main 2026-04-28 11:26:04 -06:00
parkerhdavis commented 2026-04-28 11:25:58 -06:00 (Migrated from github.com)

Summary

  • New copy_from_spouse_lily Tauri command: promotes a Spouse contact in the source folder to the client of a new .lily, demotes the original client to a Spouse contact, retargets bindings, copies questionnaire data + required documents, and recreates each of source's documents from template with the swapped variable values.
  • Copied filenames are renamed to embed the new client's name (e.g., GPOA - Jack Doe.docx → GPOA - Jane Doe.docx); collisions get (2), (3), ... appended; required_documents.document_filename is updated to track renames.
  • New CopyFromSpouseDialog and an empty-state CTA on ClientHub (only when the workspace is fresh — no questionnaire, contacts, docs, or required docs). The dialog walks pick → review → run, auto-detects a single Spouse contact (offers a picker for the multi-spouse case), and notes that manual .docx edits in the source don't carry over since documents are rebuilt from template.

Test plan

  • make typecheck
  • make lint
  • cargo test (79 → 87, 19 in lily_file::tests)
  • Manual: copy a couple's spouse workspace and verify questionnaire/contacts/required_documents carry over, docs are rebuilt with the new client's variables, filenames reflect the new client, and Has Spouse / Client Spouse Name resolve correctly in the new file.
## Summary - New `copy_from_spouse_lily` Tauri command: promotes a Spouse contact in the source folder to the client of a new `.lily`, demotes the original client to a Spouse contact, retargets bindings, copies questionnaire data + required documents, and recreates each of source's documents from template with the swapped variable values. - Copied filenames are renamed to embed the new client's name (e.g., `GPOA - Jack Doe.docx` → `GPOA - Jane Doe.docx`); collisions get ` (2)`, ` (3)`, ... appended; `required_documents.document_filename` is updated to track renames. - New `CopyFromSpouseDialog` and an empty-state CTA on `ClientHub` (only when the workspace is fresh — no questionnaire, contacts, docs, or required docs). The dialog walks pick → review → run, auto-detects a single Spouse contact (offers a picker for the multi-spouse case), and notes that manual `.docx` edits in the source don't carry over since documents are rebuilt from template. ## Test plan - [x] `make typecheck` - [x] `make lint` - [x] `cargo test` (79 → 87, 19 in `lily_file::tests`) - [ ] Manual: copy a couple's spouse workspace and verify questionnaire/contacts/required_documents carry over, docs are rebuilt with the new client's variables, filenames reflect the new client, and `Has Spouse` / `Client Spouse Name` resolve correctly in the new file.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
parker/lily!53
No description provided.