package fr.marouse.mapper;

import fr.marouse.dto.AgenceDTO;
import fr.marouse.entity.Agence;

public class AgenceMapper {

    public static AgenceDTO toDTO(Agence entity) {
        if (entity == null) return null;

        AgenceDTO dto = new AgenceDTO();
        dto.setNumAgence(entity.getNumAgence());
        dto.setTelAgence(entity.getTelAgence());
        dto.setAdAgence(entity.getAdAgence());
        return dto;
    }

    public static Agence toEntity(AgenceDTO dto) {
        if (dto == null) return null;

        Agence entity = new Agence();
        entity.setTelAgence(dto.getTelAgence());
        entity.setAdAgence(dto.getAdAgence());
        return entity;
    }
}
