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
@@ -48,6 +48,16 @@ public class RemoveSeedDataOptions
public bool Bills { get; set; }
public bool Expenses { get; set; }
public bool Workers { get; set; }
public bool Vendors { get; set; }
public bool NamedOvens { get; set; }
public bool Appointments { get; set; }
/// <summary>
/// When true, all removal blocks skip fingerprint matching and delete by CompanyId only.
/// Use for demo resets where the goal is a full wipe regardless of which code version seeded
/// the data. Never set this on a real tenant company.
/// </summary>
public bool ForceRemoveAll { get; set; }
}
public class SeedDataResult