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:
@@ -5,7 +5,7 @@ describe("calculateOrderIncome", () => {
|
||||
it("calculates percentage commission income", () => {
|
||||
const result = calculateOrderIncome(100, {
|
||||
commissionType: "percentage",
|
||||
commissionValue: 12,
|
||||
commissionValue: "12",
|
||||
})
|
||||
|
||||
expect(result).toEqual({
|
||||
@@ -17,7 +17,7 @@ describe("calculateOrderIncome", () => {
|
||||
it("calculates fixed commission income", () => {
|
||||
const result = calculateOrderIncome(60, {
|
||||
commissionType: "fixed",
|
||||
commissionValue: 8,
|
||||
commissionValue: "8",
|
||||
})
|
||||
|
||||
expect(result).toEqual({
|
||||
@@ -38,7 +38,7 @@ describe("calculateOrderIncome", () => {
|
||||
it("does not return negative income for fixed commission", () => {
|
||||
const result = calculateOrderIncome(6, {
|
||||
commissionType: "fixed",
|
||||
commissionValue: 8,
|
||||
commissionValue: "8",
|
||||
})
|
||||
|
||||
expect(result.income).toBe(0)
|
||||
|
||||
Reference in New Issue
Block a user