fix(log): replace magic number with constant for gift type in purchase checkout logic

This commit is contained in:
Chang lue Tsen 2025-09-05 09:52:45 -04:00
parent 2f4cc46a38
commit d0d03e724e

View File

@ -390,7 +390,7 @@ func (l *PurchaseCheckoutLogic) balancePayment(u *user.User, o *order.Order) err
if giftUsed > 0 { if giftUsed > 0 {
giftLog := &log.Gift{ giftLog := &log.Gift{
OrderNo: o.OrderNo, OrderNo: o.OrderNo,
Type: 2, // Type 2 represents gift amount decrease/usage Type: log.GiftTypeReduce, // Type 2 represents gift amount decrease/usage
Amount: giftUsed, Amount: giftUsed,
Balance: userInfo.GiftAmount, Balance: userInfo.GiftAmount,
Remark: "Purchase payment", Remark: "Purchase payment",