Add M365 License Calculator feature

New top-nav section with a CSV-based license calculator. Upload an Azure AD
user export to see license counts (M365 Standard/Basic, Defender P1, PBI Pro,
PBI Premium) grouped by QWE Client. QWE Client and IsRestaurant are editable
per user, saved to SQLite, and restored on the next upload. Department-based
defaults pre-populate QWE Client (AT→QWE AT, SK→QWE SK) when no saved value
exists.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 15:40:19 +02:00
co-authored by Claude Sonnet 4.6
parent e37ee99054
commit adf303ad53
5 changed files with 581 additions and 1 deletions
+10 -1
View File
@@ -1,6 +1,6 @@
import os
import datetime
from sqlalchemy import create_engine, Column, Integer, String, DateTime
from sqlalchemy import create_engine, Column, Integer, String, DateTime, Boolean
from sqlalchemy.orm import declarative_base, sessionmaker
DATABASE_URL = f"sqlite:///{os.getenv('DB_PATH', '/data/audit.db')}"
@@ -10,6 +10,15 @@ SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
class M365UserOverride(Base):
__tablename__ = "m365_user_overrides"
username = Column(String, primary_key=True) # User principal name
qwe_client = Column(String, default="", nullable=False)
is_restaurant = Column(Boolean, default=False, nullable=False)
updated_at = Column(DateTime, default=datetime.datetime.utcnow)
class RebootLog(Base):
__tablename__ = "reboot_log"