Renovus-Tech / solarec-java

GNU Affero General Public License v3.0
0 stars 1 forks source link

Customization of interaction flows #53

Closed pferrariuy closed 1 month ago

pferrariuy commented 3 months ago

Description

The idea is to enable custom flows of the interactions beteween the front and backend in different parts of the system. By default, the solution will execute a standar flow, allowing in different parts the possibility to call a service, that will determinate if the flow must continue or must be stoped and send a response to the frontend.

Expected Behavior

By default the flow wil lbe as defined, but depending on certain events (after login, after logout, etc.) a method will be code (like an API) with different information and can return updated information that will determinate if the flow must continue or the result must be send to the frontend.

Additional Context

These will allow to customize the solution without the need of changing code of the Renovus solution; allowing other solutions to add customized code in the current flow.

Implementation Suggestions

pferrariuy commented 3 months ago

Created property solarec.service.custom_flow, if empty then tech.renovus.solarec.business.impl.DefaultCustomFlow will be use.

In order to use a custom flow code, the property must set a value and the implementation must add the @ConditionalOnProperty(name = "solarec.service.custom_flow", havingValue = "xxxxx").

The tech.renovus.solarec.business.CustomFlowInterface allows the following customizations:

Added to UserDataproperty authenticationErrorMessageto allow custom error messages.