WL-135 added the migration for the expiration_date field in the coupons model

added the functionality of adding the expiration date, and also handled in the shopping cart when the user try to add the expired coupon code in the shopping cart

added expiration date in the coupons list in the ecommerce page

added the unit tests and jasmine tests

fix the quality issues and rebased with master

regenerated the migration file with a different number

i18n and verified te course mode

changes suggested by  stephan
This commit is contained in:
Muhammad Shoaib
2014-11-19 14:39:32 +05:00
committed by Muhammad Shoaib
parent 30b572b1b1
commit 10f8d8c097
18 changed files with 476 additions and 27 deletions

View File

@@ -30,7 +30,7 @@ SALE_ORDER_FEATURES = ('id', 'company_name', 'company_contact_name', 'company_co
AVAILABLE_FEATURES = STUDENT_FEATURES + PROFILE_FEATURES
COURSE_REGISTRATION_FEATURES = ('code', 'course_id', 'created_by', 'created_at')
COUPON_FEATURES = ('course_id', 'percentage_discount', 'description')
COUPON_FEATURES = ('code', 'course_id', 'percentage_discount', 'description', 'expiration_date')
def sale_order_record_features(course_id, features):
@@ -228,6 +228,7 @@ def coupon_codes_features(features, coupons_list):
# codes csv. In the case of active and generated registration codes the redeemed_by value will be None.
# They have not been redeemed yet
coupon_dict['expiration_date'] = coupon.display_expiry_date
coupon_dict['course_id'] = coupon_dict['course_id'].to_deprecated_string()
return coupon_dict
return [extract_coupon(coupon, features) for coupon in coupons_list]