Subversion Repositories SmartDukaan

Rev

Rev 751 | Rev 1397 | 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
 
4
/**
5
Helper service
6
created by @ashish
7
**/
8
 
121 ashish 9
struct Mail{
10
	1:list<string> to,
11
	2:string subject,
12
	3:string data,
351 ashish 13
	4:string sender,
14
	5:list<string> attachments,
15
	6:string password
121 ashish 16
}
17
 
18
struct TextMessage{
19
	1:string number,
20
	2:string message,
21
	3:i64 dispatchTime,
22
	4:i64 deliveryTime
23
}
24
 
116 ashish 25
exception HelperServiceException{
26
	1:i64 id,
27
	2:string message
28
}
29
 
121 ashish 30
struct Message{
31
	1:i64 id,
32
	2:string message
33
}
34
 
495 rajveer 35
struct DashboardUser{
36
	1:string username,
37
	2:string password,
38
	3:i64 dispatchTime,
39
	4:i64 deliveryTime
40
}
41
 
751 chandransh 42
struct LogisticsUser{
43
	1:string username,
44
	2:i64 providerId
45
}
46
 
302 ashish 47
service HelperService{
763 rajveer 48
	/**
49
	* For closing the open session in sqlalchemy
50
	*/
51
	void closeSession(),
52
 
121 ashish 53
	void sendMail(1:Mail mail) throws (1:HelperServiceException se),
54
	void sendText(1:TextMessage message) throws (1:HelperServiceException se),
55
 
351 ashish 56
	void addMessage(1:Message message) throws (1:HelperServiceException se),
121 ashish 57
	void updateMessage(1:i64 id, 2:string message) throws (1:HelperServiceException se),
351 ashish 58
	Message getMessage(1:i64 id) throws (1:HelperServiceException se),
495 rajveer 59
	Message getSubstitutedMessage(1:i64 id, 2:map<string,string> params) throws (1:HelperServiceException se),
60
 
61
	//authenticate dashboard users
62
	bool addUser(1:string username, 2:string password, 3:i64 warehouseId) throws (1:HelperServiceException se),
63
	bool deleteUser(1:string username) throws (1:HelperServiceException se),
751 chandransh 64
	/**
65
	 Returns the warehouseId for the given user if the password matches. Returns -1 otherwise.
66
	 The loggedOn timestamp for the dashboard user is updated as a timestamp.
67
	 It's unclear to me when an exception is thrown : Chandranshu
68
	*/
495 rajveer 69
	i64 authenticateUser(1:string username, 2:string password) throws (1:HelperServiceException se),
751 chandransh 70
	bool updatePassword(1:string username, 2:string oldPassword, 3:string newPassword) throws (1:HelperServiceException se),
71
 
72
	/**
73
	 Returns the LogisticsUser struct associated with the given username and password if they match.
74
	 Throws an exception otherwise.
75
	*/
76
	LogisticsUser authenticateLogisticsUser(1:string username, 2:string password) throws(1:HelperServiceException hse)
116 ashish 77
}