/* global axios */ import ApiClient from './ApiClient'; const getTimeOffset = () => -new Date().getTimezoneOffset() / 60; class SummaryReportsAPI extends ApiClient { constructor() { super('summary_reports', { accountScoped: true, apiVersion: 'v2' }); } getTeamReports({ since, until, businessHours } = {}) { return axios.get(`${this.url}/team`, { params: { since, until, business_hours: businessHours, timezone_offset: getTimeOffset(), }, }); } getAgentReports({ since, until, businessHours } = {}) { return axios.get(`${this.url}/agent`, { params: { since, until, business_hours: businessHours, timezone_offset: getTimeOffset(), }, }); } getInboxReports({ since, until, businessHours } = {}) { return axios.get(`${this.url}/inbox`, { params: { since, until, business_hours: businessHours, timezone_offset: getTimeOffset(), }, }); } getLabelReports({ since, until, businessHours } = {}) { return axios.get(`${this.url}/label`, { params: { since, until, business_hours: businessHours, timezone_offset: getTimeOffset(), }, }); } } export default new SummaryReportsAPI();