- Add main application files (main.py, models.py, schemas.py, etc.) - Add routers for all features (waiting, attendance, members, etc.) - Add HTML templates for admin and user interfaces - Add migration scripts and utility files - Add Docker configuration - Add documentation files - Add .gitignore to exclude database and cache files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
|
|
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import sessionmaker
|
|
from routers.waiting import get_available_class
|
|
from database import get_db
|
|
from models import Store
|
|
from datetime import date
|
|
|
|
# Setup DB
|
|
SQLALCHEMY_DATABASE_URL = "sqlite:///./waiting_system.db"
|
|
engine = create_engine(SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False})
|
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
|
db = SessionLocal()
|
|
|
|
def test_logic():
|
|
print("--- Simulating Class Assignment Logic ---")
|
|
store_id = 4
|
|
business_date = date(2025, 12, 8)
|
|
|
|
try:
|
|
available_class, count = get_available_class(db, business_date, store_id)
|
|
print(f"RESULT: Assigned to Class '{available_class.class_name}' (ID: {available_class.id})")
|
|
print(f"Wait Count: {count}")
|
|
|
|
if available_class.id == 33:
|
|
print("SUCCESS: Correctly assigned to 4th period.")
|
|
elif available_class.id == 34:
|
|
print("FAILURE: Assigned to 5th period (Skipped 4th).")
|
|
else:
|
|
print(f"FAILURE: Assigned to {available_class.class_name} (ID {available_class.id})")
|
|
|
|
except Exception as e:
|
|
print(f"ERROR: {str(e)}")
|
|
|
|
if __name__ == "__main__":
|
|
test_logic()
|