- RetentionSummaryBadge in the "Previous conversations" sidebar: tiered status (First contact / Active / Recurring / Sleeping / At risk / Inactive) + counts of interactions, one-shots, Pix. - Retention tab in Captain Reports: KpiCards, FlowCard, CohortMatrix (12x13 heatmap with CSV export). - Five new filters on the contacts list: recurring, last interaction, days since, interactions count, reservations paid. - Full pt_BR + en i18n under CAPTAIN_REPORTS.RETENTION.* - Spec for InteractionCalculatorService covering gap behavior, one-shot classification, internal-label exclusion, multi-conversation grouping across the 30h window. - Docs: docs/captain-retention-indicators.md with business rules, column reference, endpoint shape, and backup SQL queries.
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
/* global axios */
|
|
import ApiClient from '../ApiClient';
|
|
|
|
class CaptainReportsAPI extends ApiClient {
|
|
constructor() {
|
|
super('captain/reports', { accountScoped: true });
|
|
}
|
|
|
|
getOperational(params = {}) {
|
|
return axios.get(`${this.url}/operational`, { params });
|
|
}
|
|
|
|
getInsights(params = {}) {
|
|
return axios.get(`${this.url}/insights`, { params });
|
|
}
|
|
|
|
getInsight(id) {
|
|
return axios.get(`${this.url}/insights/${id}`);
|
|
}
|
|
|
|
generateInsight(data) {
|
|
return axios.post(`${this.url}/insights/generate`, data);
|
|
}
|
|
|
|
getExecutive(params = {}) {
|
|
return axios.get(`${this.url}/executive`, { params });
|
|
}
|
|
|
|
drilldown(params = {}) {
|
|
return axios.get(`${this.url}/executive/drilldown`, { params });
|
|
}
|
|
|
|
deliverExecutive(params = {}) {
|
|
return axios.post(`${this.url}/executive/deliver`, params);
|
|
}
|
|
|
|
getRetention(params = {}) {
|
|
return axios.get(`${this.url}/retention`, { params });
|
|
}
|
|
|
|
getRetentionCohort(params = {}) {
|
|
return axios.get(`${this.url}/retention/cohort`, { params });
|
|
}
|
|
}
|
|
|
|
export default new CaptainReportsAPI();
|