feat(publish): 增加等级与特殊皮肤价格修正

This commit is contained in:
yml
2026-11-24 20:33:22 +08:00
parent 9283a68143
commit 3ac4052ac5
14 changed files with 1744 additions and 606 deletions
@@ -750,7 +750,7 @@ func TestExternalAccountToCreateRequestMapsUploadFields(t *testing.T) {
if req.HafCoinAmount != 197100000 {
t.Fatalf("expected haf coin amount 197100000, got %d", req.HafCoinAmount)
}
if req.PriceCent != 59590 || req.DepositAmountCent != 40000 {
if req.PriceCent != 60040 || req.DepositAmountCent != 40000 {
t.Fatalf("unexpected price/deposit cent %d/%d", req.PriceCent, req.DepositAmountCent)
}
if req.AssetSummary["season_insurance"] != "3*3" {
@@ -790,10 +790,10 @@ func TestExternalAccountToCreateRequestMapsUploadFields(t *testing.T) {
t.Fatalf("price_breakdown = %#v", req.AssetSummary["price_breakdown"])
}
if breakdown["seller_coin_base_price"] != 458.0 ||
breakdown["consumable_price"] != 90.5 ||
breakdown["seller_total_price"] != 548.5 ||
breakdown["consumable_price"] != 95.0 ||
breakdown["seller_total_price"] != 553.0 ||
breakdown["buyer_coin_base_price"] != 505.4 ||
breakdown["buyer_total_price"] != 595.9 ||
breakdown["buyer_total_price"] != 600.4 ||
breakdown["buyer_ratio"] != 39.0 ||
breakdown["platform_markup_amount"] != 47.4 ||
breakdown["platform_rule_type"] != "ratio_subtract" {
@@ -850,19 +850,19 @@ func TestExternalAccountToCreateRequestSeparatesPureCoinAndExtraItems(t *testing
t.Fatalf("price_breakdown = %#v", req.AssetSummary["price_breakdown"])
}
if breakdown["seller_coin_base_price"] != 659.0 ||
breakdown["consumable_price"] != 11.0 ||
breakdown["seller_total_price"] != 670.0 {
breakdown["consumable_price"] != 12.0 ||
breakdown["seller_total_price"] != 671.0 {
t.Fatalf("回收租金未按纯币价与额外物品拆分:%#v", breakdown)
}
if breakdown["buyer_coin_base_price"] != 717.6 ||
breakdown["buyer_total_price"] != 728.6 ||
breakdown["buyer_total_price"] != 729.6 ||
breakdown["buyer_ratio"] != 39.3 ||
breakdown["platform_markup_amount"] != 58.6 ||
breakdown["platform_rule_type"] != "ratio_subtract" {
t.Fatalf("外部上传未按比例加价:%#v", breakdown)
}
if req.PriceCent != 72860 {
t.Fatalf("PriceCent = %d, want 72860", req.PriceCent)
if req.PriceCent != 72960 {
t.Fatalf("PriceCent = %d, want 72960", req.PriceCent)
}
}
@@ -1332,14 +1332,14 @@ func TestCreateDistributionListingUsesMainSiteReceiveRatio(t *testing.T) {
}
pricing := ReceivePricingFromAssetSummary(mustMarshalSummary(t, dto.AssetSummary))
if pricing.SellerRatio != 43 {
t.Fatalf("distribution receive seller_ratio = %v, want 43 from main-site ratio_config", pricing.SellerRatio)
if pricing.SellerRatio != 46 {
t.Fatalf("distribution receive seller_ratio = %v, want 46 from main-site ratio_config", pricing.SellerRatio)
}
if pricing.SellerTotalPriceCent != 23260 {
t.Fatalf("seller_total_price_cent = %d, want 23260", pricing.SellerTotalPriceCent)
if pricing.SellerTotalPriceCent != 21740 {
t.Fatalf("seller_total_price_cent = %d, want 21740", pricing.SellerTotalPriceCent)
}
if dto.PriceCent != 26320 {
t.Fatalf("listing PriceCent = %d, want 26320 from main-site sale price", dto.PriceCent)
if dto.PriceCent != 24390 {
t.Fatalf("listing PriceCent = %d, want 24390 from main-site sale price", dto.PriceCent)
}
if dto.DistributionSiteCode != "dist_ratio_1" {
t.Fatalf("DistributionSiteCode = %s, want dist_ratio_1", dto.DistributionSiteCode)
@@ -1399,11 +1399,11 @@ func TestCreateDistributionListingAppliesSiteReceiveCostDelta(t *testing.T) {
t.Fatalf("Create failed: %v", err)
}
pricing := ReceivePricingFromAssetSummary(mustMarshalSummary(t, dto.AssetSummary))
if pricing.SellerRatio != 46 {
t.Fatalf("seller_ratio = %v, want 46 after site cost delta 3 (R=43+3) under decoupled model", pricing.SellerRatio)
if pricing.SellerRatio != 49 {
t.Fatalf("seller_ratio = %v, want 49 after site cost delta 3 (R=46+3) under decoupled model", pricing.SellerRatio)
}
if dto.PriceCent != 26320 {
t.Fatalf("listing PriceCent = %d, want 26320 (buyer price stays anchored to main-site R)", dto.PriceCent)
if dto.PriceCent != 24390 {
t.Fatalf("listing PriceCent = %d, want 24390 (buyer price stays anchored to main-site R)", dto.PriceCent)
}
}