using Microsoft.AspNetCore.Mvc.RazorPages;

namespace Nalu.Web.Pages.En;

public class EnIndexModel : PageModel
{
    public record FaqItem(string Q, string A);

    public IReadOnlyList<ValidatorCard> Validators { get; } =
    [
        new("🔤", "validate_name",         "Extracts full name, ignores greetings and titles.",                          3),
        new("✉️", "validate_email",        "Extracts email and fixes domain typos (gmail→gmail.com).",                   3),
        new("🌍", "validate_postal_code",  "International postal code (non-BR).",                                        3),
        new("☑️", "validate_yes_no",       "Detects yes/no in any language and indirect phrasing.",                      3),
        new("🎂", "validate_birthdate",    "Date of birth in any format. Detects minors.",                               3),
        new("🤝", "validate_handoff",      "Detects intent to speak with a human (urgency 1-3).",                        3),
        new("🚫", "validate_cancel_intent","Differentiates service cancellation vs. current operation.",                  3),
        new("🏢", "validate_company_name", "Extracts company name. Detects legal suffixes.",                              3),
        new("🆔", "validate_cpf",          "Validates CPF with mod 11. Formats XXX.XXX.XXX-XX.",                         3),
        new("📮", "validate_cep",          "Extracts ZIP code and returns enriched address.",                             3),
        new("📱", "validate_phone",        "Extracts phone with area code. Validates ANATEL DDDs.",                      3),
        new("🏢", "validate_cnpj",         "Validates CNPJ with mod 11. Formats XX.XXX.XXX/XXXX-XX.",                   3),
        new("🧠", "validate_reply",        "Analyzes conversational context. Detects counteroffers, handoffs, cancellations.", 5, IsNew: true),
    ];

    public IReadOnlyList<FaqItem> Faqs { get; } =
    [
        new("What happens when my credits run out?",
            "Your calls return 429 with an upgrade suggestion. No surprise charges. Your data and keys remain intact."),
        new("Why does validate_reply cost 5 credits?",
            "It requires deep context analysis of the agent+user pair as a semantic unit. Other validators use faster multi-layer extraction."),
        new("Does it work with n8n and Make?",
            "Yes. It's a standard REST API. If your tool accepts HTTP, it works with NALU. Also available via MCP for Claude Code and Cursor."),
        new("Can I use the MCP with Claude Code?",
            "Yes. Add the NALU server to Claude Code and call validators as native tools. See /en/docs/mcp."),
        new("Is my data stored?",
            "No. Dialogues sent are used only to process the call and discarded. We do not store conversation content."),
    ];

    public void OnGet() { }
}
