<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2026 Nexa Systems Inc.
    License OPL-1 (Odoo Proprietary License v1.0)
-->
<odoo>
    <record id="res_config_settings_view_form_fusion_notes" model="ir.ui.view">
        <field name="name">res.config.settings.view.form.fusion.notes</field>
        <field name="model">res.config.settings</field>
        <field name="inherit_id" ref="base.res_config_settings_view_form"/>
        <field name="arch" type="xml">
            <xpath expr="//form" position="inside">
                <app data-string="Fusion Notes" string="Fusion Notes" name="fusion_notes">
                    <h2>Voice Transcription</h2>
                    <div class="row mt-4 o_settings_container">
                        <!-- OpenAI API Key -->
                        <div class="col-12 col-lg-6 o_setting_box">
                            <div class="o_setting_right_pane">
                                <span class="o_form_label">OpenAI API Key</span>
                                <div class="text-muted">
                                    Required for Whisper voice transcription and GPT note
                                    formatting. Get your key at
                                    <a href="https://platform.openai.com" target="_blank">
                                        platform.openai.com
                                    </a>
                                </div>
                                <div class="content-group mt-2">
                                    <field name="fn_openai_api_key" password="True"/>
                                </div>
                            </div>
                        </div>

                        <!-- AI Formatting Model -->
                        <div class="col-12 col-lg-6 o_setting_box">
                            <div class="o_setting_right_pane">
                                <span class="o_form_label">AI Formatting Model</span>
                                <div class="text-muted">
                                    Model used to clean up and professionally format
                                    transcribed voice notes. GPT-4o Mini is recommended
                                    for speed and low cost.
                                </div>
                                <div class="content-group mt-2">
                                    <field name="fn_ai_model"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <h2>Defaults</h2>
                    <div class="row mt-4 o_settings_container">
                        <!-- Review Before Posting -->
                        <div class="col-12 col-lg-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="fn_default_review_mode"/>
                            </div>
                            <div class="o_setting_right_pane">
                                <span class="o_form_label">Review Before Posting</span>
                                <div class="text-muted">
                                    Show transcribed text for review and editing before
                                    posting to chatter. If disabled, notes are posted
                                    immediately after transcription.
                                </div>
                            </div>
                        </div>

                        <!-- AI Format by Default -->
                        <div class="col-12 col-lg-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="fn_default_ai_format"/>
                            </div>
                            <div class="o_setting_right_pane">
                                <span class="o_form_label">AI Format by Default</span>
                                <div class="text-muted">
                                    Automatically format notes with AI before review.
                                    Users can still toggle this per note.
                                </div>
                            </div>
                        </div>

                        <!-- Max Recording Duration -->
                        <div class="col-12 col-lg-6 o_setting_box">
                            <div class="o_setting_right_pane">
                                <span class="o_form_label">Max Recording Duration</span>
                                <div class="text-muted">
                                    Maximum recording time in seconds. Recording
                                    automatically stops when this limit is reached.
                                    Default: 300 seconds (5 minutes).
                                </div>
                                <div class="content-group mt-2">
                                    <field name="fn_max_recording_seconds"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </app>
            </xpath>
        </field>
    </record>
</odoo>
