#!/usr/bin/env python3 import sys import os from pathlib import Path import json sys.path.insert(0, str(Path(__file__).parent)) from sqlalchemy.orm import Session from src.config.database import SessionLocal from src.models.page_content import PageContent, PageType from datetime import datetime def get_db(): db = SessionLocal() try: return db finally: pass def seed_privacy_policy(db: Session): print("=" * 80) print("SEEDING PRIVACY POLICY PAGE CONTENT") print("=" * 80) privacy_content = """

Introduction

At our hotel, we are committed to protecting your privacy and ensuring the security of your personal information. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you visit our website or use our services.

Information We Collect

We collect information that you provide directly to us, including:

How We Use Your Information

We use the information we collect to:

Data Security

We implement appropriate technical and organizational measures to protect your personal information against unauthorized access, alteration, disclosure, or destruction.

Your Rights

You have the right to:

Contact Us

If you have any questions about this Privacy Policy, please contact us at privacy@hotel.com.

Last updated: """ + datetime.now().strftime("%B %d, %Y") + """

""" privacy_data = { "title": "Privacy Policy", "subtitle": "Your privacy is important to us", "description": "Learn how we collect, use, and protect your personal information.", "content": privacy_content, "meta_title": "Privacy Policy - Luxury Hotel | Data Protection & Privacy", "meta_description": "Read our privacy policy to understand how we collect, use, and protect your personal information when you use our hotel booking services." } existing = db.query(PageContent).filter(PageContent.page_type == PageType.PRIVACY).first() if existing: for key, value in privacy_data.items(): setattr(existing, key, value) existing.updated_at = datetime.utcnow() print("✓ Updated existing privacy policy page content") else: new_content = PageContent( page_type=PageType.PRIVACY, **privacy_data ) db.add(new_content) print("✓ Created new privacy policy page content") db.commit() print("\n✅ Privacy policy page content seeded successfully!") print("=" * 80) def seed_terms_conditions(db: Session): print("=" * 80) print("SEEDING TERMS & CONDITIONS PAGE CONTENT") print("=" * 80) terms_content = """

Agreement to Terms

By accessing and using our hotel's website and services, you accept and agree to be bound by the terms and provision of this agreement.

Booking Terms

When making a reservation with us, you agree to:

Payment Terms

Payment terms include:

Cancellation Policy

Our cancellation policy is as follows:

Check-in and Check-out

Standard check-in time is 3:00 PM and check-out time is 11:00 AM. Early check-in and late check-out may be available upon request and subject to availability.

Guest Responsibilities

Guests are responsible for:

Limitation of Liability

The hotel shall not be liable for any loss, damage, or injury to persons or property during your stay, except where such loss, damage, or injury is caused by our negligence.

Modifications to Terms

We reserve the right to modify these terms at any time. Changes will be effective immediately upon posting on our website.

Contact Information

For questions about these terms, please contact us at legal@hotel.com.

Last updated: """ + datetime.now().strftime("%B %d, %Y") + """

""" terms_data = { "title": "Terms & Conditions", "subtitle": "Please read these terms carefully", "description": "Terms and conditions governing your use of our hotel booking services.", "content": terms_content, "meta_title": "Terms & Conditions - Luxury Hotel | Booking Terms & Policies", "meta_description": "Read our terms and conditions to understand the rules and policies governing your bookings and stay at our luxury hotel." } existing = db.query(PageContent).filter(PageContent.page_type == PageType.TERMS).first() if existing: for key, value in terms_data.items(): setattr(existing, key, value) existing.updated_at = datetime.utcnow() print("✓ Updated existing terms & conditions page content") else: new_content = PageContent( page_type=PageType.TERMS, **terms_data ) db.add(new_content) print("✓ Created new terms & conditions page content") db.commit() print("\n✅ Terms & conditions page content seeded successfully!") print("=" * 80) def seed_refunds_policy(db: Session): print("=" * 80) print("SEEDING REFUNDS POLICY PAGE CONTENT") print("=" * 80) refunds_content = """

Refund Policy Overview

At our hotel, we understand that plans can change. This policy outlines our refund procedures and timelines for various scenarios.

Booking Cancellations

Refunds for cancelled bookings are processed as follows:

Early Check-out

If you check out earlier than your reserved departure date:

Service Issues

If you experience service issues during your stay:

Refund Processing Time

Refunds are typically processed within:

Refund Method

Refunds will be issued to the original payment method used for the booking. If the original payment method is no longer available, please contact us to arrange an alternative refund method.

Non-Refundable Bookings

Some special offers or promotional rates may be non-refundable. This will be clearly stated at the time of booking.

Force Majeure

In cases of force majeure (natural disasters, pandemics, government restrictions, etc.), we will work with you to reschedule your booking or provide appropriate refunds based on the circumstances.

Dispute Resolution

If you have concerns about a refund decision, please contact our customer service team. We are committed to resolving all disputes fairly and promptly.

Contact Us

For refund inquiries, please contact us at refunds@hotel.com or call our customer service line.

Last updated: """ + datetime.now().strftime("%B %d, %Y") + """

""" refunds_data = { "title": "Refunds Policy", "subtitle": "Our commitment to fair refunds", "description": "Learn about our refund policies and procedures for bookings and cancellations.", "content": refunds_content, "meta_title": "Refunds Policy - Luxury Hotel | Cancellation & Refund Terms", "meta_description": "Understand our refund policy, including cancellation terms, processing times, and how to request refunds for your hotel bookings." } existing = db.query(PageContent).filter(PageContent.page_type == PageType.REFUNDS).first() if existing: for key, value in refunds_data.items(): setattr(existing, key, value) existing.updated_at = datetime.utcnow() print("✓ Updated existing refunds policy page content") else: new_content = PageContent( page_type=PageType.REFUNDS, **refunds_data ) db.add(new_content) print("✓ Created new refunds policy page content") db.commit() print("\n✅ Refunds policy page content seeded successfully!") print("=" * 80) def seed_cancellation_policy(db: Session): print("=" * 80) print("SEEDING CANCELLATION POLICY PAGE CONTENT") print("=" * 80) cancellation_content = """

Cancellation Policy Overview

We understand that plans can change. This policy outlines our cancellation procedures and fees.

Standard Cancellation Terms

For standard bookings, the following cancellation terms apply:

Special Rate Bookings

Some special rates or promotional offers may have different cancellation terms. Please review your booking confirmation for specific details.

How to Cancel

To cancel your booking:

Refund Processing

Refunds will be processed to the original payment method within 5-10 business days after cancellation confirmation.

Last updated: """ + datetime.now().strftime("%B %d, %Y") + """

""" cancellation_data = { "title": "Cancellation Policy", "subtitle": "Flexible cancellation options for your peace of mind", "description": "Learn about our cancellation policy, fees, and refund procedures.", "content": cancellation_content, "meta_title": "Cancellation Policy - Luxury Hotel | Booking Cancellation Terms", "meta_description": "Review our cancellation policy to understand cancellation fees, refund procedures, and terms for modifying or canceling your hotel booking." } existing = db.query(PageContent).filter(PageContent.page_type == PageType.CANCELLATION).first() if existing: for key, value in cancellation_data.items(): setattr(existing, key, value) existing.updated_at = datetime.utcnow() print("✓ Updated existing cancellation policy page content") else: new_content = PageContent( page_type=PageType.CANCELLATION, **cancellation_data ) db.add(new_content) print("✓ Created new cancellation policy page content") db.commit() print("\n✅ Cancellation policy page content seeded successfully!") print("=" * 80) def seed_accessibility_policy(db: Session): print("=" * 80) print("SEEDING ACCESSIBILITY PAGE CONTENT") print("=" * 80) accessibility_content = """

Our Commitment to Accessibility

We are committed to ensuring that our hotel and website are accessible to all guests, regardless of ability. We strive to provide an inclusive experience for everyone.

Hotel Accessibility Features

Our hotel offers the following accessibility features:

Website Accessibility

We are continuously working to improve the accessibility of our website. Our website includes:

Requesting Accommodations

If you require specific accommodations during your stay, please contact us at least 48 hours before your arrival. We will do our best to accommodate your needs.

Feedback

We welcome feedback on how we can improve accessibility. Please contact us with your suggestions or concerns.

Last updated: """ + datetime.now().strftime("%B %d, %Y") + """

""" accessibility_data = { "title": "Accessibility", "subtitle": "Committed to providing an inclusive experience for all guests", "description": "Learn about our accessibility features and accommodations.", "content": accessibility_content, "meta_title": "Accessibility - Luxury Hotel | Accessible Accommodations", "meta_description": "Discover our commitment to accessibility, including accessible rooms, facilities, and website features for guests with disabilities." } existing = db.query(PageContent).filter(PageContent.page_type == PageType.ACCESSIBILITY).first() if existing: for key, value in accessibility_data.items(): setattr(existing, key, value) existing.updated_at = datetime.utcnow() print("✓ Updated existing accessibility page content") else: new_content = PageContent( page_type=PageType.ACCESSIBILITY, **accessibility_data ) db.add(new_content) print("✓ Created new accessibility page content") db.commit() print("\n✅ Accessibility page content seeded successfully!") print("=" * 80) def seed_faq_page(db: Session): print("=" * 80) print("SEEDING FAQ PAGE CONTENT") print("=" * 80) faq_content = """

Frequently Asked Questions

Find answers to common questions about our hotel, bookings, and services.

Booking & Reservations

How do I make a reservation?

You can make a reservation online through our website, by phone, or by email. Simply select your dates, choose your room, and complete the booking process.

What is the deposit requirement?

A 20% deposit is required to secure your booking. The remaining balance is due upon arrival at the hotel.

Can I modify my booking?

Yes, you can modify your booking by logging into your account and visiting "My Bookings", or by contacting us directly. Changes are subject to availability and may incur fees.

Check-in & Check-out

What are your check-in and check-out times?

Check-in is from 3:00 PM, and check-out is by 11:00 AM. Early check-in and late check-out may be available upon request, subject to availability.

Do you offer early check-in or late check-out?

Early check-in and late check-out are available upon request, subject to availability. Additional fees may apply.

Payment & Cancellation

What payment methods do you accept?

We accept major credit cards, debit cards, and bank transfers. Payment can be made online or at the hotel.

What is your cancellation policy?

For cancellations made more than 48 hours before check-in, the deposit is fully refundable. Cancellations made 48 hours or less before check-in are non-refundable. Please see our Cancellation Policy page for full details.

Hotel Services & Amenities

What amenities are included?

Our hotel offers complimentary Wi-Fi, parking, fitness center access, and more. Please check the room details for specific amenities.

Do you have parking available?

Yes, we offer complimentary parking for all guests. Valet parking is also available for an additional fee.

Is Wi-Fi available?

Yes, complimentary high-speed Wi-Fi is available throughout the hotel.

Special Requests

Can I request a specific room?

Yes, you can make special requests when booking. We will do our best to accommodate your preferences, subject to availability.

Do you accommodate dietary restrictions?

Yes, please inform us of any dietary restrictions or allergies when making your reservation, and we will do our best to accommodate your needs.

Contact & Support

How can I contact the hotel?

You can contact us by phone, email, or through our website's contact form. Our team is available 24/7 to assist you.

Last updated: """ + datetime.now().strftime("%B %d, %Y") + """

""" faq_data = { "title": "Frequently Asked Questions", "subtitle": "Find answers to common questions", "description": "Get answers to frequently asked questions about bookings, services, and policies.", "content": faq_content, "meta_title": "FAQ - Luxury Hotel | Frequently Asked Questions", "meta_description": "Find answers to common questions about hotel bookings, check-in, payment, cancellation, amenities, and more." } existing = db.query(PageContent).filter(PageContent.page_type == PageType.FAQ).first() if existing: for key, value in faq_data.items(): setattr(existing, key, value) existing.updated_at = datetime.utcnow() print("✓ Updated existing FAQ page content") else: new_content = PageContent( page_type=PageType.FAQ, **faq_data ) db.add(new_content) print("✓ Created new FAQ page content") db.commit() print("\n✅ FAQ page content seeded successfully!") print("=" * 80) def main(): db = get_db() try: print("\n") seed_privacy_policy(db) print("\n") seed_terms_conditions(db) print("\n") seed_refunds_policy(db) print("\n") seed_cancellation_policy(db) print("\n") seed_accessibility_policy(db) print("\n") seed_faq_page(db) print("\n") print("=" * 80) print("✅ ALL POLICY PAGES SEEDED SUCCESSFULLY!") print("=" * 80) print("\n") except Exception as e: print(f"\n❌ Error: {e}") import traceback traceback.print_exc() db.rollback() finally: db.close() if __name__ == "__main__": main()