From 011df76dff0d8d9dce2033ce8808b353e9324ed5 Mon Sep 17 00:00:00 2001 From: alissonalbuquerque Date: Wed, 23 Mar 2022 16:03:57 -0300 Subject: [PATCH] add Ensino Coordenacao table e model --- app/Models/Tabelas/Ensino/EnsinoAula.php | 4 + .../Tabelas/Ensino/EnsinoCoordenacao.php | 110 ++++++++++++++++++ ...184642_create_ensino_coordenacao_table.php | 38 ++++++ 3 files changed, 152 insertions(+) create mode 100644 app/Models/Tabelas/Ensino/EnsinoCoordenacao.php create mode 100644 database/migrations/2022_03_23_184642_create_ensino_coordenacao_table.php diff --git a/app/Models/Tabelas/Ensino/EnsinoAula.php b/app/Models/Tabelas/Ensino/EnsinoAula.php index 577561f..4c3382c 100644 --- a/app/Models/Tabelas/Ensino/EnsinoAula.php +++ b/app/Models/Tabelas/Ensino/EnsinoAula.php @@ -32,6 +32,10 @@ class EnsinoAula extends Model protected $fillable = ['cod_atividade', 'componente_curricular', 'curso_id', 'nivel', 'modalidade', 'ch_semanal', 'ch_total', 'pad_id']; + /** + * cod_dimensao from planejamento table + * @var array + */ private $codesDimensao = ['E-1', 'E-2', 'E-3']; diff --git a/app/Models/Tabelas/Ensino/EnsinoCoordenacao.php b/app/Models/Tabelas/Ensino/EnsinoCoordenacao.php new file mode 100644 index 0000000..d61e765 --- /dev/null +++ b/app/Models/Tabelas/Ensino/EnsinoCoordenacao.php @@ -0,0 +1,110 @@ + 'Graduação', + self::NIVEL_POS_GRADUACAO_LATO_SENSU => 'Pós-graduação Stricto Sensu', + self::NIVEL_POS_GRADUACAO_STRICTO_SENSU => 'Pós-Graduação Lato Sensu', + + ]; + + return $value !== null? $values[$value] : $values; + } + + + /** + * @return array|string + */ + public function listModalidade($value = null) { + $values = [ + self::MODALIDADE_EAD => 'EAD', + self::MODALIDADE_PRESENCIAL => 'Presencial', + + ]; + + return $value !== null? $values[$value] : $values; + } + + /** + * @return array + */ + public function orientacaoPreenchimento() { + return [ + 'descricao' => ['item' => '2.', 'ENSINO (COORDENAÇÃO/ REGÊNCIA COMPONENTES CURRICULARES)'], + 'componente_curricular' => ['item' => 'Nome do Componente:', 'descricao' => 'Nome do componente curricular como descrito no PPC do curso'], + 'curso' => ['item' => 'Curso:', 'descricao' => 'Nome do curso ao qual o componente curricular pertence'], + 'nivel' => ['item' => 'Nível:', 'descricao' => 'Preencher o nível do curso ao qual o componente curricular pertence, sendo as opções: Graduação, Pós-graduação Stricto Sensu, Pós-Graduação Lato Sensu'], + 'modalidade' => ['item' => 'Modalidade:', 'descricao' => 'Preencher a modalidade que o componente curricular é ofertado, sendo as opções: Presencial e EAD'], + 'ch_semanal' => ['item' => 'Carga Horária Semanal:', 'descricao' => 'Carga horária semanal efetivamente exercida na atividade (preencher de acordo com quadro de referência)'], + ]; + } + + + /** + * Get PAD with pad.id = ensino_coordenacao.pad_id + * + * @return PAD + */ + public function pad() { + return $this->belongsTo(PAD::class); + } + + /** + * Get Curso with curso.id = ensino_aulas.curso_id + * + * @return Curso + */ + public function curso() + { + return $this->belongsTo(Curso::class); + } + + /** + * @return array + */ + public function getPlanejamentos() { + $query = new PlanejamentoQuery(); + return $query->whereInCodDimensao($this->codesDimensao)->get(); + } + +} diff --git a/database/migrations/2022_03_23_184642_create_ensino_coordenacao_table.php b/database/migrations/2022_03_23_184642_create_ensino_coordenacao_table.php new file mode 100644 index 0000000..914477d --- /dev/null +++ b/database/migrations/2022_03_23_184642_create_ensino_coordenacao_table.php @@ -0,0 +1,38 @@ +id(); + $table->string('cod_atividade')->notNull(); + $table->string('componente_curricular')->notNull(); + $table->foreignId('curso_id')->notNull(); + $table->tinyInteger('nivel')->notNull(); + $table->tinyInteger('modalidade')->notNull(); + $table->integer('ch_semanal')->notNull(); + $table->foreignId('pad_id'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('ensino_coordenacao'); + } +} -- GitLab