Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
3026 mandeep.dh 1
namespace java in.shop2020.crm
2
namespace py shop2020.thriftpy.crm
3
 
4
enum TicketPriority {
5
    LOW = 0,
6
    HIGH = 1,
7
    MEDIUM = 2
8
}
9
 
10
enum TicketStatus {
11
    OPEN = 0,
12
    CLOSED = 1,
13
    REOPEN = 2
14
}
15
 
16
enum TicketCategory {
17
    RETURN_FORM = 1,
18
    ORDER_CANCELLATION = 2,
19
    DELIVERY_PROBLEM = 3,
20
    PAYMENT_STATUS = 4,
21
    ORDER_STATUS = 5,
22
    PRODUCT_REQUEST = 6,
23
    PRODUCT_QUESTION = 7,
24
    OTHER = 8
25
}
26
 
3106 mandeep.dh 27
enum ActivityType {
3269 mandeep.dh 28
    SEND_EMAIL_TO_CUSTOMER = 1,
3271 mandeep.dh 29
    RECEIVED_EMAIL_FROM_CUSTOMER = 2,
3269 mandeep.dh 30
    CALLED_CUSTOMER = 3,
3271 mandeep.dh 31
    RECEIVED_CALL_FROM_CUSTOMER = 4,
3269 mandeep.dh 32
    OTHER = 5
3106 mandeep.dh 33
}
34
 
3026 mandeep.dh 35
struct Ticket {
36
    1:i64 id,
3269 mandeep.dh 37
    2:optional i64 customerId, // used for registered users
38
    3:optional string customerEmailId, // used for un-registered users
39
    4:i64 openDate,
40
    5:optional i64 closeDate,
41
    6:optional string description,
42
    7:TicketPriority priority,
43
    8:TicketCategory category,
44
    9:TicketStatus status,
45
   10:optional i64 assigneeId,
46
   11:i64 creatorId,
47
   12:optional i64 orderId,
48
   13:optional string airwayBillNo,
49
   14:optional string productName
3026 mandeep.dh 50
}
51
 
52
struct Activity {
53
    1:i64 id,
3168 mandeep.dh 54
    2:optional string description,
3106 mandeep.dh 55
    3:i64 creationTimestamp, // represents time at which this activity occurred
56
    4:ActivityType type,
3269 mandeep.dh 57
    5:optional i64 customerId, // used for registered users
58
    6:optional string customerMobileNumber, // used for unregistered users
59
    7:i64 creatorId,
3026 mandeep.dh 60
 
3269 mandeep.dh 61
    // represents the numeric identifier for the emails sent to customers
62
    // These are archived in helper..useremailarchive or helper..useremail
63
    8:optional i64 emailId,
64
 
3106 mandeep.dh 65
    // ticket related fields to track changes on ticket fields
3269 mandeep.dh 66
    9:optional i64 ticketId,
67
   10:optional TicketPriority ticketPriority,
68
   11:optional i64 ticketAssigneeId,
69
   12:optional TicketStatus ticketStatus,
70
   13:optional TicketCategory ticketCategory,
71
   14:optional string ticketDescription
3026 mandeep.dh 72
}
73
 
74
struct Agent {
75
    1:i64 id,
76
    2:string name,
77
    3:string emailId,
3168 mandeep.dh 78
    4:optional i64 managerId,
3026 mandeep.dh 79
    5:string password
80
}
81
 
82
service CRMService {
83
    // Methods to read/write tickets from/in database
84
    list<Ticket> getTickets(1:i64 customerId);
3087 mandeep.dh 85
    list<Ticket> getAssignedTickets(1:i64 agentId);
3137 mandeep.dh 86
    list<Ticket> getUnassignedTickets();
87
    // Retrieves all tickets assigned to an agent or its reportee.
88
    list<Ticket> getAllTickets(1:i64 agentId);
3026 mandeep.dh 89
    Ticket getTicket(1:i64 ticketId);
3206 mandeep.dh 90
    void updateTicket(1:Ticket ticket, 2:Activity activity);
91
    i64 insertTicket(1:Ticket ticket, 2:Activity activity);
3026 mandeep.dh 92
 
93
    // Methods to read/write activities from/in database
94
    list<Activity> getActivities(1:i64 customerId);
3339 mandeep.dh 95
    list<Activity> getActivitiesByCreator(1:i64 creatorId);
3026 mandeep.dh 96
    list<Activity> getActivitiesForTicket(1:i64 ticketId);
97
    Activity getActivity(1:i64 activityId);
98
    Activity getLastActivity(1:i64 ticketId);
99
    void insertActivity(1:Activity activity);
100
 
101
    // Methods to read agent information
3087 mandeep.dh 102
    list<Agent> getAllAgents();
3026 mandeep.dh 103
    Agent getAgent(1:i64 agentId);
104
    Agent getAgentByEmailId(1:string agentEmailId);
3087 mandeep.dh 105
    void updatePasswordForAgent(1:string agentEmailId, 2:string password);
106
 
107
    // Methods to read roles and permissions information
108
    list<string> getRoleNamesForAgent(1:string agentEmailId);
3106 mandeep.dh 109
    list<string> getPermissionsForRoleName(1:string roleName);
3339 mandeep.dh 110
 
111
    // Misc methods
112
    i64 getLastEmailProcessedTimestamp();
113
    void updateLastEmailProcessedTimestamp(1:i64 timestamp);
3026 mandeep.dh 114
}