Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
        public CargoRoutingDTO loadCargoForRouting(string trackingId)
        {
            var cargo = bookingService.loadCargoForRouting(new TrackingId(trackingId));

            return(DTOAssembler.toDTO(cargo));
        }
Ejemplo n.º 5
0
        public IEnumerable <LocationDTO> listShippingLocations()
        {
            var allLocations = locationRepository.findAll();

            return(DTOAssembler.toDTOList(allLocations));
        }