package de.avatic.lcc.service.calculation.execution.steps;

import de.avatic.lcc.model.db.packaging.PackagingDimension;
import de.avatic.lcc.model.db.packaging.PackagingType;
import de.avatic.lcc.model.db.premises.Premise;
import org.springframework.stereotype.Service;

@Service
public class PremiseToHuService {

    public PackagingDimension createHuFromPremise(Premise premise) {
        var hu = new PackagingDimension();

        hu.setWeight(premise.getIndividualHuWeight());
        hu.setWeightUnit(premise.getHuDisplayedWeightUnit());

        hu.setHeight(premise.getIndividualHuHeight());
        hu.setWidth(premise.getIndividualHuWidth());
        hu.setLength(premise.getIndividualHuLength());
        hu.setDimensionUnit(premise.getHuDisplayedDimensionUnit());

        hu.setContentUnitCount(premise.getHuUnitCount());
        hu.setType(PackagingType.HU);

        return hu;
    }

}
