-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor predictive modeling routes and services; remove obsolete com…
…ponent and styles, and introduce new targets schema
- Loading branch information
1 parent
3f4a35b
commit e831b22
Showing
12 changed files
with
200 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,71 @@ | ||
import mongoose from 'mongoose'; | ||
|
||
class TargetValuesService { | ||
async getTargetValues() { | ||
try { | ||
const Targets = mongoose.model('Targets'); | ||
const targets = await Targets.findOne(); | ||
return targets; | ||
} catch (error) { | ||
throw new Error(`Error fetching target values: ${error}`); | ||
} | ||
} | ||
|
||
async updateTargetValues(data: { | ||
targetedRoomForImprovement: number, | ||
targetedNumberOfDevelopers: number, | ||
targetedPercentOfTimeSaved: number | ||
current: { | ||
seats: string; | ||
adoptedDevs: string; | ||
monthlyDevsReportingTimeSavings: string; | ||
percentSeatsReportingTimeSavings: string; | ||
percentSeatsAdopted: string; | ||
percentMaxAdopted: string; | ||
dailySuggestions: string; | ||
dailyChatTurns: string; | ||
weeklyPRSummaries: string; | ||
weeklyTimeSaved: string; | ||
monthlyTimeSavings: string; | ||
annualTimeSavingsDollars: string; | ||
productivityBoost: string; | ||
}; | ||
target: { | ||
seats: string; | ||
adoptedDevs: string; | ||
monthlyDevsReportingTimeSavings: string; | ||
percentSeatsReportingTimeSavings: string; | ||
percentSeatsAdopted: string; | ||
percentMaxAdopted: string; | ||
dailySuggestions: string; | ||
dailyChatTurns: string; | ||
weeklyPRSummaries: string; | ||
weeklyTimeSaved: string; | ||
monthlyTimeSavings: string; | ||
annualTimeSavingsDollars: string; | ||
productivityBoost: string; | ||
}; | ||
max: { | ||
seats: string; | ||
adoptedDevs: string; | ||
monthlyDevsReportingTimeSavings: string; | ||
percentSeatsReportingTimeSavings: string; | ||
percentSeatsAdopted: string; | ||
percentMaxAdopted: string; | ||
dailySuggestions: string; | ||
dailyChatTurns: string; | ||
weeklyPRSummaries: string; | ||
weeklyTimeSaved: string; | ||
monthlyTimeSavings: string; | ||
annualTimeSavingsDollars: string; | ||
productivityBoost: string; | ||
}; | ||
}) { | ||
try { | ||
const Targets = mongoose.model('Targets'); | ||
const targets = await Targets.findOneAndUpdate({}, data, { new: true, upsert: true }); | ||
return targets; | ||
} catch (error) { | ||
throw new Error(`Error updating target values: ${error}`); | ||
} | ||
} | ||
} | ||
|
||
export default new TargetValuesService(); | ||
export default new TargetValuesService(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 0 additions & 69 deletions
69
frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.html
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.scss
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.spec.ts
This file was deleted.
Oops, something went wrong.
129 changes: 0 additions & 129 deletions
129
frontend/src/app/main/copilot/predictive-modeling/predictive-modeling.component.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.