package com.ikon.projectmanagement.entity;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Table(name = "project_schedule_task")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ProjectScheduleTask {

    @Id
    @Column(name = "id")
    private Long id;

    @Column(name = "parent_id")
    private Long parentId;

    @Column(name = "task_name")
    private String taskName;

    @Column(name = "task_duration")
    private Double taskDuration;

    @Column(name = "task_predecessor")
    private String taskPredecessor;

    @Column(name = "dependency_type")
    private Integer dependencyType;

    @Column(name = "task_colour")
    private String taskColour;

    @Column(name = "delay_duration")
    private Double delayDuration;

    @Column(name = "task_description", columnDefinition = "TEXT")
    private String taskDescription;

    @Column(name = "task_start")
    private String taskStart;

    @Column(name = "task_end")
    private String taskEnd;

    @Column(name = "milestone_task")
    private Boolean milestoneTask;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "schedule_identifier", nullable = false)
    private ProjectSchedule schedule;
}
