public async Task <Result <bool> > HandleAsync(ChangePaymentMethodCommand command, User currentUser, CancellationToken cancellationToken = default) { if (command == null) { throw new ArgumentNullException(nameof(command)); } if (currentUser == null) { return(FailureResult <bool> .Unauthorized()); } if (currentUser.Role < Role.SystemAdmin) { return(FailureResult <bool> .Forbidden()); } var paymentMethod = await paymentMethodRepository.FindByPaymentMethodIdAsync(command.PaymentMethodId, cancellationToken); if (paymentMethod == null) { return(FailureResult <bool> .Create(FailureResultCode.PaymentMethodDoesNotExist)); } paymentMethod.Change(command.Name, command.Description); await paymentMethodRepository.StoreAsync(paymentMethod, cancellationToken); return(SuccessResult <bool> .Create(true)); }