/*
  Warnings:

  - Added the required column `quoteConfirmationTemplate` to the `emailsettings` table without a default value. This is not possible if the table is not empty.
  - Added the required column `quoteNotificationTemplate` to the `emailsettings` table without a default value. This is not possible if the table is not empty.
  - Added the required column `quoteStatusUpdateTemplate` to the `emailsettings` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE `emailsettings` ADD COLUMN `quoteConfirmationTemplate` TEXT NOT NULL,
    ADD COLUMN `quoteNotificationTemplate` TEXT NOT NULL,
    ADD COLUMN `quoteStatusUpdateTemplate` TEXT NOT NULL;

-- Update existing records with default templates
UPDATE `emailsettings` SET 
    `quoteConfirmationTemplate` = '<!DOCTYPE html>
<html>
<head>
    <style>
        body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }
        .container { max-width: 600px; margin: 0 auto; padding: 20px; }
        .header { background-color: #B87333; color: white; padding: 20px; text-align: center; }
        .content { padding: 20px; background-color: #f9f9f9; }
        .quote-details { background-color: #f0f0f0; padding: 15px; margin: 15px 0; border-radius: 5px; }
        .footer { text-align: center; padding: 20px; font-size: 12px; color: #666; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>Quote Request Confirmation</h1>
        </div>
        <div class="content">
            <p>Dear {fullName},</p>
            <p>Thank you for submitting your quote request to {companyName}. We have received your project details and will review them carefully.</p>
            
            <div class="quote-details">
                <h3>Your Quote Request Details:</h3>
                <p><strong>Request ID:</strong> {requestId}</p>
                <p><strong>Project Type:</strong> {projectType}</p>
                <p><strong>Budget Range:</strong> {budgetRange}</p>
                <p><strong>Timeline:</strong> {timeline}</p>
                <p><strong>Selected Features:</strong> {selectedFeatures}</p>
            </div>

            <p>We will review your project requirements and get back to you within 24-48 hours with a detailed quote.</p>
            
            <p><strong>Access Your Quote:</strong><br>
            You can track your quote status anytime by visiting:<br>
            <a href="{quoteUrl}">{quoteUrl}</a><br>
            Password: {accessPassword}</p>

            <p>If you have any questions or need to provide additional information, please don''t hesitate to contact us.</p>
            
            <p>Best regards,<br>The {companyName} Team</p>
        </div>
        <div class="footer">
            <p>This is an automated message. Please do not reply to this email.</p>
            <p>© 2024 {companyName}. All rights reserved.</p>
        </div>
    </div>
</body>
</html>',
    `quoteNotificationTemplate` = '<!DOCTYPE html>
<html>
<head>
    <style>
        body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }
        .container { max-width: 600px; margin: 0 auto; padding: 20px; }
        .header { background-color: #B87333; color: white; padding: 20px; text-align: center; }
        .content { padding: 20px; background-color: #f9f9f9; }
        .quote-details { background-color: #f0f0f0; padding: 15px; margin: 15px 0; border-radius: 5px; }
        .footer { text-align: center; padding: 20px; font-size: 12px; color: #666; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>New Quote Request Received</h1>
        </div>
        <div class="content">
            <p>A new quote request has been submitted through your website:</p>
            
            <div class="quote-details">
                <h3>Quote Request Details:</h3>
                <p><strong>Request ID:</strong> {requestId}</p>
                <p><strong>Client Name:</strong> {fullName}</p>
                <p><strong>Email:</strong> {email}</p>
                <p><strong>Phone:</strong> {phone}</p>
                <p><strong>Project Type:</strong> {projectType}</p>
                <p><strong>Budget Range:</strong> {budgetRange}</p>
                <p><strong>Timeline:</strong> {timeline}</p>
                <p><strong>Selected Features:</strong> {selectedFeatures}</p>
                <p><strong>Additional Features:</strong> {additionalFeatures}</p>
                <p><strong>Additional Info:</strong> {additionalInfo}</p>
            </div>

            <p>Please review this request and provide a quote as soon as possible.</p>
            
            <p><strong>Admin Access:</strong><br>
            You can manage this quote request from your admin panel.</p>
        </div>
        <div class="footer">
            <p>This is an automated notification from your website''s quote form.</p>
            <p>© 2024 {companyName}. All rights reserved.</p>
        </div>
    </div>
</body>
</html>',
    `quoteStatusUpdateTemplate` = '<!DOCTYPE html>
<html>
<head>
    <style>
        body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }
        .container { max-width: 600px; margin: 0 auto; padding: 20px; }
        .header { background-color: #B87333; color: white; padding: 20px; text-align: center; }
        .content { padding: 20px; background-color: #f9f9f9; }
        .status-update { background-color: #f0f0f0; padding: 15px; margin: 15px 0; border-radius: 5px; }
        .footer { text-align: center; padding: 20px; font-size: 12px; color: #666; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>Quote Status Update</h1>
        </div>
        <div class="content">
            <p>Dear {fullName},</p>
            <p>Your quote request has been updated. Here are the latest details:</p>
            
            <div class="status-update">
                <h3>Status Update:</h3>
                <p><strong>Request ID:</strong> {requestId}</p>
                <p><strong>New Status:</strong> {status}</p>
                <p><strong>Estimated Price:</strong> {estimatedPrice}</p>
                <p><strong>Admin Notes:</strong> {adminNotes}</p>
            </div>

            <p><strong>Access Your Quote:</strong><br>
            You can view the full details anytime by visiting:<br>
            <a href="{quoteUrl}">{quoteUrl}</a><br>
            Password: {accessPassword}</p>

            <p>If you have any questions, please don''t hesitate to contact us.</p>
            
            <p>Best regards,<br>The {companyName} Team</p>
        </div>
        <div class="footer">
            <p>This is an automated message. Please do not reply to this email.</p>
            <p>© 2024 {companyName}. All rights reserved.</p>
        </div>
    </div>
</body>
</html>';
