package de.avatic.taric.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import de.avatic.taric.serializer.*;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.jdbc.core.mapping.AggregateReference;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;
import org.springframework.lang.Nullable;

@Getter
@Setter
@Table("applied_measure_condition")
public class AppliedMeasureCondition {

	@Id
    @JsonIgnore
	private Integer id;

	private Integer sequenceNo;

	private String amount;

	@NotNull
	@Column("measure_action_id")
    @JsonSerialize(using = MeasureActionReferenceSerializer.class)
	private AggregateReference<MeasureAction, Integer> measureAction;

	@Column("monetary_unit_id")
	@Nullable
    @JsonSerialize(using = MonetaryUnitReferenceSerializer.class)
	private AggregateReference<MonetaryUnit, Integer> monetaryUnit;


	@Column("unit_id")
	@Nullable
    @JsonSerialize(using = UnitReferenceSerializer.class)
	private AggregateReference<Unit, Integer> unit;

	@Column("certificate_id")
	@Nullable
    @JsonSerialize(using = CertificateReferenceSerializer.class)
	private AggregateReference<Certificate, Integer> certificate;

	@NotNull
	@Column("condition_type_id")
    @JsonSerialize(using = ConditionTypeReferenceSerializer.class)
	private AggregateReference<ConditionType, Integer> conditionType;



}
