#!/usr/bin/env python3
"""Script to check product variants in database"""

from app import app, db
from models import Product, ProductVariant

def check_variants():
    with app.app_context():
        products = Product.query.all()
        print(f"Total products: {len(products)}")
        
        for product in products:
            print(f"\nProduct: {product.name} (ID: {product.id})")
            print(f"  Variants: {len(product.variants)}")
            
            for variant in product.variants:
                print(f"    - {variant.color} (ID: {variant.id}, Stock: {variant.stock_quantity}, Color Code: {variant.color_code})")

if __name__ == "__main__":
    check_variants()
