Subversion Repositories SmartDukaan

Rev

Rev 7785 | Rev 7808 | 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
 
5527 anupam.sin 23
enum PickUpType {
24
	COURIER = 0,
25
	RUNNER = 1,
26
	SELF = 2
27
}
28
 
3044 chandransh 29
struct ProviderDetails{
30
	1:string accountNo,
31
	2:string email
7792 anupam.sin 32
	3:i64 logisticLocation
33
	4:DeliveryType deliveryType
3044 chandransh 34
}
35
 
412 ashish 36
struct Provider{
37
	1:i64 id,
667 chandransh 38
	2:string name,
7792 anupam.sin 39
	3:list<ProviderDetails> details,
5527 anupam.sin 40
	4:PickUpType pickup
412 ashish 41
}
42
 
646 chandransh 43
struct AwbUpdate{
44
    1:string awbNumber,
6643 rajveer 45
    2:i64 providerId,
46
    3:i64 date,
47
    4:string status,
48
    5:string description,
49
    6:string location
412 ashish 50
}
51
 
5110 mandeep.dh 52
struct LogisticsInfo {
646 chandransh 53
	1:i64 warehouseId,
54
	2:i64 providerId,
55
	3:i64 deliveryTime,
4009 chandransh 56
	4:string airway_billno,
4865 rajveer 57
	5:i64 shippingTime,
5110 mandeep.dh 58
	6:bool codAllowed,
6524 rajveer 59
	7:i64 fulfilmentWarehouseId,
6725 rajveer 60
	8:bool otgAvailable,
61
	9:i64 deliveryDelay
483 rajveer 62
}
63
 
5553 rajveer 64
struct PickupStore {
5719 rajveer 65
	1:i64 id,
66
	2:string hotspotId,	
67
	3:string name,
68
    4:string line1,
69
    5:string line2,
70
    6:string city,
71
    7:string state,
72
    8:string pin,
5739 rajveer 73
    9:string phone,
5863 rajveer 74
    10:string email,
75
    11:string zone,
76
    12:string bdm,
77
    13:string bdmEmail
5553 rajveer 78
}
7785 manish.sha 79
 
80
struct LogisticsLocationInfo {
81
	1:i64 providerId,
82
	2:string pinCode,
83
	3:string destinationCode,
84
	4:bool expAvailable,
85
	5:bool codAvailable,
86
	6:bool otgAvailable,
87
	7:i64 codLimit,
88
	8:i64 prepaidLimit,
89
	9:i64 warehouseId,
90
	10:i64 deliveryTime,
91
	11:i64 delivery_delay
92
}
5553 rajveer 93
 
472 rajveer 94
exception LogisticsServiceException{
95
	1:i64 id,
96
	2:string message
97
}
98
 
3374 rajveer 99
service LogisticsService extends GenericService.GenericService{
646 chandransh 100
	/**
667 chandransh 101
	 Returns a provider for a given provider ID. Throws an exception if none found.
102
	*/
103
	Provider getProvider(1:i64 providerId) throws (1:LogisticsServiceException lse),
104
 
105
	/**
673 chandransh 106
	 Returns a list containing all the providers.
107
	*/
108
	list<Provider> getAllProviders() throws (1:LogisticsServiceException lse),
109
 
110
	/**
646 chandransh 111
	 Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
112
	 Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
4630 mandeep.dh 113
	 is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
646 chandransh 114
	 */
4630 mandeep.dh 115
	LogisticsInfo getLogisticsEstimation(1:i64 itemId, 2:string destination_pin, 3:DeliveryType type) throws (1:LogisticsServiceException se),
483 rajveer 116
 
7256 rajveer 117
	LogisticsInfo getLogisticsEstimationForStore(1:i64 itemId, 2:string destination_pin, 3:DeliveryType type) throws (1:LogisticsServiceException se),
118
 
646 chandransh 119
	/**
120
	 Same as above excpet that an airway bill number is also allocated and returned.
121
	*/
5766 rajveer 122
	LogisticsInfo getLogisticsInfo(1:string destination_pincode, 2:i64 item_id, 3:DeliveryType type, 4:PickUpType pickUp) throws (1:LogisticsServiceException se),
477 rajveer 123
 
646 chandransh 124
	/**
125
	 Returns an unused AWB number for the given provider.
126
	*/
5247 rajveer 127
	string getEmptyAWB(1:i64 providerId, DeliveryType type) throws (1:LogisticsServiceException se),
472 rajveer 128
 
646 chandransh 129
	/**
130
	 Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.
131
	*/
6643 rajveer 132
	list<AwbUpdate> getShipmentInfo(1:string awbNumber, 2:i64 providerId) throws (1:LogisticsServiceException se),
729 chandransh 133
 
134
	/**
6643 rajveer 135
	 Store the update for the given AWB number and provider id.
136
	*/
137
	void storeShipmentInfo(1:AwbUpdate update) throws (1:LogisticsServiceException se),
138
 
139
 
140
	/**
729 chandransh 141
	 Returns the short three letter code of a pincode for the given provider.
142
     Raises an exception if the pin code is not serviced by the given provider.
143
	*/
1138 chandransh 144
	string getDestinationCode(1:i64 providerId, 2:string pinCode) throws (1:LogisticsServiceException se),
145
 
146
	/**
3103 chandransh 147
	Returns the number of unused AWB numbers for the given provider of the given type  
1138 chandransh 148
	*/
3103 chandransh 149
	i64 getFreeAwbCount(1:i64 providerId, 2:string type),
1730 ankur.sing 150
 
151
	/**
152
	Returns list of Holiday dates between fromDate and toDate (both inclusive)
153
	fromDate should be passed as milliseconds corresponding to the start of the day.
154
	If fromDate is passed as -1, fromDate is not considered for filtering
155
	If toDate is passed as -1, toDate is not considered for filtering
156
	*/
4934 amit.gupta 157
	list<i64> getHolidays(1:i64 fromDate, 2:i64 toDate),
158
 
159
	/**
160
	 Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
161
	 Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
162
	 is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
163
	 */
164
	list<i64> getEntityLogisticsEstimation(1:i64 catalogItemId, 2:string destination_pin, 3:DeliveryType type) throws (1:LogisticsServiceException se)
5527 anupam.sin 165
 
166
	/**
167
	* Returns the id for a given pickUpType
168
	*/
5553 rajveer 169
	i64 getProviderForPickupType(1:i64 pickUp),
170
 
171
 
172
	list<PickupStore> getAllPickupStores(),
173
 
5719 rajveer 174
	PickupStore getPickupStore(1:i64 storeId),
175
 
6322 amar.kumar 176
	PickupStore getPickupStoreByHotspotId(1:string hotspotId),
177
 
7567 rajveer 178
	void addPincode(1:i64 providerId, 2:string pincode, 3:string destCode, 4:bool exp, 5:bool cod, 6:i32 stationType, 7:bool otgAvailable),
6322 amar.kumar 179
 
7567 rajveer 180
	void updatePincode(1:i64 providerId, 2:string pincode, 3:bool exp, 4:bool cod, 5:bool otgAvailable),
181
 
7734 manish.sha 182
	bool addNewAwbs(1:i64 providerId, 2:bool cod, 3:list<string> awbs),
183
 
7785 manish.sha 184
	void runLogisticsLocationInfoUpdate(1:list<LogisticsLocationInfo> logisticsLocationInfoList, 2:bool runCompleteUpdate)
412 ashish 185
}