<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">

    <!-- Auto Clock-Out Cron: runs every 15 minutes -->
    <record id="cron_auto_clock_out" model="ir.cron">
        <field name="name">Fusion Clock: Auto Clock-Out</field>
        <field name="model_id" ref="hr_attendance.model_hr_attendance"/>
        <field name="state">code</field>
        <field name="code">model._cron_fusion_auto_clock_out()</field>
        <field name="interval_number">15</field>
        <field name="interval_type">minutes</field>
        <field name="active">True</field>
        <field name="priority">50</field>
    </record>

    <!-- Report Generation Cron: runs daily at 1:00 AM -->
    <record id="cron_generate_reports" model="ir.cron">
        <field name="name">Fusion Clock: Generate Period Reports</field>
        <field name="model_id" ref="fusion_clock.model_fusion_clock_report"/>
        <field name="state">code</field>
        <field name="code">model._cron_generate_period_reports()</field>
        <field name="interval_number">1</field>
        <field name="interval_type">days</field>
        <field name="active">True</field>
        <field name="priority">60</field>
    </record>

    <!-- Absence Check Cron: runs daily at midnight -->
    <record id="cron_check_absences" model="ir.cron">
        <field name="name">Fusion Clock: Daily Absence Check</field>
        <field name="model_id" ref="hr_attendance.model_hr_attendance"/>
        <field name="state">code</field>
        <field name="code">model._cron_fusion_check_absences()</field>
        <field name="interval_number">1</field>
        <field name="interval_type">days</field>
        <field name="active">True</field>
        <field name="priority">55</field>
    </record>

    <!-- Employee Reminder Cron: runs every 15 minutes -->
    <record id="cron_employee_reminders" model="ir.cron">
        <field name="name">Fusion Clock: Employee Reminders</field>
        <field name="model_id" ref="hr_attendance.model_hr_attendance"/>
        <field name="state">code</field>
        <field name="code">model._cron_fusion_employee_reminders()</field>
        <field name="interval_number">15</field>
        <field name="interval_type">minutes</field>
        <field name="active">True</field>
        <field name="priority">70</field>
    </record>

    <!-- Weekly Summary Cron: runs daily (checks if Monday internally) -->
    <record id="cron_weekly_summary" model="ir.cron">
        <field name="name">Fusion Clock: Weekly Summary</field>
        <field name="model_id" ref="hr_attendance.model_hr_attendance"/>
        <field name="state">code</field>
        <field name="code">model._cron_fusion_weekly_summary()</field>
        <field name="interval_number">1</field>
        <field name="interval_type">days</field>
        <field name="active">True</field>
        <field name="priority">80</field>
    </record>

</odoo>
