feat: Add report on customer waiting time (#7545)

This commit is contained in:
Pranav Raj S
2023-07-20 12:01:22 -07:00
committed by GitHub
parent d7566c453d
commit 27419eef66
9 changed files with 81 additions and 82 deletions

View File

@@ -7,19 +7,13 @@ export default {
accountSummary: 'getAccountSummary',
accountReport: 'getAccountReports',
}),
calculateTrend() {
return metric_key => {
if (!this.accountSummary.previous[metric_key]) return 0;
const diff =
this.accountSummary[metric_key] -
this.accountSummary.previous[metric_key];
return Math.round(
(diff / this.accountSummary.previous[metric_key]) * 100
);
};
},
},
methods: {
calculateTrend(key) {
if (!this.accountSummary.previous[key]) return 0;
const diff = this.accountSummary[key] - this.accountSummary.previous[key];
return Math.round((diff / this.accountSummary.previous[key]) * 100);
},
displayMetric(key) {
if (this.isAverageMetricType(key)) {
return formatTime(this.accountSummary[key]);
@@ -39,7 +33,11 @@ export default {
return '';
},
isAverageMetricType(key) {
return ['avg_first_response_time', 'avg_resolution_time'].includes(key);
return [
'avg_first_response_time',
'avg_resolution_time',
'reply_time',
].includes(key);
},
},
};