feat: integrate OA activation workflows and business migration

This commit is contained in:
Yvan
2026-11-07 00:09:19 +08:00
parent 64aca495f2
commit 9caf5b1abc
47 changed files with 1831 additions and 152 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ func exerciseAlertOwnerRecheck(t *testing.T, db *gorm.DB) {
}
write(true)
oldExemption := &business.AlertExemption{ChannelKey: business.ChannelKey{SourceDB: "lx", ID: 1}, OwnerID: 7, AddedBy: 7, AddedName: "原商务", Reason: "原商务的豁免", AddedAt: now}
if err := NewAlertGovernanceRepo(testData{db}).AddExemption(ctx, scope, oldExemption.ChannelKey, func(*business.AlertExemptionTarget) (*business.AlertExemption, error) { return oldExemption, nil }); err != nil {
if err := NewAlertGovernanceRepo(testData{db}, activationDatabases{db}).AddExemption(ctx, scope, oldExemption.ChannelKey, func(*business.AlertExemptionTarget) (*business.AlertExemption, error) { return oldExemption, nil }); err != nil {
t.Fatal(err)
}
@@ -72,7 +72,7 @@ func exerciseAlertOwnerRecheck(t *testing.T, db *gorm.DB) {
if len(histories) != 2 || histories[0].BusinessID != 7 || histories[0].AlertContent != "换绑前" || histories[1].BusinessID != 8 {
t.Fatalf("旧商务预警不应被转移给新商务: %+v", histories)
}
governance := NewAlertGovernanceRepo(testData{db})
governance := NewAlertGovernanceRepo(testData{db}, activationDatabases{db})
called := false
build := func(*business.AlertExemptionTarget) (*business.AlertExemption, error) {
called = true