Subversion Repositories SmartDukaan

Rev

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

Rev 6367 Rev 6433
Line 9... Line 9...
9
from shop2020.model.v1.user.impl.PromotionDataAccessors import initialize, \
9
from shop2020.model.v1.user.impl.PromotionDataAccessors import initialize, \
10
    create_promotion, generate_coupons_for_promotion, apply_coupon, \
10
    create_promotion, generate_coupons_for_promotion, apply_coupon, \
11
    track_coupon_usage, is_alive, get_active_coupons, \
11
    track_coupon_usage, is_alive, get_active_coupons, \
12
    get_successful_payment_count_for_coupon, get_rule_doc_string, \
12
    get_successful_payment_count_for_coupon, get_rule_doc_string, \
13
    get_item_discount_map, get_discounts_for_entity, add_voucher, assign_voucher, \
13
    get_item_discount_map, get_discounts_for_entity, add_voucher, assign_voucher, \
14
    mark_voucher_as_redeemed, create_coupon, get_coupon
14
    mark_voucher_as_redeemed, create_coupon, get_coupon, apply_recharge_coupon
15
from shop2020.model.v1.user.impl.PromotionRuleDataUtilities import \
15
from shop2020.model.v1.user.impl.PromotionRuleDataUtilities import \
16
    get_coupon_usage_count_by_user
16
    get_coupon_usage_count_by_user
17
 
17
 
18
class PromotionServiceHandler:
18
class PromotionServiceHandler:
19
    
19
    
Line 95... Line 95...
95
        '''
95
        '''
96
        try:
96
        try:
97
            return create_coupon(promotionId, endOn, email, amount, isCod, usage)
97
            return create_coupon(promotionId, endOn, email, amount, isCod, usage)
98
        finally:
98
        finally:
99
            PromotionDataAccessors.close_session()
99
            PromotionDataAccessors.close_session()
-
 
100
            
-
 
101
    def applyRechargeCoupon(self, couponCode, rechargeOrderId, userId):
-
 
102
        try:
-
 
103
            return apply_recharge_coupon(couponCode, rechargeOrderId, userId)
-
 
104
        finally:
-
 
105
            PromotionDataAccessors.close_session()
100
    
106
    
101
    def applyCoupon(self, couponCode, cartId):
107
    def applyCoupon(self, couponCode, cartId):
102
        '''
108
        '''
103
        Parameters:
109
        Parameters:
104
        - couponCode
110
        - couponCode