""" Privacy Policy Page Seeder Seeds the database with comprehensive privacy policy content """ import json import sys from pathlib import Path from datetime import datetime, timezone # Add parent directory to path to allow importing from src sys.path.insert(0, str(Path(__file__).resolve().parents[1])) from sqlalchemy.orm import Session from src.shared.config.database import SessionLocal from src.shared.config.logging_config import get_logger from src.content.models.page_content import PageContent, PageType # Import all models to ensure relationships are loaded from src.models import * logger = get_logger(__name__) def get_privacy_page_data(): """Generate comprehensive privacy policy page data""" now = datetime.now(timezone.utc) return { 'page_type': PageType.PRIVACY, 'title': 'Privacy Policy', 'subtitle': 'Your Privacy Matters to Us', 'description': 'Learn how we collect, use, and protect your personal information. We are committed to maintaining your privacy and ensuring the security of your data.', 'content': """
At Luxury Hotel & Resort, 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, make a reservation, or use our services.
We may collect personal information that you provide directly to us, including:
When you visit our website, we may automatically collect certain information, including:
We use the information we collect for various purposes, including:
We do not sell your personal information. We may share your information in the following circumstances:
We implement appropriate technical and organizational measures to protect your personal information against unauthorized access, alteration, disclosure, or destruction. However, no method of transmission over the Internet is 100% secure, and we cannot guarantee absolute security.
Depending on your location, you may have certain rights regarding your personal information, including:
We use cookies and similar tracking technologies to enhance your browsing experience, analyze website traffic, and personalize content. You can control cookie preferences through your browser settings.
Our website may contain links to third-party websites. We are not responsible for the privacy practices of these external sites. We encourage you to review their privacy policies.
Our services are not directed to individuals under the age of 18. We do not knowingly collect personal information from children. If you believe we have collected information from a child, please contact us immediately.
Your information may be transferred to and processed in countries other than your country of residence. We ensure appropriate safeguards are in place to protect your information in accordance with this Privacy Policy.
We may update this Privacy Policy from time to time. We will notify you of any material changes by posting the new policy on this page and updating the "Last Updated" date.
If you have any questions or concerns about this Privacy Policy or our data practices, please contact us at:
Email: privacy@luxuryhotel.com
Phone: +1 (555) 123-4567
Address: 123 Luxury Avenue, Premium City, PC 12345, United States
Last Updated: {}
""".format(now.strftime('%B %d, %Y')), 'meta_title': 'Privacy Policy | Luxury Hotel & Resort', 'meta_description': 'Learn how Luxury Hotel & Resort collects, uses, and protects your personal information. Read our comprehensive privacy policy.', 'meta_keywords': 'privacy policy, data protection, personal information, GDPR, privacy rights, hotel privacy', 'og_title': 'Privacy Policy - Luxury Hotel & Resort', 'og_description': 'Your privacy matters to us. Learn how we protect and use your personal information.', 'og_image': 'https://images.unsplash.com/photo-1556761175-5973dc0f32e7?w=1200&h=630&fit=crop', 'canonical_url': 'https://luxuryhotel.com/privacy', 'is_active': True, 'created_at': now, 'updated_at': now } def seed_privacy_page(db: Session): """Seed privacy policy page content into the database""" try: privacy_data = get_privacy_page_data() # Check if privacy page content already exists existing_content = db.query(PageContent).filter(PageContent.page_type == PageType.PRIVACY).first() if existing_content: logger.info('Updating existing privacy policy page content...') for key, value in privacy_data.items(): if key not in ['id', 'page_type', 'created_at']: setattr(existing_content, key, value) existing_content.updated_at = datetime.now(timezone.utc) else: logger.info('Creating new privacy policy page content...') privacy_page = PageContent(**privacy_data) db.add(privacy_page) db.commit() logger.info('Privacy policy page content seeded successfully!') except Exception as e: db.rollback() logger.error(f'Error seeding privacy policy page: {str(e)}', exc_info=True) raise def main(): db = SessionLocal() try: seed_privacy_page(db) except Exception as e: logger.error(f'Failed to seed privacy policy page: {str(e)}', exc_info=True) sys.exit(1) finally: db.close() if __name__ == '__main__': main()