69 lines
2.8 KiB
C#
69 lines
2.8 KiB
C#
namespace Registration.Data;
|
|
|
|
/// <summary>
|
|
/// Abstraction over registration data.
|
|
/// MockDataService for development, SqlDataService when DB is connected.
|
|
/// </summary>
|
|
public interface IRegistrationDataService
|
|
{
|
|
Task<RegistrationListResult> GetPendingAsync(CancellationToken ct = default);
|
|
Task<Applicant?> GetByIdAsync(string registrationId, CancellationToken ct = default);
|
|
Task<RegistrationResult> RegisterAsync(RegisterRequest request, CancellationToken ct = default);
|
|
Task<RegistrationResult> RejectAsync(string registrationId, string? reason, string? rejectedBy, CancellationToken ct = default);
|
|
Task<RegistrationResult> 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? FirstName { get; set; }
|
|
public string? LastName { 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? FirstName { get; set; }
|
|
public string? LastName { get; set; }
|
|
public string? ContactName { get; set; } // Combined first + last, set by client
|
|
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<Applicant> 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; }
|
|
}
|