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