Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
116 ashish 1
namespace java in.shop2020.utils
2
namespace py shop2020.thriftpy.utils
3
 
3374 rajveer 4
include "GenericService.thrift"
5
 
116 ashish 6
/**
7
Helper service
8
created by @ashish
9
**/
10
 
4693 mandeep.dh 11
struct Agent {
12
    1:i64 id,
13
    2:string name,
14
    3:string emailId,
15
    4:optional i64 managerId,
16
    5:string password,
17
    6:bool isActive
18
}
19
 
121 ashish 20
struct Mail{
21
	1:list<string> to,
22
	2:string subject,
23
	3:string data,
351 ashish 24
	4:string sender,
25
	5:list<string> attachments,
26
	6:string password
121 ashish 27
}
28
 
29
struct TextMessage{
30
	1:string number,
31
	2:string message,
32
	3:i64 dispatchTime,
33
	4:i64 deliveryTime
34
}
35
 
116 ashish 36
exception HelperServiceException{
37
	1:i64 id,
38
	2:string message
39
}
40
 
121 ashish 41
struct Message{
42
	1:i64 id,
43
	2:string message
44
}
45
 
2780 chandransh 46
enum Role{
47
	WAREHOUSE_EXECUTIVE = 0,
48
	ADMIN = 1,
8910 amar.kumar 49
	WAREHOUSE_MONITOR = 2,
50
	WAREHOUSE_OBSERVER = 3
2780 chandransh 51
}
52
 
495 rajveer 53
struct DashboardUser{
54
	1:string username,
55
	2:string password,
2442 chandransh 56
	3:i64 warehouseId,
8303 amar.kumar 57
	4:Role role,
58
	5:i64 source
495 rajveer 59
}
60
 
751 chandransh 61
struct LogisticsUser{
62
	1:string username,
63
	2:i64 providerId
64
}
65
 
1611 ankur.sing 66
struct StatisticsUser{
1891 ankur.sing 67
	1:string username
1611 ankur.sing 68
}
69
 
2023 ankur.sing 70
struct CatalogDashboardUser{
71
	1:string username,
2356 ankur.sing 72
	2:string password,
73
	3:i64 role
2023 ankur.sing 74
}
75
 
1397 varun.gupt 76
struct UserEmail{
1422 varun.gupt 77
	1:i64 id,
5864 rajveer 78
	2:list<string> emailTo,
1422 varun.gupt 79
	3:string emailFrom,
80
	4:string subject,
81
	5:string body,
82
	6:string source,
83
	7:string emailType,
84
	8:bool status,
5864 rajveer 85
	9:i64 timestamp,
86
	10:list<string> cc,
87
	11:list<string> bcc
1397 varun.gupt 88
}
89
 
1891 ankur.sing 90
struct ReportUser{
91
	1:string username,
92
	2:i64 role
93
}
94
 
95
struct Report{
96
	1:i64 id,
97
	2:string description,
98
	3:string controller
99
}
100
 
4806 varun.gupt 101
struct QuickLink	{
4996 varun.gupt 102
	1:i64 id,
103
	2:string url,
104
	3:string text
4806 varun.gupt 105
}
106
 
7410 amar.kumar 107
struct AgentWarehouseMapping{
108
	1:i64 agentId,
109
	2:i64 warehouseId
110
}
111
 
3374 rajveer 112
service HelperService extends GenericService.GenericService{
763 rajveer 113
	/**
3206 mandeep.dh 114
	* Save email details, to be sent later; Also returns its identifier.
2455 varun.gupt 115
	*/
8020 rajveer 116
	i64 saveUserEmailForSending(1:list<string> emailTo, 2:string emailFrom, 3:string subject, 4:string body, 5:string source, 6:string emailType, 7:list<string> cc, 8:list<string> bcc, 9:i64 sourceId) throws (1:HelperServiceException se),
2455 varun.gupt 117
 
118
	/**
119
	* Retreives all the emails pending for dispatch
120
	*/
3086 rajveer 121
	list<UserEmail> getEmailsToBeSent() throws (1:HelperServiceException se),
2455 varun.gupt 122
 
123
	/**
124
	* Marks email as sent after successful dispatch
125
	*/
1422 varun.gupt 126
	void markEmailAsSent(1:i64 emailId) throws (1:HelperServiceException se),
1397 varun.gupt 127
 
121 ashish 128
	void sendMail(1:Mail mail) throws (1:HelperServiceException se),
129
	void sendText(1:TextMessage message) throws (1:HelperServiceException se),
130
 
351 ashish 131
	void addMessage(1:Message message) throws (1:HelperServiceException se),
121 ashish 132
	void updateMessage(1:i64 id, 2:string message) throws (1:HelperServiceException se),
351 ashish 133
	Message getMessage(1:i64 id) throws (1:HelperServiceException se),
495 rajveer 134
	Message getSubstitutedMessage(1:i64 id, 2:map<string,string> params) throws (1:HelperServiceException se),
135
 
136
	//authenticate dashboard users
137
	bool addUser(1:string username, 2:string password, 3:i64 warehouseId) throws (1:HelperServiceException se),
138
	bool deleteUser(1:string username) throws (1:HelperServiceException se),
2442 chandransh 139
 
751 chandransh 140
	/**
2442 chandransh 141
	 Returns the dashboard user if the supplied username and password match. Raises an exception otherwise.
142
	 The loggedOn timestamp for the dashboard user is updated .
751 chandransh 143
	*/
2442 chandransh 144
	DashboardUser authenticateDashboardUser(1:string username, 2:string password) throws (1:HelperServiceException se),
145
 
146
	/**
147
	Update the password of the dashboard user. Currently, there is no place where this method is called.
148
	*/
751 chandransh 149
	bool updatePassword(1:string username, 2:string oldPassword, 3:string newPassword) throws (1:HelperServiceException se),
150
 
151
	/**
152
	 Returns the LogisticsUser struct associated with the given username and password if they match.
153
	 Throws an exception otherwise.
154
	*/
155
	LogisticsUser authenticateLogisticsUser(1:string username, 2:string password) throws(1:HelperServiceException hse)
1611 ankur.sing 156
 
157
	/**
158
	 Returns the StatisticsUser struct associated with the given username and password if they match.
159
	 Throws an exception otherwise.
160
	*/
1891 ankur.sing 161
	StatisticsUser authenticateStatisticsUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
162
 
163
	/**
164
	 Returns the ReportUser struct associated with the given username and password if they match.
165
	 Throws an exception otherwise.
166
	*/
167
	ReportUser authenticateReportUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
168
 
169
	/**
170
	Returns list of reports which are configured for the given role. 
171
	*/
2023 ankur.sing 172
	list<Report> getReports(1:i64 role),
173
 
174
	/**
2356 ankur.sing 175
	 Returns the CatalogDashboardUser struct associated with the given username, password and role if they match.
2023 ankur.sing 176
	 Throws an exception otherwise.
177
	*/
6788 rajveer 178
	CatalogDashboardUser authenticateCatalogUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
4544 varun.gupt 179
 
180
	/**
181
	Saves the list of entity Ids to be shared with an email address 
182
	*/
4693 mandeep.dh 183
	void shareEntities(1:list<i64> entityIds, 2:string email) throws(1:HelperServiceException hse),
184
 
185
    // Methods to read agent information
4806 varun.gupt 186
    list<Agent> getAgents(),
187
    bool validateLogIn(1:string emailId, 2:string password),
188
    void updatePasswordForAgent(1:string agentEmailId, 2:string password),
4693 mandeep.dh 189
 
190
    // Methods to read roles and permissions information
4806 varun.gupt 191
    list<string> getRoleNamesForAgent(1:string agentEmailId),
4996 varun.gupt 192
    list<string> getPermissionsForRoleName(1:string roleName),
4806 varun.gupt 193
 
194
    //Methods to save and read QuickLinks
195
    void saveQuickLink(1:string url, 2:string text) throws(1:HelperServiceException hse),
4996 varun.gupt 196
    list<QuickLink> getQuickLinks() throws(1:HelperServiceException hse),
5055 varun.gupt 197
    void updateQuickLink(1:i64 id, 2:string url, 3:string text) throws(1:HelperServiceException hse),
198
 
199
	/**
200
	Returns a list of emails to which product notifications have been sent in a given date range
201
	*/
6322 amar.kumar 202
	list<string> getEmailsForNotificationsSent(1:i64 startDatetime, 2:i64 endDatetime) throws(1:HelperServiceException hse),
203
 
204
	//Returns body of mail sent for order confirmation
7410 amar.kumar 205
	string getOrderConfirmationMail(1:i64 orderId),
7221 kshitij.so 206
 
207
	//Returns body of mail sent for delivery success
7410 amar.kumar 208
	string getOrderDeliveryMail(1:i64 orderId),
209
 
210
	list<i64> getWarehouseIdsForAgent(1:string agentEmailId),
211
 
116 ashish 212
}