disciplina.json 2.69 KB
Newer Older
1 2 3 4
{
  "name": "Disciplina",
  "plural": "disciplinas",
  "base": "PersistedModel",
5
  "idInjection": false,
6 7 8
  "properties": {
    "codigo": {
      "type": "String",
9
      "id": true,
10 11 12
      "required": true,
      "length": 64,
      "precision": null,
13
      "scale": null
14
    },
15 16 17 18 19 20
    "nome": {
      "type": "String",
      "length": 256,
      "precision": null,
      "scale": null
    },
21 22 23 24 25
    "carga_horaria": {
      "type": "Number",
      "required": true,
      "precision": null,
      "scale": null,
26
      "default": 0
27 28 29 30 31 32 33
    },
    "duracao": {
      "type": "String",
      "required": true,
      "length": 64,
      "precision": null,
      "scale": null,
34
      "default": "semestral"
35 36 37 38 39 40
    },
    "modalidade": {
      "type": "String",
      "length": 64,
      "precision": null,
      "scale": null,
41
      "default": "presencial"
42 43 44 45
    },
    "_id": {
      "type": "number",
      "generated": true
46 47 48
    }
  },
  "validations": [],
49 50 51 52
  "relations": {
    "turmas": {
      "type": "hasMany",
      "model": "Turma",
Bruno Meyer's avatar
Bruno Meyer committed
53
      "foreignKey": "disciplinaCod",
54
      "required": true
55 56 57 58 59
    },
    "recursosnecessarios": {
      "type": "hasAndBelongsToMany",
      "model": "Recursodesala",
      "foreignKey": ""
Bruno Meyer's avatar
Bruno Meyer committed
60 61 62 63 64
    },
    "tipo_sala_necessaria": {
      "type": "belongsTo",
      "model": "Tipodesala",
      "foreignKey": "tipodesalaId"
65 66 67 68 69
    },
    "departamento": {
      "type": "belongsTo",
      "model": "Departamento",
      "foreignKey": "departamentoCod"
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
    }
  },
  "acls": [
    {
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "DENY",
      "property": "*"
    },
    {
      "accessType": "READ",
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "ALLOW"
    },
    {
      "principalType": "ROLE",
      "principalId": "admin",
      "permission": "ALLOW",
      "property": "*"
    }
  ],
92 93 94 95
  "methods": {
    "prototype.addEquivalencia": {
      "accepts": [
        {
96 97
          "arg": "disciplina_eq_code",
          "type": "string"
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
        }
      ],
      "returns": {
        "arg": "data",
        "type": "string"
      },
      "http": {
        "verb": "post",
        "path": "/addEquivalencia"
      }
    },
    "prototype.getEquivalencias": {
      "accepts": [],
      "returns": {
        "arg": "data",
        "type": "string"
      },
      "http": {
        "verb": "get",
        "path": "/getEquivalencias"
      }
    },
    "prototype.deleteEquivalencia": {
      "accepts": [
        {
123 124
          "arg": "disciplina_eq_code",
          "type": "string"
125 126 127 128 129 130 131 132 133 134 135
        }
      ],
      "returns": {
        "arg": "data",
        "type": "string"
      },
      "http": {
        "verb": "post",
        "path": "/deleteEquivalencia"
      }
    }
136
  }
137
}