feat(inventory): implement inter-project material transfer backend

- Add ProjectTransfer database model and migration
- Implement project transfer service with immediate stock deduction on creation
- Support 100% full delivery receipt logic across destination warehouses
- Enforce canonical_specs_hash matching for cross-project stock merge
- Add RBAC guards and status lock on received transfers (409 Conflict)
- Register API router for transfers with on-the-way integration
This commit is contained in:
2026-09-23 22:30:31 +03:30
parent da883a28c0
commit b326cf64bf
9 changed files with 868 additions and 0 deletions
+2
View File
@@ -31,6 +31,7 @@ from app.db.init_db import (
ensure_dashboard_tables,
ensure_material_topic_column,
ensure_quote_projects,
ensure_project_transfers_table,
ensure_v26,
)
from app.observability import RequestContextMiddleware, setup_logging
@@ -107,6 +108,7 @@ async def lifespan(_app: FastAPI):
await ensure_v26(engine)
await ensure_audit_table(engine)
await ensure_drop_category_tables(engine)
await ensure_project_transfers_table(engine)
task = asyncio.create_task(_auto_expire_loop()) if settings.AUTO_EXPIRE_ENABLED else None
try:
yield