d0d45bd2d3
JobTokenService.CreateTokenAsync queries cvSearch.JobProviders for any enabled row; returns null (no token created) when the table is empty or all providers are disabled. TriggerStartAsync snapshots enabled providers from DB at session-start time, preserving the existing snapshot contract. CvMatcherController guards link-building on a non-null TokenId so the "Start a job search" CTA is omitted from match emails when no providers are configured. JobSearchSettings.Providers list removed — provider config now lives exclusively in the DB. CvSearchJobTask.GetProviders falls back to an empty list with a warning (snapshot should always be populated from DB). Closes #35 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
929 B
C#
25 lines
929 B
C#
namespace CvMatcher.Models.Settings;
|
|
|
|
public sealed class JobSearchSettings
|
|
{
|
|
public bool Enabled { get; set; } = true;
|
|
public string JobSearchLinkBaseUrl { get; set; } = string.Empty;
|
|
public int TokenExpiryDays { get; set; } = 7;
|
|
public int MinMatchScore { get; set; } = 15;
|
|
public int MaxJobsToMatch { get; set; } = 15;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Runtime DTO for a job provider. Populated from <c>cvSearch.JobProviders</c> at session-creation
|
|
/// time and snapshotted to <c>JobSearchSessionEntity.ProviderConfigJson</c>.
|
|
/// </summary>
|
|
public sealed class JobProviderConfig
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public bool Enabled { get; set; } = true;
|
|
public string SearchUrlTemplate { get; set; } = string.Empty;
|
|
public string JobLinkContains { get; set; } = string.Empty;
|
|
public List<string> InitialKeywords { get; set; } = [];
|
|
public int MaxResults { get; set; } = 20;
|
|
}
|