Subversion Repositories SmartDukaan

Rev

Rev 510 | Rev 667 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 510 Rev 646
Line 1... Line 1...
1
namespace java in.shop2020.logistics
1
namespace java in.shop2020.logistics
2
namespace py shop2020.thriftpy.logistics
2
namespace py shop2020.thriftpy.logistics
3
 
3
 
4
//struct AWB{
4
enum StationType{
5
//    1:string awb_number,
-
 
6
//    2:bool is_available,
-
 
7
//    3:i64 provider_id
5
	OWN_STATION = 0,		//The service provider's own station.
8
//}
-
 
9
 
-
 
10
 
-
 
11
struct ItemLogistics{
-
 
12
	1:i64 warehouseId,
-
 
13
	2:i64 availability,
-
 
14
	3:i64 shippingTime
-
 
15
}
-
 
16
 
-
 
17
 
-
 
18
struct ShipmentUpdate{
-
 
19
	1:string pin,
-
 
20
	2:i64 timestamp,
-
 
21
	3:string description
6
	ASSOCIATE_STATION = 1	//An associate's station
22
}
7
}
23
 
8
 
24
struct ShipmentStatusInfo{
9
enum WarehouseLocation{
25
	1:string awb,
10
	Delhi = 0,
26
	2:i64 provider_id,
11
	Mumbai = 1,
27
	3:list<ShipmentUpdate> updates,
12
	Bangalore = 2,
28
	4:ShipmentUpdate currentUpdate
13
	Kolkata = 3
29
}
14
}
30
 
15
 
31
struct Provider{
16
struct Provider{
32
	1:i64 id,
17
	1:i64 id,
33
	2:string name
18
	2:string name
34
}
19
}
35
 
20
 
36
struct Shipment{
21
struct AwbUpdate{
37
	1:string warehouse_name,
-
 
38
	2:string awb,
22
    1:string awbNumber,
39
	3:string origin,
23
    2:string providerName,
40
	4:string destination,
24
    3:string location,
41
	5:i64 timestamp,
25
    4:i64 entryDate,
42
	6:string recepient_name,
-
 
43
	7:string recepient_address,
-
 
44
	8:string recepient_pincode,
-
 
45
	9:string recepient_phone,
26
    5:string description
46
	10:string shipment_weight,
-
 
47
	11:string shipment_contents
-
 
48
}
27
}
49
 
28
 
50
struct LogisticsInfo{
29
struct LogisticsInfo{
51
	1:i64 warehouse_id,
30
	1:i64 warehouseId,
52
	2:i64 provider_id,
31
	2:i64 providerId,
53
	3:string airway_billno,
32
	3:i64 deliveryTime,
54
	4:i64 delivery_estimate
33
	4:string airway_billno
55
}
34
}
56
 
35
 
57
exception LogisticsServiceException{
36
exception LogisticsServiceException{
58
	1:i64 id,
37
	1:i64 id,
59
	2:string message
38
	2:string message
60
}
39
}
61
 
40
 
62
service LogisticsService{
41
service LogisticsService{	
63
 
42
	/**
-
 
43
	 Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
64
	//API for order service
44
	 Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
-
 
45
	 is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised. 
-
 
46
	 */
65
	LogisticsInfo getLogisticsInfo(1:string destination_pincode, 2:string sku_id) throws (1:LogisticsServiceException se),
47
	LogisticsInfo getLogisticsEstimation(1:i64 itemId, 2:string destination_pin) throws (1:LogisticsServiceException se),
66
	
48
	
-
 
49
	/**
67
	//This call would return the logistic estimate 
50
	 Same as above excpet that an airway bill number is also allocated and returned.
-
 
51
	*/
68
	ItemLogistics getLogisticsEstimation(1:i64 itemId, 2:string destination_pin, 3:i64 provider_id ) throws (1:LogisticsServiceException se),
52
	LogisticsInfo getLogisticsInfo(1:string destination_pincode, 2:string item_id) throws (1:LogisticsServiceException se),
69
	void addDeliveryEstimate(1:i64 warahouse_id, 2:string destination_pin, 3:i64 provider_id, 4:i64 delivery_time, 5:i64 reliability),
-
 
70
	void addPincodeWarehouseMapping(1:string pin_code, 2:i64 warehouse_id, 3:string warehouse_pin),
-
 
71
	
53
	
72
	//APIs to be used by shop2020 components
54
	/**
73
	void addEmptyAWBs(1:list<string> numbers, 2:i64 provider_id),
55
	 Returns an unused AWB number for the given provider.
-
 
56
	*/
74
	string getEmptyAWB(1:i64 provider_id),
57
	string getEmptyAWB(1:i64 providerId) throws (1:LogisticsServiceException se),
75
	list<Provider> getProviders(),
-
 
76
	Provider getProvider(1:i64 provider_id),
-
 
77
	void createShipment(1:Shipment shipment),
-
 
78
	void updateShipmentStatus(1:string awb, 2:ShipmentUpdate shipment_update),
-
 
79
	ShipmentStatusInfo getShipmentInfo(1:string awb),
-
 
80
 
58
 
81
	//APIs to be used by logistic provider
59
	/**
82
	list<Shipment> getShipments(1:i64 warehouse_id, 2:i64 from_date, 3:i64 to_date, 4:i64 provider_id),
60
	 Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.
83
	list<Shipment> getTodaysShipments(1:i64 warehouse_id,2:i64 provider_id)
-
 
84
	 	
61
	*/
-
 
62
	list<AwbUpdate> getShipmentInfo(1:string awb, 2:i64 providerId) throws (1:LogisticsServiceException se)
85
}
63
}
86
 
64