| 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, UserNote as TUserNote, Discount as TDiscount, ItemCouponDiscount as TItemCouponDiscount
|
4 |
Coupon as TCoupon, UserNote as TUserNote, Discount as TDiscount, ItemCouponDiscount as TItemCouponDiscount,\
|
| - |
|
5 |
Voucher
|
| 5 |
|
6 |
|
| 6 |
from shop2020.utils.Utils import to_java_date
|
7 |
from shop2020.utils.Utils import to_java_date
|
| 7 |
|
8 |
|
| 8 |
def to_t_address(address):
|
9 |
def to_t_address(address):
|
| 9 |
t_address = TAddress()
|
10 |
t_address = TAddress()
|
| Line 205... |
Line 206... |
| 205 |
if item_coupon_discount:
|
206 |
if item_coupon_discount:
|
| 206 |
t_item_coupon_discount.itemId = item_coupon_discount[0]
|
207 |
t_item_coupon_discount.itemId = item_coupon_discount[0]
|
| 207 |
t_item_coupon_discount.couponCode = item_coupon_discount[1]
|
208 |
t_item_coupon_discount.couponCode = item_coupon_discount[1]
|
| 208 |
t_item_coupon_discount.discount = item_coupon_discount[2]
|
209 |
t_item_coupon_discount.discount = item_coupon_discount[2]
|
| 209 |
|
210 |
|
| 210 |
return t_item_coupon_discount
|
- |
|
| 211 |
|
211 |
return t_item_coupon_discount
|
| - |
|
212 |
|
| - |
|
213 |
def to_t_voucher(voucher):
|
| - |
|
214 |
t_voucher = Voucher()
|
| - |
|
215 |
|
| - |
|
216 |
if voucher:
|
| - |
|
217 |
t_voucher.id = voucher.id
|
| - |
|
218 |
t_voucher.voucherCode = voucher.voucherCode
|
| - |
|
219 |
t_voucher.voucherType = voucher.voucherType
|
| - |
|
220 |
t_voucher.issuedOn = to_java_date(voucher.issuedOn)
|
| - |
|
221 |
t_voucher.expiredOn = to_java_date(voucher.expiredOn)
|
| - |
|
222 |
t_voucher.amount = voucher.amount
|
| - |
|
223 |
t_voucher.userEmail = voucher.email
|
| - |
|
224 |
return t_voucher
|
| - |
|
225 |
|
| 212 |
|
226 |
|