<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- ================================================================== -->
    <!-- MODULE CATEGORY (required for user settings section rendering)    -->
    <!-- Odoo 19 organizes privileges by ir.module.category.              -->
    <!-- Without this, groups fall into the generic Extra Rights list.     -->
    <!-- ================================================================== -->
    <record id="module_category_fusion_poynt" model="ir.module.category">
        <field name="name">Fusion Poynt</field>
        <field name="sequence">47</field>
    </record>

    <!-- ================================================================== -->
    <!-- FUSION POYNT PRIVILEGE (Odoo 19 pattern)                           -->
    <!-- Linked to module_category_fusion_poynt so all groups appear        -->
    <!-- under a "FUSION POYNT" section in user settings.                   -->
    <!-- ================================================================== -->
    <record id="res_groups_privilege_fusion_poynt" model="res.groups.privilege">
        <field name="name">Fusion Poynt</field>
        <field name="sequence">47</field>
        <field name="category_id" ref="module_category_fusion_poynt"/>
    </record>

    <!-- ================================================================== -->
    <!-- USER GROUP                                                          -->
    <!-- Can view terminals, collect payments, and send receipts.            -->
    <!-- Implies base.group_user and account invoice access.                 -->
    <!-- ================================================================== -->
    <record id="group_fusion_poynt_user" model="res.groups">
        <field name="name">User</field>
        <field name="sequence">10</field>
        <field name="implied_ids" eval="[(4, ref('base.group_user')), (4, ref('account.group_account_invoice'))]"/>
        <field name="privilege_id" ref="res_groups_privilege_fusion_poynt"/>
    </record>

    <!-- ================================================================== -->
    <!-- ADMINISTRATOR GROUP                                                 -->
    <!-- Full access: configure providers, manage terminals, process         -->
    <!-- payments, voids, and refunds.                                       -->
    <!-- ================================================================== -->
    <record id="group_fusion_poynt_admin" model="res.groups">
        <field name="name">Administrator</field>
        <field name="sequence">20</field>
        <field name="privilege_id" ref="res_groups_privilege_fusion_poynt"/>
        <field name="implied_ids" eval="[(4, ref('group_fusion_poynt_user'))]"/>
        <field name="user_ids" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
    </record>

</odoo>
