generator client {
  provider = "prisma-client"
  output   = "generated/prisma/client/legacy"
  engineType = "client"
}

datasource db {
  provider = "postgresql"
}

model codeDesjardins {
  id          String @id @map("_id") @db.VarChar(50)
  code        String @db.VarChar(50)
  label       String @db.VarChar(50)
  description String @db.VarChar(250)
}

model customers {
  id           String  @id @map("_id") @db.Uuid
  user_id      String? @db.VarChar(50)
  email        String? @db.VarChar(50)
  first_name   String? @db.VarChar(50)
  last_name    String? @db.VarChar(50)
  phone_number String? @db.VarChar(50)
  address      String? @db.VarChar(255)
  created_at   BigInt?
  updated_at   BigInt?
  created_by   String? @db.VarChar(50)
}

model dealers {
  id           String  @id @map("_id") @db.Uuid
  user_id      String? @db.VarChar(50)
  email        String? @db.VarChar(50)
  first_name   String? @db.VarChar(50)
  last_name    String? @db.VarChar(50)
  phone_number String? @db.VarChar(50)
  created_at   BigInt?
  updated_at   BigInt?
  created_by   String? @db.VarChar(50)
}

model employee_shift_template {
  id              String @id @map("_id") @db.Uuid
  employee_id     String @db.VarChar
  day_of_the_week String @db.VarChar
  start_time      BigInt
  end_time        BigInt
  created_at      BigInt
  updated_at      BigInt
}

model employees {
  id                String   @id @map("_id") @db.Uuid
  user_id           String?  @db.VarChar(50)
  employee_number   String?  @db.VarChar(50)
  email             String?  @db.VarChar(50)
  first_name        String?  @db.VarChar(50)
  last_name         String?  @db.VarChar(50)
  phone_number      String?  @db.VarChar(50)
  job_title         String?  @db.VarChar(50)
  company           Int?
  supervisor        String?  @db.VarChar(50)
  is_supervisor     Boolean?
  onboarding        BigInt?
  offboarding       BigInt?
  regular_hours_day Float?   @db.Real
  hours_bank_max    Int?
  created_at        BigInt?
  updated_at        BigInt?
  created_by        String?  @db.VarChar
}

model expenses {
  id              String   @id @map("_id") @db.Uuid
  time_sheet_id   String?  @db.VarChar(50)
  date            String?  @db.VarChar(50)
  code            String?  @db.VarChar(50)
  value           Float?   @db.Real
  description     String?  @db.VarChar
  evidence_id     String?  @db.VarChar
  status          Boolean?
  created_at      BigInt?
  updated_at      BigInt?
  supervisor_note String?  @db.VarChar(255)
}

model hours_bank {
  id          String  @id @map("_id") @db.Uuid
  employee_id String? @db.VarChar(50)
  hours       Float?  @db.Real
  created_at  BigInt?
  updated_at  BigInt?
}

model mileage_bank {
  id          String  @id @map("_id") @db.Uuid
  employee_id String? @db.VarChar(50)
  mileage     Int?
  year        Int?
}

model shifts {
  id              String    @id @map("_id") @db.Uuid
  time_sheet_id   String?   @db.VarChar(50)
  code            String?   @db.VarChar(50)
  type            String?   @db.VarChar(50)
  date            DateTime? @db.Date
  start_time      BigInt?
  end_time        BigInt?
  comment         String?   @db.VarChar(255)
  status          Boolean?
  created_at      BigInt?
  updated_at      BigInt?
  supervisor_note String?   @db.VarChar(255)
}

model shifts_of_template {
  id              String @id @map("_id") @db.Uuid
  model_id        String @db.Uuid
  day_of_the_week String @db.VarChar(50)
  start_time      BigInt
  end_time        BigInt
  created_at      BigInt
  updated_at      BigInt
}

model sick_leave {
  id          String  @id @map("_id") @db.Uuid
  employee_id String? @db.VarChar(50)
  accumulated Float?  @db.Real
  consumed    Float?  @db.Real
  year        Int?
  created_at  BigInt?
  updated_at  BigInt?
}

model time_sheet_periods {
  id            String    @id @map("_id") @db.Uuid
  start_date    DateTime? @db.Date
  end_date      DateTime? @db.Date
  payment_date  DateTime? @db.Date
  period_number Int?
  year          Int?
}

model time_sheet_template {
  id          String  @id @map("_id") @db.Uuid
  title       String  @db.VarChar
  description String? @db.VarChar
  created_at  BigInt
  updated_at  BigInt
}

model time_sheets {
  id                String    @id @map("_id") @db.Uuid
  employee_id       String?   @db.VarChar
  start_date        DateTime? @db.Date
  end_date          DateTime? @db.Date
  status            Boolean?
  banked_hours      Float?    @db.Real
  consumed_vacation Float?    @db.Real
  consumed_sick     Float?    @db.Real
  period_id         String?   @db.VarChar(50)
  period_number     Int?
  created_at        BigInt?
  updated_at        BigInt?
  blocked_week      Boolean?  @default(false)
}

model users {
  id                 String   @id @map("_id") @db.VarChar(50)
  email              String   @unique @db.VarChar(50)
  password           String   @db.VarChar(255)
  type               String   @db.VarChar(50)
  role               String   @db.VarChar(50)
  is_verified        Boolean?
  verification_token String?
  otp_token          String?
  refresh_token      String?
  created_at         BigInt?
  updated_at         BigInt?
  created_by         String   @db.VarChar(255)
  last_login         BigInt
}

model vacation_leave {
  id                 String  @id @map("_id") @db.Uuid
  employee_id        String? @db.VarChar(50)
  accumulated        Float?  @db.Real
  consumed           Float?  @db.Real
  created_at         BigInt?
  updated_at         BigInt?
  start_year         Int?
  end_year           Int?
  max_hours_per_year Float?  @db.Real
}
