mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-27 09:21:05 -04:00
Saving a nest drawing to the drawing library now has a Linux-testable model, DrawingLibrarySaveSession, ahead of the desktop dialog. Prefill starts from the drawing's name and customer (the nest's customer when the drawing has none), the nest's material, grade, thickness and units, and the linked revision's cut type and notes when the drawing came from this server's library, otherwise the operator's last-used cut type. Duplicates follow D4: active drawings whose normalized customer, name, material and grade and exact thickness, units and cut type match. The server only narrows (a blank filter means "any" there, and LIKE does not collapse whitespace), so every key is checked again on the client. The default is the linked drawing when it matches, else the only match; several matches require the operator to choose, and a linked drawing that no longer matches is offered but never the default, so a thickness change cannot silently rewrite it. Writes follow NestSaveSession: a new drawing's id is allocated before the upload, and a save that fails without a definite answer stays pending. The next save first looks for the revision it would have produced and adopts it when the package hash and details match; a not-stored new drawing is retried under the same id, never onto another drawing, and a revision someone else saved meanwhile is a conflict. A definite refusal (409, old server, invalid request) leaves nothing pending. On success the drawing's link points at the saved revision; nothing else in the nest copy changes (D2). RemoteDrawingLibrary now implements IDrawingLibraryStore, the read/write surface the session needs, so tests can use an in-memory store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>