Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.service;

import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
import com.spice.profitmandi.dao.entity.user.AgendaInstance;
import com.spice.profitmandi.dao.enumuration.dtr.AgendaSource;

import java.time.LocalDate;

public interface AgendaInstanceService {

    /**
     * Open an instance; no-op returning the existing one if already OPEN for
     * (fofoId, agendaType). Race-safe via the uq_one_open DB key.
     */
    AgendaInstance open(int fofoId, String agendaType, AgendaSource source, Integer openedBy,
                        String openMetricJson) throws ProfitMandiBusinessException;

    /** Cron-only close path: metric normalized. closed_by stays NULL. */
    void closeByMetric(AgendaInstance instance, String closeMetricJson);

    /** Team close path. Rejects AUTO instances — those close only by metric. */
    void closeManual(AgendaInstance instance, int closedBy, String remark)
            throws ProfitMandiBusinessException;

    /** Log one visit discussion against an OPEN instance. */
    void logVisit(int instanceId, Integer locationTrackingId, int visitorUserId,
                  LocalDate visitDate, String discussion) throws ProfitMandiBusinessException;
}