Traits
Traits are way to group together common features that entities should have, like common fields with validations. Developers apply traits to entities with the inherits
function.
Here is a trait that is built into Data API block, which can be used for any entity. It is defined in the namespace of kisai
and it can be accessed as kisai.id
Trait Definition
Entity inheriting the trait
The person entity will have an additional field id along with firstname, middlename, lastname and address
Default traits
All entities created on the kis.ai platform have the below fields, injected. into them through the traits kisai.common
and kisai.softdelete
, as they have the attribute applytoall
set to true
.
Trait | Field | Description |
---|---|---|
kisai.common | createdby | this will have the id of the user creating the current row of the entity |
kisai.common | createdon | this will have the timestamp when the user created the current row of the entity |
kisai.common | updatedby | this will have the id of the user updating the current row of the entity |
kisai.common | updatedon | this will have the timestamp when the user updated the current row of the entity |
kisai.softdelete | deletedby | this will have the id of the user soft deleted the current row of the entity |
kisai.softdelete | deletedon | this will have the timestamp when the user soft deleted the current row of the entity |
YAML Definition of common traits