Subversion Repositories SmartDukaan

Rev

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

Rev 4405 Rev 4475
Line 3... Line 3...
3
 
3
 
4
@author: varungupta
4
@author: varungupta
5
 
5
 
6
raghvendra.saboo@gmail.com will get Rs.200 off on one transaction
6
raghvendra.saboo@gmail.com will get Rs.200 off on one transaction
7
michaelananth.ravichandran@tcs.com will get Rs.200 off on one transaction
7
michaelananth.ravichandran@tcs.com will get Rs.200 off on one transaction
-
 
8
nc41@indiatimes.com will get Rs.200 off on one transaction
8
'''
9
'''
9
 
10
 
10
from shop2020.thriftpy.model.v1.user.ttypes import PromotionException
11
from shop2020.thriftpy.model.v1.user.ttypes import PromotionException
11
from shop2020.clients.UserClient import UserClient
12
from shop2020.clients.UserClient import UserClient
12
from shop2020.model.v1.user.impl.PromotionRuleDataUtilities import get_coupon_usage_count_by_user
13
from shop2020.model.v1.user.impl.PromotionRuleDataUtilities import get_coupon_usage_count_by_user
Line 17... Line 18...
17
    user_client = UserClient().get_client()
18
    user_client = UserClient().get_client()
18
    user = user_client.getUserById(cart.userId)
19
    user = user_client.getUserById(cart.userId)
19
    
20
    
20
    email = user.email.lower().strip()
21
    email = user.email.lower().strip()
21
    
22
    
22
    if email in ('raghvendra.saboo@gmail.com', 'michaelananth.ravichandran@tcs.com'):
23
    if email in ('raghvendra.saboo@gmail.com', 'michaelananth.ravichandran@tcs.com', 'nc41@indiatimes.com'):
23
        discount_value = 200
24
        discount_value = 200
24
    else:
25
    else:
25
        raise PromotionException(111, 'You are not allowed to use this coupon')
26
        raise PromotionException(111, 'You are not allowed to use this coupon')
26
    
27
    
27
    #Allow only first 1000 users to use the coupon
28
    #Allow only first 1000 users to use the coupon