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:
zetaloop
2026-04-23 21:14:46 +08:00
parent d0985a91b8
commit ca4bef959f
5 changed files with 38 additions and 40 deletions
+3 -3
View File
@@ -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)