Especialidades (Specializations)


Routes

Method URI Action
GET /specializations index
GET /specializations/{id} show
POST /specializations store
PATCH /specializations/{id} update
DELETE /specializations/{id} delete
GET /specializations/{id}/semesters/{id}/prelationable-courses custom get

Model Attributes

{
  "id": 1,
  "code": "diseño_grafico",
  "title": "Diseño Grafico",
  "color": " \#ffffff",     // ignora el palito \ es por limitaciones de renderizado
  "text_color": "\#ffffff",
  "enabled": true,
  "updated_at": "2020-03-06 18:11:17",
  "created_at": "2020-03-06 18:11:17"
}

Relations

  • Tiene muchos pensums HasMany pensums
  • Pensum más actualizado (por version) HasOne latestPensum
  • Tiene secciones HasMany sections
  • Tiene semestres HasMany semesters Through pensums

{primary} Al obtener un modelo con el metodo show o index se puede utilizar un query string para cargar las relaciones ?with=relation o ?with=relationA,relationB


Index

Route GET /specializations

Filters extends Query Filters

Filter Description
search=string Busca a traves code y title
enabled=bool Obtiene solo los habilitados

Response 200

[
  {
    // Model Attributes
  }
]

Store

Route POST /specializations

Request Body

{
  "code": "required|string",
  "title": "required|string",
  "color": "required|string",
  "text_color": "required|string",
  "enabled": "boolean" // default false
}

Response 201

{
  // Model Attributes
}

Update

{warning} Aun no hay reglas definidas para limites de actualiación

Route PATCH /specializations/{id}

Request Body

{
  "code": "string",
  "title": "string",
  "color": "string",
  "text_color": "string",
  "enabled": "boolean" // default false
}

Response 200

{
  // Model Attributes
}

Delete

{warning} Aun no hay reglas definidas para limites de eliminación

Route DELETE /specializations/{id}

Response 204 No Content


Obtener Materias Prelacionables

Se obtiene una lista de materias desde un semestre de origen


Proporcionando specialization_id y semester_id se busca los semestres mayores que semester_id con sus materias.

Route GET /specializations/{id}/semesters/{id}/prelationable-courses

Response 200

{
  "originating_semester": { // este sera el semestre proporcionado en la ruta con materias
    "id": 1,
    "number": 3,
    "code": "SEM3",
    "created_at": "2020-04-07 10:37:46",
    "updated_at": "2020-04-07 10:37:46",
    "pensum_id": 1,
    "courses": [
      {
        "id": 1,
        "code": "code",
        "title": "title",
        "scheduled_content": "Test description",
        "scheduled_content_resource": null,
        "credits": 10,
        "hours": 20,
        "priority": 1,
        "calculated_avg": null,
        "elective": false,
        "enabled": true,
        "final_delivery": false,
        "final_delivery_value_percent": null,
        "created_at": "2020-04-07 10:37:46",
        "updated_at": "2020-04-07 10:37:46",
        "pivot": {
          "semester_id": "1",
          "course_id": "1"
        }
      }
    ]
  },
  "target_semesters": [ // estos seran todos los semestre mayores al de origen con materias
    {
      "id": 2,
      "number": 4,
      "code": "SEM4",
      "created_at": "2020-04-07 10:37:46",
      "updated_at": "2020-04-07 10:37:46",
      "pensum_id": 2,
      "courses": [
        {
          "id": 2,
          "code": "code",
          "title": "title",
          "scheduled_content": "Test description",
          "scheduled_content_resource": null,
          "credits": 10,
          "hours": 20,
          "priority": 1,
          "calculated_avg": null,
          "elective": false,
          "enabled": true,
          "final_delivery": false,
          "final_delivery_value_percent": null,
          "created_at": "2020-04-07 10:37:46",
          "updated_at": "2020-04-07 10:37:46",
          "pivot": {
            "semester_id": "2",
            "course_id": "2"
          }
        }
      ]
    }
  ]
}