chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)

This commit is contained in:
MiFaZhan
2026-11-02 13:27:59 +08:00
1250 changed files with 154111 additions and 0 deletions
@@ -0,0 +1,34 @@
package iot
import (
"context"
"testing"
)
func TestResolvePackageEffectiveSalePriceUsesSystemDefaults(t *testing.T) {
got, err := resolvePackageEffectiveSalePrice(
context.Background(),
nil,
"tenant-1",
0,
0,
packagePriceSource{
PackageCode: "PKG-1",
CostPrice: 10,
TerminalCost: 20,
SysDefaultRatio: 80,
SysDefaultProfit: 1,
SysDefaultTerminalRatio: 50,
SysDefaultTerminalProfit: 2,
},
)
if err != nil {
t.Fatalf("resolvePackageEffectiveSalePrice() error = %v", err)
}
if got.AgentShipmentPrice != 9 {
t.Fatalf("agent shipment price = %v, want 9", got.AgentShipmentPrice)
}
if got.TerminalSalePrice != 12 {
t.Fatalf("terminal sale price = %v, want 12", got.TerminalSalePrice)
}
}