📦 Offer Agent — Manual Técnico
Versão: 1.0
Data: 2026-01-22
Status: Produção
📋 Visão Geral
O Offer Agent é responsável por construir ofertas comerciais personalizadas combinando:
- Preços do Pricing Agent
- Condições do Credit Agent
- Sinal de compra do NBA Agent
Posição no Fluxo
NBA Agent → Offer Agent → Quote Builder → Execution Orchestrator
(sinal) (oferta) (proposta) (execução)
🔌 API Endpoints
Base URL
https://csuite.internut.com.br/offer
Porta Local: 8019
Endpoints Principais
| Método |
Endpoint |
Descrição |
POST |
/offer/build |
Constrói oferta baseada em inputs |
GET |
/offer/{offer_id} |
Busca oferta por ID |
GET |
/health |
Health check |
📥 Construir Oferta
Request
POST /offer/build
Content-Type: application/json
{
"client_id": 8841,
"seller_id": 22,
"channel": "whatsapp",
"products": [
{
"sku": "Y5S",
"qty": 2,
"anchor": true
},
{
"sku": "KIT-001",
"qty": 2
}
],
"pricing_ref": "PRC-2026-001",
"credit_ref": "CRD-2026-001",
"nba_ref": "NBA-2026-001"
}
Response
{
"offer_id": "OFF-2026-000001",
"client_id": 8841,
"seller_id": 22,
"items": [
{
"sku": "Y5S",
"qty": 2,
"unit_price": 198.00,
"total": 396.00,
"role": "anchor",
"description": "Bateria Y5S 60Ah"
},
{
"sku": "KIT-001",
"qty": 2,
"unit_price": 50.00,
"total": 100.00,
"role": "cross_sell",
"description": "Kit Peças"
}
],
"pricing_total": 496.00,
"payment_terms": {
"max_days": 28,
"discount_percent": 0,
"text": "Prazo máximo 28 dias"
},
"validity_hours": 48,
"created_at": "2026-01-22T14:00:00Z"
}
🔗 Integrações
Pricing Agent
- Consulta preços por SKU
- Aplica descontos conforme curva
Credit Agent
- Consulta limite de crédito
- Obtém condições de pagamento
NBA Agent
- Recebe sinal de "proceed_with_offer"
- Valida contexto antes de construir
⚙️ Configuração
Variáveis de Ambiente
# Database
MYSQL_DSN=mysql+pymysql://user:pass@host:3306/csuite_offer
# Integrações
PRICING_AGENT_URL=http://localhost:8017
CREDIT_AGENT_URL=http://localhost:8018
# App
LOG_LEVEL=INFO
🐳 Deploy
Docker Compose (Dev)
cd c-suite/agents/offer
docker-compose up --build
Docker Swarm (Prod)
📊 Métricas
| Métrica |
Valor |
| Tempo médio de build |
< 500ms |
| Cache hit rate |
> 80% |
| SLA uptime |
99.9% |
📝 Changelog
| Data |
Versão |
Descrição |
| 2026-01-22 |
1.0 |
Documentação inicial |