Skip to content

Commit

Permalink
fix: adapting the graph to the new criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
danilogomes committed Oct 31, 2023
1 parent fb09ac9 commit ab1afb6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 6 additions & 4 deletions app/graphql/types/teams/membership_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ def member_role_description
end

def team_members_hourly_rate_list
tmhrl = []
(1..13).reverse_each do |date|
tmhrl << {'value_per_hour_performed' => (calculate_hours_per_month(object.monthly_payment, object.effort_in_period(Date.today.ago(date.month).beginning_of_month, Date.today.ago(date.month).end_of_month))), 'period_date' => Date.today.ago(date.month).beginning_of_month }
if object.monthly_payment != 0 && object.team_member.billable?
tmhrl = []
(1..7).reverse_each do |date|
tmhrl << {'value_per_hour_performed' => (calculate_hours_per_month(object.monthly_payment, object.effort_in_period(Date.today.ago(date.month).beginning_of_month, Date.today.ago(date.month).end_of_month))), 'period_date' => Date.today.ago(date.month).end_of_month }
end
tmhrl
end
tmhrl
end

def calculate_hours_per_month(sallary, month_hours)
Expand Down
2 changes: 1 addition & 1 deletion app/spa/src/locales/en/teams.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"leadTimeP80YLabel": "Days",
"financialPerformance": "Financial Performance",
"financialPerformanceYLabel": "Amount",
"hoursPerPeriodMemberships": "Memberships Hours"
"hoursPerPeriodMemberships": "Value per Hour of Work"
},
"actions": {
"edit": "Edit Team",
Expand Down
2 changes: 1 addition & 1 deletion app/spa/src/locales/pt/teams.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"leadTimeP80YLabel": "Days",
"financialPerformance": "Financial Performance",
"financialPerformanceYLabel": "Amount",
"hoursPerPeriodMemberships": "Memberships Hours"
"hoursPerPeriodMemberships": "Value per Hour of Work"
},
"actions": {
"edit": "Editar Time",
Expand Down
6 changes: 2 additions & 4 deletions spec/graphql/types/query_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,8 @@
'teamConsolidationsWeekly' => [],
'teamMonthlyInvestment' => { 'xAxis' => ['2022-09-30'], 'yAxis' => [-4500.0] },
'teamMemberEfficiency' => { 'membersEfficiency' => [{ 'effortInMonth' => 0.0, 'membership' => { 'teamMemberName' => 'aaa' }, 'realizedMoneyInMonth' => 0.0 }, { 'effortInMonth' => 0.0, 'membership' => { 'teamMemberName' => 'ddd' }, 'realizedMoneyInMonth' => 0.0 }] },
'memberships' => [{ 'id' => other_membership.id.to_s, 'memberRoleDescription' => 'Cliente', 'teamMembersHourlyRateList' => [{"periodDate"=>"2021-08-01","valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2021-09-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2021-10-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2021-11-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2021-12-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-01-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-02-01", "valuePerHourPerformed"=>2000.0},
{"periodDate"=>"2022-03-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-04-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-05-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-06-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-07-01", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-08-01", "valuePerHourPerformed"=>2000.0}] },
{ 'id' => membership.id.to_s, 'memberRoleDescription' => 'Desenvolvedor', "teamMembersHourlyRateList"=> [{"periodDate"=>"2021-08-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2021-09-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2021-10-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2021-11-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2021-12-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-01-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-02-01", "valuePerHourPerformed"=>0.0},
{"periodDate"=>"2022-03-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-04-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-05-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-06-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-07-01", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-08-01", "valuePerHourPerformed"=>0.0}] }],
'memberships' => [{ 'id' => other_membership.id.to_s, 'memberRoleDescription' => 'Cliente', "teamMembersHourlyRateList"=>[{"periodDate"=>"2022-02-28", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-03-31", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-04-30", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-05-31", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-06-30", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-07-31", "valuePerHourPerformed"=>2000.0}, {"periodDate"=>"2022-08-31", "valuePerHourPerformed"=>2000.0}] },
{ 'id' => membership.id.to_s, 'memberRoleDescription' => 'Desenvolvedor', "teamMembersHourlyRateList"=>[{"periodDate"=>"2022-02-28", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-03-31", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-04-30", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-05-31", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-06-30", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-07-31", "valuePerHourPerformed"=>0.0}, {"periodDate"=>"2022-08-31", "valuePerHourPerformed"=>0.0}]}],
'lastReplenishingConsolidations' => [
{
'id' => replenishing_consolidation.id.to_s,
Expand Down

0 comments on commit ab1afb6

Please sign in to comment.