Files
AdPlatform-Server/Registration/Data/IRegistrationDataService.cs
Grae Jones 7ce747ce48
All checks were successful
Registration / build-deploy (push) Successful in 1m13s
Reg Fix 1
2026-03-23 14:02:58 -07:00

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; }
}