Skip to content

Commit

Permalink
Merge pull request #117 from fga-gpp-mds/development
Browse files Browse the repository at this point in the history
Pull request sprint 13
  • Loading branch information
byronkamal authored Jun 12, 2018
2 parents 440e8eb + 52a8642 commit 40b39fa
Show file tree
Hide file tree
Showing 21 changed files with 340 additions and 80 deletions.
51 changes: 51 additions & 0 deletions app/controllers/recommendations_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
class RecommendationsController < ApplicationController
before_action :set_recommendation, only: [:show, :update, :destroy]

# GET /recommendations
def index
@recommendations = Recommendation.all

render json: @recommendations
end

# GET /recommendations/1
def show
render json: @recommendation
end

# POST /recommendations
def create
@recommendation = Recommendation.new(recommendation_params)

if @recommendation.save
render json: @recommendation, status: :created, location: @recommendation
else
render json: @recommendation.errors, status: :unprocessable_entity
end
end

# PATCH/PUT /recommendations/1
def update
if @recommendation.update(recommendation_params)
render json: @recommendation
else
render json: @recommendation.errors, status: :unprocessable_entity
end
end

# DELETE /recommendations/1
def destroy
@recommendation.destroy
end

private
# Use callbacks to share common setup or constraints between actions.
def set_recommendation
@recommendation = Recommendation.find(params[:id])
end

# Only allow a trusted parameter "white list" through.
def recommendation_params
params.require(:recommendation).permit(:title, :string, :body, :student_id)
end
end
2 changes: 1 addition & 1 deletion app/controllers/students_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ def set_student

# Only allow a trusted parameter "white list" through.
def student_params
params.require(:student).permit(:name, :birth_date, :age, :nationality, :year, :student_class, :shift, :father_name, :mother_name, :address, :parent_telephone, :parent_email) #:teacher_name)
params.require(:student).permit(:name, :birth_date, :age, :nationality, :year, :student_class, :shift, :father_name, :mother_name, :responsible, :address, :parent_telephone, :parent_email) #:teacher_name)
end
end
7 changes: 7 additions & 0 deletions app/models/recommendation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Recommendation < ApplicationRecord
belongs_to :student

validates_presence_of :student_id, presence: true, message: 'cannot be left blank'
validates_presence_of :title, presence: true, message: 'cannot be left blank'
validates_presence_of :body, presence: true, message: 'cannot be left blank'
end
24 changes: 12 additions & 12 deletions app/models/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ class Report < ApplicationRecord
validates_presence_of :psycholog_name, presence: true, message: 'can t be left blank'
validates_presence_of :psycholog_function, presence: true, message: 'can t be left blank'
validates_presence_of :psycholog_registry, presence: true, message: 'can t be left blank'
validates_presence_of :reason_adequation, presence: true, message: 'can t be left blank'
validates_presence_of :reason_emotional, presence: true, message: 'can t be left blank'
validates_presence_of :reason_performance, presence: true, message: 'can t be left blank'
validates_presence_of :reason_behavior, presence: true, message: 'can t be left blank'
validates_presence_of :reason_language, presence: true, message: 'can t be left blank'
validates_presence_of :level_school, presence: true, message: 'can t be left blank'
validates_presence_of :level_family, presence: true, message: 'can t be left blank'
validates_presence_of :level_student, presence: true, message: 'can t be left blank'
validates_inclusion_of :reason_adequation, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :reason_emotional, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :reason_performance, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :reason_behavior, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :reason_language, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :level_school, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :level_family, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :level_student, :in => [true, false], message: 'can t be left blank'
validates_presence_of :envolved_school, presence: true, message: 'can t be left blank'
validates_presence_of :envolved_family, presence: true, message: 'can t be left blank'
validates_presence_of :envolved_student, presence: true, message: 'can t be left blank'
validates_presence_of :realized_actions, presence: true, message: 'can t be left blank'
validates_presence_of :possibly_saa, presence: true, message: 'can t be left blank'
validates_presence_of :possibly_eeaa, presence: true, message: 'can t be left blank'
validates_presence_of :possibly_resources, presence: true, message: 'can t be left blank'
validates_presence_of :possibly_adequation, presence: true, message: 'can t be left blank'
validates_inclusion_of :possibly_saa, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :possibly_eeaa, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :possibly_resources, :in => [true, false], message: 'can t be left blank'
validates_inclusion_of :possibly_adequation, :in => [true, false], message: 'can t be left blank'

end
4 changes: 3 additions & 1 deletion app/models/student.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ class Student < ApplicationRecord
validates_presence_of :shift, presence: true, message: 'can t be left blank'
validates_presence_of :father_name, presence: true, message: 'can t be left blank'
validates_presence_of :mother_name, presence: true, message: 'can t be left blank'
validates_presence_of :responsible, presence: true, message: 'can t be left blank'
validates_presence_of :address, presence: true, message: 'can t be left blank'
validates_presence_of :parent_telephone, presence: true, length: { is: 11 }, message: 'can t be left blank'
validates_presence_of :parent_email, presence: true, email: true, message: 'can t be left blank'
#validates_presence_of :parent_email, presence: true, email: true, message: 'can t be left blank'
#validates_presence_of :teacher_name, presence: true, message: 'can t be left blank'

validates_length_of :name, minimum: 5, message: 'at least 5 characters'
Expand All @@ -20,6 +21,7 @@ class Student < ApplicationRecord
validates_length_of :shift, minimum: 1, message: 'at least 1 characters'
validates_length_of :father_name, minimum: 5, message: 'at least 5 characters'
validates_length_of :mother_name,minimum: 5, message: 'at least 5 characters'
validates_length_of :responsible,minimum: 5, message: 'at least 5 characters'
validates_length_of :address, minimum: 7, message: 'at least 7 characters'

validates_numericality_of :age, message: 'need to be number'
Expand Down
4 changes: 4 additions & 0 deletions app/serializers/recommendation_serializer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class RecommendationSerializer < ActiveModel::Serializer
attributes :id, :title, :body
has_one :student
end
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Rails.application.routes.draw do
resources :recommendations
resources :referrals
resources :reports
resources :daily_logs
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20180412220351_create_students.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def change
t.string :shift
t.string :father_name
t.string :mother_name
t.string :responsible
t.string :address
t.integer :parent_telephone
t.string :parent_email
Expand Down
24 changes: 12 additions & 12 deletions db/migrate/20180523222308_create_reports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ def change
t.string :psycholog_name
t.string :psycholog_function
t.string :psycholog_registry
t.string :reason_adequation
t.string :reason_emotional
t.string :reason_performance
t.string :reason_behavior
t.string :reason_language
t.string :level_school
t.string :level_family
t.string :level_student
t.boolean :reason_adequation
t.boolean :reason_emotional
t.boolean :reason_performance
t.boolean :reason_behavior
t.boolean :reason_language
t.boolean :level_school
t.boolean :level_family
t.boolean :level_student
t.string :envolved_school
t.string :envolved_family
t.string :envolved_student
t.text :realized_actions
t.string :possibly_saa
t.string :possibly_eeaa
t.string :possibly_resources
t.string :possibly_adequation
t.boolean :possibly_saa
t.boolean :possibly_eeaa
t.boolean :possibly_resources
t.boolean :possibly_adequation
t.belongs_to :student, index: true

t.timestamps
Expand Down
11 changes: 11 additions & 0 deletions db/migrate/20180607195236_create_recommendations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateRecommendations < ActiveRecord::Migration[5.1]
def change
create_table :recommendations do |t|
t.string :title
t.string :body
t.belongs_to :student, index: true

t.timestamps
end
end
end
36 changes: 23 additions & 13 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20180531182716) do
ActiveRecord::Schema.define(version: 20180607195236) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand All @@ -25,6 +25,15 @@
t.index ["student_id"], name: "index_daily_logs_on_student_id"
end

create_table "recommendations", force: :cascade do |t|
t.string "title"
t.string "body"
t.bigint "student_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["student_id"], name: "index_recommendations_on_student_id"
end

create_table "referrals", force: :cascade do |t|
t.string "title"
t.text "body"
Expand Down Expand Up @@ -52,22 +61,22 @@
t.string "psycholog_name"
t.string "psycholog_function"
t.string "psycholog_registry"
t.string "reason_adequation"
t.string "reason_emotional"
t.string "reason_performance"
t.string "reason_behavior"
t.string "reason_language"
t.string "level_school"
t.string "level_family"
t.string "level_student"
t.boolean "reason_adequation"
t.boolean "reason_emotional"
t.boolean "reason_performance"
t.boolean "reason_behavior"
t.boolean "reason_language"
t.boolean "level_school"
t.boolean "level_family"
t.boolean "level_student"
t.string "envolved_school"
t.string "envolved_family"
t.string "envolved_student"
t.text "realized_actions"
t.string "possibly_saa"
t.string "possibly_eeaa"
t.string "possibly_resources"
t.string "possibly_adequation"
t.boolean "possibly_saa"
t.boolean "possibly_eeaa"
t.boolean "possibly_resources"
t.boolean "possibly_adequation"
t.bigint "student_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
Expand All @@ -84,6 +93,7 @@
t.string "shift"
t.string "father_name"
t.string "mother_name"
t.string "responsible"
t.string "address"
t.integer "parent_telephone"
t.string "parent_email"
Expand Down
28 changes: 16 additions & 12 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
shift: "VESPERTINO",
father_name: "Pai #{num}",
mother_name: "Mãe #{num}",
responsible: "Responsável #{num}",
address: "Endereço #{num}",
parent_telephone: "99999999#{num}",
parent_email: "teste#{num}@email.com"
Expand Down Expand Up @@ -53,25 +54,28 @@
psycholog_name: "MyString",
psycholog_function: "MyString",
psycholog_registry: "MyString",
reason_adequation: "MyString",
reason_emotional: "MyString",
reason_performance: "MyString",
reason_behavior: "MyString",
reason_language: "MyString",
level_school: "MyString",
level_family: "MyString",
level_student: "MyString",
reason_adequation: "false",
reason_emotional: "false",
reason_performance: "true",
reason_behavior: "false",
reason_language: "false",
level_school: "true",
level_family: "false",
level_student: "true",
envolved_school: "MyString",
envolved_family: "MyString",
envolved_student: "MyString",
realized_actions: "MyText",
possibly_saa: "MyString",
possibly_eeaa: "MyString",
possibly_resources: "MyString",
possibly_adequation: "MyString",
possibly_saa: "false",
possibly_eeaa: "true",
possibly_resources: "false",
possibly_adequation: "false",
student_id: 2)
puts "Reports seeded."

Referral.create!(title: "Encaminhamento ao Neurologista", body: "Teste 1", student_id: 1)
Referral.create!(title: "Encaminhamento ao Psicólogo", body: "Teste 2", student_id: 2)
puts "Referrals seeded."

Recommendation.create!(title: "Recomendações ao professor João", body: "Aluno com DHCP, cuidados necessários!", student_id: 1)
puts "Recommendation seeded."
1 change: 0 additions & 1 deletion docs/_config.yml

This file was deleted.

84 changes: 84 additions & 0 deletions docs/sprints/13/results_sprint13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
## Sprint 13
### Data de inicio: 02/05/2018
### Data de término: 09/06/2018

### Reunião
#### Data da reunião: 09/06/2018

|Nome|Presente|
|----|----|
|Byron Kamal|:heavy_check_mark: |
|Gabriel Alves|:heavy_check_mark: |
|Igor Aragão|<p><strong>JUSTIFICADO</strong></p> |
|Igor Veludo|:heavy_check_mark: |
|João Mota|<p><strong>JUSTIFICADO</strong></p> |
|Marcelo Araújo|:heavy_check_mark: |
|William Silva|:heavy_check_mark: |

## Review

#### Histórias entregues:
- [US#14-sendRecommendations](https://github.com/fga-gpp-mds/2018.1-IncluCare_API/issues/22) **Pontos 8**
- [US#26-studentPanelLog](https://github.com/fga-gpp-mds/2018.1-IncluCare_API/issues/102) **Pontos 3**

###TD - Divida Tecnica
- [US#23-exportReport](https://github.com/fga-gpp-mds/2018.1-IncluCare_API/issues/93) **8 pontos**

##### Total de pontos planejados: 11
##### Total de pontos entregues: 11

## Retrospectiva
### Pontos Positivos:
<ul>
<li>Melhora no conhecimento técnico - linguagens</li>
<li>Melhora nos pareamentos</li>
<li>Melhora na gestão do tempo</li>
</ul>

### Pontos Negativos:

<ul>
<li>Testes no front-end</li>
</ul>

### Pontos a melhorar:
<ul>
<li>Nivelamento técnico da equipe</li>
<li>Testes no front-end</li>
</ul>

## Burndown
![Sprint 13 - Burndown](https://imgur.com/a/AZf3IT3.png)

## Velocity
![Sprint 13 - Velocity](https://imgur.com/HrWG9I4.png)

Foram planejadas as entregas de 3 histórias de usuário, sendo uma divida técnica. Todas foram entregues.

## Métricas
Nessa Sprint os valores alcançados nas métricas foram:

#### BackEnd
|Métrica|Resultado|Aceitável?|
|----|----|----|
|MAINTAINABILITY|A|:heavy_check_mark:|
|BUILD|PASSING|:heavy_check_mark:|
|TESTS COVERAGE|97%|:heavy_check_mark:|

#### FrontEnd
|Métrica|Resultado|Aceitável?|
|----|----|----|
|MAINTAINABILITY|F|:x:|
|BUILD|PASSING|:heavy_check_mark:|
|TESTS COVERAGE|65%|:x:|

## Comparação Entre Quadros de Conhecimento
### Sprint 12 (passada)
![Sprint 12 - Quadro de Conhecimento](https://imgur.com/G1NDaiO.png)

### Sprint 13 (atual)
![Sprint 13 - Quadro de Conhecimento](https://imgur.com/a/qhzjVc7.png)

## Análise do Scrum Master
<p>Nessa Sprint, houve um comprometimento maior dos integrantes em relação a Sprint passada. Alguns pareamentos conseguiram entregar a sua história bem mais cedo em relação a Sprint passada. Porém, outros grupos de pareamento entregaram em cima da hora.</p>
<p>Houve maior participação de membros que se mostravam mais ausentes em relação ao código. O pareamento de certa forma foi bem-sucedido, pois alguns membros conseguiram melhorar seu conhecimento, o que é possível ver no quadro de conhecimento.</p>
Loading

0 comments on commit 40b39fa

Please sign in to comment.