Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

from shop2020.clients.PromotionClient import PromotionClient
from shop2020.thriftpy.model.v1.user.ttypes import *
import datetime
from datetime import timedelta
from shop2020.utils.Utils import to_java_date

promotion_client = PromotionClient().get_client()

#promotion_client.createPromotion("Test Promotion 1", "rule_for_5perc_discount_on_5k_purchase", to_java_date(datetime.datetime.now()), to_java_date(datetime.datetime.now()))

#promotion_client.generateCouponsForPromotion(1, "SHOPFOR5K");

#promotion_client.generateCouponsForPromotion(2, [5, 41, 42])

#promotion_client.applyCoupon(5, 5)

print promotion_client.getCouponUsageCountByUser("SHOPFOR5K", 5)