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_cost_unit", indexes = {
        @Index(name = "idx_ls_cost_unit_upd", columnList = "upd"),
        @Index(name = "idx_ls_cost_unit_mcl_id", columnList = "mcl_id"),
        @Index(name = "idx_ls_cost_unit_person_dbk", columnList = "person_dbk"),
        @Index(name = "idx_ls_cost_unit_org_dbk", columnList = "organization_dbk"),
        @Index(name = "idx_ls_cost_unit_contract_dbk", columnList = "contract_dbk"),
        @Index(name = "idx_ls_cost_unit_contract_position_dbk", columnList = "contract_position_dbk")
})
@Getter @Setter @NoArgsConstructor
public class LeitstandCostUnit extends AbstractLeitstandDbkEntity {
    @Column(name = "person_dbk", length = 24) private String personDbk;
    @Column(name = "organization_dbk", length = 24) private String organizationDbk;
    @Column(name = "contract_dbk", length = 24) private String contractDbk;
    @Column(name = "legacy_relation_4_dbk", length = 24) private String legacyRelation4Dbk;
    @Column(name = "legacy_relation_5_dbk", length = 24) private String legacyRelation5Dbk;
    @Column(name = "contract_position_dbk", length = 24) private String contractPositionDbk;
    @Column(name = "project_name", length = 255) private String projectName;
    @Column(name = "project_id") private Integer projectId;
    @Column(name = "project_task") private Integer projectTask;
    @Column(name = "mcl_id", length = 255) private String mclId;
    @Column(name = "mcl_name", length = 255) private String mclName;
    @Column(name = "mcl_desc", length = 255) private String mclDesc;
    @Column(name = "valid_from") private OffsetDateTime validFrom;
    @Column(name = "valid_to") private OffsetDateTime validTo;
    @Column(name = "effort_plan", precision = 19, scale = 3) private BigDecimal effortPlan;
}
