# ClientFlow
APP_NAME=ClientFlow
ENV=dev
CLIENTFLOW_PERSIST=true
CLIENTFLOW_WEBHOOK_SECRET=

# Base de dados
DATABASE_URL=postgresql+psycopg://clientflow:password@127.0.0.1:5432/clientflow
PSQL_DATABASE_URL=postgresql://clientflow:password@127.0.0.1:5432/clientflow

# LLM / OpenRouter
OPENROUTER_API_KEY=
OPENROUTER_MODEL=qwen/qwen3-30b-a3b

# Chatwoot
CHATWOOT_BASE_URL=http://127.0.0.1:3010
CHATWOOT_PUBLIC_URL=https://inbox.exemplo.pt
CHATWOOT_ACCOUNT_ID=1
CHATWOOT_API_TOKEN=
CHATWOOT_WRITE_ENABLED=false

# Odoo: motor de vendas, stock e produção
ODOO_ENABLED=false
ODOO_BASE_URL=https://odoo.exemplo.pt
ODOO_PUBLIC_URL=https://odoo.exemplo.pt
ODOO_DB=odoo19_prod
ODOO_USERNAME=clientflow@example.pt
ODOO_API_KEY=

# Jasmin: faturação oficial
JASMIN_ENABLED=false
JASMIN_BASE_URL=https://my.jasminsoftware.com
JASMIN_PUBLIC_URL=https://my.jasminsoftware.com
JASMIN_ACCOUNT=
JASMIN_SUBSCRIPTION=
JASMIN_CLIENT_ID=
JASMIN_CLIENT_SECRET=

# Packlink PRO: envios/recolhas/tracking
PACKLINK_ENABLED=false
PACKLINK_OUTBOX_ENABLED=false
PACKLINK_BASE_URL=https://api.packlink.com/v1
PACKLINK_PUBLIC_URL=https://pro.packlink.pt
PACKLINK_API_KEY=
PACKLINK_DEFAULT_SERVICE_ID=20571
PACKLINK_DEFAULT_SERVICE=Paq 24
PACKLINK_DEFAULT_CARRIER=Correos Express
PACKLINK_SOURCE=PRO
PACKLINK_PLATFORM=PRO
PACKLINK_PLATFORM_COUNTRY=UN
PACKLINK_COLLECTION_TIME=09:00-14:00
PACKLINK_COLLECTION_DAYS_AHEAD=1
PACKLINK_DEFAULT_PACKAGE_HEIGHT=10
PACKLINK_DEFAULT_PACKAGE_WIDTH=20
PACKLINK_DEFAULT_PACKAGE_LENGTH=30
PACKLINK_DEFAULT_PACKAGE_WEIGHT=2
PACKLINK_SENDER_NAME=
PACKLINK_SENDER_SURNAME=.
PACKLINK_SENDER_COMPANY=
PACKLINK_SENDER_STREET1=
PACKLINK_SENDER_STREET2=
PACKLINK_SENDER_ZIP=
PACKLINK_SENDER_CITY=
PACKLINK_SENDER_COUNTRY=PT
PACKLINK_SENDER_PHONE=
PACKLINK_SENDER_EMAIL=
PACKLINK_FALLBACK_PHONE=
PACKLINK_FALLBACK_EMAIL=

# Admin interno: proxy (header autenticado), token, ou local (apenas loopback)
CLIENTFLOW_ADMIN_AUTH_MODE=proxy
# Em proxy mode, o reverse proxy deve substituir (não apenas encaminhar)
# X-ClientFlow-Admin-User pelo utilizador autenticado.
# Obrigatório apenas quando CLIENTFLOW_ADMIN_AUTH_MODE=token.
CLIENTFLOW_ADMIN_TOKEN=

# Jasmin API validada em testes reais
JASMIN_OUTBOX_ENABLED=false
JASMIN_TOKEN_URL=https://identity.primaverabss.com/connect/token
JASMIN_SCOPE=application
JASMIN_COMPANY_KEY=CTULDA
JASMIN_QUOTATION_TYPE=ORC
JASMIN_QUOTATION_SERIE=ORC2026
JASMIN_DEFAULT_PRICE_LIST=03
JASMIN_DEFAULT_PAYMENT_METHOD=TRA
JASMIN_DEFAULT_PAYMENT_TERM=00
JASMIN_DEFAULT_DELIVERY_TERM=TRANSP
JASMIN_DEFAULT_CURRENCY=EUR
JASMIN_DEFAULT_COUNTRY=PT
JASMIN_DEFAULT_CUSTOMER_GROUP=02
JASMIN_DEFAULT_PARTY_TAX_SCHEMA=CONTINENTE
JASMIN_DEFAULT_UNIT=UN
JASMIN_DEFAULT_ITEM_TAX_SCHEMA=NORMAL
# Opcional: fallback quando a linha da oportunidade não tem SKU/Jasmin item.
JASMIN_DEFAULT_SALES_ITEM=CARREGADOR_MONO_7KW

# ---------------------------------------------------------------------------
# URLs e configuração geral do ClientFlow
# ---------------------------------------------------------------------------
CLIENTFLOW_BASE_URL=http://127.0.0.1:8020
CLIENTFLOW_PUBLIC_URL=
CLIENTFLOW_BACKUP_DIR=/var/backups/clientflow
CLIENTFLOW_DISABLE_CHATWOOT_PRIVATE_NOTES=false
CLIENTFLOW_NON_BILLABLE_ODOO_LINES=

# ---------------------------------------------------------------------------
# Chatwoot
# ---------------------------------------------------------------------------
CHATWOOT_AUTO_COMPLETE_ON_OUTGOING=true
CHATWOOT_AUTO_COMPLETE_ACTION_CODES=

# ---------------------------------------------------------------------------
# Identificação por email / LLM
# ---------------------------------------------------------------------------
EMAIL_IDENTITY_LLM_MODEL=
EMAIL_IDENTITY_LLM_FALLBACK_MODEL=
EMAIL_IDENTITY_LLM_TIMEOUT_SECONDS=30
EMAIL_IDENTITY_LLM_MAX_BODY_CHARS=12000

# ---------------------------------------------------------------------------
# Jasmin — impressão de faturas
# ---------------------------------------------------------------------------
JASMIN_INVOICE_TYPE=
JASMIN_INVOICE_SERIE=
JASMIN_INVOICE_PRINT_LAYOUT=
JASMIN_INVOICE_PRINTED_REPORT_NAME=

# ---------------------------------------------------------------------------
# Mautic
# ---------------------------------------------------------------------------
MAUTIC_BASE_URL=
MAUTIC_API_TOKEN=
MAUTIC_ADD_TAG_URL=
MAUTIC_REMOVE_TAG_URL=

# ---------------------------------------------------------------------------
# Outbox
# ---------------------------------------------------------------------------
OUTBOX_LIMIT=50
OUTBOX_TARGET_SYSTEM=
OUTBOX_WORKER_ID=
OUTBOX_STALE_PROCESSING_MINUTES=30
OUTBOX_STALE_RECOVERY_LIMIT=100
OUTBOX_STALE_RECOVERY_MODE=false

# ---------------------------------------------------------------------------
# Packlink — testes
# ---------------------------------------------------------------------------
PACKLINK_TEST_FROM_ZIP=
PACKLINK_TEST_TO_ZIP=

# ---------------------------------------------------------------------------
# Assistente de resposta
# ---------------------------------------------------------------------------
CLIENTFLOW_REPLY_LLM_ENABLED=false
CLIENTFLOW_REPLY_LLM_FIRST_ENABLED=true
CLIENTFLOW_REPLY_LLM_MODEL=
CLIENTFLOW_EMAIL_REPLY_AGENT_ENABLED=false
OPENAI_VECTOR_STORE_ID=
OPENAI_API_KEY=
