예제 #1
0
        public void assignCargoToRoute(string trackingIdStr, RouteCandidateDTO routeCandidateDTO)
        {
            var itinerary  = DTOAssembler.fromDTO(routeCandidateDTO, voyageRepository, locationRepository);
            var trackingId = new TrackingId(trackingIdStr);

            bookingService.assignCargoToRoute(itinerary, trackingId);
        }
예제 #2
0
        public IEnumerable <CargoRoutingDTO> listAllCargos()
        {
            var cargoList = cargoRepository.findAll();
            var dtoList   = new List <CargoRoutingDTO>(cargoList.Count());

            foreach (Cargo cargo in cargoList)
            {
                dtoList.Add(DTOAssembler.toDTO(cargo));
            }
            return(dtoList);
        }
예제 #3
0
        public IEnumerable <RouteCandidateDTO> requestPossibleRoutesForCargo(string trackingId)
        {
            var itineraries = bookingService.requestPossibleRoutesForCargo(new TrackingId(trackingId));

            var routeCandidates = new List <RouteCandidateDTO>(itineraries.Count());

            foreach (Itinerary itinerary in itineraries)
            {
                routeCandidates.Add(DTOAssembler.toDTO(itinerary));
            }

            return(routeCandidates);
        }
예제 #4
0
        public CargoRoutingDTO loadCargoForRouting(string trackingId)
        {
            var cargo = bookingService.loadCargoForRouting(new TrackingId(trackingId));

            return(DTOAssembler.toDTO(cargo));
        }
예제 #5
0
        public IEnumerable <LocationDTO> listShippingLocations()
        {
            var allLocations = locationRepository.findAll();

            return(DTOAssembler.toDTOList(allLocations));
        }