Class Ticket

java.lang.Object
domain.Ticket

public class Ticket extends Object
Represents a support ticket in the system | Représente un ticket de support dans le système.
Author:
FIGUEIRAS Jossua
  • Constructor Details

    • Ticket

      public Ticket(int id, Machine m, Admin creator, Technician technician, String title, String description, String status, LocalDateTime open_at, LocalDateTime closed_at)
      Creates a Ticket instance with explicit values | Crée une instance Ticket à partir de valeurs explicites.
      Parameters:
      id - the unique identifier of the ticket | l'identifiant unique du ticket
      m - the machine associated with the ticket | la machine associée au ticket
      creator - the admin who created the ticket | l'admin ayant créé le ticket
      technician - the technician assigned to the ticket | le technicien assigné au ticket
      title - the title of the ticket | le titre du ticket
      description - the detailed description of the issue | la description détaillée du problème
      status - the current status of the ticket ("open", "in_progress", "closed") | le statut actuel du ticket ("open", "in_progress", "closed")
      open_at - the date and time the ticket was opened | la date et l'heure d'ouverture du ticket
      closed_at - the date and time the ticket was closed | la date et l'heure de fermeture du ticket
    • Ticket

      public Ticket(ResultSet result)
      Creates a Ticket instance from a SQL result set | Crée une instance Ticket à partir d'un résultat SQL.
      Parameters:
      result - the SQL result set containing ticket data | le résultat SQL contenant les données du ticket
  • Method Details

    • createTicket

      public void createTicket()
      Creates this ticket in the database | Crée ce ticket dans la base de données.
    • SetStatus

      public void SetStatus(String newStatus)
      Sets the status of the ticket if valid | Définit le statut du ticket si valide.
      Parameters:
      newStatus - the new status ("open", "in_progress", "closed") | le nouveau statut ("open", "in_progress", "closed")
    • close

      public void close()
      Closes the ticket and sets the closing timestamp | Ferme le ticket et définit la date de fermeture.
    • getId

      public int getId()
    • getMachine

      public Machine getMachine()
    • getCreator

      public Admin getCreator()
    • getTechnician

      public Technician getTechnician()
    • getTitle

      public String getTitle()
    • getDescription

      public String getDescription()
    • getStatus

      public String getStatus()
    • getOpen_at

      public LocalDateTime getOpen_at()
    • getClosed_at

      public LocalDateTime getClosed_at()
    • updateInDb

      public void updateInDb()
      Updates this ticket in the database | Met à jour ce ticket dans la base de données.