public async Task <RegistrationResponse> Handle(AddRegistrationCommand request, CancellationToken cancellationToken)
        {
            var registeredVehicle = await _registrationService.Get(request.VehicleDeviceId);

            if (registeredVehicle != null)
            {
                _logger.LogWarning($"VehicleDeviceId: {registeredVehicle.VehicleDeviceId} already registered!");
                return(new RegistrationResponse(registeredVehicle.VehicleDeviceId, registeredVehicle.RegistrationId));
            }

            var registrationInfo = request.GetRegistrationInfo(request);
            await _registrationService.AddRegistrationAsync(registrationInfo);

            if (registrationInfo.Id != null)
            {
                _logger.LogInformation(
                    $"VehicleDeviceId: {registrationInfo.VehicleDeviceId} has been registered with RegistrationId: {registrationInfo.RegistrationId}.");

                await CreateTrackingHistoryPlaceholder(registrationInfo.RegistrationId, registrationInfo.VehicleDeviceId);

                return(new RegistrationResponse(registrationInfo.VehicleDeviceId, registrationInfo.RegistrationId));
            }

            _logger.LogError($"For VehicleDeviceId: {registrationInfo.VehicleDeviceId} registration has failed!");
            return(null);
        }
 public async Task <bool> AddRegistrationAsync(RegistrationRequest model)
 {
     return(await _registrationService.AddRegistrationAsync(model));
 }