from datetime import datetime
from mongoengine import connect
from models.notification_model import Notification  # make sure path is correct
from dotenv import load_dotenv
import os
load_dotenv()
# Connect to MongoDB
connect('backend', host=os.getenv("MONGO_URI"))

# Sample notifications
notifications = [
    Notification(
        title="New UPSC Prelims Test Series",
        description="We have added 10 new mock tests for UPSC Prelims 2025. Start practicing now!",
        image="https://cdn.eduapp.com/notifications/upsc-tests.png",
        status=1,
        created_date=datetime.utcnow()
    ),
    Notification(
        title="App Update: Quiz Feature Released",
        description="Introducing a new quiz feature for faster practice and self-evaluation.",
        image="https://cdn.eduapp.com/notifications/quiz-update.png",
        status=1,
        created_date=datetime.utcnow()
    ),
    Notification(
        title="Maintenance Notice",
        description="The app will be under maintenance on 28th Aug from 2 AM - 5 AM.",
        status=1,
        created_date=datetime.utcnow()
    ),
    Notification(
        title="RRB Exam Results Released",
        description="RRB 2025 exam results are now available. Check the official site for details.",
        image="https://cdn.eduapp.com/notifications/rrb-results.png",
        status=1,
        created_date=datetime.utcnow()
    ),
    Notification(
        title="Old Notification Example",
        description="This notification is no longer active.",
        status=0,
        created_date=datetime(2025, 7, 20, 7, 10, 0)
    )
]

# Insert into DB
for notif in notifications:
    notif.save()

print("✅ Sample notifications inserted successfully!")