package com.itsol.quantrivanphong.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.itsol.quantrivanphong.audit.DateAudit;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@EntityListeners(AuditingEntityListener.class)
@JsonIgnoreProperties(value = {"createdAt", "updatedAt"},allowGetters = true)
@Table(name = "project_report")
public class ProjectReport extends DateAudit {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false, unique = true)
    private int id;

    @Column(name = "project_name")
    private String projectName;

    @Column(name = "team_leader")
    private String teamLeader;

    @Column(name = "number_of_members")
    private int numberOfMember;

    @Column(name = "calendar_effort")
    private int calendarEffort;

    @Column(name = "lack_of_reports")
    private int lackOfReport;

    @Column(name = "status")
    private boolean status;

    @Column(name = "first_date")
    private String firstDate;

    @Column(name = "final_date")
    private String finalDate;

    //    @JsonIgnore
    @ManyToOne(fetch = FetchType.EAGER)
    private Project project;
}
