Skip to content

Latest commit

 

History

History
54 lines (44 loc) · 1.3 KB

File metadata and controls

54 lines (44 loc) · 1.3 KB

Diagramas de fluxo

1) Matrícula + pagamento

sequenceDiagram
  participant FE as Frontend
  participant API as Enrollment API
  participant DB as PostgreSQL
  participant PG as Payment Provider

  FE->>API: POST /api/leads
  API->>DB: insert lead_enrollments
  API-->>FE: lead_id + lead_code

  FE->>API: POST /api/payments (+ Idempotency-Key)
  API->>DB: insert payment_checkouts (processing)
  API->>PG: authorize/capture
  PG-->>API: approved/declined/3DS
  API->>DB: update checkout + lead payment status
  API-->>FE: normalized payment response
Loading

2) Retry / idempotência

sequenceDiagram
  participant Client
  participant API
  participant DB

  Client->>API: POST /api/payments (same Idempotency-Key)
  API->>DB: lookup payment_checkouts by idempotency_key
  alt found
    API-->>Client: reuse existing result (no new charge)
  else missing column / older schema
    API->>DB: fallback lookup by deterministic reference
    API-->>Client: reuse if found
  end
Loading

3) Consulta interna operacional

sequenceDiagram
  participant Ops as Operator Dashboard
  participant API
  participant DB

  Ops->>API: GET /api/leads?lead_code=... + x-internal-token
  API->>API: token/hash validation
  API->>DB: query lead/payment details
  API-->>Ops: filtered lead/payment payload
Loading