feat(t245): use ERP images as procurement references

This commit is contained in:
QiuSW
2026-07-29 17:29:20 +08:00
parent a20590b4b7
commit 15074692a3
22 changed files with 1057 additions and 117 deletions
@@ -34,8 +34,11 @@ func TestClaimsMigrationPreservesHistoryAcrossUpDownUp(t *testing.T) {
if applied, err := runner.Up(ctx); err != nil {
t.Fatalf("initial Up() error = %v", err)
} else if applied != 16 {
t.Fatalf("initial Up() applied = %d, want 16", applied)
} else if applied != 17 {
t.Fatalf("initial Up() applied = %d, want 17", applied)
}
if err := runner.Down(ctx); err != nil {
t.Fatalf("initial Down(v17) error = %v", err)
}
if err := runner.Down(ctx); err != nil {
t.Fatalf("initial Down(v16) error = %v", err)
@@ -77,9 +80,14 @@ func TestClaimsMigrationPreservesHistoryAcrossUpDownUp(t *testing.T) {
seedClaimsHistoricalFixture(t, db)
if applied, err := runner.Up(ctx); err != nil {
t.Fatalf("Up(v5-v16) over historical data error = %v", err)
} else if applied != 12 {
t.Fatalf("Up(v5-v16) applied = %d, want 12", applied)
t.Fatalf("Up(v5-v17) over historical data error = %v", err)
} else if applied != 13 {
t.Fatalf("Up(v5-v17) applied = %d, want 13", applied)
}
assertClaimsHistory(t, db, true)
if err := runner.Down(ctx); err != nil {
t.Fatalf("Down(v17) with compatible history error = %v", err)
}
assertClaimsHistory(t, db, true)
@@ -149,9 +157,9 @@ func TestClaimsMigrationPreservesHistoryAcrossUpDownUp(t *testing.T) {
assertClaimsHistory(t, db, false)
if applied, err := runner.Up(ctx); err != nil {
t.Fatalf("final Up(v4-v16) error = %v", err)
} else if applied != 13 {
t.Fatalf("final Up(v4-v16) applied = %d, want 13", applied)
t.Fatalf("final Up(v4-v17) error = %v", err)
} else if applied != 14 {
t.Fatalf("final Up(v4-v17) applied = %d, want 14", applied)
}
assertClaimsHistory(t, db, true)
}
@@ -387,6 +395,9 @@ func TestClaimsMigrationDownFailsClosedForNewAuditData(t *testing.T) {
t.Fatalf("insert v4 audit event: %v", err)
}
if err := runner.Down(ctx); err != nil {
t.Fatalf("Down(v17) error = %v", err)
}
if err := runner.Down(ctx); err != nil {
t.Fatalf("Down(v16) error = %v", err)
}
@@ -27,8 +27,8 @@ func TestRunnerSupportsUpStatusDownAndIdempotentUp(t *testing.T) {
if err != nil {
t.Fatalf("Up() error = %v", err)
}
if applied != 16 {
t.Fatalf("Up() applied = %d, want 16", applied)
if applied != 17 {
t.Fatalf("Up() applied = %d, want 17", applied)
}
assertStatuses(t, runner, map[int64]bool{
1: true,
@@ -47,6 +47,7 @@ func TestRunnerSupportsUpStatusDownAndIdempotentUp(t *testing.T) {
14: true,
15: true,
16: true,
17: true,
})
applied, err = runner.Up(context.Background())
@@ -76,7 +77,8 @@ func TestRunnerSupportsUpStatusDownAndIdempotentUp(t *testing.T) {
13: true,
14: true,
15: true,
16: false,
16: true,
17: false,
})
applied, err = runner.Up(context.Background())
@@ -103,6 +105,7 @@ func TestRunnerSupportsUpStatusDownAndIdempotentUp(t *testing.T) {
14: true,
15: true,
16: true,
17: true,
})
}