Subversion Repositories SmartDukaan

Rev

Rev 3024 | Rev 3390 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3024 mandeep.dh 1
/**
2
 * 
3
 */
4
package in.shop2020.crm.handler;
5
 
6
import in.shop2020.crm.domain.Activity;
7
import in.shop2020.crm.persistence.ActivityMapper;
8
 
9
import java.util.List;
10
 
11
import org.apache.thrift.TException;
12
import org.springframework.beans.factory.annotation.Autowired;
13
import org.springframework.stereotype.Service;
14
 
15
/**
16
 * Handler for CRUD operations done on activities in CRM.
17
 *
18
 * @author mandeep
19
 */
20
@Service
21
public class ActivityHandler {
22
    @Autowired
23
    ActivityMapper activityMapper;
24
 
25
    /**
26
     * Retrieves all the activities for a customer.
27
     *
28
     * @param customerId
29
     * @return
30
     * @throws TException
31
     */
32
    public List<Activity> getActivities(Long customerId) {
33
        return activityMapper.getActivities(customerId);
34
    }
35
 
36
    public void insertActivity(Activity activity) {
37
        activityMapper.insertActivity(activity);
38
    }
39
 
40
    public Activity getActivity(long activityId) {
41
        return activityMapper.getActivity(activityId);
42
    }
43
 
44
    /**
45
     * Returns the latest activity done on a given ticket id
46
     *
47
     * @param ticketId
48
     * @return
49
     * @throws TException
50
     */
51
    public Activity getLastActivity(long ticketId) {
52
        return activityMapper.getLastActivity(ticketId);
53
    }
54
 
55
    /**
56
     * Gets all activities done on a ticket
57
     *
58
     * @param ticketId
59
     * @return
60
     * @throws TException
61
     */
62
    public List<Activity> getActivitiesForTicket(long ticketId) {
63
        return activityMapper.getActivitiesForTicket(ticketId);
64
    }
3339 mandeep.dh 65
 
66
    public List<Activity> getActivitiesByCreator(long creatorId) {
67
        return activityMapper.getActivitiesByCreator(creatorId);
68
    }
3024 mandeep.dh 69
}