# Billing engine conventions (ADR-0008, Master Prompt §6.10) - Entities: `billing_accounts`, `billing_cycles`, `subscriptions/services`, `charge_components`, `usage_charges`, `invoices`, `invoice_items`, `invoice_adjustments`, `billing_runs`, `billing_run_logs`. - Supports: mensalidade, pró-rata, implantação, locação, SaaS por usuário, franquia, consumo de telefonia, serviços avulsos, descontos contratados, ajustes manuais auditados. - A billing run must be idempotent and safely re-runnable **before** final consolidation. - After consolidation, an invoice is never silently edited — use adjustment/credit-debit note or a controlled re-billing flow instead. - Test explicitly: billing run repeated does not duplicate an invoice (Master Prompt §15.3).