Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
412 ashish 1
namespace java in.shop2020.logistics
2
namespace py shop2020.thriftpy.logistics
3
 
646 chandransh 4
enum StationType{
5
	OWN_STATION = 0,		//The service provider's own station.
6
	ASSOCIATE_STATION = 1	//An associate's station
472 rajveer 7
}
442 rajveer 8
 
646 chandransh 9
enum WarehouseLocation{
10
	Delhi = 0,
11
	Mumbai = 1,
12
	Bangalore = 2,
13
	Kolkata = 3
412 ashish 14
}
15
 
16
struct Provider{
17
	1:i64 id,
667 chandransh 18
	2:string name,
2514 chandransh 19
	3:string accountNo,
20
	4:string email
412 ashish 21
}
22
 
646 chandransh 23
struct AwbUpdate{
24
    1:string awbNumber,
25
    2:string providerName,
26
    3:string location,
27
    4:i64 entryDate,
28
    5:string description
412 ashish 29
}
30
 
483 rajveer 31
struct LogisticsInfo{
646 chandransh 32
	1:i64 warehouseId,
33
	2:i64 providerId,
34
	3:i64 deliveryTime,
35
	4:string airway_billno
483 rajveer 36
}
37
 
472 rajveer 38
exception LogisticsServiceException{
39
	1:i64 id,
40
	2:string message
41
}
42
 
667 chandransh 43
service LogisticsService{
646 chandransh 44
	/**
763 rajveer 45
	* For closing the open session in sqlalchemy
46
	*/
47
	void closeSession(),
48
 
49
	/**
667 chandransh 50
	 Returns a provider for a given provider ID. Throws an exception if none found.
51
	*/
52
	Provider getProvider(1:i64 providerId) throws (1:LogisticsServiceException lse),
53
 
54
	/**
673 chandransh 55
	 Returns a list containing all the providers.
56
	*/
57
	list<Provider> getAllProviders() throws (1:LogisticsServiceException lse),
58
 
59
	/**
646 chandransh 60
	 Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
61
	 Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
62
	 is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised. 
63
	 */
64
	LogisticsInfo getLogisticsEstimation(1:i64 itemId, 2:string destination_pin) throws (1:LogisticsServiceException se),
483 rajveer 65
 
646 chandransh 66
	/**
67
	 Same as above excpet that an airway bill number is also allocated and returned.
68
	*/
714 rajveer 69
	LogisticsInfo getLogisticsInfo(1:string destination_pincode, 2:i64 item_id) throws (1:LogisticsServiceException se),
477 rajveer 70
 
646 chandransh 71
	/**
72
	 Returns an unused AWB number for the given provider.
73
	*/
74
	string getEmptyAWB(1:i64 providerId) throws (1:LogisticsServiceException se),
472 rajveer 75
 
646 chandransh 76
	/**
77
	 Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.
78
	*/
729 chandransh 79
	list<AwbUpdate> getShipmentInfo(1:string awb, 2:i64 providerId) throws (1:LogisticsServiceException se),
80
 
81
	/**
82
	 Returns the short three letter code of a pincode for the given provider.
83
     Raises an exception if the pin code is not serviced by the given provider.
84
	*/
1138 chandransh 85
	string getDestinationCode(1:i64 providerId, 2:string pinCode) throws (1:LogisticsServiceException se),
86
 
87
	/**
88
	Returns the number of unused AWB numbers for the given provider  
89
	*/
1730 ankur.sing 90
	i64 getFreeAwbCount(1:i64 providerId),
91
 
92
	/**
93
	Returns list of Holiday dates between fromDate and toDate (both inclusive)
94
	fromDate should be passed as milliseconds corresponding to the start of the day.
95
	If fromDate is passed as -1, fromDate is not considered for filtering
96
	If toDate is passed as -1, toDate is not considered for filtering
97
	*/
98
	list<i64> getHolidays(1:i64 fromDate, 2:i64 toDate)
412 ashish 99
}