584664e7c8
- 5 named shop workers seeded as ApplicationUser (Employee role): Mike Sanders (Coater), Jake Wilson (Sandblaster), Sarah Brooks (Inspector), Tyler Green (General), Chris Mason (Lead) — @pcldemo.com fingerprint domain - Job time entries seeded for all in-progress and completed jobs; Worker Productivity report will have data from day one - Maintenance history seeded per equipment: 2 completed records + 1 upcoming scheduled + 1 overdue record on Pressure Pot for overdue alert demo - Equipment renamed to spec names: Main Batch Oven, Small Batch Oven, Powder Coating Booth, Blast Cabinet, Pressure Pot Blaster, Air Compressor, Wash Station, Forklift (replaced Overhead Conveyor which wasn't in spec) - RemoveSeedDataOptions.Workers added; Remove.cs cleans up workers + time entries on Demo Reset; SeedDataController resets workers in ResetDemoCompany Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
62 lines
2.2 KiB
C#
62 lines
2.2 KiB
C#
using PowderCoating.Core.Entities;
|
|
|
|
namespace PowderCoating.Application.Interfaces;
|
|
|
|
public interface ISeedDataService
|
|
{
|
|
/// <summary>
|
|
/// Seeds only lookup tables for a new company (called automatically on company creation).
|
|
/// This includes job statuses, priorities, and quote statuses.
|
|
/// </summary>
|
|
/// <param name="companyId">The company to seed lookup data for</param>
|
|
/// <returns>Result message indicating what was seeded</returns>
|
|
Task<SeedDataResult> SeedCompanyLookupsAsync(int companyId);
|
|
|
|
/// <summary>
|
|
/// Seeds initial data for a specific company
|
|
/// </summary>
|
|
/// <param name="companyId">The company to seed data for</param>
|
|
/// <returns>Result message indicating what was seeded</returns>
|
|
Task<SeedDataResult> SeedCompanyDataAsync(int companyId);
|
|
|
|
/// <summary>
|
|
/// Seeds system-level data (roles, default company, SuperAdmins)
|
|
/// </summary>
|
|
/// <returns>Result message indicating what was seeded</returns>
|
|
Task<SeedDataResult> SeedSystemDataAsync();
|
|
|
|
/// <summary>
|
|
/// Removes seeded demo data for a company based on the selected options.
|
|
/// Matches records by their known seed identifiers (emails, SKUs, serial numbers, etc.).
|
|
/// </summary>
|
|
Task<SeedDataResult> RemoveSeedDataAsync(int companyId, RemoveSeedDataOptions options);
|
|
|
|
/// <summary>
|
|
/// Gets a list of all companies for seeding
|
|
/// </summary>
|
|
Task<List<Company>> GetCompaniesAsync();
|
|
}
|
|
|
|
public class RemoveSeedDataOptions
|
|
{
|
|
public bool Customers { get; set; }
|
|
public bool InventoryItems { get; set; }
|
|
public bool Equipment { get; set; }
|
|
public bool Catalog { get; set; }
|
|
public bool PricingTiers { get; set; }
|
|
public bool OperatingCosts { get; set; }
|
|
public bool Bills { get; set; }
|
|
public bool Expenses { get; set; }
|
|
public bool Workers { get; set; }
|
|
}
|
|
|
|
public class SeedDataResult
|
|
{
|
|
public bool Success { get; set; }
|
|
public string Message { get; set; } = string.Empty;
|
|
public List<string> Details { get; set; } = new();
|
|
public List<string> Warnings { get; set; } = new();
|
|
public int ItemsSeeded { get; set; }
|
|
public int ItemsSkipped { get; set; }
|
|
}
|