@itleanchatbot/shared-models-js-postgres 1.1.36 → 1.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -18
- package/index.js +94 -94
- package/package.json +41 -41
- package/src/apiAuthentications.js +56 -56
- package/src/apiResourceBodies.js +41 -41
- package/src/apiResourceHeaders.js +29 -29
- package/src/apiResourcePathParams.js +28 -28
- package/src/apiResourceQueryStringParams.js +36 -36
- package/src/apiResources.js +73 -73
- package/src/apis.js +67 -67
- package/src/attendances.js +70 -70
- package/src/branches.js +43 -43
- package/src/channelConfigurations.js +41 -41
- package/src/channelTypes.js +27 -26
- package/src/channels.js +54 -54
- package/src/client.js +23 -23
- package/src/comments.js +27 -27
- package/src/departments.js +35 -35
- package/src/dialogNodes.js +142 -142
- package/src/dialogNodes_MultipleResponses.js +38 -38
- package/src/dialogNodes_apiResources.js +40 -40
- package/src/enterprises.js +29 -29
- package/src/entity.js +34 -34
- package/src/entityValues.js +63 -63
- package/src/files.js +35 -35
- package/src/ibmProvider.js +62 -62
- package/src/intelligence.js +45 -45
- package/src/intention.js +36 -36
- package/src/intentionValue.js +31 -31
- package/src/itleanProvider.js +33 -33
- package/src/lineConfigurations.js +60 -60
- package/src/lines.js +48 -48
- package/src/permissions.js +27 -27
- package/src/profile.js +23 -23
- package/src/profiles_permission.js +25 -25
- package/src/quickMessages.js +34 -34
- package/src/response_DialogNodes.js +31 -31
- package/src/responses.js +54 -54
- package/src/responsesBoxes.js +65 -60
- package/src/sessions.js +56 -56
- package/src/skill.js +112 -112
- package/src/skill_apiResources.js +31 -31
- package/src/socketClients.js +56 -56
- package/src/subDepartments.js +35 -35
- package/src/synonyms.js +66 -66
- package/src/systemUsers.js +50 -50
- package/src/systemUsers_Lines.js +25 -25
- package/src/systemUsers_profiles.js +25 -25
- package/src/transhipConversations.js +50 -50
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
exports.ApiResourcesQueryStringParamsModel = (sequelize, Sequelize) => {
|
|
2
|
-
const ApiResourcesQueryStringParams = sequelize.define(
|
|
3
|
-
'ApiResourcesQueryStringParams',
|
|
4
|
-
{
|
|
5
|
-
ApiResourceId: {
|
|
6
|
-
type: Sequelize.UUID,
|
|
7
|
-
allowNull: false,
|
|
8
|
-
references: {
|
|
9
|
-
model: 'ApiResources',
|
|
10
|
-
key: 'id',
|
|
11
|
-
},
|
|
12
|
-
onDelete: 'RESTRICT',
|
|
13
|
-
onUpdate: 'CASCADE',
|
|
14
|
-
},
|
|
15
|
-
key: {
|
|
16
|
-
type: Sequelize.STRING,
|
|
17
|
-
allowNull: false,
|
|
18
|
-
},
|
|
19
|
-
value: {
|
|
20
|
-
type: Sequelize.STRING,
|
|
21
|
-
allowNull: false,
|
|
22
|
-
},
|
|
23
|
-
type: {
|
|
24
|
-
type: Sequelize.STRING(40),
|
|
25
|
-
allowNull: false,
|
|
26
|
-
defaultValue: 'string',
|
|
27
|
-
},
|
|
28
|
-
}
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
ApiResourcesQueryStringParams.associate = (models) => {
|
|
32
|
-
ApiResourcesQueryStringParams.belongsTo(models.ApiResources)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return ApiResourcesQueryStringParams
|
|
36
|
-
}
|
|
1
|
+
exports.ApiResourcesQueryStringParamsModel = (sequelize, Sequelize) => {
|
|
2
|
+
const ApiResourcesQueryStringParams = sequelize.define(
|
|
3
|
+
'ApiResourcesQueryStringParams',
|
|
4
|
+
{
|
|
5
|
+
ApiResourceId: {
|
|
6
|
+
type: Sequelize.UUID,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
references: {
|
|
9
|
+
model: 'ApiResources',
|
|
10
|
+
key: 'id',
|
|
11
|
+
},
|
|
12
|
+
onDelete: 'RESTRICT',
|
|
13
|
+
onUpdate: 'CASCADE',
|
|
14
|
+
},
|
|
15
|
+
key: {
|
|
16
|
+
type: Sequelize.STRING,
|
|
17
|
+
allowNull: false,
|
|
18
|
+
},
|
|
19
|
+
value: {
|
|
20
|
+
type: Sequelize.STRING,
|
|
21
|
+
allowNull: false,
|
|
22
|
+
},
|
|
23
|
+
type: {
|
|
24
|
+
type: Sequelize.STRING(40),
|
|
25
|
+
allowNull: false,
|
|
26
|
+
defaultValue: 'string',
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
ApiResourcesQueryStringParams.associate = (models) => {
|
|
32
|
+
ApiResourcesQueryStringParams.belongsTo(models.ApiResources)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return ApiResourcesQueryStringParams
|
|
36
|
+
}
|
|
37
37
|
|
package/src/apiResources.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
const HTTP_METHODS = [
|
|
2
|
-
'PUT',
|
|
3
|
-
'GET',
|
|
4
|
-
'DELETE',
|
|
5
|
-
'POST',
|
|
6
|
-
'COPY',
|
|
7
|
-
'OPTIONS',
|
|
8
|
-
'PATCH',
|
|
9
|
-
'PURGE',
|
|
10
|
-
'LINK',
|
|
11
|
-
'UNLINK',
|
|
12
|
-
'LOCK',
|
|
13
|
-
'UNLOCK',
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
const ApiResourcesModel = (sequelize, Sequelize) => {
|
|
17
|
-
const ApiResources = sequelize.define('ApiResources', {
|
|
18
|
-
ApiId: {
|
|
19
|
-
type: Sequelize.UUID,
|
|
20
|
-
allowNull: false,
|
|
21
|
-
references: {
|
|
22
|
-
model: 'Apis',
|
|
23
|
-
key: 'id',
|
|
24
|
-
},
|
|
25
|
-
onDelete: 'RESTRICT',
|
|
26
|
-
onUpdate: 'CASCADE',
|
|
27
|
-
},
|
|
28
|
-
ApiResourcesBodyId: {
|
|
29
|
-
type: Sequelize.UUID,
|
|
30
|
-
allowNull: true,
|
|
31
|
-
references: {
|
|
32
|
-
model: 'ApiResourcesBodies',
|
|
33
|
-
key: 'id',
|
|
34
|
-
},
|
|
35
|
-
onDelete: 'RESTRICT',
|
|
36
|
-
onUpdate: 'CASCADE',
|
|
37
|
-
},
|
|
38
|
-
uri: {
|
|
39
|
-
type: Sequelize.STRING,
|
|
40
|
-
allowNull: false,
|
|
41
|
-
},
|
|
42
|
-
method: {
|
|
43
|
-
type: Sequelize.ENUM({
|
|
44
|
-
values: HTTP_METHODS,
|
|
45
|
-
}),
|
|
46
|
-
allowNull: true,
|
|
47
|
-
},
|
|
48
|
-
name: {
|
|
49
|
-
type: Sequelize.STRING,
|
|
50
|
-
allowNull: true,
|
|
51
|
-
},
|
|
52
|
-
description: {
|
|
53
|
-
type: Sequelize.STRING,
|
|
54
|
-
allowNull: true,
|
|
55
|
-
},
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
ApiResources.associate = (models) => {
|
|
59
|
-
ApiResources.belongsTo(models.Apis)
|
|
60
|
-
ApiResources.belongsTo(models.ApiResourcesBodies)
|
|
61
|
-
ApiResources.hasMany(models.ApiResourcesHeaders)
|
|
62
|
-
ApiResources.hasMany(models.ApiResourcesQueryStringParams)
|
|
63
|
-
ApiResources.hasMany(models.ApiResourcesPathParams)
|
|
64
|
-
ApiResources.hasMany(models.Skill_ApiResources)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return ApiResources
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
module.exports = {
|
|
72
|
-
ApiResourcesModel,
|
|
73
|
-
HTTP_METHODS
|
|
1
|
+
const HTTP_METHODS = [
|
|
2
|
+
'PUT',
|
|
3
|
+
'GET',
|
|
4
|
+
'DELETE',
|
|
5
|
+
'POST',
|
|
6
|
+
'COPY',
|
|
7
|
+
'OPTIONS',
|
|
8
|
+
'PATCH',
|
|
9
|
+
'PURGE',
|
|
10
|
+
'LINK',
|
|
11
|
+
'UNLINK',
|
|
12
|
+
'LOCK',
|
|
13
|
+
'UNLOCK',
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
const ApiResourcesModel = (sequelize, Sequelize) => {
|
|
17
|
+
const ApiResources = sequelize.define('ApiResources', {
|
|
18
|
+
ApiId: {
|
|
19
|
+
type: Sequelize.UUID,
|
|
20
|
+
allowNull: false,
|
|
21
|
+
references: {
|
|
22
|
+
model: 'Apis',
|
|
23
|
+
key: 'id',
|
|
24
|
+
},
|
|
25
|
+
onDelete: 'RESTRICT',
|
|
26
|
+
onUpdate: 'CASCADE',
|
|
27
|
+
},
|
|
28
|
+
ApiResourcesBodyId: {
|
|
29
|
+
type: Sequelize.UUID,
|
|
30
|
+
allowNull: true,
|
|
31
|
+
references: {
|
|
32
|
+
model: 'ApiResourcesBodies',
|
|
33
|
+
key: 'id',
|
|
34
|
+
},
|
|
35
|
+
onDelete: 'RESTRICT',
|
|
36
|
+
onUpdate: 'CASCADE',
|
|
37
|
+
},
|
|
38
|
+
uri: {
|
|
39
|
+
type: Sequelize.STRING,
|
|
40
|
+
allowNull: false,
|
|
41
|
+
},
|
|
42
|
+
method: {
|
|
43
|
+
type: Sequelize.ENUM({
|
|
44
|
+
values: HTTP_METHODS,
|
|
45
|
+
}),
|
|
46
|
+
allowNull: true,
|
|
47
|
+
},
|
|
48
|
+
name: {
|
|
49
|
+
type: Sequelize.STRING,
|
|
50
|
+
allowNull: true,
|
|
51
|
+
},
|
|
52
|
+
description: {
|
|
53
|
+
type: Sequelize.STRING,
|
|
54
|
+
allowNull: true,
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
ApiResources.associate = (models) => {
|
|
59
|
+
ApiResources.belongsTo(models.Apis)
|
|
60
|
+
ApiResources.belongsTo(models.ApiResourcesBodies)
|
|
61
|
+
ApiResources.hasMany(models.ApiResourcesHeaders)
|
|
62
|
+
ApiResources.hasMany(models.ApiResourcesQueryStringParams)
|
|
63
|
+
ApiResources.hasMany(models.ApiResourcesPathParams)
|
|
64
|
+
ApiResources.hasMany(models.Skill_ApiResources)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return ApiResources
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
module.exports = {
|
|
72
|
+
ApiResourcesModel,
|
|
73
|
+
HTTP_METHODS
|
|
74
74
|
}
|
package/src/apis.js
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
const API_INTEGRATION_TYPES = {
|
|
2
|
-
JSON: 'json',
|
|
3
|
-
XML: 'xml',
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
const API_INTEGRATION_TYPE = [
|
|
7
|
-
API_INTEGRATION_TYPES.JSON,
|
|
8
|
-
API_INTEGRATION_TYPES.XML,
|
|
9
|
-
]
|
|
10
|
-
|
|
11
|
-
const ApisModel = (sequelize, Sequelize) => {
|
|
12
|
-
const Api = sequelize.define('Apis', {
|
|
13
|
-
baseUrl: {
|
|
14
|
-
type: Sequelize.STRING,
|
|
15
|
-
allowNull: false,
|
|
16
|
-
},
|
|
17
|
-
type: {
|
|
18
|
-
type: Sequelize.ENUM({
|
|
19
|
-
values: API_INTEGRATION_TYPE,
|
|
20
|
-
}),
|
|
21
|
-
defaultValue: API_INTEGRATION_TYPES.JSON,
|
|
22
|
-
allowNull: false,
|
|
23
|
-
},
|
|
24
|
-
name: {
|
|
25
|
-
type: Sequelize.STRING,
|
|
26
|
-
allowNull: true,
|
|
27
|
-
},
|
|
28
|
-
description: {
|
|
29
|
-
type: Sequelize.STRING,
|
|
30
|
-
allowNull: true,
|
|
31
|
-
},
|
|
32
|
-
ApiAuthenticationId: {
|
|
33
|
-
type: Sequelize.UUID,
|
|
34
|
-
defaultValue: null,
|
|
35
|
-
allowNull: true,
|
|
36
|
-
references: {
|
|
37
|
-
model: 'ApiAuthentications',
|
|
38
|
-
key: 'id',
|
|
39
|
-
},
|
|
40
|
-
onDelete: 'RESTRICT',
|
|
41
|
-
onUpdate: 'CASCADE',
|
|
42
|
-
},
|
|
43
|
-
EnterpriseId: {
|
|
44
|
-
type: Sequelize.UUID,
|
|
45
|
-
allowNull: true,
|
|
46
|
-
references: {
|
|
47
|
-
model: 'Enterprises',
|
|
48
|
-
key: 'id',
|
|
49
|
-
},
|
|
50
|
-
onDelete: 'RESTRICT',
|
|
51
|
-
onUpdate: 'CASCADE',
|
|
52
|
-
},
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
Api.associate = (models) => {
|
|
56
|
-
Api.hasMany(models.ApiResources)
|
|
57
|
-
Api.belongsTo(models.ApiAuthentications)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return Api
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
module.exports = {
|
|
65
|
-
ApisModel,
|
|
66
|
-
API_INTEGRATION_TYPE,
|
|
67
|
-
API_INTEGRATION_TYPES
|
|
1
|
+
const API_INTEGRATION_TYPES = {
|
|
2
|
+
JSON: 'json',
|
|
3
|
+
XML: 'xml',
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const API_INTEGRATION_TYPE = [
|
|
7
|
+
API_INTEGRATION_TYPES.JSON,
|
|
8
|
+
API_INTEGRATION_TYPES.XML,
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
const ApisModel = (sequelize, Sequelize) => {
|
|
12
|
+
const Api = sequelize.define('Apis', {
|
|
13
|
+
baseUrl: {
|
|
14
|
+
type: Sequelize.STRING,
|
|
15
|
+
allowNull: false,
|
|
16
|
+
},
|
|
17
|
+
type: {
|
|
18
|
+
type: Sequelize.ENUM({
|
|
19
|
+
values: API_INTEGRATION_TYPE,
|
|
20
|
+
}),
|
|
21
|
+
defaultValue: API_INTEGRATION_TYPES.JSON,
|
|
22
|
+
allowNull: false,
|
|
23
|
+
},
|
|
24
|
+
name: {
|
|
25
|
+
type: Sequelize.STRING,
|
|
26
|
+
allowNull: true,
|
|
27
|
+
},
|
|
28
|
+
description: {
|
|
29
|
+
type: Sequelize.STRING,
|
|
30
|
+
allowNull: true,
|
|
31
|
+
},
|
|
32
|
+
ApiAuthenticationId: {
|
|
33
|
+
type: Sequelize.UUID,
|
|
34
|
+
defaultValue: null,
|
|
35
|
+
allowNull: true,
|
|
36
|
+
references: {
|
|
37
|
+
model: 'ApiAuthentications',
|
|
38
|
+
key: 'id',
|
|
39
|
+
},
|
|
40
|
+
onDelete: 'RESTRICT',
|
|
41
|
+
onUpdate: 'CASCADE',
|
|
42
|
+
},
|
|
43
|
+
EnterpriseId: {
|
|
44
|
+
type: Sequelize.UUID,
|
|
45
|
+
allowNull: true,
|
|
46
|
+
references: {
|
|
47
|
+
model: 'Enterprises',
|
|
48
|
+
key: 'id',
|
|
49
|
+
},
|
|
50
|
+
onDelete: 'RESTRICT',
|
|
51
|
+
onUpdate: 'CASCADE',
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
Api.associate = (models) => {
|
|
56
|
+
Api.hasMany(models.ApiResources)
|
|
57
|
+
Api.belongsTo(models.ApiAuthentications)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return Api
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
module.exports = {
|
|
65
|
+
ApisModel,
|
|
66
|
+
API_INTEGRATION_TYPE,
|
|
67
|
+
API_INTEGRATION_TYPES
|
|
68
68
|
}
|
package/src/attendances.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
exports.AttendancesModel = (sequelize, DataTypes) => {
|
|
2
|
-
const Attendances = sequelize.define('Attendances', {
|
|
3
|
-
SessionId: {
|
|
4
|
-
type: DataTypes.UUID,
|
|
5
|
-
allowNull: false,
|
|
6
|
-
references: {
|
|
7
|
-
model: 'Sessions',
|
|
8
|
-
key: 'id',
|
|
9
|
-
},
|
|
10
|
-
onDelete: 'RESTRICT',
|
|
11
|
-
onUpdate: 'CASCADE',
|
|
12
|
-
},
|
|
13
|
-
LineId: {
|
|
14
|
-
type: DataTypes.UUID,
|
|
15
|
-
allowNull: false,
|
|
16
|
-
references: {
|
|
17
|
-
model: 'Lines',
|
|
18
|
-
key: 'id',
|
|
19
|
-
},
|
|
20
|
-
onDelete: 'RESTRICT',
|
|
21
|
-
onUpdate: 'CASCADE',
|
|
22
|
-
},
|
|
23
|
-
SystemUserId: {
|
|
24
|
-
type: DataTypes.UUID,
|
|
25
|
-
allowNull: true,
|
|
26
|
-
references: {
|
|
27
|
-
model: 'SystemUsers',
|
|
28
|
-
key: 'id',
|
|
29
|
-
},
|
|
30
|
-
onDelete: 'RESTRICT',
|
|
31
|
-
onUpdate: 'CASCADE',
|
|
32
|
-
},
|
|
33
|
-
status: {
|
|
34
|
-
type: DataTypes.ENUM(['waiting', 'started', 'closed', 'transfered']),
|
|
35
|
-
allowNull: false,
|
|
36
|
-
validate: {
|
|
37
|
-
notEmpty: false,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
startedAt: {
|
|
41
|
-
allowNull: true,
|
|
42
|
-
type: DataTypes.DATE,
|
|
43
|
-
},
|
|
44
|
-
closedAt: {
|
|
45
|
-
allowNull: true,
|
|
46
|
-
type: DataTypes.DATE,
|
|
47
|
-
},
|
|
48
|
-
PreviousAttendanceId: {
|
|
49
|
-
type: DataTypes.UUID,
|
|
50
|
-
allowNull: true,
|
|
51
|
-
references: {
|
|
52
|
-
model: 'Attendances',
|
|
53
|
-
key: 'id',
|
|
54
|
-
},
|
|
55
|
-
onDelete: 'RESTRICT',
|
|
56
|
-
onUpdate: 'CASCADE',
|
|
57
|
-
},
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
Attendances.associate = models => {
|
|
61
|
-
Attendances.belongsTo(models.Sessions)
|
|
62
|
-
Attendances.belongsTo(models.SystemUsers)
|
|
63
|
-
Attendances.belongsTo(models.Lines)
|
|
64
|
-
Attendances.hasMany(models.TranshipConversations)
|
|
65
|
-
Attendances.hasOne(models.Attendances, { as: 'PreviousAttendance' })
|
|
66
|
-
Attendances.hasMany(models.Comments)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return Attendances
|
|
70
|
-
}
|
|
1
|
+
exports.AttendancesModel = (sequelize, DataTypes) => {
|
|
2
|
+
const Attendances = sequelize.define('Attendances', {
|
|
3
|
+
SessionId: {
|
|
4
|
+
type: DataTypes.UUID,
|
|
5
|
+
allowNull: false,
|
|
6
|
+
references: {
|
|
7
|
+
model: 'Sessions',
|
|
8
|
+
key: 'id',
|
|
9
|
+
},
|
|
10
|
+
onDelete: 'RESTRICT',
|
|
11
|
+
onUpdate: 'CASCADE',
|
|
12
|
+
},
|
|
13
|
+
LineId: {
|
|
14
|
+
type: DataTypes.UUID,
|
|
15
|
+
allowNull: false,
|
|
16
|
+
references: {
|
|
17
|
+
model: 'Lines',
|
|
18
|
+
key: 'id',
|
|
19
|
+
},
|
|
20
|
+
onDelete: 'RESTRICT',
|
|
21
|
+
onUpdate: 'CASCADE',
|
|
22
|
+
},
|
|
23
|
+
SystemUserId: {
|
|
24
|
+
type: DataTypes.UUID,
|
|
25
|
+
allowNull: true,
|
|
26
|
+
references: {
|
|
27
|
+
model: 'SystemUsers',
|
|
28
|
+
key: 'id',
|
|
29
|
+
},
|
|
30
|
+
onDelete: 'RESTRICT',
|
|
31
|
+
onUpdate: 'CASCADE',
|
|
32
|
+
},
|
|
33
|
+
status: {
|
|
34
|
+
type: DataTypes.ENUM(['waiting', 'started', 'closed', 'transfered']),
|
|
35
|
+
allowNull: false,
|
|
36
|
+
validate: {
|
|
37
|
+
notEmpty: false,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
startedAt: {
|
|
41
|
+
allowNull: true,
|
|
42
|
+
type: DataTypes.DATE,
|
|
43
|
+
},
|
|
44
|
+
closedAt: {
|
|
45
|
+
allowNull: true,
|
|
46
|
+
type: DataTypes.DATE,
|
|
47
|
+
},
|
|
48
|
+
PreviousAttendanceId: {
|
|
49
|
+
type: DataTypes.UUID,
|
|
50
|
+
allowNull: true,
|
|
51
|
+
references: {
|
|
52
|
+
model: 'Attendances',
|
|
53
|
+
key: 'id',
|
|
54
|
+
},
|
|
55
|
+
onDelete: 'RESTRICT',
|
|
56
|
+
onUpdate: 'CASCADE',
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
Attendances.associate = models => {
|
|
61
|
+
Attendances.belongsTo(models.Sessions)
|
|
62
|
+
Attendances.belongsTo(models.SystemUsers)
|
|
63
|
+
Attendances.belongsTo(models.Lines)
|
|
64
|
+
Attendances.hasMany(models.TranshipConversations)
|
|
65
|
+
Attendances.hasOne(models.Attendances, { as: 'PreviousAttendance' })
|
|
66
|
+
Attendances.hasMany(models.Comments)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return Attendances
|
|
70
|
+
}
|
package/src/branches.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
exports.BranchesModel = (sequelize, DataTypes) => {
|
|
2
|
-
const Branches = sequelize.define('Branches', {
|
|
3
|
-
EnterpriseId: {
|
|
4
|
-
type: DataTypes.UUID,
|
|
5
|
-
allowNull: false,
|
|
6
|
-
references: {
|
|
7
|
-
model: 'Enterprises',
|
|
8
|
-
key: 'id',
|
|
9
|
-
},
|
|
10
|
-
onDelete: 'RESTRICT',
|
|
11
|
-
onUpdate: 'CASCADE',
|
|
12
|
-
},
|
|
13
|
-
internalId: {
|
|
14
|
-
allowNull: false,
|
|
15
|
-
type: DataTypes.STRING(50),
|
|
16
|
-
validate: {
|
|
17
|
-
notEmpty: true,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
name: {
|
|
21
|
-
allowNull: false,
|
|
22
|
-
type: DataTypes.STRING(50),
|
|
23
|
-
validate: {
|
|
24
|
-
notEmpty: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
phone: {
|
|
28
|
-
allowNull: true,
|
|
29
|
-
type: DataTypes.STRING(50),
|
|
30
|
-
},
|
|
31
|
-
website: {
|
|
32
|
-
allowNull: true,
|
|
33
|
-
type: DataTypes.STRING(255),
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
Branches.associate = models => {
|
|
38
|
-
Branches.belongsTo(models.Enterprises)
|
|
39
|
-
Branches.hasMany(models.Lines)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return Branches
|
|
43
|
-
}
|
|
1
|
+
exports.BranchesModel = (sequelize, DataTypes) => {
|
|
2
|
+
const Branches = sequelize.define('Branches', {
|
|
3
|
+
EnterpriseId: {
|
|
4
|
+
type: DataTypes.UUID,
|
|
5
|
+
allowNull: false,
|
|
6
|
+
references: {
|
|
7
|
+
model: 'Enterprises',
|
|
8
|
+
key: 'id',
|
|
9
|
+
},
|
|
10
|
+
onDelete: 'RESTRICT',
|
|
11
|
+
onUpdate: 'CASCADE',
|
|
12
|
+
},
|
|
13
|
+
internalId: {
|
|
14
|
+
allowNull: false,
|
|
15
|
+
type: DataTypes.STRING(50),
|
|
16
|
+
validate: {
|
|
17
|
+
notEmpty: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
name: {
|
|
21
|
+
allowNull: false,
|
|
22
|
+
type: DataTypes.STRING(50),
|
|
23
|
+
validate: {
|
|
24
|
+
notEmpty: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
phone: {
|
|
28
|
+
allowNull: true,
|
|
29
|
+
type: DataTypes.STRING(50),
|
|
30
|
+
},
|
|
31
|
+
website: {
|
|
32
|
+
allowNull: true,
|
|
33
|
+
type: DataTypes.STRING(255),
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
Branches.associate = models => {
|
|
38
|
+
Branches.belongsTo(models.Enterprises)
|
|
39
|
+
Branches.hasMany(models.Lines)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return Branches
|
|
43
|
+
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
exports.ChannelConfigurationsModel = (sequelize, DataTypes) => {
|
|
2
|
-
const ChannelConfigurations = sequelize.define('ChannelConfigurations', {
|
|
3
|
-
ChannelTypeId: {
|
|
4
|
-
type: DataTypes.UUID,
|
|
5
|
-
allowNull: false,
|
|
6
|
-
references: {
|
|
7
|
-
model: 'ChannelTypes',
|
|
8
|
-
key: 'id',
|
|
9
|
-
},
|
|
10
|
-
onDelete: 'RESTRICT',
|
|
11
|
-
onUpdate: 'CASCADE',
|
|
12
|
-
},
|
|
13
|
-
fieldName: {
|
|
14
|
-
type: DataTypes.STRING(50),
|
|
15
|
-
allowNull: false,
|
|
16
|
-
validate: {
|
|
17
|
-
notEmpty: true,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
fieldType: {
|
|
21
|
-
type: DataTypes.STRING(50),
|
|
22
|
-
allowNull: false,
|
|
23
|
-
validate: {
|
|
24
|
-
notEmpty: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
fieldLabel: {
|
|
28
|
-
type: DataTypes.STRING(50),
|
|
29
|
-
allowNull: false,
|
|
30
|
-
validate: {
|
|
31
|
-
notEmpty: true,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
ChannelConfigurations.associate = models => {
|
|
37
|
-
ChannelConfigurations.belongsTo(models.ChannelTypes)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return ChannelConfigurations
|
|
41
|
-
}
|
|
1
|
+
exports.ChannelConfigurationsModel = (sequelize, DataTypes) => {
|
|
2
|
+
const ChannelConfigurations = sequelize.define('ChannelConfigurations', {
|
|
3
|
+
ChannelTypeId: {
|
|
4
|
+
type: DataTypes.UUID,
|
|
5
|
+
allowNull: false,
|
|
6
|
+
references: {
|
|
7
|
+
model: 'ChannelTypes',
|
|
8
|
+
key: 'id',
|
|
9
|
+
},
|
|
10
|
+
onDelete: 'RESTRICT',
|
|
11
|
+
onUpdate: 'CASCADE',
|
|
12
|
+
},
|
|
13
|
+
fieldName: {
|
|
14
|
+
type: DataTypes.STRING(50),
|
|
15
|
+
allowNull: false,
|
|
16
|
+
validate: {
|
|
17
|
+
notEmpty: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
fieldType: {
|
|
21
|
+
type: DataTypes.STRING(50),
|
|
22
|
+
allowNull: false,
|
|
23
|
+
validate: {
|
|
24
|
+
notEmpty: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
fieldLabel: {
|
|
28
|
+
type: DataTypes.STRING(50),
|
|
29
|
+
allowNull: false,
|
|
30
|
+
validate: {
|
|
31
|
+
notEmpty: true,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
ChannelConfigurations.associate = models => {
|
|
37
|
+
ChannelConfigurations.belongsTo(models.ChannelTypes)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return ChannelConfigurations
|
|
41
|
+
}
|