Subversion Repositories SmartDukaan

Rev

Rev 3044 | Rev 3103 | 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
 
3044 chandransh 16
enum DeliveryType {
17
	PREPAID = 0,
18
	COD = 1
19
}
20
 
21
struct ProviderDetails{
22
	1:string accountNo,
23
	2:string email
24
}
25
 
412 ashish 26
struct Provider{
27
	1:i64 id,
667 chandransh 28
	2:string name,
3044 chandransh 29
	3:map<DeliveryType, ProviderDetails> details
412 ashish 30
}
31
 
646 chandransh 32
struct AwbUpdate{
33
    1:string awbNumber,
34
    2:string providerName,
35
    3:string location,
36
    4:i64 entryDate,
37
    5:string description
412 ashish 38
}
39
 
483 rajveer 40
struct LogisticsInfo{
646 chandransh 41
	1:i64 warehouseId,
42
	2:i64 providerId,
43
	3:i64 deliveryTime,
44
	4:string airway_billno
483 rajveer 45
}
46
 
472 rajveer 47
exception LogisticsServiceException{
48
	1:i64 id,
49
	2:string message
50
}
51
 
667 chandransh 52
service LogisticsService{
646 chandransh 53
	/**
763 rajveer 54
	* For closing the open session in sqlalchemy
55
	*/
56
	void closeSession(),
57
 
58
	/**
667 chandransh 59
	 Returns a provider for a given provider ID. Throws an exception if none found.
60
	*/
61
	Provider getProvider(1:i64 providerId) throws (1:LogisticsServiceException lse),
62
 
63
	/**
673 chandransh 64
	 Returns a list containing all the providers.
65
	*/
66
	list<Provider> getAllProviders() throws (1:LogisticsServiceException lse),
67
 
68
	/**
646 chandransh 69
	 Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
70
	 Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
71
	 is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised. 
72
	 */
73
	LogisticsInfo getLogisticsEstimation(1:i64 itemId, 2:string destination_pin) throws (1:LogisticsServiceException se),
483 rajveer 74
 
646 chandransh 75
	/**
76
	 Same as above excpet that an airway bill number is also allocated and returned.
77
	*/
3044 chandransh 78
	LogisticsInfo getLogisticsInfo(1:string destination_pincode, 2:i64 item_id, 3:DeliveryType type) throws (1:LogisticsServiceException se),
477 rajveer 79
 
646 chandransh 80
	/**
81
	 Returns an unused AWB number for the given provider.
82
	*/
83
	string getEmptyAWB(1:i64 providerId) throws (1:LogisticsServiceException se),
472 rajveer 84
 
646 chandransh 85
	/**
86
	 Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.
87
	*/
729 chandransh 88
	list<AwbUpdate> getShipmentInfo(1:string awb, 2:i64 providerId) throws (1:LogisticsServiceException se),
89
 
90
	/**
91
	 Returns the short three letter code of a pincode for the given provider.
92
     Raises an exception if the pin code is not serviced by the given provider.
93
	*/
1138 chandransh 94
	string getDestinationCode(1:i64 providerId, 2:string pinCode) throws (1:LogisticsServiceException se),
95
 
96
	/**
97
	Returns the number of unused AWB numbers for the given provider  
98
	*/
1730 ankur.sing 99
	i64 getFreeAwbCount(1:i64 providerId),
100
 
101
	/**
102
	Returns list of Holiday dates between fromDate and toDate (both inclusive)
103
	fromDate should be passed as milliseconds corresponding to the start of the day.
104
	If fromDate is passed as -1, fromDate is not considered for filtering
105
	If toDate is passed as -1, toDate is not considered for filtering
106
	*/
3060 chandransh 107
	list<i64> getHolidays(1:i64 fromDate, 2:i64 toDate),
108
 
109
	/**
110
	Returns true if COD is allowed for this destination pincode
111
	*/
112
	bool isCodAllowed(1:string destination_pincode)
412 ashish 113
}