Fix Reset Demo Company: full wipe mode + missing removal categories

Root cause: fingerprint-based removal failed on databases seeded with
older code (different emails/SKUs); plus Vendors, Named Ovens, and
Appointments had no removal path at all.

- Add ForceRemoveAll flag to RemoveSeedDataOptions: when true, all
  removal blocks delete by CompanyId instead of fingerprint matching
- Customers block: ForceRemoveAll deletes all company customers
- Workers block: ForceRemoveAll deletes all users with CompanyRole=Worker
- New Vendors block (triggered by options.Vendors || ForceRemoveAll)
- New NamedOvens (OvenCost) block (triggered by options.NamedOvens || ForceRemoveAll)
- New Appointments block (triggered by options.Appointments || ForceRemoveAll)
- ResetDemoCompany: set ForceRemoveAll=true and enable all new flags so
  every re-seedable table is wiped clean before re-seeding

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 22:49:30 -04:00
parent c0e4a66126
commit 249128e852
3 changed files with 97 additions and 9 deletions
@@ -125,7 +125,8 @@ public class SeedDataController : Controller
return RedirectToAction(nameof(Index));
}
// Remove all seed data categories
// Full wipe — ForceRemoveAll bypasses fingerprint matching so stale seed data from
// previous code versions (different emails, renamed SKUs, etc.) is always cleared.
var removeOptions = new RemoveSeedDataOptions
{
Customers = true,
@@ -137,6 +138,10 @@ public class SeedDataController : Controller
Bills = true,
Expenses = true,
Workers = true,
Vendors = true,
NamedOvens = true,
Appointments = true,
ForceRemoveAll = true,
};
var removeResult = await _seedDataService.RemoveSeedDataAsync(demo.Id, removeOptions);