Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
danilogomes committed Sep 25, 2023
1 parent f09f5a2 commit 115acd2
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 196 deletions.
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ GEM
fabrication (2.30.0)
faker (3.2.1)
i18n (>= 1.8.11, < 2)
ffi (1.15.5)
ffi (1.16.1)
figaro (1.2.0)
thor (>= 0.14.0, < 2)
flamegraph (0.9.5)
Expand Down Expand Up @@ -237,7 +237,7 @@ GEM
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-smtp (0.4.0)
net-protocol
netrc (0.11.0)
newrelic_rpm (9.5.0)
Expand All @@ -262,7 +262,7 @@ GEM
path_expander (1.1.1)
pg (1.5.4)
public_suffix (5.0.3)
puma (6.3.1)
puma (6.4.0)
nio4r (~> 2.0)
puma_worker_killer (0.3.1)
get_process_mem (~> 0.2)
Expand Down Expand Up @@ -375,7 +375,7 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
Expand All @@ -388,7 +388,7 @@ GEM
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-rspec (2.24.0)
rubocop-rspec (2.24.1)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
Expand Down Expand Up @@ -470,7 +470,7 @@ GEM
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
yui-compressor (0.12.0)
zeitwerk (2.6.11)
zeitwerk (2.6.12)

PLATFORMS
arm64-darwin-21
Expand Down
2 changes: 1 addition & 1 deletion app/graphql/mutations/save_membership_mutation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

module Mutations
class SaveMembershipMutation < Mutations::BaseMutation
argument :effort_percentage, Float, required: true
argument :end_date, String, required: false
argument :hours_per_month, Integer, required: true
argument :effort_percentage, Float, required: true
argument :member_role, Integer, required: true
argument :membership_id, ID, required: true
argument :start_date, String, required: true
Expand Down
2 changes: 1 addition & 1 deletion app/graphql/types/demand_effort_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ class DemandEffortType < Types::BaseObject
field :main_effort_in_transition, Boolean, null: false
field :management_percentage, Float, null: false
field :member_role, String, null: true
field :membership_effort_percentage, Float, null: true
field :pairing_percentage, Float, null: false
field :stage, String, null: true
field :stage_percentage, Float, null: false
field :start_time_to_computation, GraphQL::Types::ISO8601DateTime, null: false
field :total_blocked, Float, null: false
field :updated_at, GraphQL::Types::ISO8601DateTime, null: false
field :who, String, null: true
field :membership_effort_percentage, Float, null: true
end
end
2 changes: 1 addition & 1 deletion app/graphql/types/teams/membership_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module Types
module Teams
class MembershipType < Types::BaseObject
field :created_at, GraphQL::Types::ISO8601DateTime, null: false
field :effort_percentage, Float
field :end_date, GraphQL::Types::ISO8601Date
field :hours_per_month, Integer
field :effort_percentage, Float
field :id, ID, null: false
field :member_role, Integer, null: false
field :member_role_description, String, null: false
Expand Down
6 changes: 3 additions & 3 deletions app/services/demand_effort_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ def compute_and_save_effort(day_to_effort, assignment, top_effort_assignment, tr
pairing_percentage = transition.stage_pairing_percentage_to_project

management_percentage = transition.stage_management_percentage_to_project

membership_effort_percentage = membership.effort_percentage.nil? ? 100.0 : membership.effort_percentage

effort_total = (effort_by_dates * (management_percentage + 1) * stage_percentage * membership_effort_percentage)/100
effort_total = (effort_by_dates * (management_percentage + 1) * stage_percentage * membership_effort_percentage) / 100

effort_total *= pairing_percentage unless main_assignment

effort_total = remove_member_previous_efforts_in_demand(assignment, demand, demand_effort, effort_start_time, effort_total)

demand_effort.update(effort_value: effort_total, stage_percentage: stage_percentage,
Expand Down
Loading

0 comments on commit 115acd2

Please sign in to comment.