enum AssignmentStatus {
  PENDING
  CONFIRMED
  OPEN
  COMPLETED
  CANCELED
  ACTIVE
}

type Assignment @table(name: "assignments") {
  id: UUID! @default(expr: "uuidV4()")

  # Who is doing the assignment
  workforceId: UUID!
  workforce: Workforce! @ref(fields: "workforceId", references: "id")

  # What exact shift + role this assignment is for
  roleId: UUID!
  shiftId: UUID!
  
  shiftRole: ShiftRole! @ref(
    fields: ["shiftId", "roleId"],
    references: ["shiftId", "roleId"]
  )

  # --- task info ---
  title: String
  description: String
  instructions: String

  status: AssignmentStatus @default(expr: "'PENDING'")

  # flags / perks
  tipsAvailable: Boolean
  travelTime: Boolean
  mealProvided: Boolean
  parkingAvailable: Boolean
  gasCompensation: Boolean

  # Optional managers list (still ok as json)
  managers: [Any!]

  createdAt: Timestamp @default(expr: "request.time")
  updatedAt: Timestamp @default(expr: "request.time")
  createdBy: String @default(expr: "auth.uid")
}