namespace Registration.Data;
///
/// Abstraction over registration data.
/// MockDataService for development, SqlDataService when DB is connected.
///
public interface IRegistrationDataService
{
Task GetPendingAsync(CancellationToken ct = default);
Task GetByIdAsync(string registrationId, CancellationToken ct = default);
Task RegisterAsync(RegisterRequest request, CancellationToken ct = default);
Task RejectAsync(string registrationId, string? reason, string? rejectedBy, CancellationToken ct = default);
Task CompleteAsync(string registrationId, string? platformClientId, CancellationToken ct = default);
}
// ── Models ──
public sealed class Applicant
{
public string RegistrationId { get; set; } = "";
public string BusinessName { get; set; } = "";
public string? WebsiteUrl { get; set; }
public string? BusinessCategory { get; set; }
public string? BusinessDescription { get; set; }
public string? ContactName { get; set; }
public string? ContactEmail { get; set; }
public string? ContactPhone { get; set; }
public string? EntraSubjectId { get; set; }
public string? ClientCategory { get; set; } // General | Franchisee | Franchisor
public string Status { get; set; } = "Pending"; // Pending, Approved, Rejected
public bool PaymentVerified { get; set; }
public DateTime RegisteredUtc { get; set; }
public DateTime? ReviewedUtc { get; set; }
public string? ReviewedBy { get; set; }
public string? RejectionReason { get; set; }
public string? PlatformClientId { get; set; } // Set after approval
}
public sealed class RegisterRequest
{
public string? BusinessName { get; set; }
public string? WebsiteUrl { get; set; }
public string? BusinessCategory { get; set; }
public string? BusinessDescription { get; set; }
public string? ContactName { get; set; }
public string? ContactEmail { get; set; }
public string? ContactPhone { get; set; }
public string? EntraSubjectId { get; set; }
public string? ClientCategory { get; set; } // General | Franchisee | Franchisor
}
public sealed class RegistrationListResult
{
public bool Ok { get; set; }
public List Applicants { get; set; } = new();
public int TotalCount { get; set; }
}
public sealed class RegistrationResult
{
public bool Ok { get; set; }
public string? Error { get; set; }
public string? RegistrationId { get; set; }
}