<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data noupdate="1">
        <!-- Starter Plan -->
        <record id="saas_plan_starter" model="saas.plan">
            <field name="name">Starter</field>
            <field name="max_pos">1</field>
            <field name="max_users">5</field>
            <field name="price_monthly">49.00</field>
            <field name="price_yearly">490.00</field>
        </record>

        <!-- Professional Plan -->
        <record id="saas_plan_professional" model="saas.plan">
            <field name="name">Professional</field>
            <field name="max_pos">5</field>
            <field name="max_users">25</field>
            <field name="price_monthly">149.00</field>
            <field name="price_yearly">1490.00</field>
        </record>

        <!-- Enterprise Plan -->
        <record id="saas_plan_enterprise" model="saas.plan">
            <field name="name">Enterprise</field>
            <field name="max_pos">0</field> <!-- 0 represents Unlimited -->
            <field name="max_users">0</field>
            <field name="price_monthly">299.00</field>
            <field name="price_yearly">2990.00</field>
        </record>
        <!-- Welcome Email Template -->
        <record id="saas_welcome_email_template" model="mail.template">
            <field name="name">SaaS Welcome Email</field>
            <field name="model_id" ref="dine360_saas_master.model_saas_restaurant"/>
            <field name="subject">Welcome to your Dine360 Restaurant Platform!</field>
            <field name="email_from">{{ object.env.company.email or object.env.user.email_formatted }}</field>
            <field name="email_to">{{ object.email }}</field>
            <field name="body_html" type="html">
                <div style="margin: 0px; padding: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;">
                    <p>Hello <t t-out="object.owner_name"/>,</p>
                    <p>Congratulations! Your Dine360 restaurant tenant <strong><t t-out="object.name"/></strong> has been provisioned successfully.</p>
                    <p>You can access your dedicated dashboard and POS environment using the link below:</p>
                    <p style="margin: 20px 0;">
                        <a t-att-href="'http://' + object.subdomain" style="background-color: #e50000; color: #ffffff; padding: 10px 20px; text-decoration: none; font-weight: bold; border-radius: 4px;">Go to Dashboard</a>
                    </p>
                    <p><strong>Login Details:</strong></p>
                    <ul>
                        <li>URL: <t t-out="object.subdomain"/></li>
                        <li>Username/Email: <t t-out="object.email"/></li>
                        <li>Temporary Password: <strong><t t-out="ctx.get('temp_password')"/></strong></li>
                    </ul>
                    <p style="color: #888888; font-size: 12px; margin-top: 30px;">This is an automated onboarding email. Please change your password upon logging in.</p>
                </div>
            </field>
        </record>
    </data>
</odoo>
