Subversion Repositories SmartDukaan

Rev

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

Rev 18590 Rev 18634
Line 11... Line 11...
11
    to_t_order, to_t_lineitem, to_t_payment_settlement, to_t_verification_agent, \
11
    to_t_order, to_t_lineitem, to_t_payment_settlement, to_t_verification_agent, \
12
    to_t_attribute, to_t_rechargeTransaction, to_t_frc, to_t_hotspot, \
12
    to_t_attribute, to_t_rechargeTransaction, to_t_frc, to_t_hotspot, \
13
    to_t_sourcedetail, to_t_amazonorder, to_t_storeOrderDetail, \
13
    to_t_sourcedetail, to_t_amazonorder, to_t_storeOrderDetail, \
14
    to_t_storeOrderCollection, to_t_hotspotServiceMatrix, to_t_ebayOrder, \
14
    to_t_storeOrderCollection, to_t_hotspotServiceMatrix, to_t_ebayOrder, \
15
    to_t_amazonFbaSalesSnapshot, to_t_snapdealOrder, to_t_flipkartOrder, \
15
    to_t_amazonFbaSalesSnapshot, to_t_snapdealOrder, to_t_flipkartOrder, \
16
    to_t_amazonFbaOrderReturn, to_t_flipkartAdvantageOrder, to_t_hsOrder
16
    to_t_amazonFbaOrderReturn, to_t_flipkartAdvantageOrder, to_t_hsOrder, to_t_Creditor, \
-
 
17
    to_t_CreditHistory, to_t_UserSanction, to_t_LoanHistory
17
from shop2020.model.v1.order.impl.DataAccessors import create_transaction, \
18
from shop2020.model.v1.order.impl.DataAccessors import create_transaction, \
18
    get_transactions_for_customer, get_transaction_status, get_line_items_for_order, \
19
    get_transactions_for_customer, get_transaction_status, get_line_items_for_order, \
19
    get_transaction, get_transactions_for_shopping_cart_id, \
20
    get_transaction, get_transactions_for_shopping_cart_id, \
20
    change_transaction_status, get_orders_for_customer, get_orders_for_transaction, \
21
    change_transaction_status, get_orders_for_customer, get_orders_for_transaction, \
21
    get_order, get_returnable_orders_for_customer, \
22
    get_order, get_returnable_orders_for_customer, \
Line 106... Line 107...
106
    flipkart_fa_order_exists, get_recharge_order_status, \
107
    flipkart_fa_order_exists, get_recharge_order_status, \
107
    get_recharge_transaction_status, accept_package_orders, \
108
    get_recharge_transaction_status, accept_package_orders, \
108
    get_group_orders_by_logistics_txn_id, add_billing_details_for_groupped_orders, \
109
    get_group_orders_by_logistics_txn_id, add_billing_details_for_groupped_orders, \
109
    get_invoice_format_logistics_txn_id, homeshop_order_exists, \
110
    get_invoice_format_logistics_txn_id, homeshop_order_exists, \
110
    create_homeshop_order, get_homeshop_order, split_bulk_order, move_orders_to_correct_warehouse, \
111
    create_homeshop_order, get_homeshop_order, split_bulk_order, move_orders_to_correct_warehouse, \
-
 
112
    verify_orders_for_transaction, get_creditor_info, update_creditor_info, get_user_sanction_details, \
-
 
113
    update_user_sanction, get_credit_history_records, process_credit_transaction, \
-
 
114
    get_loan_payable_for_user_to_creditor, get_loan_history_records, \
111
    verify_orders_for_transaction
115
    process_loan_transaction
112
from shop2020.model.v1.order.impl.DataService import DtrBatchCreditTracker
116
from shop2020.model.v1.order.impl.DataService import DtrBatchCreditTracker
113
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
117
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
114
from shop2020.model.v1.order.impl.model.DigitalTransaction import \
118
from shop2020.model.v1.order.impl.model.DigitalTransaction import \
115
    DigitalTransaction
119
    DigitalTransaction
116
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
120
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
Line 2649... Line 2653...
2649
        try:
2653
        try:
2650
            return verify_orders_for_transaction(transactionId)
2654
            return verify_orders_for_transaction(transactionId)
2651
        finally:
2655
        finally:
2652
            close_session()
2656
            close_session()
2653
            
2657
            
-
 
2658
    def getCreditorInfo(self, creditorId, name):
-
 
2659
        try:
-
 
2660
            return to_t_Creditor(get_creditor_info(creditorId, name))
-
 
2661
        except:
-
 
2662
            return None
-
 
2663
        finally:
-
 
2664
            close_session()
-
 
2665
            
-
 
2666
    def updateCreditorInfo(self, creditor):
-
 
2667
        try:
-
 
2668
            return update_creditor_info(creditor)
-
 
2669
        finally:
-
 
2670
            close_session()
-
 
2671
 
-
 
2672
    def getUserSanctionDetails(self, userId):
-
 
2673
        try:
-
 
2674
            return [to_t_UserSanction(userSanction) for userSanction in get_user_sanction_details(userId, None)]
-
 
2675
        finally:
-
 
2676
            close_session()
-
 
2677
    
-
 
2678
    def getUserSanctionDetailsForCreditor(self, userId, creditorId):
-
 
2679
        try:
-
 
2680
            return to_t_UserSanction(get_user_sanction_details(userId, creditorId)[0])
-
 
2681
        except:
-
 
2682
            return None
-
 
2683
        finally:
-
 
2684
            close_session()
-
 
2685
            
-
 
2686
    def updateUserSanction(self, userSanaction):
-
 
2687
        try:
-
 
2688
            return update_user_sanction(userSanaction)
-
 
2689
        finally:
-
 
2690
            close_session()
-
 
2691
            
-
 
2692
    def getCreditHistoryRecordsForTransaction(self, paymentId, creditTxnType):
-
 
2693
        try:
-
 
2694
            return [to_t_CreditHistory(creditHistory) for creditHistory in get_credit_history_records(paymentId, None, None, creditTxnType)]
-
 
2695
        finally:
-
 
2696
            close_session()
-
 
2697
            
-
 
2698
    def getCreditHistoryRecordsForUserAndCreditor(self, userId, creditorId, creditTxnType):
-
 
2699
        try:
-
 
2700
            return [to_t_CreditHistory(creditHistory) for creditHistory in get_credit_history_records(None, userId, creditorId, creditTxnType)]
-
 
2701
        finally:
-
 
2702
            close_session()
-
 
2703
            
-
 
2704
    def processCreditTransaction(self, paymentId, userId, creditorId, creditTxns):
-
 
2705
        try:
-
 
2706
            return process_credit_transaction(paymentId, userId, creditorId, creditTxns)
-
 
2707
        finally:
-
 
2708
            close_session()
-
 
2709
            
-
 
2710
    def getLoanPayableForUserToCreditor(self, userId, creditorId, dueDate):
-
 
2711
        try:
-
 
2712
            return get_loan_payable_for_user_to_creditor(userId, creditorId, dueDate)
-
 
2713
        finally:
-
 
2714
            close_session()
-
 
2715
            
-
 
2716
    def getLoanHistoryRecordsForTransaction(self, paymentId, creditTxnType):
-
 
2717
        try:
-
 
2718
            return [to_t_LoanHistory(loanHistory) for loanHistory in get_loan_history_records(paymentId, None, None, creditTxnType)]
-
 
2719
        finally:
-
 
2720
            close_session()
-
 
2721
    
-
 
2722
    def getLoanHistoryRecordsForUserAndCreditor(self, userId, creditorId, creditTxnType):
-
 
2723
        try:
-
 
2724
            return [to_t_LoanHistory(loanHistory) for loanHistory in get_loan_history_records(None, userId, creditorId, creditTxnType)]
-
 
2725
        finally:
-
 
2726
            close_session()
-
 
2727
    
-
 
2728
    def processLoanTransaction(self, paymentId, userId, creditorId, creditTxns):
-
 
2729
        try:
-
 
2730
            return process_loan_transaction(paymentId, creditTxns)
-
 
2731
        finally:
-
 
2732
            close_session()     
2654
          
2733
          
2655
def main():
2734
def main():
2656
    OrderServiceHandler().creditBatch(2, '{"483649":100.0, "8021773":23, "123213":10}')
2735
    OrderServiceHandler().creditBatch(2, '{"483649":100.0, "8021773":23, "123213":10}')
2657
            
2736
            
2658
if __name__ == '__main__':
2737
if __name__ == '__main__':