예제 #1
0
        public async Task <MovementOperationData> HandleAsync(GetReceivedMovements message)
        {
            var movements = await movementRepository.GetAllActiveMovementsForRecovery(message.NotificationId);

            var notificationType = await notificationRepository.GetNotificationType(message.NotificationId);

            var movementsData = movements.Select(m => mapper.Map <MovementData>(m)).ToArray();

            return(new MovementOperationData
            {
                MovementDatas = movementsData,
                NotificationType = notificationType
            });
        }
        public async Task <AddedCancellableMovementValidation> HandleAsync(IsAddedCancellableMovementValid message)
        {
            var movement = await movementRepository.GetByNumberOrDefault(message.ShipmentNumber, message.NotificationId);

            var notificationType = await notificationRepository.GetNotificationType(message.NotificationId);

            var result = new AddedCancellableMovementValidation()
            {
                NotificationType = notificationType
            };

            if (movement != null)
            {
                result.IsCancellableExistingShipment = movement.IsInternallyCancellable;

                result.IsNonCancellableExistingShipment = !movement.IsInternallyCancellable;

                result.Status = movement.Status;
            }

            return(result);
        }
예제 #3
0
 public async Task <NotificationType> HandleAsync(GetNotificationType message)
 {
     return(await repository.GetNotificationType(message.NotificationId));
 }