package cz.moneta.test.dsl.util.data.hypos;

import cz.moneta.test.dsl.hypos.contractPrepare.data.HyposContractYamlData;
import lombok.Builder;
import lombok.Getter;

@Builder
@Getter
public class Realty {
    private String searchByRealtyType;
    private String registerId;
    private String registerArea;
    private String autosuggestionText;
    private String descriptiveNumber;
    private String registrationNumber;
    private String flatNumber;
    private String realtyType;
    private int realtyPrice;
    private String contractRelation;
    private String collateralCode;
    private String collateralType;
    private String pledgeType;
    private String appraiserCompany;
    private int realtyPriceCurrent;
    @Builder.Default
    private int appraiserOrder = 2;

    /**
     * Creating new realty used for prepare contract data.
     * @return Realty with yaml data.
     */
    public Realty createRealty(HyposContractYamlData hyposContractData) {
        return Realty.builder()
                .searchByRealtyType(hyposContractData.getRealty().getSearchByRealtyType())
                .registerArea(hyposContractData.getRealty().getRegisterArea())
                .autosuggestionText(hyposContractData.getRealty().getAutosuggestionText())
                .descriptiveNumber(hyposContractData.getRealty().getDescriptiveNumber())
                .flatNumber(hyposContractData.getRealty().getFlatNumber())
                .realtyPrice(hyposContractData.getRealty().getRealtyPrice())
                .realtyPriceCurrent(hyposContractData.getRealty().getRealtyPriceCurrent())
                .realtyType(hyposContractData.getRealty().getRealtyType())
                .pledgeType(hyposContractData.getRealty().getPledgeType())
                .contractRelation(hyposContractData.getRealty().getContractRelation())
                .collateralType(hyposContractData.getRealty().getCollateralType())
                .appraiserCompany(hyposContractData.getRealty().getAppraiserCompany())
                .build();
    }
}