Subversion Repositories SmartDukaan

Rev

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

Rev 472 Rev 477
Line 4... Line 4...
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
from shop2020.thriftpy.logistics.ttypes import Shipment
6
from shop2020.thriftpy.logistics.ttypes import Shipment
7
from shop2020.logistics.service.impl.DataAccessor import add_empty_AWBs, get_empty_AWB,\
7
from shop2020.logistics.service.impl.DataAccessor import add_empty_AWBs, get_empty_AWB,\
8
    get_provider, get_shipment_info, get_shipments, get_todays_shipments, initialize,\
8
    get_provider, get_shipment_info, get_shipments, get_todays_shipments, initialize,\
9
    get_providers, create_shipment, update_shipment_status, get_logistics_estimation, add_delivery_estimate
9
    get_providers, create_shipment, update_shipment_status, get_logistics_estimation, add_delivery_estimate,\
-
 
10
    add_pincode_warehouse_mapping
10
from shop2020.logistics.service.impl.Converters import to_t_provider,\
11
from shop2020.logistics.service.impl.Converters import to_t_provider,\
11
    to_t_shipment, to_t_shipmentstatusinfo, to_t_shipmentupdate, to_t_itemLogistics
12
    to_t_shipment, to_t_shipmentstatusinfo, to_t_shipmentupdate, to_t_itemLogistics
12
 
13
 
13
from shop2020.utils.Utils import log_entry, to_py_date
14
from shop2020.utils.Utils import log_entry, to_py_date
14
 
15
 
Line 102... Line 103...
102
        Parameters:
103
        Parameters:
103
         - itemId
104
         - itemId
104
         - destination_pin
105
         - destination_pin
105
        """
106
        """
106
        
107
        
107
        delivery_estimate = get_logistics_estimation(itemId, destination_pin, provider_id)
108
        delivery_estimate, warehouse_id = get_logistics_estimation(itemId, destination_pin, provider_id)
108
        items_in_inventory = 100
109
        items_in_inventory = 100
109
        return to_t_itemLogistics(delivery_estimate, items_in_inventory)
110
        return to_t_itemLogistics(delivery_estimate, items_in_inventory, warehouse_id)
110
 
111
 
111
    def addDeliveryEstimate(self, warahouse_id, destination_pin, provider_id, delivery_time):
112
    def addDeliveryEstimate(self, warahouse_id, destination_pin, provider_id, delivery_time, reliability):
112
        """
113
        """
113
        Parameters:
114
        Parameters:
114
         - warahouse_id
115
         - warahouse_id
115
         - destination_pin
116
         - destination_pin
116
         - provider_id
117
         - provider_id
117
         - delivery_time
118
         - delivery_time
118
        """
119
        """
119
        add_delivery_estimate(warahouse_id, destination_pin, provider_id, delivery_time)
120
        add_delivery_estimate(warahouse_id, destination_pin, provider_id, delivery_time, reliability)
-
 
121
        
-
 
122
    def addPincodeWarehouseMapping(self, pincode, warehouse_id, warehouse_pin):
-
 
123
        """
-
 
124
        Parameters:
-
 
125
         - pincode
-
 
126
         - warehouse_id
-
 
127
         - warehouse_name
-
 
128
        """
-
 
129
        add_pincode_warehouse_mapping(pincode, warehouse_id, warehouse_pin)
120
        
130
        
121
    def getTodaysShipments(self, warehouse_id, provider_id):
131
    def getTodaysShipments(self, warehouse_id, provider_id):
122
        """
132
        """
123
        Parameters:
133
        Parameters:
124
         - warehouse_id
134
         - warehouse_id