feat(platform): improve admin data workflows

This commit is contained in:
2026-08-05 13:58:16 +08:00
parent 3b0188e9cf
commit 20e3071789
23 changed files with 666 additions and 296 deletions

View File

@@ -41,3 +41,29 @@ func TestIdentityOfEmbeddedEntity(t *testing.T) {
t.Fatalf("identityOf(nil) = %q, want empty", got)
}
}
func TestIdentityOfDirectIdentityField(t *testing.T) {
record := struct {
Identity string
}{Identity: "mock-direct-identity"}
if got := identityOf(&record); got != record.Identity {
t.Fatalf("identityOf() = %q, want %q", got, record.Identity)
}
}
func TestAdditionalScenarioIdentitiesDoNotOverlapBaseScenario(t *testing.T) {
seen := make(map[string]struct{}, 226)
for sequence := 1; sequence <= 56; sequence++ {
seen[entity(sequence, common.StatusEnable).Identity] = struct{}{}
}
for scenario := 2; scenario <= 10; scenario++ {
base := 1000 + scenario*100
for offset := 1; offset <= 20; offset++ {
identity := entity(base+offset, common.StatusEnable).Identity
if _, exists := seen[identity]; exists {
t.Fatalf("duplicate identity %q", identity)
}
seen[identity] = struct{}{}
}
}
}