refactor(listing): 卖家发布定价改用整数分与基点

This commit is contained in:
yml2213
2026-10-30 14:49:33 +08:00
parent 37e1980d2d
commit ce93f1636d
18 changed files with 1492 additions and 343 deletions
@@ -1106,11 +1106,11 @@ func TestCreateDistributionListingUsesMainSiteReceiveRatio(t *testing.T) {
if pricing.SellerRatio != 43 {
t.Fatalf("distribution receive seller_ratio = %v, want 43 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 != 23255 {
t.Fatalf("seller_total_price_cent = %d, want 23255", pricing.SellerTotalPriceCent)
}
if dto.PriceCent != 26320 {
t.Fatalf("listing PriceCent = %d, want 26320 from main-site sale price", dto.PriceCent)
if dto.PriceCent != 26315 {
t.Fatalf("listing PriceCent = %d, want 26315 from main-site sale price", dto.PriceCent)
}
if dto.DistributionSiteCode != "dist_ratio_1" {
t.Fatalf("DistributionSiteCode = %s, want dist_ratio_1", dto.DistributionSiteCode)
@@ -1173,8 +1173,8 @@ func TestCreateDistributionListingAppliesSiteReceiveCostDelta(t *testing.T) {
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 dto.PriceCent != 26320 {
t.Fatalf("listing PriceCent = %d, want 26320 (buyer price stays anchored to main-site R)", dto.PriceCent)
if dto.PriceCent != 26315 {
t.Fatalf("listing PriceCent = %d, want 26315 (buyer price stays anchored to main-site R)", dto.PriceCent)
}
}