<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Ready for Submission Wizard Form View -->
    <record id="view_ready_for_submission_wizard_form" model="ir.ui.view">
        <field name="name">fusion_claims.ready.for.submission.wizard.form</field>
        <field name="model">fusion_claims.ready.for.submission.wizard</field>
        <field name="arch" type="xml">
            <form string="Ready for Submission">
                <field name="sale_order_id" invisible="1"/>
                <field name="has_authorization_date" invisible="1"/>
                <field name="has_client_refs" invisible="1"/>
                <field name="has_reason" invisible="1"/>
                <field name="has_documents" invisible="1"/>
                <field name="requires_previous_funding" invisible="1"/>
                
                <div class="alert alert-info mb-3" role="alert">
                    <strong><i class="fa fa-clipboard-check"/> Submission Checklist</strong>
                    <p class="mb-0">Please verify all required information before marking as ready for submission.</p>
                </div>
                
                <!-- Status indicators -->
                <div class="row mb-3">
                    <div class="col-md-3">
                        <span class="badge bg-success" invisible="not has_documents">
                            <i class="fa fa-check"/> Documents Uploaded
                        </span>
                        <span class="badge bg-danger" invisible="has_documents">
                            <i class="fa fa-times"/> Documents Missing
                        </span>
                    </div>
                    <div class="col-md-3">
                        <span class="badge bg-success" invisible="not has_reason">
                            <i class="fa fa-check"/> Reason Set
                        </span>
                        <span class="badge bg-warning" invisible="has_reason">
                            <i class="fa fa-exclamation"/> Reason Needed
                        </span>
                    </div>
                    <div class="col-md-3">
                        <span class="badge bg-success" invisible="not has_client_refs">
                            <i class="fa fa-check"/> Client Refs
                        </span>
                        <span class="badge bg-warning" invisible="has_client_refs">
                            <i class="fa fa-exclamation"/> Client Refs Needed
                        </span>
                    </div>
                    <div class="col-md-3">
                        <span class="badge bg-success" invisible="not has_authorization_date">
                            <i class="fa fa-check"/> Authorized
                        </span>
                        <span class="badge bg-warning" invisible="has_authorization_date">
                            <i class="fa fa-exclamation"/> Auth Date Needed
                        </span>
                    </div>
                </div>
                
                <group>
                    <group string="Authorization">
                        <field name="claim_authorization_date"/>
                    </group>
                    <group string="Client References">
                        <field name="client_ref_1" placeholder="e.g., JODO"/>
                        <field name="client_ref_2" placeholder="e.g., 1234"/>
                    </group>
                </group>
                
                <group>
                    <group string="Application Details">
                        <field name="reason_for_application"/>
                        <field name="previous_funding_date" 
                               invisible="not requires_previous_funding"
                               required="requires_previous_funding"/>
                    </group>
                    <group string="Notes">
                        <field name="notes" placeholder="Any notes about the submission..."/>
                    </group>
                </group>
                
                <footer>
                    <button name="action_confirm" type="object" 
                            string="Mark Ready for Submission" class="btn-primary"
                            icon="fa-check"/>
                    <button string="Cancel" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <!-- Action for the wizard -->
    <record id="action_ready_for_submission_wizard" model="ir.actions.act_window">
        <field name="name">Ready for Submission</field>
        <field name="res_model">fusion_claims.ready.for.submission.wizard</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>
</odoo>
