SetPropertyValueParams
The setPropertyValueParams section allows you to set the default values for the entity properties.
An example of use is when you have fields in your entity that aren't informed in the request, but have default values to be included in the database, for example, Status field.
Fields
A setPropertyValueParam contains the following fields to be defined:
PropertyName
The name of entity property to which rule will be applied.
Requirements Rules:
- Is Required;
- The name must exist in the Properties list for the rule entity;
- The referred property type must not be a array or an entity relationship
Example:
1 2 |
|
Expression
The value that must be assigned to the property as default value. This value must be reported as an expression. For more details, see Expression section.
Requirements Rules:
- Is Required;
- The expression must be valid. See Expression section to learn more about the rules for each expression type
Example:
1 2 3 |
|
ReplacementType
Defines the assignment value type that will be used.
Possible types are:
- Always: The value will always be assigned to the property, even if a value was informed in the request;
- IfIsEmpty: The value will only be assigned to the property if a value doesn't informed in the request
Requirements Rules:
- Is Required;
- Must be an Allowed valid type, according to the types informed above
Example:
1 2 3 4 |
|