Subversion Repositories SmartDukaan

Rev

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