Subversion Repositories SmartDukaan

Rev

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

Rev 3187 Rev 3376
Line 2... Line 2...
2
Created on: May 24, 2011
2
Created on: May 24, 2011
3
@author: Varun Gupta
3
@author: Varun Gupta
4
'''
4
'''
5
 
5
 
6
from shop2020.model.v1.user.impl.PromotionDataAccessors import initialize, create_promotion,\
6
from shop2020.model.v1.user.impl.PromotionDataAccessors import initialize, create_promotion,\
7
    generate_coupons_for_promotion, apply_coupon, track_coupon_usage
7
    generate_coupons_for_promotion, apply_coupon, track_coupon_usage, is_alive
8
from shop2020.model.v1.user.impl.PromotionRuleDataUtilities import get_coupon_usage_count_by_user
8
from shop2020.model.v1.user.impl.PromotionRuleDataUtilities import get_coupon_usage_count_by_user
9
from shop2020.model.v1.user.impl import PromotionDataAccessors
9
from shop2020.model.v1.user.impl import PromotionDataAccessors
10
 
10
 
11
class PromotionServiceHandler:
11
class PromotionServiceHandler:
12
    
12
    
Line 84... Line 84...
84
        - userId
84
        - userId
85
        '''
85
        '''
86
        try:
86
        try:
87
            return get_coupon_usage_count_by_user(couponCode, userId)
87
            return get_coupon_usage_count_by_user(couponCode, userId)
88
        finally:
88
        finally:
89
            PromotionDataAccessors.close_session()
-
 
90
89
            PromotionDataAccessors.close_session()
-
 
90
 
-
 
91
    def isAlive(self, ):
-
 
92
        """
-
 
93
        For checking weather service is active alive or not. It also checks connectivity with database
-
 
94
        """
-
 
95
        try:
-
 
96
            return is_alive()
-
 
97
        finally:
-
 
98
            PromotionDataAccessors.close_session()
-
 
99