Subversion Repositories SmartDukaan

Rev

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

Rev 5481 Rev 5527
Line 36... Line 36...
36
    mark_orders_as_local_connected, mark_orders_as_destinationCityReached,\
36
    mark_orders_as_local_connected, mark_orders_as_destinationCityReached,\
37
    mark_orders_as_firstDeliveryAttempted, get_non_delivered_orders_by_courier, get_orders_not_local_connected,\
37
    mark_orders_as_firstDeliveryAttempted, get_non_delivered_orders_by_courier, get_orders_not_local_connected,\
38
    get_doas_not_picked_up, get_return_orders_not_picked_up, get_orders_not_picked_up, get_rto_orders, get_order_list,\
38
    get_doas_not_picked_up, get_return_orders_not_picked_up, get_orders_not_picked_up, get_rto_orders, get_order_list,\
39
    get_order_ids_for_status, update_orders_as_paid_to_vendor, update_COD_agent,\
39
    get_order_ids_for_status, update_orders_as_paid_to_vendor, update_COD_agent,\
40
    get_refunded_orders_marked_paid, get_settlement_for_Cod, get_order_list_for_vendor, update_order_only_as_paid_to_vendor,\
40
    get_refunded_orders_marked_paid, get_settlement_for_Cod, get_order_list_for_vendor, update_order_only_as_paid_to_vendor,\
41
    get_all_verification_agents, get_billed_orders, get_all_return_orders
41
    get_all_verification_agents, get_all_attributes_for_order_id, set_order_attribute_for_transaction, get_billed_orders, get_all_return_orders
-
 
42
 
42
 
43
 
43
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
44
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
44
    to_t_alert, to_t_order, to_t_lineitem, to_t_payment_settlement, to_t_verification_agent
45
    to_t_alert, to_t_order, to_t_lineitem, to_t_payment_settlement, to_t_verification_agent, to_t_attribute
45
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
46
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
46
    LineItem, Order, TransactionServiceException
47
    LineItem, Order, TransactionServiceException
47
from shop2020.utils.Utils import to_py_date, get_fdate_tdate, to_java_date
48
from shop2020.utils.Utils import to_py_date, get_fdate_tdate, to_java_date
48
 
49
 
49
class OrderServiceHandler:
50
class OrderServiceHandler:
Line 118... Line 119...
118
        try:
119
        try:
119
            return get_transaction_status(transactionId)
120
            return get_transaction_status(transactionId)
120
        finally:
121
        finally:
121
            close_session()
122
            close_session()
122
                
123
                
123
    def changeTransactionStatus(self, transactionId, status, description, selfPickup):
124
    def changeTransactionStatus(self, transactionId, status, description, pickUp, orderType):
124
        """
125
        """
125
        Parameters:
126
        Parameters:
126
         - transactionId
127
         - transactionId
127
         - status
128
         - status
128
         - description
129
         - description
129
         - selfPickup
130
         - selfPickup
130
        """
131
        """
131
        try:
132
        try:
132
            return change_transaction_status(transactionId, status, description, selfPickup)
133
            return change_transaction_status(transactionId, status, description, pickUp, orderType)
133
        finally:
134
        finally:
134
            close_session()
135
            close_session()
135
            
136
            
136
    def getOrdersForTransaction(self, transactionId, customerId):
137
    def getOrdersForTransaction(self, transactionId, customerId):
137
        """
138
        """
Line 1490... Line 1491...
1490
            
1491
            
1491
    def getAllVerificationAgents(self, minOrderId, maxOrderId):
1492
    def getAllVerificationAgents(self, minOrderId, maxOrderId):
1492
        try:
1493
        try:
1493
            return [to_t_verification_agent(codAgent) for codAgent in get_all_verification_agents(minOrderId, maxOrderId)]
1494
            return [to_t_verification_agent(codAgent) for codAgent in get_all_verification_agents(minOrderId, maxOrderId)]
1494
        finally:
1495
        finally:
1495
            close_session()        
1496
            close_session()
-
 
1497
            
-
 
1498
    def getAllAttributesForOrderId(self, orderId):
-
 
1499
        try:
-
 
1500
            return [to_t_attribute(attribute) for attribute in get_all_attributes_for_order_id(orderId)]
-
 
1501
        finally:
-
 
1502
            close_session()
-
 
1503
            
-
 
1504
    def setOrderAttributeForTransaction(self, transactionId, attribute):
-
 
1505
        try:
-
 
1506
            set_order_attribute_for_transaction(transactionId, attribute)                    
-
 
1507
        finally:
-
 
1508
            close_session()
1496
        
1509
            
1497
    def closeSession(self, ):
1510
    def closeSession(self, ):
1498
        close_session()
1511
        close_session()
1499
 
1512
 
1500
    def isAlive(self, ):
1513
    def isAlive(self, ):
1501
        """
1514
        """