feat(plantare): reproduction-commitment data layer (schema v9)
The Plantare — a promise to reproduce seed and return some (data-model §2.7, the seed-domain Pledge with return_kind=similar). NOT a sale. Local-first v1: your honest ledger of commitments (from/to a person by name); the bilateral signed cross-party form is a later social-layer phase. - New Plantares table (SyncColumns): varietyId, direction (iReturn/owedToMe), counterparty, owedDescription, madeOn, dueBy, status (open/returned/ forgiven), settledOn, note. schemaVersion 8 -> 9 with a guarded createTable migration; schema exported + migration-test helper regenerated. - VarietyRepository: createPlantare / watchPlantares / watchPlantaresForVariety / setPlantareStatus / deletePlantare (soft-delete, CRDT-stamped). - Included in backups + sync: InventorySnapshot + JSON codec (round-trips isDeleted) + exportInventory/exportForSync/importInventory, so commitments survive restore and replicate LWW like every other row. Tests: v1..v8 -> v9 migration + fresh v9; repo create/list/settle/reopen/ delete; and a backup round-trip preserving a commitment. 13 green. UI (detail section + Plantares screen) follows.
This commit is contained in:
parent
0e41293de5
commit
81094f25a8
12 changed files with 5418 additions and 60 deletions
|
|
@ -86,3 +86,18 @@ enum AttachmentKind { photo, doc }
|
|||
|
||||
/// Polymorphic parent of an Attachment / ExternalLink.
|
||||
enum ParentType { variety, lot, movement }
|
||||
|
||||
/// Whose reproduction promise a Plantare is, seen from this app's owner
|
||||
/// (data-model §2.7). A Plantare is a commitment to REPRODUCE and return seed —
|
||||
/// not a sale.
|
||||
enum PlantareDirection {
|
||||
/// I received seed and promised to grow it out and return some.
|
||||
iReturn,
|
||||
|
||||
/// I gave seed and the other person promised to return some.
|
||||
owedToMe,
|
||||
}
|
||||
|
||||
/// Lifecycle of a Plantare. Framed as a promise, not a debt (data-model §2.7):
|
||||
/// `forgiven` (not "defaulted") when it's let go.
|
||||
enum PlantareStatus { open, returned, forgiven }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue