Subversion Repositories SmartDukaan

Rev

Rev 3374 | Rev 3405 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3374 Rev 3390
Line 32... Line 32...
32
    CALLED_CUSTOMER = 3,
32
    CALLED_CUSTOMER = 3,
33
    RECEIVED_CALL_FROM_CUSTOMER = 4,
33
    RECEIVED_CALL_FROM_CUSTOMER = 4,
34
    OTHER = 5
34
    OTHER = 5
35
}
35
}
36
 
36
 
-
 
37
struct Agent {
-
 
38
    1:i64 id,
-
 
39
    2:string name,
-
 
40
    3:string emailId,
-
 
41
    4:optional i64 managerId,
-
 
42
    5:string password
-
 
43
}
-
 
44
 
37
struct Ticket {
45
struct Ticket {
38
    1:i64 id,
46
    1:i64 id,
39
    2:optional i64 customerId, // used for registered users
47
    2:optional i64 customerId,
40
    3:optional string customerEmailId, // used for un-registered users
-
 
41
    4:i64 openDate,
48
    3:i64 openDate,
42
    5:optional i64 closeDate,
49
    4:optional i64 closeDate,
43
    6:optional string description,
50
    5:optional string description,
44
    7:TicketPriority priority,
51
    6:TicketPriority priority,
45
    8:TicketCategory category,
52
    7:TicketCategory category,
46
    9:TicketStatus status,
53
    8:TicketStatus status,
47
   10:optional i64 assigneeId,
54
    9:optional i64 assigneeId,
48
   11:i64 creatorId,
55
   10:i64 creatorId,
49
   12:optional i64 orderId,
56
   11:optional i64 orderId,
50
   13:optional string airwayBillNo,
57
   12:optional string airwayBillNo,
51
   14:optional string productName
58
   13:optional string productName,
-
 
59
 
-
 
60
   // used for un-registered users
-
 
61
   14:optional string customerMobileNumber,
-
 
62
   15:optional string customerEmailId,
-
 
63
   16:optional string customerName,
-
 
64
 
-
 
65
   // knitted/enriched object
-
 
66
   17:optional Agent assignee,
-
 
67
   18:optional Agent creator
52
}
68
}
53
 
69
 
54
struct Activity {
70
struct Activity {
55
    1:i64 id,
71
    1:i64 id,
56
    2:optional string description,
72
    2:optional string description,
57
    3:i64 creationTimestamp, // represents time at which this activity occurred
73
    3:i64 creationTimestamp, // represents time at which this activity occurred
58
    4:ActivityType type,
74
    4:ActivityType type,
59
    5:optional i64 customerId, // used for registered users
75
    5:optional i64 customerId, // used for registered users
60
    6:optional string customerMobileNumber, // used for unregistered users
-
 
61
    7:i64 creatorId,
76
    6:i64 creatorId,
62
 
77
 
63
    // represents the numeric identifier for the emails sent to customers
78
    // represents the numeric identifier for the emails sent to customers
64
    // These are archived in helper..useremailarchive or helper..useremail
79
    // These are archived in helper..useremailarchive or helper..useremail
65
    8:optional i64 emailId,
80
    7:optional i64 userEmailId,
66
 
81
 
67
    // ticket related fields to track changes on ticket fields
82
    // ticket related fields to track changes on ticket fields
68
    9:optional i64 ticketId,
83
    8:optional i64 ticketId,
69
   10:optional TicketPriority ticketPriority,
84
    9:optional TicketPriority ticketPriority,
70
   11:optional i64 ticketAssigneeId,
85
   10:optional i64 ticketAssigneeId,
71
   12:optional TicketStatus ticketStatus,
86
   11:optional TicketStatus ticketStatus,
72
   13:optional TicketCategory ticketCategory,
87
   12:optional TicketCategory ticketCategory,
73
   14:optional string ticketDescription
88
   13:optional string ticketDescription,
-
 
89
 
-
 
90
   // Activities created as part of mails received from customers
-
 
91
   // have to be explicitly marked as read by agents in CRM.
-
 
92
   // This flag is set over such activities when any agent marks it as read!
-
 
93
   14:optional bool isRead
-
 
94
 
-
 
95
   // used for un-registered users
-
 
96
   15:optional string customerMobileNumber,
-
 
97
   16:optional string customerEmailId,
-
 
98
   17:optional string customerName,
-
 
99
   
-
 
100
   // knitted types for enriched objects
-
 
101
   18:optional Agent creator,
-
 
102
   19:optional Agent ticketAssignee
74
}
103
}
75
 
104
 
76
struct Agent {
105
struct SearchFilter {
77
    1:i64 id,
106
    1:optional i64 ticketId,
78
    2:string name,
107
    2:optional i64 activityId,
-
 
108
    3:optional list<i64> ticketAssigneeIds,
-
 
109
    4:optional list<i64> activityCreatorIds,
79
    3:string emailId,
110
    5:optional i64 agentId,
80
    4:optional i64 managerId,
111
    6:optional i64 customerId,
-
 
112
    7:optional i64 startTimestamp,
-
 
113
    8:optional i64 endTimestamp,
-
 
114
    9:optional bool isActivityRead,
-
 
115
   10:optional string agentEmailId,
81
    5:string password
116
   11:optional string customerEmailId,
-
 
117
   12:optional string customerMobileNumber
82
}
118
}
83
 
119
 
84
service CRMService extends GenericService.GenericService{
120
service CRMService extends GenericService.GenericService{
85
    // Methods to read/write tickets from/in database
121
    // Methods to read/write tickets from/in database
86
    list<Ticket> getTickets(1:i64 customerId);
122
    list<Ticket> getTickets(1:SearchFilter searchFilter);
87
    list<Ticket> getAssignedTickets(1:i64 agentId);
-
 
88
    list<Ticket> getUnassignedTickets();
123
    list<Ticket> getUnassignedTickets();
89
    // Retrieves all tickets assigned to an agent or its reportee.
-
 
90
    list<Ticket> getAllTickets(1:i64 agentId);
-
 
91
    Ticket getTicket(1:i64 ticketId);
-
 
92
    void updateTicket(1:Ticket ticket, 2:Activity activity);
124
    void updateTicket(1:Ticket ticket, 2:Activity activity);
93
    i64 insertTicket(1:Ticket ticket, 2:Activity activity);
125
    i64 insertTicket(1:Ticket ticket, 2:Activity activity);
94
 
126
 
95
    // Methods to read/write activities from/in database
127
    // Methods to read/write activities from/in database
96
    list<Activity> getActivities(1:i64 customerId);
128
    list<Activity> getActivities(1:SearchFilter searchFilter);
97
    list<Activity> getActivitiesByCreator(1:i64 creatorId);
-
 
98
    list<Activity> getActivitiesForTicket(1:i64 ticketId);
-
 
99
    Activity getActivity(1:i64 activityId);
-
 
100
    Activity getLastActivity(1:i64 ticketId);
-
 
101
    void insertActivity(1:Activity activity);
129
    void insertActivity(1:Activity activity);
-
 
130
    void markAsRead(1:i64 activityId, 2:i64 agentId);
102
 
131
 
103
    // Methods to read agent information
132
    // Methods to read agent information
104
    list<Agent> getAllAgents();
-
 
105
    Agent getAgent(1:i64 agentId);
-
 
106
    Agent getAgentByEmailId(1:string agentEmailId);
133
    list<Agent> getAgents(1:SearchFilter searchFilter);
107
    void updatePasswordForAgent(1:string agentEmailId, 2:string password);
134
    void updatePasswordForAgent(1:string agentEmailId, 2:string password);
108
 
135
 
109
    // Methods to read roles and permissions information
136
    // Methods to read roles and permissions information
110
    list<string> getRoleNamesForAgent(1:string agentEmailId);
137
    list<string> getRoleNamesForAgent(1:string agentEmailId);
111
    list<string> getPermissionsForRoleName(1:string roleName);
138
    list<string> getPermissionsForRoleName(1:string roleName);