enum ComplianceType {
  BACKGROUND_CHECK
  FOOD_HANDLER
  RBS
  LEGAL
  OPERATIONAL
  SAFETY
  TRAINING
  LICENSE
  OTHER
}

enum CertificateStatus {
  CURRENT
  EXPIRING_SOON
  COMPLETED
  PENDING
  EXPIRED
  EXPIRING
  NOT_STARTED
}

enum ValidationStatus {
  APPROVED
  PENDING_EXPERT_REVIEW
  REJECTED
  AI_VERIFIED
  AI_FLAGGED
  MANUAL_REVIEW_NEEDED
}


type Certificate @table(name: "certificates") {
  id: UUID! @default(expr: "uuidV4()")

  name: String!
  description: String
  expiry: Timestamp
  status: CertificateStatus!
  fileUrl: String
  icon: String
  certificationType: ComplianceType
  issuer: String #Issuing Authority
  certificateNumber: String 
  
  validationStatus: ValidationStatus

  staffId: UUID!
  staff: Staff! @ref(fields: "staffId", references: "id")

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