new CoreEntity( e_entity, attributes, options, helpers [, additionalRoutes ] )

Description

Abstract class extended by entity route classes found in /app/routes

CoreEntity methods present in the `registeredRoutes` array and `additionalRoutes` parameter will be provided as route definition to expressjs

Behavior of route methods can be altered by using its hooks from the child class, or by overriding the method

Parameters
Name Type Attributes Description
e_entity string The name of the entity.
attributes object The models attributes of the entity.
options array The models options of the entity.
helpers object Helpers modules found in `/_core/helpers`.
additionalRoutes array <optional>
Additional routes implemented in CoreEntity child class.

Namespaces


list


datalist


subdatalist


show


create_form


create


update_form


update


loadtab


set_status



destroy

Type Definitions


associationObject

Description
An object providing association function and its parameter.
Properties
Name Type Description
func string Sequelize alias function (Ex: setR_user) used to create association in database
value number | Array.<number> Parameter of alias function. Id or array of ids to associate
Examples
const association = {func: 'setR_user', value: [42, 84]};
			await entityInstance[association.func](association.value);
Details
object

fileObject

Description
File object built from multer data in `model_builder.parseBody()`
Properties
Name Type Attributes Description
isPicture boolean If file is for a picture field
isModified boolean True when any modification occur client side. Used to know if a previous version need to be deleted
attribute string Field attribute of the file
finalPath string Secured and formated filepath
buffer buffer <optional>
If there is no buffer, the file as been removed from form data and needs to be deleted on disk
func function <optional>
Function called in `res.success()` with the fileObject as parameter. Default function that write or remove file to/from disk is added in '/create' and '/update' routes. Provide your own to change how file is handled
Details
object