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