//
// Copyright © 2023 Nevis Security AG. All rights reserved.
//

import NevisMobileAuthentication

protocol UserInteractionMethodHandler: MethodHandler {
	func execute(using client: MobileAuthenticationClient, method: ReactMethod, with message: ChannelInMessage, operation: any UserInteractionOperation) async
}

extension UserInteractionMethodHandler {
	func execute(using client: MobileAuthenticationClient, method: ReactMethod, with message: ChannelInMessage) async {
		let operation: any UserInteractionOperation = await OperationCache.shared.read(by: message.operationId)
		await execute(using: client, method: method, with: message, operation: operation)
	}
}
