package de.avatic.lcc.service.transformer.rates;

import de.avatic.lcc.dto.generic.ValidityPeriodDTO;
import de.avatic.lcc.model.db.properties.PropertySet;
import de.avatic.lcc.model.db.rates.ValidityPeriod;
import org.springframework.stereotype.Service;

@Service
public class ValidityPeriodTransformer {

    public ValidityPeriodDTO toValidityPeriodDTO(ValidityPeriod entity) {
        ValidityPeriodDTO dto = new ValidityPeriodDTO();

        dto.setId(entity.getId());
        dto.setEndDate(entity.getEndDate());
        dto.setStartDate(entity.getStartDate());
        dto.setState(entity.getState());

        return dto;
    }


    public ValidityPeriodDTO toValidityPeriodDTO(PropertySet entity) {
        ValidityPeriodDTO dto = new ValidityPeriodDTO();

        dto.setId(entity.getId());
        dto.setEndDate(entity.getEndDate());
        dto.setStartDate(entity.getStartDate());
        dto.setState(entity.getState());

        return dto;
    }

}
