@@ -389,23 +389,23 @@ export class ValueModelingComponent implements OnInit, AfterViewInit {
389389 this . gridObject . max . percentMaxAdopted = this . calculatePercentage ( this . gridObject . max . adoptedDevs as number , this . gridObject . max . seats as number ) ;
390390 this . gridObject . max . annualTimeSavingsDollars = this . calculateAnnualTimeSavingsDollars ( this . gridObject . max . weeklyTimeSaved as number , this . gridObject . max . adoptedDevs as number ) ;
391391 this . gridObject . max . monthlyTimeSavings = this . calculateMonthlyTimeSavings ( this . gridObject . max . adoptedDevs as number , this . gridObject . max . weeklyTimeSaved as number ) ;
392- this . gridObject . max . productivityBoost = this . calculateProductivityBoost ( this . gridObject . max . dailySuggestions as number , this . gridObject . max . dailyChatTurns as number ) ;
392+ this . gridObject . max . productivityBoost = this . calculateProductivityBoost ( this . gridObject . max . weeklyTimeSaved as number , this . gridObject . max . seats as number , this . gridObject . max . adoptedDevs as number ) ;
393393
394394 // 2. Calculate Current column percentages and then Impacts
395395 this . gridObject . current . percentSeatsAdopted = this . calculatePercentage ( this . gridObject . current . adoptedDevs as number , this . gridObject . current . seats as number ) ;
396396 this . gridObject . current . percentSeatsReportingTimeSavings = this . calculatePercentage ( this . gridObject . current . monthlyDevsReportingTimeSavings as number , this . gridObject . current . seats as number ) ;
397397 this . gridObject . current . percentMaxAdopted = this . calculatePercentage ( this . gridObject . current . adoptedDevs as number , this . gridObject . max . seats as number ) ;
398398 this . gridObject . current . annualTimeSavingsDollars = this . calculateAnnualTimeSavingsDollars ( this . gridObject . current . weeklyTimeSaved as number , this . gridObject . current . adoptedDevs as number ) ;
399399 this . gridObject . current . monthlyTimeSavings = this . calculateMonthlyTimeSavings ( this . gridObject . current . adoptedDevs as number , this . gridObject . current . weeklyTimeSaved as number ) ;
400- this . gridObject . current . productivityBoost = this . calculateProductivityBoost ( this . gridObject . current . dailySuggestions as number , this . gridObject . current . dailyChatTurns as number ) ;
400+ this . gridObject . current . productivityBoost = this . calculateProductivityBoost ( this . gridObject . current . weeklyTimeSaved as number , this . gridObject . current . seats as number , this . gridObject . current . adoptedDevs as number ) ;
401401
402402 // 3. Calculate Target column values (percentages and then impacts)
403403 this . gridObject . target . percentSeatsAdopted = this . calculatePercentage ( this . gridObject . target . adoptedDevs as number , this . gridObject . target . seats as number ) ;
404404 this . gridObject . target . percentSeatsReportingTimeSavings = this . calculatePercentage ( this . gridObject . target . monthlyDevsReportingTimeSavings as number , this . gridObject . target . seats as number ) ;
405405 this . gridObject . target . percentMaxAdopted = this . calculatePercentage ( this . gridObject . target . adoptedDevs as number , this . gridObject . target . seats as number ) ;
406406 this . gridObject . target . annualTimeSavingsDollars = this . calculateAnnualTimeSavingsDollars ( this . gridObject . target . weeklyTimeSaved as number , this . gridObject . target . adoptedDevs as number ) ;
407407 this . gridObject . target . monthlyTimeSavings = this . calculateMonthlyTimeSavings ( this . gridObject . target . adoptedDevs as number , this . gridObject . target . weeklyTimeSaved as number ) ;
408- this . gridObject . target . productivityBoost = this . calculateProductivityBoost ( this . gridObject . target . dailySuggestions as number , this . gridObject . target . dailyChatTurns as number ) ;
408+ this . gridObject . target . productivityBoost = this . calculateProductivityBoost ( this . gridObject . target . weeklyTimeSaved as number , this . gridObject . target . seats as number , this . gridObject . target . adoptedDevs as number ) ;
409409
410410 // 4. Update the form values
411411 console . log ( '4. modelCalc: Updated gridObject:' , this . gridObject ) ;
@@ -425,17 +425,22 @@ export class ValueModelingComponent implements OnInit, AfterViewInit {
425425 }
426426
427427 private calculateAnnualTimeSavingsDollars ( weeklyTimeSaved : number , adoptedDevs : number ) : number {
428- const weeksInYear = 50 ; // TO DO: needs to come from settings
429- const hourlyRate = 50 ; // TO DO: needs to come from settings
428+ const weeksInYear = 50 ;
429+ const hoursPerWeek = this . hoursPerYear / weeksInYear ;
430+ const hourlyRate = this . devCostPerYear / this . hoursPerYear ;
430431 return weeklyTimeSaved * weeksInYear * hourlyRate * adoptedDevs ;
431432 }
432433
433- private calculateProductivityBoost ( dailySuggestions : number , dailyChatTurns : number ) : number {
434- return dailySuggestions + dailyChatTurns ; // Example calculation
435- }
434+ private calculateProductivityBoost ( weeklyTimeSaved : number , adoptedDevs : number , maxDevs : number ) : number {
435+
436+ return weeklyTimeSaved * adoptedDevs * 50 / ( this . hoursPerYear * maxDevs || 1 ) ;
437+ }
436438
437439 private calculateMonthlyTimeSavings ( adoptedDevs : number , weeklyTimeSaved : number ) : number {
438- return adoptedDevs * weeklyTimeSaved * 4 ;
440+ const weeksInYear = 50 ;
441+ const weeksInMonth = 4 ;
442+ const hoursPerWeek = this . hoursPerYear / weeksInYear ;
443+ return weeklyTimeSaved * weeksInMonth * adoptedDevs ;
439444 }
440445
441446 toggleInputs ( disable : boolean ) {
0 commit comments