Subversion Repositories SmartDukaan

Rev

Rev 3137 | Rev 3206 | 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 {
28
    EMAIL_CUSTOMER = 1,
29
    CALL_CUSTOMER = 2,
30
    OTHER = 3
31
}
32
 
3026 mandeep.dh 33
struct Ticket {
34
    1:i64 id,
35
    2:i64 customerId,
36
    3:i64 openDate,
3168 mandeep.dh 37
    4:optional i64 closeDate,
3106 mandeep.dh 38
    5:string description,
39
    6:TicketPriority priority,
40
    7:TicketCategory category,
41
    8:TicketStatus status,
3168 mandeep.dh 42
    9:optional i64 assigneeId
3106 mandeep.dh 43
    10:i64 creatorId,
3168 mandeep.dh 44
    11:optional i64 orderId,
45
    12:optional string airwayBillNo,
46
    13:optional string productName
3026 mandeep.dh 47
}
48
 
49
struct Activity {
50
    1:i64 id,
3168 mandeep.dh 51
    2:optional string description,
3106 mandeep.dh 52
    3:i64 creationTimestamp, // represents time at which this activity occurred
53
    4:ActivityType type,
3026 mandeep.dh 54
    5:i64 customerId,
55
    6:i64 creatorId,
56
 
3106 mandeep.dh 57
    // ticket related fields to track changes on ticket fields
3168 mandeep.dh 58
    7:optional i64 ticketId,
59
    8:optional TicketPriority ticketPriority,
60
    9:optional i64 ticketAssigneeId,
61
   10:optional TicketStatus ticketStatus,
62
   11:optional TicketCategory ticketCategory,
63
   12:optional string ticketDescription
3026 mandeep.dh 64
}
65
 
66
struct Agent {
67
    1:i64 id,
68
    2:string name,
69
    3:string emailId,
3168 mandeep.dh 70
    4:optional i64 managerId,
3026 mandeep.dh 71
    5:string password
72
}
73
 
74
service CRMService {
75
    // Methods to read/write tickets from/in database
76
    list<Ticket> getTickets(1:i64 customerId);
3087 mandeep.dh 77
    list<Ticket> getAssignedTickets(1:i64 agentId);
3137 mandeep.dh 78
    list<Ticket> getUnassignedTickets();
79
    // Retrieves all tickets assigned to an agent or its reportee.
80
    list<Ticket> getAllTickets(1:i64 agentId);
3026 mandeep.dh 81
    Ticket getTicket(1:i64 ticketId);
82
    void updateTicket(1:Ticket ticket);
83
    i64 insertTicket(1:Ticket ticket);
84
 
85
    // Methods to read/write activities from/in database
86
    list<Activity> getActivities(1:i64 customerId);
87
    list<Activity> getActivitiesForTicket(1:i64 ticketId);
88
    Activity getActivity(1:i64 activityId);
89
    Activity getLastActivity(1:i64 ticketId);
90
    void insertActivity(1:Activity activity);
91
 
92
    // Methods to read agent information
3087 mandeep.dh 93
    list<Agent> getAllAgents();
3026 mandeep.dh 94
    Agent getAgent(1:i64 agentId);
95
    Agent getAgentByEmailId(1:string agentEmailId);
3087 mandeep.dh 96
    void updatePasswordForAgent(1:string agentEmailId, 2:string password);
97
 
98
    // Methods to read roles and permissions information
99
    list<string> getRoleNamesForAgent(1:string agentEmailId);
3106 mandeep.dh 100
    list<string> getPermissionsForRoleName(1:string roleName);
3026 mandeep.dh 101
}