Commit 75c275a7 authored by Odair M.'s avatar Odair M. Committed by Matheus Horstmann

especifica o modelo

metodo de reserva sala semi concluido, sistema de enviar email

metodo aprova ok

sistema de email

adiciona pesquisa por reserva
parent c894b6c3
......@@ -24,6 +24,7 @@ var models = [
'Setor',
'Departamento',
'Curso',
"ReservaHorario",
"CursoDisciplina",
"Professor",
"Horario",
......
This diff is collapsed.
......@@ -2,45 +2,50 @@
"name": "Reserva",
"plural": "reservas",
"base": "Evento",
"idInjection": false,
"idInjection": true,
"hidden": [
"aprovado"
],
"properties": {
"codigo": {
"type": "String",
"id": true,
"required": true,
"length": 64
},
"repetir": {
"type": "boolean",
"default": false
},
"tipo_repeticao": {
"type": "integer"
"intervalo": {
"type": "number"
},
"incio_repeticao": {
"data": {
"type": "date"
},
"dia": {
"type": "date"
"dias": {
"type": [
"number"
]
},
"horario_inicio": {
"type": "string",
"required": true
},
"motivo":{
"type": "string"
"horario_fim": {
"type": "string",
"required": true
},
"motivo": {
"type": "string"
},
"observacao": {
"type": "string"
},
"fim-repeticao": {
"fim_repeticao": {
"type": "date"
},
"aprovado": {
"type": "boolean",
"default": false
}
},
"validations": [],
"relations": {
"departamento": {
"type": "belongsTo",
"model": "Departamento",
"foreignKey": "departamentoCod"
},
"sala": {
"type": "belongsTo",
"model": "Sala",
......@@ -80,6 +85,31 @@
}
],
"methods": {
"search": {
"accepts": [
{
"arg": "query",
"type": "string",
"required": true,
"description": "query da bucas"
}
],
"returns": [
{
"arg": "reservas",
"type": "array",
"root": false,
"description": "todas reservas"
}
],
"description": "pesquisa por reservas",
"http": [
{
"path": "/search",
"verb": "get"
}
]
},
"reservar": {
"accepts": [
{
......@@ -97,13 +127,38 @@
"description": "não sei ainda o que vou retornar"
}
],
"description": "faz a reserva de uma sala",
"description": "requisita a reserva de uma sala",
"http": [
{
"path": "/reservar",
"verb": "post"
}
]
},
"aprova": {
"accepts": [
{
"arg": "reservaId",
"type": "number",
"required": true,
"description": "id da reserva a ser aprovada"
}
],
"returns": [
{
"arg": "status",
"type": "object",
"root": false,
"description": "objeto de retorno"
}
],
"description": "aprova uma reserva",
"http": [
{
"path": "/aprova",
"verb": "post"
}
]
}
}
}
......@@ -2,14 +2,14 @@
set -e
if [ "$1" = 'DEVELOPMENT' ]; then
/usr/local/bin/node /app/bin/automigrate.js
# echo "oi"
fi
if [ "$1" = 'PRODUCTION' ]; then
/usr/local/bin/node /app/bin/automigrate.js
fi
#if [ "$1" = 'DEVELOPMENT' ]; then
# /usr/local/bin/node /app/bin/automigrate.js
# # echo "oi"
#fi
#
#if [ "$1" = 'PRODUCTION' ]; then
# /usr/local/bin/node /app/bin/automigrate.js
#fi
# echo "while true; do sleep 2; done" >> /app/test.sh && chmod +x /app/test.sh
# /bin/bash /app/test.sh
......
......@@ -18,5 +18,18 @@
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "sie-report"
}
},
"Email_d": {
"name": "Email_d",
"connector": "mail",
"transports": [
{
"secure": false,
"ignoreTLS": true,
"type": "smtp",
"host": "mx.c3sl.ufpr.br",
"port": 25
}
]
}
}
......@@ -8,5 +8,18 @@
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "sie-report"
},
"Email_d": {
"name": "Email_d",
"connector": "mail",
"transports": [
{
"secure": false,
"ignoreTLS": true,
"type": "smtp",
"host": "mx.c3sl.ufpr.br",
"port": 25
}
]
}
}
......@@ -119,5 +119,9 @@
"Reserva": {
"dataSource": "ensalamento",
"public": true
},
"mail_dinf": {
"dataSource": "Email_d",
"public": true
}
}
'use strict';
module.exports = function(Maildinf) {
};
{
"name": "mail_dinf",
"base": "Email",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment