Subversion Repositories SmartDukaan

Rev

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