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

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

model Vehicle {
  id                        String    @id @default(uuid())
  name                      String
  license_plate             String    @unique
  model                     String
  manufacture_year          Int
  status                    String
  brand                     String
  number_renavan            String?
  owner_full_name           String?
  owner_tax_id_number       String?
  vin                       String?   // Vehicle Identification Number (Chassi)
  financing_institution_name String?
  mileage                 Int?
  type                    String?
  fuel_type               String?
  gearbox_type            String?
  brake_type              String?
  steering_type           String?
  suspension_type         String?
  transmission_type       String?
  logo                     String?
  fipe_price              Float?
  maintenance_date        DateTime?
  insurance_expiry_date   DateTime?
  license_expiry_date     DateTime?
  purchase_date           DateTime?
  purchase_price          Float?
  current_value           Float?
  engine_number           String?
  engine_power            Float?   @db.Decimal(6,2)
  engine_capacity         Float?   @db.Decimal(6,2)
  max_speed               Float?   @db.Decimal(6,2)
  max_load                Float?   @db.Decimal(8,2)
  tank_capacity           Float?   @db.Decimal(6,2)
  current_fuel            Float?   @db.Decimal(6,2)
  average_consumption     Float?   @db.Decimal(6,2)
  dimensions_length       Float?   @db.Decimal(6,2)
  dimensions_width        Float?   @db.Decimal(6,2)
  dimensions_height       Float?   @db.Decimal(6,2)
  color                   String?
  notes                   String?
  created_at              DateTime  @default(now())
  updated_at              DateTime  @updatedAt

  @@map("vehicles")
}
