refactor(types): align entity types with backend API responses
Adjust all entity types to match actual backend response shapes. String-typed numeric fields (Shop.rating, Shop.commissionValue, WalletTransaction.amount) now correctly typed as strings. Post.linkedOrderId changed from SnowflakeId to number (backend int64). Removed fields absent from backend: Order consumer/player/shopName, Review fromUserAvatar/toUserId, Dispute initiatorId/initiatorName, Post authorRole/quotedPostId, Comment postId, ChatSession readonly/lastMessageAt, ChatMessage senderName/senderAvatar. Added Player.gender field.
This commit is contained in:
@@ -19,15 +19,17 @@ export function calculateOrderIncome(totalPrice: number, shop?: ShopCommission):
|
||||
}
|
||||
}
|
||||
|
||||
const commission = Number(shop.commissionValue)
|
||||
|
||||
if (shop.commissionType === "percentage") {
|
||||
return {
|
||||
income: roundCurrency(totalPrice * (1 - shop.commissionValue / 100)),
|
||||
income: roundCurrency(totalPrice * (1 - commission / 100)),
|
||||
commissionLabel: `扣除${shop.commissionValue}%抽成`,
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
income: roundCurrency(Math.max(0, totalPrice - shop.commissionValue)),
|
||||
income: roundCurrency(Math.max(0, totalPrice - commission)),
|
||||
commissionLabel: `扣除¥${shop.commissionValue}固定抽成`,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user