| 36877 |
vikas |
1 |
package com.spice.profitmandi.dao.service;
|
|
|
2 |
|
|
|
3 |
import java.util.List;
|
|
|
4 |
import java.util.Map;
|
|
|
5 |
|
|
|
6 |
/**
|
| 36897 |
vikas |
7 |
* Read-only Period analytics for the new "Beat Journey" console — live
|
|
|
8 |
* cross-schema native SQL, where every query is scoped to a caller-supplied set
|
|
|
9 |
* of user ids so each manager sees only their own downline. The caller resolves
|
|
|
10 |
* the scope (downline → auth_user ids → dtr.users ids via the email bridge) and
|
|
|
11 |
* passes both id sets in.
|
| 36877 |
vikas |
12 |
*
|
|
|
13 |
* (The "Today / live" payload is assembled in the controller from repositories —
|
|
|
14 |
* it reuses Beat Report's per-user today-assembly rather than duplicating
|
|
|
15 |
* name/beat lookups in SQL.)
|
|
|
16 |
*
|
|
|
17 |
* Identity bridge: planning rows (beat/beat_route/beat_schedule/beat_deferred_visit,
|
|
|
18 |
* cs.position, my_franchisee_visit) key on auth.auth_user.id; execution rows
|
|
|
19 |
* (auth.location_tracking) key on dtr.users.id. No FK exists between them.
|
|
|
20 |
*/
|
|
|
21 |
public interface BeatJourneyService {
|
|
|
22 |
|
|
|
23 |
/**
|
|
|
24 |
* "Period" analytics payload over [startDate, endDate]: KPIs, aggregate funnel,
|
|
|
25 |
* per-executive scorecard, coverage by level, working-hour utilization, deferrals
|
|
|
26 |
* + SLA, travel/route quality, outcomes, and the computed "what to fix" findings.
|
|
|
27 |
*
|
|
|
28 |
* @param startDate range start, 'yyyy-MM-dd'
|
|
|
29 |
* @param endDate range end (inclusive), 'yyyy-MM-dd'
|
|
|
30 |
* @param today elapsed boundary for "to-date" comparisons, 'yyyy-MM-dd'
|
|
|
31 |
* @param authIds in-scope auth_user ids (planning side)
|
|
|
32 |
* @param dtrIds in-scope dtr.users ids (execution side)
|
|
|
33 |
*/
|
|
|
34 |
Map<String, Object> periodAnalytics(String startDate, String endDate, String today,
|
|
|
35 |
List<Integer> authIds, List<Integer> dtrIds);
|
|
|
36 |
}
|