Initial commit: PESCO NCR system
Complete Non-Conformance Report system replacing the PowerApps/SharePoint prototype: FastAPI + SQLAlchemy 2 (async) + Alembic + MySQL 8 backend, React 18 + Vite + TypeScript + MUI frontend, Entra ID auth (MSAL / JWKS, group-gated), Microsoft Graph delegated Mail.Send notifications (OBO), six-stage workflow state machine with server-side enforcement, atomic NCR-YYYY-NNNN numbering, attachments with camera capture, immutable field-level audit trail, admin reopen, reports + CSV export, WeasyPrint PDF traveler, Power BI reporting views + read-only DB user, documented VISUAL ERP job-lookup stub, pytest suite (26 tests), docker-compose deployment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
21
backend/app/dev_init.py
Normal file
21
backend/app/dev_init.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""Create the schema directly from the models — for LOCAL SQLite development
|
||||
only (`python -m app.dev_init`). Real MySQL deployments use Alembic
|
||||
(`alembic upgrade head`), which also creates the Power BI reporting views.
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
from app.config import get_settings
|
||||
from app.database import get_engine
|
||||
from app.models import Base
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
url = get_settings().effective_database_url
|
||||
engine = get_engine()
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
print(f"Schema created for {url}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user