The Method
model is a container of conditions (triggers) and actions.
- A
Method
has multipleCondition
- Each
Condition
has multipleAction
We can have different types of Condition
, for instance:
- Order amount between
0
and500
USD - Order weight between
10
and100
pounds
And we can have different types of Action
, for instance:
- Call supervisor ID
5
- Send email to
[email protected]
We are creating a table for each type of condition
and a table for each type of action
. That way we don't end up with a table full of columns to encompass each possible scenario.
The problem is: how to create this Polymorphic Relationship?
Starting with Conditions
…
My database looks like: