package at.procon.dip.domain.time.entity.leitstand;

import at.procon.dip.architecture.SchemaNames;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import java.math.BigDecimal;
import java.time.OffsetDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Entity
@Table(schema = SchemaNames.TIME, name = "ls_person_task_assignment", indexes = {
        @Index(name = "idx_ls_person_task_assignment_upd", columnList = "upd"),
        @Index(name = "idx_ls_person_task_assignment_task_dbk", columnList = "task_dbk"),
        @Index(name = "idx_ls_person_task_assignment_person_dbk", columnList = "person_dbk"),
        @Index(name = "idx_ls_person_task_assignment_cost_unit_dbk", columnList = "cost_unit_dbk")
})
@Getter @Setter @NoArgsConstructor
public class LeitstandPersonTaskAssignment extends AbstractLeitstandDbkEntity {
    @Column(name = "task_dbk", length = 24) private String taskDbk;
    @Column(name = "person_dbk", length = 24) private String personDbk;
    @Column(name = "cost_unit_dbk", length = 24) private String costUnitDbk;
    @Column(name = "rtype", length = 1) private String rtype;
    @Column(name = "last_work") private OffsetDateTime lastWork;
    @Column(name = "effort_plan", precision = 19, scale = 3) private BigDecimal effortPlan;
}
