Subversion Repositories SmartDukaan

Rev

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

Rev 21044 Rev 21090
Line 14... Line 14...
14
    to_t_amazonFbaSalesSnapshot, to_t_snapdealOrder, to_t_flipkartOrder, \
14
    to_t_amazonFbaSalesSnapshot, to_t_snapdealOrder, to_t_flipkartOrder, \
15
    to_t_amazonFbaOrderReturn, to_t_flipkartAdvantageOrder, to_t_hsOrder, \
15
    to_t_amazonFbaOrderReturn, to_t_flipkartAdvantageOrder, to_t_hsOrder, \
16
    to_t_Creditor, to_t_CreditHistory, to_t_UserSanction, to_t_LoanHistory, \
16
    to_t_Creditor, to_t_CreditHistory, to_t_UserSanction, to_t_LoanHistory, \
17
    to_t_PaginatedCreditHistory, to_t_PaginatedLoanHistory, \
17
    to_t_PaginatedCreditHistory, to_t_PaginatedLoanHistory, \
18
    to_t_PaginatedUserSanction, to_t_returnOrderInfo, to_t_returnTransaction, \
18
    to_t_PaginatedUserSanction, to_t_returnOrderInfo, to_t_returnTransaction, \
19
    to_t_rPickupRequest, to_t_OutstandingPayments, to_t_ShipmentLogisticsCostDetail
19
    to_t_rPickupRequest, to_t_OutstandingPayments, to_t_ShipmentLogisticsCostDetail, to_t_pmsa
20
from shop2020.model.v1.order.impl.DataAccessors import create_transaction, \
20
from shop2020.model.v1.order.impl.DataAccessors import create_transaction, \
21
    get_transactions_for_customer, get_transaction_status, get_line_items_for_order, \
21
    get_transactions_for_customer, get_transaction_status, get_line_items_for_order, \
22
    get_transaction, get_transactions_for_shopping_cart_id, \
22
    get_transaction, get_transactions_for_shopping_cart_id, \
23
    change_transaction_status, get_orders_for_customer, get_orders_for_transaction, \
23
    change_transaction_status, get_orders_for_customer, get_orders_for_transaction, \
24
    get_order, get_returnable_orders_for_customer, \
24
    get_order, get_returnable_orders_for_customer, \
Line 115... Line 115...
115
    get_return_pickup_request, mark_return_not_required_orders_as_processed, \
115
    get_return_pickup_request, mark_return_not_required_orders_as_processed, \
116
    get_all_return_orders_for_return_pickup_request, unaccept_order, \
116
    get_all_return_orders_for_return_pickup_request, unaccept_order, \
117
    get_outstanding_payments, mark_payment_settled, get_seller_info, \
117
    get_outstanding_payments, mark_payment_settled, get_seller_info, \
118
    get_warehouse_address, get_buyer_by_warehouse, add_shipment_delay, \
118
    get_warehouse_address, get_buyer_by_warehouse, add_shipment_delay, \
119
    refund_return_order, get_cost_detail_for_logistics_txn_id, add_shipment_logistic_detail, \
119
    refund_return_order, get_cost_detail_for_logistics_txn_id, add_shipment_logistic_detail, \
120
    create_payment, calculate_payment_amount, add_amount_in_wallet, get_billed_orders_for_manifest_gen, register_rsa
120
    create_payment, calculate_payment_amount, add_amount_in_wallet, get_billed_orders_for_manifest_gen, register_rsa, \
-
 
121
    add_sales_associate, search_pmsa, get_pmsa_user, update_pmsa_user, get_pending_pmsa, get_pmsa_users, get_stats_for_associates
121
from shop2020.model.v1.order.impl.DataService import DtrBatchCreditTracker
122
from shop2020.model.v1.order.impl.DataService import DtrBatchCreditTracker
122
from shop2020.model.v1.order.impl.ObsoleteDataAccessors import create_ebay_order, \
123
from shop2020.model.v1.order.impl.ObsoleteDataAccessors import create_ebay_order, \
123
    get_ebay_order_by_orderId, get_ebay_order_by_sales_rec_number, get_ebay_order, \
124
    get_ebay_order_by_orderId, get_ebay_order_by_sales_rec_number, get_ebay_order, \
124
    update_ebay_order, ebay_order_exists, update_order_for_ebay, split_ebay_order, \
125
    update_ebay_order, ebay_order_exists, update_order_for_ebay, split_ebay_order, \
125
    add_or_update_amazon_fba_sales_snapshot, get_amazon_fba_sales_snapshot_for_days, \
126
    add_or_update_amazon_fba_sales_snapshot, get_amazon_fba_sales_snapshot_for_days, \
Line 3215... Line 3216...
3215
    def registerRsa(self, userId, activation_code):
3216
    def registerRsa(self, userId, activation_code):
3216
        try:
3217
        try:
3217
            return register_rsa(userId, activation_code)
3218
            return register_rsa(userId, activation_code)
3218
        finally:
3219
        finally:
3219
            close_session()
3220
            close_session()
-
 
3221
    
-
 
3222
    def addSalesAssociate(self, pmsa, referrerEmail, l1_userEmail):
-
 
3223
        try:
-
 
3224
            return add_sales_associate(pmsa, referrerEmail, l1_userEmail)
-
 
3225
        finally:
-
 
3226
            close_session()
-
 
3227
    
-
 
3228
    def searchPmsa(self, pmsaSearchFilter, associateEmail):
-
 
3229
        pmsa_list = []
-
 
3230
        try:
-
 
3231
            for pmsa in search_pmsa(pmsaSearchFilter, associateEmail):
-
 
3232
                pmsa_list.append(to_t_pmsa(pmsa, "", ""))
-
 
3233
            return pmsa_list
-
 
3234
        finally:
-
 
3235
            close_session()
-
 
3236
    
-
 
3237
    def getPmsaUser(self,id, associateEmail):
-
 
3238
        try:
-
 
3239
            pmsa, l1_user_email, l2_user_email = get_pmsa_user(id, associateEmail)
-
 
3240
            return to_t_pmsa(pmsa, l1_user_email, l2_user_email)
-
 
3241
        finally:
-
 
3242
            close_session()
-
 
3243
    
-
 
3244
    def updatePmsaUser(self, pmsa, associateEmail):
-
 
3245
        try:
-
 
3246
            return update_pmsa_user(pmsa, associateEmail)
-
 
3247
        finally:
-
 
3248
            close_session()
-
 
3249
    
-
 
3250
    def getPendingAssociates(self, associateEmail):
-
 
3251
        pmsa_list = []
-
 
3252
        try:
-
 
3253
            for pmsa in get_pending_pmsa(associateEmail):
-
 
3254
                pmsa_list.append(to_t_pmsa(pmsa, "", ""))
-
 
3255
            return pmsa_list
-
 
3256
        finally:
-
 
3257
            close_session()
-
 
3258
    
-
 
3259
    def getPmsaUsers(self, associateEmail):
-
 
3260
        pmsa_list = []
-
 
3261
        try:
-
 
3262
            for pmsa in get_pmsa_users(associateEmail):
-
 
3263
                pmsa_list.append(to_t_pmsa(pmsa, "", ""))
-
 
3264
            return pmsa_list
-
 
3265
        finally:
-
 
3266
            close_session()
-
 
3267
    
-
 
3268
    def getStatsForAssociates(self, associateEmail):
-
 
3269
        try:
-
 
3270
            return get_stats_for_associates(associateEmail)
-
 
3271
        finally:
-
 
3272
            close_session()
3220
            
3273
            
3221
        
3274
        
3222
def main():
3275
def main():
3223
    OrderServiceHandler().creditBatch(2, '{"483649":100.0, "8021773":23, "123213":10}')
3276
    OrderServiceHandler().creditBatch(2, '{"483649":100.0, "8021773":23, "123213":10}')
3224
            
3277