Subversion Repositories SmartDukaan

Rev

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

Rev 8201 Rev 8707
Line 1... Line 1...
1
from shop2020.thriftpy.model.v1.user.ttypes import Address as TAddress, UserCommunication as TUserCommunication, \
1
from shop2020.thriftpy.model.v1.user.ttypes import Address as TAddress, UserCommunication as TUserCommunication, \
2
    User as TUser, Cart as TCart, Line as TLine, MasterAffiliate as TMasterAffiliate, \
2
    User as TUser, Cart as TCart, Line as TLine, MasterAffiliate as TMasterAffiliate, \
3
    Affiliate as TAffiliate, Tracker as TTracker, TrackLog as TTrackLog, Promotion as TPromotion, \
3
    Affiliate as TAffiliate, Tracker as TTracker, TrackLog as TTrackLog, Promotion as TPromotion, \
4
    Coupon as TCoupon, Discount as TDiscount, ItemCouponDiscount as TItemCouponDiscount,\
4
    Coupon as TCoupon, Discount as TDiscount, ItemCouponDiscount as TItemCouponDiscount,\
5
    Voucher
5
    Voucher, CouponCategory
6
    
6
    
7
from shop2020.utils.Utils import to_java_date
7
from shop2020.utils.Utils import to_java_date
8
 
8
 
9
def to_t_address(address):
9
def to_t_address(address):
10
    t_address = TAddress()
10
    t_address = TAddress()
Line 198... Line 198...
198
 
198
 
199
    if coupon:
199
    if coupon:
200
        t_coupon.couponCode = coupon.coupon_code
200
        t_coupon.couponCode = coupon.coupon_code
201
        t_coupon.promotion = to_t_promotion(coupon.promotion)
201
        t_coupon.promotion = to_t_promotion(coupon.promotion)
202
        t_coupon.arguments = coupon.arguments
202
        t_coupon.arguments = coupon.arguments
-
 
203
        if coupon.coupon_category:
-
 
204
            t_coupon.coupon_category = CouponCategory._NAMES_TO_VALUES[coupon.coupon_category]
203
    
205
    
204
    return t_coupon
206
    return t_coupon
205
 
207
 
206
def to_t_item_coupon_discount(item_coupon_discount):
208
def to_t_item_coupon_discount(item_coupon_discount):
207
    t_item_coupon_discount = TItemCouponDiscount()
209
    t_item_coupon_discount = TItemCouponDiscount()