Subversion Repositories SmartDukaan

Rev

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

Rev 1627 Rev 1731
Line 12... Line 12...
12
    get_all_orders, change_order_status, get_alerts, set_alert, add_billing_details,\
12
    get_all_orders, change_order_status, get_alerts, set_alert, add_billing_details,\
13
    mark_orders_as_manifested, close_session, accept_order, bill_order, mark_orders_as_picked_up,\
13
    mark_orders_as_manifested, close_session, accept_order, bill_order, mark_orders_as_picked_up,\
14
    mark_orders_as_delivered, mark_orders_as_failed, add_jacket_number,\
14
    mark_orders_as_delivered, mark_orders_as_failed, add_jacket_number,\
15
    order_outofstock, batch_orders, update_non_delivery_reason, enqueue_transaction_info_email,\
15
    order_outofstock, batch_orders, update_non_delivery_reason, enqueue_transaction_info_email,\
16
    get_undelivered_orders, get_order_for_customer, get_valid_order_count,\
16
    get_undelivered_orders, get_order_for_customer, get_valid_order_count,\
17
    get_max_valid_order_amount, get_min_valid_order_amount,\
17
    get_cust_count_with_successful_txn, get_valid_orders_amount_range
18
    get_cust_count_with_successful_txn
-
 
19
 
18
 
20
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
19
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
21
    to_t_alert, to_t_order, to_t_lineitem
20
    to_t_alert, to_t_order, to_t_lineitem
22
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
21
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
23
    LineItem, Order
22
    LineItem, Order
Line 451... Line 450...
451
 
450
 
452
    def getValidOrderCount(self, ):
451
    def getValidOrderCount(self, ):
453
        """
452
        """
454
        Return the number of valid orders. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
453
        Return the number of valid orders. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
455
        """
454
        """
-
 
455
        try:
456
        return get_valid_order_count()
456
            return get_valid_order_count()
-
 
457
        finally:
-
 
458
            close_session()
457
    
459
    
458
    def getNoOfCustomersWithSuccessfulTransaction(self, ):
460
    def getNoOfCustomersWithSuccessfulTransaction(self, ):
459
        """
461
        """
460
        Returns the number of distinct customers who have done successful transactions
462
        Returns the number of distinct customers who have done successful transactions
461
        """
463
        """
-
 
464
        try:
462
        return get_cust_count_with_successful_txn()
465
            return get_cust_count_with_successful_txn()
-
 
466
        finally:
-
 
467
            close_session()
463
 
468
 
464
    def getMaxValidOrderAmount(self, ):
-
 
465
        """
-
 
466
        Returns the maximum amount of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
-
 
467
        """
-
 
468
        return get_max_valid_order_amount()
-
 
469
 
469
 
470
    def getMinValidOrderAmount(self, ):
470
    def getValidOrdersAmountRange(self, ):
471
        """
471
        """
472
        Returns the minimum amount of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
472
        Returns the minimum and maximum amounts of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
-
 
473
        List contains two values, first minimum amount and second maximum amount.
473
        """
474
        """
-
 
475
        try:
474
        return get_min_valid_order_amount()    
476
            return get_valid_orders_amount_range()
-
 
477
        finally:
-
 
478
            close_session()
-
 
479
 
475
            
480
            
476
    def closeSession(self, ):
481
    def closeSession(self, ):
477
        close_session()
482
        close_session()
478
    
483
    
479
    
484