package mx.gob.jumapacelaya.models;

/*Esta clase obtiene los detalles de los tickets*/

import java.sql.Date;
import java.time.LocalDate;


public class Ticket {

    private int id;
    private String subject;
    private String description;
    private String status;
    private LocalDate dateCreate;
    private User author;


    public Ticket(int id, String subject, String description, String status, String dateCreate, User author) {
        this.id = id;
        this.subject = subject;
        this.description = description;
        this.status = status;
        this.dateCreate = LocalDate.parse(dateCreate);
        this.author = author;
    }

    public int getId() {
        return id;
    }

    public String getSubject() {
        return subject;
    }

    public String getDescription() {
        return description;
    }

    public String getStatus() {
        return status;
    }

    public User getAuthor() {
        return author;
    }

    public void setAuthor(User author) {
        this.author = author;
    }

    public Date getDateCreate() {
        return java.sql.Date.valueOf(this.dateCreate);
    }


    public static class User {
        private String username;

        public User(String username) {
            this.username = username;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }
    }
}
