Subversion Repositories SmartDukaan

Rev

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

Rev 11656 Rev 11890
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, CouponCategory
5
    Voucher, CouponCategory, PrivateDealUser as TPrivateDealUser
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 228... Line 228...
228
        t_voucher.voucherType = voucher.voucherType
228
        t_voucher.voucherType = voucher.voucherType
229
        t_voucher.issuedOn = to_java_date(voucher.issuedOn)
229
        t_voucher.issuedOn = to_java_date(voucher.issuedOn)
230
        t_voucher.expiredOn = to_java_date(voucher.expiredOn)
230
        t_voucher.expiredOn = to_java_date(voucher.expiredOn)
231
        t_voucher.amount = voucher.amount
231
        t_voucher.amount = voucher.amount
232
        t_voucher.userEmail = voucher.email
232
        t_voucher.userEmail = voucher.email
233
    return t_voucher
-
 
234
233
    return t_voucher
-
 
234
 
-
 
235
def to_t_private_deal(privateDeal):
-
 
236
    t_private_deal = TPrivateDealUser()
-
 
237
    if privateDeal is not None:
-
 
238
        t_private_deal.userId = privateDeal.id
-
 
239
        t_private_deal.addedOn = to_java_date(privateDeal.created_on)
-
 
240
        t_private_deal.isActive = privateDeal.isActive
-
 
241
    return t_private_deal
-
 
242
        
-
 
243
235
244