Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ensalamento-back
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ensalamento
ensalamento-back
Commits
e9f5cc45
Commit
e9f5cc45
authored
Nov 21, 2018
by
Bruno Meyer
😢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#23
: Add Professor model
parent
684d6268
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
121 additions
and
12 deletions
+121
-12
common/models/README.md
common/models/README.md
+22
-5
common/models/departamento.json
common/models/departamento.json
+21
-2
common/models/disciplina.json
common/models/disciplina.json
+1
-1
common/models/models.js
common/models/models.js
+3
-1
common/models/professor.js
common/models/professor.js
+5
-0
common/models/professor.json
common/models/professor.json
+57
-0
common/models/sala.json
common/models/sala.json
+2
-2
common/models/turma.js
common/models/turma.js
+1
-1
common/models/turma.json
common/models/turma.json
+5
-0
server/model-config.json
server/model-config.json
+4
-0
No files found.
common/models/README.md
View file @
e9f5cc45
...
...
@@ -18,7 +18,7 @@
*
**owner**
ROLE have all EXECUTE, READ and WRITE operations
-
Relations
*
Belongs to :
**Bloco**
as
`blocoCod`
*
Has and Belongs To Many :
**Recursodesala**
as
`recursos`
*
Has and Belongs To Many :
**Recursodesala**
*
Belongs to :
**Tipodesala**
as
`tipo`
*
Belongs to :
**Secretario**
as
`ownerId`
...
...
@@ -53,7 +53,7 @@
-
Relations
*
This model have a self-realtion. To implement this, we use the EquivalenciaDisciplina model
*
Has Many :
**Turma**
`Required (in Turma)`
as
`disciplinaId (in Turma)`
*
Has and Belongs To Many :
**Recursodesala**
as
`recursosnecessarios`
*
Has and Belongs To Many :
**Recursodesala**
*
Belongs To :
**Tipodesala**
as
`tipodesalaId`
*
Belongs To :
**Departamento**
as
`departamentoCod`
...
...
@@ -97,6 +97,7 @@
*
**admin**
ROLE have all EXECUTE, READ and WRITE operations
-
Relations
*
Belongs To :
**Departamento**
as
`departamentoCod`
*
Belongs To :
**Disciplina**
as
`disciplinaCod`
## Recursodesala
-
Public:
`False`
...
...
@@ -160,14 +161,17 @@
-
Relations
*
Belongs To :
**Bloco**
as
`blocoCod`
*
Belongs To :
**Setor**
as
`setorCod`
*
Has and Belongs To Many :
**
Setor**
as
`Disciplina`
*
Has and Belongs To Many :
**
Disciplina**
-
Observation: The relation with Bloco means that one Curso will be relationed
with a Bloco.
## Departamento
-
Public:
`True`
-
Description: This model extend
`Orgao`
-
Attributes
-
Attributes
`idInjection`
=
`false`
*
nome :
**string**
`Required`
*
codigo :
**string**
`Required`
,
`id`
*
_id :
**number**
`generated`
-
ACLs
*
All permissions not specified is
`DENY`
*
**admin**
ROLE have all EXECUTE, READ and WRITE operations
...
...
@@ -203,4 +207,17 @@
*
**admin**
ROLE have all EXECUTE, READ and WRITE operations
-
Relations
*
Has Many :
**Orgao**
as
`secretarioId`
*
Has Many :
**Sala**
as
`ownerId`
\ No newline at end of file
*
Has Many :
**Sala**
as
`ownerId`
## Professor
-
Public:
`True`
-
Attributes
`idInjection`
=
`false`
*
nome :
**string**
`Required`
*
codigo :
**string**
`Required`
,
`id`
*
_id :
**number**
`generated`
-
ACLs
*
All permissions not specified is
`DENY`
*
**admin**
ROLE have all EXECUTE, READ and WRITE operations
-
Relations
*
Belongs To :
**Departamento**
as
`departamentoCod`
*
Has and Belongs To Many :
**Turma**
\ No newline at end of file
common/models/departamento.json
View file @
e9f5cc45
...
...
@@ -2,11 +2,25 @@
"name"
:
"Departamento"
,
"plural"
:
"departamentos"
,
"base"
:
"Orgao"
,
"idInjection"
:
tru
e
,
"idInjection"
:
fals
e
,
"options"
:
{
"validateUpsert"
:
true
},
"properties"
:
{},
"properties"
:
{
"nome"
:
{
"type"
:
"string"
,
"required"
:
true
},
"codigo"
:
{
"type"
:
"string"
,
"id"
:
true
,
"required"
:
true
},
"_id"
:
{
"type"
:
"number"
,
"generated"
:
true
}
},
"validations"
:
[],
"relations"
:
{
"setor"
:
{
...
...
@@ -18,6 +32,11 @@
"type"
:
"hasMany"
,
"model"
:
"Turma"
,
"foreignKey"
:
"departamentoCod"
},
"professores"
:
{
"type"
:
"hasMany"
,
"model"
:
"Professor"
,
"foreignKey"
:
"departamentoCod"
}
},
"acls"
:
[
...
...
common/models/disciplina.json
View file @
e9f5cc45
...
...
@@ -45,7 +45,7 @@
"turmas"
:
{
"type"
:
"hasMany"
,
"model"
:
"Turma"
,
"foreignKey"
:
"disciplina
I
d"
,
"foreignKey"
:
"disciplina
Co
d"
,
"required"
:
true
},
"recursosnecessarios"
:
{
...
...
common/models/models.js
View file @
e9f5cc45
...
...
@@ -23,7 +23,9 @@ var models = [
'
Setor
'
,
'
Departamento
'
,
'
Curso
'
,
"
CursoDisciplina
"
"
CursoDisciplina
"
,
"
Professor
"
,
"
ProfessorTurma
"
];
/**
...
...
common/models/professor.js
0 → 100644
View file @
e9f5cc45
'
use strict
'
;
module
.
exports
=
function
(
Professor
)
{
};
common/models/professor.json
0 → 100644
View file @
e9f5cc45
{
"name"
:
"Professor"
,
"plural"
:
"professores"
,
"base"
:
"PersistedModel"
,
"idInjection"
:
false
,
"options"
:
{
"validateUpsert"
:
true
},
"properties"
:
{
"codigo"
:
{
"type"
:
"string"
,
"required"
:
true
,
"id"
:
true
},
"nome"
:
{
"type"
:
"string"
,
"required"
:
true
},
"website"
:
{
"type"
:
"string"
},
"email"
:
{
"type"
:
"string"
},
"_id"
:
{
"type"
:
"number"
,
"generated"
:
true
}
},
"validations"
:
[],
"relations"
:
{
"departamento"
:
{
"type"
:
"belongsTo"
,
"model"
:
"Departamento"
,
"foreignKey"
:
"departamentoCod"
},
"turmas"
:
{
"type"
:
"hasAndBelongsToMany"
,
"model"
:
"Turma"
}
},
"acls"
:
[
{
"principalType"
:
"ROLE"
,
"principalId"
:
"$everyone"
,
"permission"
:
"DENY"
,
"property"
:
"*"
},
{
"principalType"
:
"ROLE"
,
"principalId"
:
"admin"
,
"permission"
:
"ALLOW"
,
"property"
:
"*"
}
],
"methods"
:
{}
}
common/models/sala.json
View file @
e9f5cc45
...
...
@@ -16,8 +16,8 @@
},
"codigo"
:
{
"type"
:
"string"
,
"
require
d"
:
true
,
"
i
d"
:
true
"
i
d"
:
true
,
"
require
d"
:
true
},
"localizacao"
:
{
"type"
:
"geopoint"
,
...
...
common/models/turma.js
View file @
e9f5cc45
'
use strict
'
;
module
.
exports
=
function
(
Turma
)
{
Turma
.
validatesPresenceOf
(
'
disciplina
I
d
'
);
Turma
.
validatesPresenceOf
(
'
disciplina
Co
d
'
);
};
common/models/turma.json
View file @
e9f5cc45
...
...
@@ -26,6 +26,11 @@
"type"
:
"belongsTo"
,
"model"
:
"Departamento"
,
"foreignKey"
:
"departamentoCod"
},
"disciplina"
:
{
"type"
:
"belongsTo"
,
"model"
:
"Disciplina"
,
"foreignKey"
:
"disciplinaCod"
}
},
"acls"
:
[
...
...
server/model-config.json
View file @
e9f5cc45
...
...
@@ -87,5 +87,9 @@
"Curso"
:
{
"dataSource"
:
"ensalamento"
,
"public"
:
true
},
"Professor"
:
{
"dataSource"
:
"ensalamento"
,
"public"
:
true
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment