// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "sqlite"
  url      = env("DATABASE_URL")
}

model Boleto {
  id              String   @id @default(cuid())
  transactionId   String   @unique
  paymentId       String?
  amount          Float
  tax             Float?
  taxPercent      Float?
  netAmount       Float?
  barcode         String?
  dueDate         DateTime?
  acquirente      String?
  paymentMethod   String   @default("BOLETO")
  status          String   @default("PENDING")
  statusText      String?

  // Dados do cliente/pagador
  customerName    String
  customerEmail   String
  customerDocument String
  customerPhone   String?

  description     String?
  webhookUrl      String?

  rawResponse     String?

  createdAt       DateTime @default(now())
  updatedAt       DateTime @updatedAt
  confirmedAt     DateTime?

  @@index([status])
  @@index([customerEmail])
  @@index([createdAt])
}
