I have built a class that calls a system external to Salesforce for checking customer's data. The service is an electronic VAT check provided by the state in the form of a very simple API.
I want to be able to call that class both via Javascript remoting (using @remoteAction annotation), from a Lightning Component (using @auraneabled annotation) and from a Flow (using @invocableMethod annotation).
The use cases are: call the eVAT service both from the client side (when the customer first inputs its data on registration), and from the back-end side (when a financial manager wants to check that VAT data is correct for existing customers)
Am I forced to design a class with two almost identical methods (one with @remote and one with @invocable) or are there better strategies / workarounds?
Thanks in advance for the answer coming from your hive brain, fellow SF folks.