fix: server-mode stock lifecycle - consolidated valid parts of Cursor… - #157
Conversation
… PRs #64/#65/#67 The June PRs predate the local-first merge; most of their content was re-implemented by the July review (webhook hardening, cancel reversal, idempotency guards). This consolidates what was still missing, all server-mode only (the Evolu client handles local-first stock itself): - issue(): lockForUpdate + canIssue re-check inside the transaction - two concurrent issues could burn two numbers and deduct stock twice (#64). The caller's instance is refreshed to keep the mutation contract. - cancel returns stock for Paid documents too, not only Issued (#67). - destroy(): lock + canDelete re-check + stock reversal in one transaction - deleting an issued document left its stock deducted forever (#67). Movement FK is nullOnDelete, the audit trail stays. - bulk cancel/delete reverse stock the same way (#67). - editing an issued document rebuilds its movements (reversal recorded as the new document_adjustment source, stale issue rows dropped, fresh lines applied) (#65); the source value is also added to the Evolu schema union so server-to-local migration exports stay valid. - stock transfers cannot overdraw the source warehouse (#65). - warehouses with movement history cannot be deleted - deactivate instead (#65). Nine new feature tests; PHPStan baseline shrinks by two entries. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
… PRs #64/#65/#67
The June PRs predate the local-first merge; most of their content was re-implemented by the July review (webhook hardening, cancel reversal, idempotency guards). This consolidates what was still missing, all server-mode only (the Evolu client handles local-first stock itself):
Nine new feature tests; PHPStan baseline shrinks by two entries.