# Morox Properties Seeder File

This file contains SQL scripts to seed the database with initial data for development and testing purposes.

## Seed Roles
```sql
-- Seed initial roles
insert into roles (name, description) values
('admin', 'Has full access to all dashboard features, including user management, content management, and system settings.'),
('agent', 'Can manage their own assigned properties and view company-wide properties. Can see inquiries and leads.'),
('user', 'Standard customer account. Has no access to the dashboard by default.');
```

## Seed Role Permissions
```sql
-- Seed initial permissions
insert into role_permissions (role_name, page, permissions) values
('admin', 'My Properties', '{"view", "create", "edit", "delete"}'),
('admin', 'Home Page', '{"view", "create", "edit", "delete"}'),
('admin', 'About Us Page', '{"view", "create", "edit", "delete"}'),
('admin', 'FAQ Page', '{"view", "create", "edit", "delete"}'),
('admin', 'Property Data', '{"view", "create", "edit", "delete"}'),
('admin', 'Header Images', '{"view", "create", "edit", "delete"}'),
('admin', 'Login Page', '{"view", "create", "edit", "delete"}'),
('admin', 'Inquiries & Leads', '{"view", "create", "edit", "delete"}'),
('admin', 'User Management', '{"view", "create", "edit", "delete"}'),
('agent', 'My Properties', '{"view", "create", "edit", "delete"}'),
('agent', 'Home Page', '{"view"}'),
('agent', 'About Us Page', '{"view"}'),
('agent', 'FAQ Page', '{"view"}'),
('agent', 'Inquiries & Leads', '{"view", "edit"}');
```

## Seed Page Content
```sql
-- Seed initial homepage content
INSERT INTO public.page_content (page_name, content)
VALUES (
    'home',
    '{
        "heroTitle": "Making Houses Feel Like",
        "keywords": ["Homes", "Heaven", "Castles"],
        "heroSubtitle": "Discover your private oasis at Homelengo, where every corner, from the spacious garden to the relaxing pool, is crafted for your comfort and enjoyment.",
        "heroImages": [
            { "id": "hero", "imageUrl": "https://images.unsplash.com/photo-1513584684374-8bab748fbf90?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w3NDE5ODJ8MHwxfHNlYXJjaHw4fHxtb2Rlcm4lMjBob3VzZXxlbnwwfHx8fDE3NjIwNjU2ODF8MA&ixlib.rb-4.1.0&q=80&w=1080", "description": "A modern house exterior at dusk", "imageHint": "modern house" },
            { "id": "gallery1", "imageUrl": "https://images.unsplash.com/photo-1628744448840-55bdb2497bd4?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w3NDE5ODJ8MHwxfHNlYXJjaHw5fHxtb2Rlcm4lMjBob3VzZXxlbnwwfHx8fDE3NjIwNjU2ODF8MA&ixlib.rb-4.1.0&q=80&w=1080", "description": "Side view of a modern house", "imageHint": "modern house" },
            { "id": "gallery2", "imageUrl": "https://images.unsplash.com/photo-1613152184920-bc1c4ab7fd1d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w3NDE5ODJ8MHwxfHNlYXJjaHw0fHxob3VzZSUyMHBvb2x8ZW58MHx8fHwxNzYyMDE1MjUzfDA&ixlib.rb-4.1.0&q=80&w=1080", "description": "Modern house with a pool", "imageHint": "house pool" },
            { "id": "gallery3", "imageUrl": "https://images.unsplash.com/photo-1555238920-7a6bea18473b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w3NDE5ODJ8MHwxfHNlYXJjaHw5fHxtb2Rlcm4lMjBidWlsZGluZ3xlbnwwfHx8fDE3NjE5OTA5NjV8MA&ixlib.rb-4.1.0&q=80&w=1080", "description": "Exterior of a modern building", "imageHint": "modern building" },
            { "id": "gallery4", "imageUrl": "https://images.unsplash.com/photo-1737948641148-1145c4273c70?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w3NDE5ODJ8MHwxfHNlYXJjaHw4fHxyZXNpZGVudGlhbCUyMGhvdXNlfGVufDB8fHx8MTc2MjA3NjY5OHww&ixlib.rb-4.1.0&q=80&w=1080", "description": "A beautiful residential house", "imageHint": "residential house" }
        ],
        "heroCategories": [
          { "id": "1", "name": "Houses", "icon": "Home" },
          { "id": "2", "name": "Offices", "icon": "Building2" },
          { "id": "3", "name": "Land", "icon": "LandPlot" },
          { "id": "4", "name": "Warehouses", "icon": "Warehouse" }
        ]
    }'
) ON CONFLICT (page_name) DO NOTHING;

-- Seed initial content for the about page
INSERT INTO public.page_content (page_name, content)
VALUES (
    'about',
    '{
        "md": {
            "name": "Kagiso Tshepang Morokotso",
            "bio": "Kagiso Tshepang Morokotso is a youthful Motswana entrepreneur, husband and realtor who hails from Mochudi. He is a real estate professional with extensive experience in Property Management, Property Valuations and Estate Agency. He has spent a significant period of his career working for PROMANCO in estate agency and valuations and has worked for Turnstar Holdings LTD as the Group Asset Manager. Currently he is the Managing Director of MOROX Properties, a real estate company which is mandated in estate agency, property valuations and property management. He is also a part time lecturer at Baisago University in the Faculty of Built Environment. Kagiso holds a Diploma in Real Estate, a Bachelor of Commerce Degree in Real Estate, a Post Graduate Diploma in Management, and a post-graduate certificate in Infrastructure Finance. He is currently serving as the treasurer of the Real Estate Institute of Botswana (REIB), a member of the Real Estate Advisory Council (REAC) and current Chair of the Business and Finance Sector subcommittee of the Human Resource Development Council (HRDC).",
            "imageUrl": "/team-0.jpeg"
        },
        "howItWorks": [
            { "id": "1", "title": "Search Properties", "description": "Browse our extensive listings of homes, apartments, and commercial spaces to find what you''re looking for." },
            { "id": "2", "title": "Schedule a Viewing", "description": "Book a tour of your favorite properties at your convenience. Our agents are ready to show you around." },
            { "id": "3", "title": "Make an Offer", "description": "Found your dream property? Our agents will guide you through the process of making a competitive offer." },
            { "id": "4", "title": "Close the Deal", "description": "We''ll handle the paperwork and negotiations to ensure a smooth and successful closing. Welcome home!" }
        ],
        "whyChooseUs": [
            { "id": "1", "icon": "ShieldCheck", "title": "Quality & Integrity", "description": "We deliver services that exceed expectations and conduct ourselves with the highest level of professionalism, aiming to do what is right for our clients, company, and community." },
            { "id": "2", "icon": "Zap", "title": "Synergy & Botho", "description": "We believe in creating partners in our clients and stakeholders. Every transaction is a fun journey filled with love, laughter, and the formation of strong, long-lasting relationships." },
            { "id": "3", "icon": "Users", "title": "Exceptional Customer Service", "description": "We don''t just sell houses; we sell experiences. We ensure our clients are well-handled with regular communication and that we are with them throughout the entire process." },
            { "id": "4", "icon": "Clock", "title": "Fast Turnaround Time", "description": "Our vibrant, enthusiastic, and passionate young staff is motivated to deliver services efficiently and at an ideal turnaround time, keeping you informed every step of the way." },
            { "id": "5", "icon": "ShoppingBasket", "title": "One-Stop-Shop Convenience", "description": "We have partnered with other real estate firms, conveyancers, architects, and engineers to provide a convenient, one-stop-shop model for all your real estate needs." },
            { "id": "6", "icon": "Handshake", "title": "Education & After-Service", "description": "We empower and educate our clients, not just sell services. Our relationship continues after the transaction with tokens of appreciation and continued support." }
        ],
        "journey": {
            "imageUrl": "https://picsum.photos/seed/our-beginning/600/600",
            "timeline": [
                { "id": "1", "year": "2023", "title": "Company Founded", "description": "Morox Properties Pty Ltd was established in Botswana to undertake property-related work including management, valuations, and consultancy.", "icon": "Milestone" },
                { "id": "2", "year": "2023-Expanded", "title": "Expanded Services", "description": "Launched a one-stop-shop model by partnering with conveyancers, architects, and engineers to bring convenience to clients.", "icon": "Building" },
                { "id": "3", "year": "Ongoing", "title": "Community Engagement", "description": "Established partnerships with NGOs, annual donation drives, and mentorship programs to give back to the community.", "icon": "Handshake" },
                { "id": "4", "year": "Present", "title": "Industry Leadership", "description": "Recognized as trusted experts, serving on the valuation panels for Bank Gaborone, Stanbic Bank, and Absa Bank.", "icon": "Award" }
            ]
        },
        "team": [],
        "testimonials": []
    }'
) ON CONFLICT (page_name) DO NOTHING;

-- Seed initial content for the FAQ page
INSERT INTO public.page_content (page_name, content)
VALUES (
    'faq',
    '{
        "overview": [
            { "id": "1", "question": "Why Should I Use Your Services?", "answer": "Our experienced agents provide personalized service and expert market knowledge to help you find the perfect property. We streamline the buying, selling, and renting process, ensuring a smooth and successful transaction every time." },
            { "id": "2", "question": "How Secure Are Your Services?", "answer": "We prioritize your security by using industry-standard encryption for all data transmission and adhering to strict privacy policies. Your personal and financial information is handled with the utmost care and confidentiality." },
            { "id": "3", "question": "Is There Customer Support Available?", "answer": "Yes, our dedicated customer support team is available via phone, email, and live chat during business hours. We''re here to answer your questions and provide assistance whenever you need it." },
            { "id": "4", "question": "How Can I Update My Account Information?", "answer": "You can easily update your account information by logging into your client portal. From your dashboard, you can edit your profile, change your password, and manage your saved properties and searches." }
        ],
        "payments": [
            { "id": "5", "question": "How Do You Calculate Fees?", "answer": "Our fees are transparent and competitive. For sales, we charge a standard commission percentage. For rentals and management, we have a clear fee structure outlined in our service agreement. There are no hidden costs." },
            { "id": "6", "question": "How Do I Pay My Invoices?", "answer": "Invoices can be paid securely online through our client portal using a credit card or bank transfer. We also accept payments at our local offices. We''ll provide detailed instructions with every invoice." },
            { "id": "7", "question": "Are There Opportunities For Discounts Or Promotions?", "answer": "We occasionally offer promotions for new clients or for bundling multiple services. Please check our website or subscribe to our newsletter to stay informed about current offers." },
            { "id": "8", "question": "What Is The Refund Procedure?", "answer": "Refund policies vary depending on the service. For specific details regarding refunds, please refer to your service agreement or contact our support team to discuss your situation." }
        ],
        "security": [
            { "id": "9", "question": "What Languages Does Your Service Support?", "answer": "Our primary language of service is English. However, we have multilingual agents on our team who may be able to assist in other languages. Please contact us to inquire about specific language needs." },
            { "id": "10", "question": "How Do I Integrate Your Service Into My System?", "answer": "We offer various integration options for partners and corporate clients, including API access for property listings. Please contact our business development team to discuss your technical requirements." },
            { "id": "11", "question": "How Do I Report A Technical Issue?", "answer": "If you encounter any technical issues with our website or client portal, please contact our support team immediately. You can submit a ticket through the help section of your portal or email us directly with a description of the problem." }
        ]
    }'
) ON CONFLICT (page_name) DO NOTHING;
```

## Seed Properties and Related Data
```sql
-- Seed Amenities
INSERT INTO amenities (name) VALUES
('Air Conditioning'), ('Swimming Pool'), ('Parking'), ('Gym'), ('Garden'),
('Security'), ('Furnished'), ('Unfurnished'), ('Pet Friendly'), ('Balcony'),
('Elevator'), ('WiFi'), ('Fireplace'), ('Disabled Access');

-- Seed Properties
INSERT INTO properties (id, title, description, address, location, area, property_type, price, status, rooms, beds, baths, parking, plot_sqm, house_area_sqm, year_built, is_featured, is_verified, is_new, is_main_featured)
VALUES
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'Modern Family Home in Block 8', 'A spacious and modern family home located in the quiet neighborhood of Block 8, Gaborone. Features a large garden and a swimming pool, perfect for families.', 'Plot 1234, Block 8, Gaborone', 'Gaborone', 'Block 8', 'House', 2500000, 'For Sale', 8, 4, 3, 2, 800, 320, 2018, true, true, true, true),
('b2c3d4e5-f6a7-8901-2345-67890abcdef1', 'Executive Apartment at iTowers', 'A luxurious 2-bedroom apartment in the iconic iTowers with breathtaking city views. Fully furnished and serviced, ideal for professionals.', 'iTowers, CBD, Gaborone', 'Gaborone', 'iTowers', 'Apartment', 18000, 'For Rent', 4, 2, 2, 1, null, 120, 2016, true, true, false, false),
('c3d4e5f6-a7b8-9012-3456-7890abcdef2', 'Spacious Commercial Warehouse', 'Large warehouse space available for rent in a prime industrial area. High ceilings and easy truck access.', 'Plot 5678, Industrial Area, Francistown', 'Francistown', 'Industrial Area', 'Warehouse', 35000, 'For Rent', 3, 0, 2, 10, 2000, 1500, 2015, false, true, false, false),
('d4e5f6a7-b8c9-0123-4567-890abcdef3', 'Cozy Starter Home in Phase 2', 'A charming and affordable 3-bedroom house, perfect for first-time buyers or a small family. Secure and well-maintained.', 'Plot 9101, Phase 2, Gaborone', 'Gaborone', 'Phase 2', 'House', 950000, 'For Sale', 6, 3, 2, 1, 450, 150, 2010, true, false, false, false);

-- Seed Property Images
INSERT INTO property_images (property_id, image_url, description) VALUES
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'https://picsum.photos/seed/1/1024/768', 'Front view of the modern home'),
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'https://picsum.photos/seed/2/1024/768', 'Swimming pool and backyard'),
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'https://picsum.photos/seed/3/1024/768', 'Living room interior'),
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'https://picsum.photos/seed/4/1024/768', 'Master bedroom'),
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'https://picsum.photos/seed/5/1024/768', '360-tour'),
('b2c3d4e5-f6a7-8901-2345-67890abcdef1', 'https://picsum.photos/seed/6/1024/768', 'Apartment living area'),
('b2c3d4e5-f6a7-8901-2345-67890abcdef1', 'https://picsum.photos/seed/7/1024/768', 'View from the apartment balcony'),
('c3d4e5f6-a7b8-9012-3456-7890abcdef2', 'https://picsum.photos/seed/8/1024/768', 'Interior of the warehouse'),
('d4e5f6a7-b8c9-0123-4567-890abcdef3', 'https://picsum.photos/seed/9/1024/768', 'Exterior of the starter home');

-- Seed Property Amenities
INSERT INTO property_amenities (property_id, amenity_name) VALUES
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'Air Conditioning'),
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'Swimming Pool'),
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'Garden'),
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'Security'),
('b2c3d4e5-f6a7-8901-2345-67890abcdef1', 'Air Conditioning'),
('b2c3d4e5-f6a7-8901-2345-67890abcdef1', 'Furnished'),
('b2c3d4e5-f6a7-8901-2345-67890abcdef1', 'Gym'),
('b2c3d4e5-f6a7-8901-2345-67890abcdef1', 'Elevator'),
('c3d4e5f6-a7b8-9012-3456-7890abcdef2', 'Parking'),
('d4e5f6a7-b8c9-0123-4567-890abcdef3', 'Garden'),
('d4e5f6a7-b8c9-0123-4567-890abcdef3', 'Security');

-- Seed Nearby Places
INSERT INTO nearby_places (property_id, name, distance_km) VALUES
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'Rainbow Primary School', 1.5),
('a1b2c3d4-e5f6-7890-1234-567890abcdef', 'Airport Junction Mall', 2.0),
('b2c3d4e5-f6a7-8901-2345-67890abcdef1', 'Gaborone Private Hospital', 1.0),
('b2c3d4e5-f6a7-8901-2345-67890abcdef1', 'University of Botswana', 2.5);
```
