using PowderCoating.Core.Entities;

namespace PowderCoating.Core.Interfaces.Repositories;

/// <summary>
/// Typed repository for <see cref="Customer"/> that adds domain-specific queries on top of
/// the generic CRUD interface.
/// </summary>
public interface ICustomerRepository : IRepository<Customer>
{
    /// <summary>
    /// Loads a single customer with the navigations needed by the Details view: PricingTier,
    /// and recent CustomerNotes ordered newest-first. Returns null if not found or soft-deleted.
    /// </summary>
    Task<Customer?> LoadForDetailsAsync(int id, int companyId);

    /// <summary>
    /// Finds a customer by email address within the current tenant. Used for duplicate-email
    /// validation on create and edit. Returns null if no match is found.
    /// </summary>
    Task<Customer?> FindByEmailAsync(string email);
}
