Execute reviewed tenant merges safely

This commit is contained in:
2026-08-06 12:34:52 +02:00
parent a2c5ad5dd9
commit e2fdfe9c0a
5 changed files with 440 additions and 11 deletions

View File

@@ -54,3 +54,15 @@ test("uses target as the safe default for two-way conflicts", () => {
assert.equal(plan.items[0].defaultDecision, "target")
assert.deepEqual(plan.items[0].differences.sort(), ["id", "label"])
})
test("ignores maintenance locks and audit timestamps during comparison", () => {
const plan = buildTenantMergePlan({
tenants: [{ id: 42, name: "Tenant", locked: null, updatedAt: "before" }],
}, {
tenants: [{ id: 42, name: "Tenant", locked: "maintenance_tenant", updatedAt: "after" }],
}, {
tenants: { primaryKey: ["id"] },
})
assert.equal(plan.items[0].kind, "existing")
})