<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2024-2025 Nexa Systems Inc.
    License OPL-1 (Odoo Proprietary License v1.0)
    Part of the Fusion Claim Assistant product family.
-->
<odoo>
    <data>
        <!-- Cron Job: Renew ADP Delivery Reminders -->
        <record id="ir_cron_renew_delivery_reminders" model="ir.cron">
            <field name="name">Fusion Claims: Renew Delivery Reminders</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="state">code</field>
            <field name="code">model._cron_renew_delivery_reminders()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
        </record>

        <!-- Cron Job: Renew ADP Billing Reminders -->
        <record id="ir_cron_renew_billing_reminders" model="ir.cron">
            <field name="name">Fusion Claims: Renew Billing Reminders</field>
            <field name="model_id" ref="account.model_account_move"/>
            <field name="state">code</field>
            <field name="code">model._cron_renew_billing_reminders()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
        </record>

        <!-- Cron Job: Renew ADP Correction Reminders -->
        <record id="ir_cron_renew_correction_reminders" model="ir.cron">
            <field name="name">Fusion Claims: Renew Correction Reminders</field>
            <field name="model_id" ref="account.model_account_move"/>
            <field name="state">code</field>
            <field name="code">model._cron_renew_correction_reminders()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
        </record>
        
        <!-- Cron Job: Auto-Close Cases (1 month after billed) -->
        <record id="ir_cron_auto_close_cases" model="ir.cron">
            <field name="name">Fusion Claims: Auto-Close Billed Cases</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="state">code</field>
            <field name="code">model._cron_auto_close_billed_cases()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
        </record>
        
        <!-- Cron Job: Auto-Close ODSP Cases (7 days after payment received) -->
        <record id="ir_cron_auto_close_odsp_paid" model="ir.cron">
            <field name="name">Fusion Claims: Auto-Close ODSP Paid Cases</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="state">code</field>
            <field name="code">model._cron_auto_close_odsp_paid_cases()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
        </record>

        <!-- Cron Job: Send Application Reminder Emails (4 days after assessment) -->
        <record id="ir_cron_application_reminder" model="ir.cron">
            <field name="name">Fusion Claims: First Application Reminder</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="state">code</field>
            <field name="code">model._cron_send_application_reminders()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
            <field name="nextcall" eval="DateTime.now().replace(hour=9, minute=0, second=0)"/>
        </record>
        
        <!-- Cron Job: Send Second Application Reminder Emails (X days after first reminder) -->
        <record id="ir_cron_application_reminder_2" model="ir.cron">
            <field name="name">Fusion Claims: Second Application Reminder</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="state">code</field>
            <field name="code">model._cron_send_application_reminders_2()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
            <field name="nextcall" eval="DateTime.now().replace(hour=9, minute=0, second=0)"/>
        </record>
        
        <!-- Cron Job: Acceptance Reminder Emails (next business day after submission) -->
        <record id="ir_cron_acceptance_reminder" model="ir.cron">
            <field name="name">Fusion Claims: Acceptance Reminder Emails</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="state">code</field>
            <field name="code">model._cron_send_acceptance_reminders()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
            <field name="nextcall" eval="DateTime.now().replace(hour=9, minute=0, second=0)"/>
        </record>
        
        <!-- Cron Job: Loaner Equipment Reminders - moved to separate file after views -->
        <!-- Will be added via ir_cron_loaner_data.xml -->

        <!-- Cron Job: MOD Bi-weekly Follow-up Scheduler -->
        <record id="ir_cron_mod_followup_scheduler" model="ir.cron">
            <field name="name">Fusion Claims: MOD Follow-up Scheduler</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="state">code</field>
            <field name="code">model._cron_mod_schedule_followups()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
            <field name="nextcall" eval="DateTime.now().replace(hour=8, minute=0, second=0)"/>
        </record>

        <!-- Cron Job: MOD Follow-up Escalation (auto-email when activity overdue) -->
        <record id="ir_cron_mod_followup_escalation" model="ir.cron">
            <field name="name">Fusion Claims: MOD Follow-up Escalation</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="state">code</field>
            <field name="code">model._cron_mod_escalate_followups()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
            <field name="nextcall" eval="DateTime.now().replace(hour=10, minute=0, second=0)"/>
        </record>

        <!-- Cron Job: Expire Old Page 11 Signing Requests -->
        <record id="ir_cron_expire_page11_requests" model="ir.cron">
            <field name="name">Fusion Claims: Expire Page 11 Signing Requests</field>
            <field name="model_id" ref="model_fusion_page11_sign_request"/>
            <field name="state">code</field>
            <field name="code">model._cron_expire_requests()</field>
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="active">True</field>
            <field name="nextcall" eval="DateTime.now().replace(hour=2, minute=0, second=0)"/>
        </record>

    </data>
</odoo>
