venmo/business-rules

Defining a ruleset

prafulbagai opened this issue · 1 comments

I've an API endpoint, /api/create/. This creates a new entry in the DB depending upon the payload received from the client.

Payload - { 
'field1': 'value1`,
'field2': 'value2`,
'field3': 'value3`,
'field4': 'value4`,
'type': 'A'
}

Now depending on the type, I've a specific ruleset/workflow. For eg:- Type A needs to perform certain tasks before saving the data, Type B has its own set of operations.

I don't have any UI, just the requests coming over the POST request. How can I use business-rules for such a use-case?

I am currently evaluating Business Rules for our needs. We have a similar situation to you in that we have an existing API which has a defined interface between our dashboard. An alternative we will likely do is to massage the existing data in the format of the rule dictionary. Is this not possible in your situation?