Subversion Repositories SmartDukaan

Rev

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

Rev 4133 Rev 4247
Line 20... Line 20...
20
    process_return, get_return_order, mark_doas_as_picked_up,\
20
    process_return, get_return_order, mark_doas_as_picked_up,\
21
    create_purchase_order, verify_order, is_alive, get_orders_by_shipping_date,\
21
    create_purchase_order, verify_order, is_alive, get_orders_by_shipping_date,\
22
    update_weight, change_warehouse, change_product, add_delay_reason,\
22
    update_weight, change_warehouse, change_product, add_delay_reason,\
23
    reconcile_cod_collection, get_transactions_requiring_extra_processing,\
23
    reconcile_cod_collection, get_transactions_requiring_extra_processing,\
24
    mark_transaction_as_processed, get_item_wise_risky_orders_count,\
24
    mark_transaction_as_processed, get_item_wise_risky_orders_count,\
25
    get_orders_in_batch, get_order_count
25
    get_orders_in_batch, get_order_count,\
-
 
26
    mark_order_cancellation_request_received, mark_order_as_payment_flag_removed,\
-
 
27
    mark_order_cancellation_request_denied
26
 
28
 
27
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
29
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
28
    to_t_alert, to_t_order, to_t_lineitem
30
    to_t_alert, to_t_order, to_t_lineitem
29
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
31
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
30
    LineItem, Order, TransactionServiceException
32
    LineItem, Order, TransactionServiceException
Line 893... Line 895...
893
        try:
895
        try:
894
            return get_item_wise_risky_orders_count()
896
            return get_item_wise_risky_orders_count()
895
        finally:
897
        finally:
896
            close_session()
898
            close_session()
897
    
899
    
-
 
900
    def markOrderCancellationRequestReceived(self, orderId):
-
 
901
        """
-
 
902
        Mark order as cancellation request received. If customer sends request of cancellation of
-
 
903
        a particular order, this method will be called. It will just change status of the order
-
 
904
        depending on its current status. It also records the previous status, so that we can move
-
 
905
        back to that status if cancellation request is denied.
-
 
906
    
-
 
907
        Parameters:
-
 
908
         - orderId
-
 
909
        """
-
 
910
        try:
-
 
911
            return mark_order_cancellation_request_received(orderId)
-
 
912
        finally:
-
 
913
            close_session()
-
 
914
    
-
 
915
 
-
 
916
    def markOrderAsPaymentFlagRemoved(self, orderId):
-
 
917
        """
-
 
918
        If we and/or payment has decided to accept the order, this method needs to be called.
-
 
919
        Changed order status and payment status
-
 
920
    
-
 
921
        Parameters:
-
 
922
         - orderId
-
 
923
        """
-
 
924
        try:
-
 
925
            return mark_order_as_payment_flag_removed(orderId)
-
 
926
        finally:
-
 
927
            close_session()
-
 
928
 
-
 
929
    def markOrderCancellationRequestDenied(self, orderId):
-
 
930
        """
-
 
931
        If we decide to not to cancel order, we will move the order ro previous status.
-
 
932
    
-
 
933
        Parameters:
-
 
934
         - orderId
-
 
935
        """
-
 
936
        try:
-
 
937
            return mark_order_cancellation_request_denied(orderId)
-
 
938
        finally:
-
 
939
            close_session()
-
 
940
    
-
 
941
    def markOrderCancellationRequestConfirmed(self, orderId):
-
 
942
        """
-
 
943
        If we decide to to cancel order, CRM will call this method to move the status of order to
-
 
944
        cancellation request confirmed. After this OM will be able to cancel the order.
-
 
945
    
-
 
946
        Parameters:
-
 
947
         - orderId
-
 
948
        """
-
 
949
        try:
-
 
950
            return mark_order_cancellation_request_confirmed(orderId)
-
 
951
        finally:
-
 
952
            close_session()
-
 
953
 
898
    def closeSession(self, ):
954
    def closeSession(self, ):
899
        close_session()
955
        close_session()
900
 
956
 
901
    def isAlive(self, ):
957
    def isAlive(self, ):
902
        """
958
        """
903
        For checking weather service is active alive or not. It also checks connectivity with database
959
        For checking weather service is active alive or not. It also checks connectivity with database
904
        """
960
        """
905
        try:
961
        try:
906
            return is_alive()
962
            return is_alive()
907
        finally:
963
        finally:
908
            close_session()
964
            close_session()
909
965