Class: Attribute
Defined in: server/src/utils/stack/attribute.ts:4
Extends
Attribute
Constructors
Constructor
new Attribute(
classObj,
name,
type,
config?): Attribute;
Defined in: server/src/utils/stack/attribute.ts:10
Parameters
| Parameter | Type | Default value |
|---|---|---|
classObj | Class | null |
name | string | undefined |
type | | "string" | "boolean" | "object" | "integer" | "date" | "decimal" | "foreign_key" | "enum" | "reference" | undefined |
config? | | AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | undefined |
Returns
Attribute
Overrides
Attribute_.constructor
Properties
| Property | Modifier | Type | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
class | public | Class | Attribute_.class | - | server/src/utils/stack/attribute.ts:7 |
defaultValue? | public | any | Attribute_.defaultValue | - | server/src/utils/stack/attribute.ts:8 |
description? | abstract | string | - | Attribute_.description | shared/src/utils/stack/attribute/index.ts:7 |
ensureReferenceConfigIsValid | abstract | () => Promise<void> | - | Attribute_.ensureReferenceConfigIsValid | shared/src/utils/stack/attribute/index.ts:54 |
field | abstract | ZodType | - | Attribute_.field | shared/src/utils/stack/attribute/index.ts:9 |
getEmpty | abstract | () => object | - | Attribute_.getEmpty | shared/src/utils/stack/attribute/index.ts:31 |
isMandatory | abstract | () => boolean | - | Attribute_.isMandatory | shared/src/utils/stack/attribute/index.ts:27 |
model | public | AttributeModel | Attribute_.model | - | server/src/utils/stack/attribute.ts:6 |
name | public | string | Attribute_.name | - | server/src/utils/stack/attribute.ts:5 |
setField | abstract | () => void | - | Attribute_.setField | shared/src/utils/stack/attribute/index.ts:33 |
validate | abstract | (data) => Promise<ZodSafeParseResult<any>> | - | Attribute_.validate | shared/src/utils/stack/attribute/index.ts:35 |
Methods
checkTypeValidity()
checkTypeValidity(type): boolean;
Defined in: server/src/utils/stack/attribute.ts:82
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Overrides
Attribute_.checkTypeValidity
getClass()
getClass(): Class;
Defined in: server/src/utils/stack/attribute.ts:45
Returns
Overrides
Attribute_.getClass
getModel()
getModel(): AttributeModel;
Defined in: server/src/utils/stack/attribute.ts:41
Returns
AttributeModel
Overrides
Attribute_.getModel
getName()
getName(): string;
Defined in: server/src/utils/stack/attribute.ts:78
Returns
string
Overrides
Attribute_.getName
getType()
getType(type):
| "string"
| "boolean"
| "object"
| "integer"
| "date"
| "decimal"
| "foreign_key"
| "enum"
| "reference";
Defined in: server/src/utils/stack/attribute.ts:69
Parameters
| Parameter | Type |
|---|---|
type | | "string" | "boolean" | "object" | "integer" | "date" | "decimal" | "foreign_key" | "enum" | "reference" |
Returns
| "string"
| "boolean"
| "object"
| "integer"
| "date"
| "decimal"
| "foreign_key"
| "enum"
| "reference"
Overrides
Attribute_.getType
getTypeConf()
getTypeConf(type, config):
| AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig;
Defined in: server/src/utils/stack/attribute.ts:95
Parameters
| Parameter | Type |
|---|---|
type | | "string" | "boolean" | "object" | "integer" | "date" | "decimal" | "foreign_key" | "enum" | "reference" |
config | | AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig |
Returns
| AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig
| object & AttributeTypeConfig
Overrides
Attribute_.getTypeConf
isPrimaryKey()
isPrimaryKey(): boolean;
Defined in: server/src/utils/stack/attribute.ts:36
Returns
boolean
Overrides
Attribute_.isPrimaryKey
setModel()
setModel(model): void;
Defined in: server/src/utils/stack/attribute.ts:61
Parameters
| Parameter | Type |
|---|---|
model | AttributeModel |
Returns
void
Overrides
Attribute_.setModel
build()
static build(attributeObj): Promise<Attribute>;
Defined in: server/src/utils/stack/attribute.ts:50
Parameters
| Parameter | Type |
|---|---|
attributeObj | Attribute |
Returns
Promise<Attribute>
Overrides
Attribute_.build
create()
static create(
classObj,
name,
type,
config?): Promise<Attribute>;
Defined in: server/src/utils/stack/attribute.ts:25
Parameters
| Parameter | Type |
|---|---|
classObj | Class |
name | string |
type | | "string" | "boolean" | "object" | "integer" | "date" | "decimal" | "foreign_key" | "enum" | "reference" |
config? | | AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig | object & AttributeTypeConfig |
Returns
Promise<Attribute>
Overrides
Attribute_.create