Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

static version
The version is used to keep track of the changes in the version of the calculation rule,
status
integer inactive, future, active, archived
static UUID
UUID to follow the version of the calculation

static

...

CalculationRuleName

short name of the calculation rule

...

<list>JSONObject objects {class:"className", main:True/False , 'parameters':['type':"int",'name':"example",'label':{'en':'DiplayName'},'rights':{'read':"readAuthority", ‘write':"writeAuthority"},relevance:"frontendjsdisplaylogic",condition:"frontendjsvalidationlogic",'optionSet’:[]]} // list of the parameters required on other object,

...

  • This method runs the calculation based on the object sending the signal, this means that the relationship with the other item required for the calculation could be found from the object sending the signal. (e.g., link to the product can be found in the policy as foreign key.)

  • This function should call first the activeForObject method, the context will depend on the calling event, if the fuction return true the calcuation needs to be run, in other case the even handling will stop

  • the calculate(*args) function

  • Signal need to be set up on the ready function to call it

...

Function that fetches the args from the UUID [order specific ?] then run the calculate(instance, *args) function.

calculate(instance, *args)

...

Return the data contained on the JSON so the frontend can ask the parameters for a new object of the ClassName.

for active_calculation_rule

for active_calculation_rule.objects

OR

CalculationRulesDetailsModel.objects.filter(calulation_rule__status='active').filter(calulation_rule__dateValidFrom__lte=now()).filter(Q(calulation_rule__dateValidTo__gte=now())|Q(calulation_rule__dateValidTo__isnull=True)).filter(class_name=ClassName)

return the CalculationRulesDetails json object

Authorities

Calculation (prefix 153)

  • search → 153 001

  • update → 153 003 (to activate or not)

...