<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="kyc_application_view_kanban" model="ir.ui.view">
        <field name="name">kyc.application.kanban</field>
        <field name="model">kyc.application</field>
        <field name="arch" type="xml">
            <kanban default_group_by="state" class="o_kanban_mobile">
                <field name="name"/>
                <field name="team_name"/>
                <field name="score"/>
                <field name="state"/>
                <field name="reviewer_id"/>
                <field name="submitted_date"/>
                <templates>
                    <t t-name="card">
                        <div class="oe_kanban_content">
                            <div class="o_kanban_record_top mb-2">
                                <div class="o_kanban_record_headings">
                                    <strong class="o_kanban_record_title">
                                        <field name="name"/>
                                    </strong>
                                </div>
                                <field name="state" widget="label_selection" options="{'classes': {'pending': 'warning', 'in_review': 'info', 'approved': 'success', 'rejected': 'danger'}}"/>
                            </div>
                            <div class="o_kanban_record_body">
                                <div><strong>Team:</strong> <field name="team_name"/></div>
                                <div><strong>Score:</strong> <field name="score"/>/100</div>
                                <div t-if="record.reviewer_id.raw_value">
                                    <strong>Reviewer:</strong> <field name="reviewer_id"/>
                                </div>
                            </div>
                            <div class="o_kanban_record_bottom">
                                <div class="oe_kanban_bottom_left">
                                    <field name="submitted_date" widget="date"/>
                                </div>
                            </div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>

    <record id="kyc_application_view_list" model="ir.ui.view">
        <field name="name">kyc.application.list</field>
        <field name="model">kyc.application</field>
        <field name="arch" type="xml">
            <list>
                <field name="name"/>
                <field name="team_name"/>
                <field name="tax_id" optional="show"/>
                <field name="country_id" optional="show"/>
                <field name="score"/>
                <field name="state" widget="badge" decoration-warning="state == 'pending'" decoration-info="state == 'in_review'" decoration-success="state == 'approved'" decoration-danger="state == 'rejected'"/>
                <field name="reviewer_id" optional="show"/>
                <field name="submitted_date"/>
            </list>
        </field>
    </record>

    <record id="action_kyc_application" model="ir.actions.act_window">
        <field name="name">KYC Applications</field>
        <field name="res_model">kyc.application</field>
        <field name="view_mode">kanban,list,form</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                No KYC applications yet
            </p>
            <p>
                KYC applications are created automatically when teams submit verification requests.
            </p>
        </field>
    </record>
</odoo>
