feat: Consider business hours while generating the reports (#4330)

* feat: Consider business hours while generating the reports
This commit is contained in:
Aswin Dev P.S 2022-04-08 12:48:18 +05:30 committed by GitHub
parent 57359be37e
commit d5536d65f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 241 additions and 48 deletions

View file

@ -8,7 +8,15 @@ class ReportsAPI extends ApiClient {
super('reports', { accountScoped: true, apiVersion: 'v2' });
}
getReports(metric, since, until, type = 'account', id, group_by) {
getReports(
metric,
since,
until,
type = 'account',
id,
group_by,
business_hours
) {
return axios.get(`${this.url}`, {
params: {
metric,
@ -17,12 +25,13 @@ class ReportsAPI extends ApiClient {
type,
id,
group_by,
business_hours,
timezone_offset: getTimeOffset(),
},
});
}
getSummary(since, until, type = 'account', id, group_by) {
getSummary(since, until, type = 'account', id, group_by, business_hours) {
return axios.get(`${this.url}/summary`, {
params: {
since,
@ -30,6 +39,7 @@ class ReportsAPI extends ApiClient {
type,
id,
group_by,
business_hours,
},
});
}