Search in sources :

Example 1 with VesselStorageCharacteristicsEntity

use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class VesselStorageCharacteristicsMapperTest method testSourceVesselStorageCharacteristicsMapper.

@Test
public void testSourceVesselStorageCharacteristicsMapper() {
    VesselStorageCharacteristic vesselStorageCharacteristic = MapperUtil.getVesselStorageCharacteristic();
    VesselStorageCharacteristicsEntity vesselStorageCharacteristicsEntity = VesselStorageCharacteristicsMapper.INSTANCE.mapToDestVesselStorageCharEntity(vesselStorageCharacteristic);
    assertEquals(vesselStorageCharacteristic.getID().getValue(), vesselStorageCharacteristicsEntity.getVesselId());
    assertEquals(vesselStorageCharacteristic.getID().getSchemeID(), vesselStorageCharacteristicsEntity.getVesselSchemaId());
    assertEquals(vesselStorageCharacteristic.getTypeCodes().get(0).getValue(), vesselStorageCharacteristicsEntity.getVesselStorageCharCode().iterator().next().getVesselTypeCode());
    assertEquals(vesselStorageCharacteristic.getTypeCodes().get(0).getListID(), vesselStorageCharacteristicsEntity.getVesselStorageCharCode().iterator().next().getVesselTypeCodeListId());
    assertNull(vesselStorageCharacteristicsEntity.getFishingActivitiesForSourceVesselCharId());
}
Also used : VesselStorageCharacteristicsEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity) VesselStorageCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic) Test(org.junit.Test)

Example 2 with VesselStorageCharacteristicsEntity

use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class VesselStorageCharacteristicsMapperTest method testDestVesselStorageCharacteristicsMapper.

@Test
public void testDestVesselStorageCharacteristicsMapper() {
    VesselStorageCharacteristic model = MapperUtil.getVesselStorageCharacteristic();
    VesselStorageCharacteristicsEntity vesselStorageCharacteristicsEntity = VesselStorageCharacteristicsMapper.INSTANCE.mapToDestVesselStorageCharEntity(model);
    assertEquals(model.getID().getValue(), vesselStorageCharacteristicsEntity.getVesselId());
    assertEquals(model.getID().getSchemeID(), vesselStorageCharacteristicsEntity.getVesselSchemaId());
    assertEquals(model.getTypeCodes().get(0).getValue(), vesselStorageCharacteristicsEntity.getVesselStorageCharCode().iterator().next().getVesselTypeCode());
    assertEquals(model.getTypeCodes().get(0).getListID(), vesselStorageCharacteristicsEntity.getVesselStorageCharCode().iterator().next().getVesselTypeCodeListId());
    assertNull(vesselStorageCharacteristicsEntity.getFishingActivitiesForDestVesselCharId());
}
Also used : VesselStorageCharacteristicsEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity) VesselStorageCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic) Test(org.junit.Test)

Example 3 with VesselStorageCharacteristicsEntity

use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class FishingTripServiceBean method getVesselDetailsDTO.

@Nullable
private VesselDetailsDTO getVesselDetailsDTO(VesselTransportMeansEntity vesselTransportMeansEntity, FishingActivityEntity fishingActivityEntity) {
    VesselDetailsDTO detailsDTO;
    detailsDTO = VesselTransportMeansMapper.INSTANCE.map(vesselTransportMeansEntity);
    getMdrCodesEnrichWithAssetsModuleDataIfNeeded(detailsDTO);
    if (fishingActivityEntity != null) {
        VesselStorageCharacteristicsEntity sourceVesselCharId = fishingActivityEntity.getSourceVesselCharId();
        if (detailsDTO != null) {
            detailsDTO.setStorageDto(VesselStorageCharacteristicsMapper.INSTANCE.mapToStorageDto(sourceVesselCharId));
        }
    }
    return detailsDTO;
}
Also used : VesselStorageCharacteristicsEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity) VesselDetailsDTO(eu.europa.ec.fisheries.ers.service.dto.fareport.details.VesselDetailsDTO) Nullable(org.jetbrains.annotations.Nullable)

Example 4 with VesselStorageCharacteristicsEntity

use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class FishingActivityMapper method getDestVesselStorageCharacteristics.

protected VesselStorageCharacteristicsEntity getDestVesselStorageCharacteristics(VesselStorageCharacteristic destVesselStorageChar, FishingActivityEntity fishingActivityEntity) {
    if (destVesselStorageChar == null) {
        return null;
    }
    VesselStorageCharacteristicsEntity vesselStorageCharacteristicsEntity = VesselStorageCharacteristicsMapper.INSTANCE.mapToDestVesselStorageCharEntity(destVesselStorageChar);
    vesselStorageCharacteristicsEntity.setFishingActivitiesForDestVesselCharId(fishingActivityEntity);
    return vesselStorageCharacteristicsEntity;
}
Also used : VesselStorageCharacteristicsEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity)

Example 5 with VesselStorageCharacteristicsEntity

use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class FishingActivityMapper method getSourceVesselStorageCharacteristics.

protected VesselStorageCharacteristicsEntity getSourceVesselStorageCharacteristics(VesselStorageCharacteristic sourceVesselStorageChar, FishingActivityEntity fishingActivityEntity) {
    if (sourceVesselStorageChar == null) {
        return null;
    }
    VesselStorageCharacteristicsEntity vesselStorageCharacteristicsEntity = VesselStorageCharacteristicsMapper.INSTANCE.mapToDestVesselStorageCharEntity(sourceVesselStorageChar);
    vesselStorageCharacteristicsEntity.setFishingActivitiesForSourceVesselCharId(fishingActivityEntity);
    return vesselStorageCharacteristicsEntity;
}
Also used : VesselStorageCharacteristicsEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity)

Aggregations

VesselStorageCharacteristicsEntity (eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity)5 Test (org.junit.Test)2 VesselStorageCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic)2 VesselDetailsDTO (eu.europa.ec.fisheries.ers.service.dto.fareport.details.VesselDetailsDTO)1 Nullable (org.jetbrains.annotations.Nullable)1