Files
PowderCoatingLogix/src/PowderCoating.Application/Interfaces/ISeedDataService.cs
T
2026-04-23 21:38:24 -04:00

59 lines
2.0 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 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; }
}