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_task", indexes = {
        @Index(name = "idx_ls_task_upd", columnList = "upd"),
        @Index(name = "idx_ls_task_mcl_id", columnList = "mcl_id"),
        @Index(name = "idx_ls_task_primary_cost_unit_dbk", columnList = "primary_cost_unit_dbk"),
        @Index(name = "idx_ls_task_parent_task_dbk", columnList = "parent_task_dbk")
})
@Getter @Setter @NoArgsConstructor
public class LeitstandTask extends AbstractLeitstandDbkEntity {
    @Column(name = "primary_cost_unit_dbk", length = 24) private String primaryCostUnitDbk;
    @Column(name = "secondary_cost_unit_dbk", length = 24) private String secondaryCostUnitDbk;
    @Column(name = "tertiary_cost_unit_dbk", length = 24) private String tertiaryCostUnitDbk;
    @Column(name = "parent_task_dbk", length = 24) private String parentTaskDbk;
    @Column(name = "lfdnr") private Integer lfdnr;
    @Column(name = "task_type", length = 1) private String taskType;
    @Column(name = "mcl_id", length = 255) private String mclId;
    @Column(name = "mcl_name", length = 255) private String mclName;
    @Column(name = "mcl_desc", length = 8000) private String mclDesc;
    @Column(name = "valid_from") private OffsetDateTime validFrom;
    @Column(name = "valid_to") private OffsetDateTime validTo;
    @Column(name = "effort_plan", precision = 19, scale = 1) private BigDecimal effortPlan;
    @Column(name = "last_work") private OffsetDateTime lastWork;
    @Column(name = "completion_percent") private Integer completionPercent;
    @Column(name = "done_date") private OffsetDateTime doneDate;
    @Column(name = "remark", length = 255) private String remark;
    @Column(name = "n_rid") private Integer nRid;
    @Column(name = "legacy_90702_rid") private Integer legacy90702Rid;
    @Column(name = "amount", precision = 18, scale = 4) private BigDecimal amount;
    @Column(name = "created_source_at") private OffsetDateTime createdSourceAt;
    @Column(name = "legacy_90700_rid") private Integer legacy90700Rid;
    @Column(name = "legacy_90699_rid") private Integer legacy90699Rid;
    @Column(name = "quantity") private Integer quantity;
}
