Subversion Repositories SmartDukaan

Rev

Rev 37166 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
37166 amit 1
package com.spice.profitmandi.service;
2
 
3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
4
import com.spice.profitmandi.dao.entity.user.AgendaInstance;
5
import com.spice.profitmandi.dao.enumuration.dtr.AgendaSource;
6
 
7
import java.time.LocalDate;
8
 
9
public interface AgendaInstanceService {
10
 
11
    /**
12
     * Open an instance; no-op returning the existing one if already OPEN for
13
     * (fofoId, agendaType). Race-safe via the uq_one_open DB key.
14
     */
15
    AgendaInstance open(int fofoId, String agendaType, AgendaSource source, Integer openedBy,
16
                        String openMetricJson) throws ProfitMandiBusinessException;
17
 
18
    /** Cron-only close path: metric normalized. closed_by stays NULL. */
19
    void closeByMetric(AgendaInstance instance, String closeMetricJson);
20
 
21
    /** Team close path. Rejects AUTO instances — those close only by metric. */
22
    void closeManual(AgendaInstance instance, int closedBy, String remark)
23
            throws ProfitMandiBusinessException;
24
 
25
    /** Log one visit discussion against an OPEN instance. */
26
    void logVisit(int instanceId, Integer locationTrackingId, int visitorUserId,
27
                  LocalDate visitDate, String discussion) throws ProfitMandiBusinessException;
37181 amit 28
 
29
    /**
30
     * Display-layer filter for visit surfaces (day-view agenda + checkout
31
     * remarks): when a REVIVAL instance is open, AUTO data-driven agendas other
32
     * than CREDIT_DUES stay hidden — the instances keep their own lifecycle,
33
     * they just aren't populated during the visit. MANUAL instances always show.
34
     */
35
    java.util.List<com.spice.profitmandi.dao.entity.user.AgendaInstance> filterVisibleForVisit(
36
            java.util.List<com.spice.profitmandi.dao.entity.user.AgendaInstance> openInstances);
37166 amit 37
}