JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
API Documentation Admin Webapp
API Documentation
MEDPULSE DATABASE [DRAFT]
More
Share
Explore
MEDPULSE DATABASE [DRAFT]
VISIT MODEL
id: {
type
: DataTypes
.
INTEGER
,
primaryKey:
true
,
autoIncrement:
true
,
allowNull:
false
,
}
,
datetime
: {
type
: DataTypes
.
DATE
,
allowNull:
false
,
}
,
approval: {
type
: DataTypes
.
ENUM
,
values
:
[
"pending"
,
"approved"
,
"rejected"
,
"visited"
]
,
allowNull:
false
,
defaultValue:
"pending"
,
validate: {
notNull:
true
,
isIn:
[
[
"pending"
,
"approved"
,
"rejected"
,
"visited"
]
]
,
}
,
}
,
reason: {
type
: DataTypes
.
STRING
,
allowNull:
true
,
}
,
issue: {
type
: DataTypes
.
TEXT
(
"medium"
)
,
allowNull:
true
,
}
,
description: {
type
: DataTypes
.
TEXT
(
"medium"
)
,
allowNull:
true
,
}
,
// Foreign Keys
VisitModal
.
belongsTo
(
AssigneModel
,
{
foreignKey: { name:
"assigne"
,
allowNull:
false
}
,
as
:
'employee'
,
targetKey:
"id"
,
}
)
;
VisitModal
.
belongsTo
(
ContactModal
,
{
foreignKey: { name:
"to"
,
allowNull:
true
}
,
as
:
'contact'
,
targetKey:
"id"
,
}
)
;
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.