Skip to content

Make sales order inventory updates atomic - #14

Open
gina941111-debug wants to merge 1 commit into
mainfrom
codex/atomic-sales-order-inventory
Open

gina941111-debug wants to merge 1 commit into
mainfrom
codex/atomic-sales-order-inventory

Conversation

@gina941111-debug

Copy link
Copy Markdown
Collaborator

Summary

  • create sales orders, reserve inventory, and write stock movements in one SQLite transaction
  • use conditional inventory updates under an immediate transaction to prevent concurrent overselling
  • preserve cancelled orders and restore inventory exactly once
  • safely re-reserve inventory when cancelled orders are reactivated
  • route both Streamlit and AI order creation through the shared backend service
  • generate collision-resistant AI order IDs

Validation

  • 49 focused transaction and approval tests passed
  • 332 full project tests passed
  • Python compilation and git diff checks passed

Notes

  • Existing historical records are not automatically reconciled by this change
  • Untracked local documentation and system files are not included

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant