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

import de.avatic.lcc.dto.generic.CountryDTO;
import de.avatic.lcc.model.db.country.Country;
import org.springframework.stereotype.Service;

@Service
public class CountryTransformer {

    public CountryDTO toCountryDTO(Country entity) {

        CountryDTO dto = new CountryDTO();

        dto.setIsoCode(entity.getIsoCode().getCode());
        dto.setRegionCode(entity.getRegionCode().getCode());
        dto.setName(entity.getName());
        dto.setId(entity.getId());

        return dto;

    }
}
