feat: move job providers to DB and suppress job-search link when none enabled #35

Closed
opened 2026-05-29 08:43:41 +00:00 by gelu · 0 comments
Owner

What

Two linked changes to the job-search subsystem.

A — Guard: When no job providers are enabled in the DB, the "Start a job search" CTA link is suppressed from match emails entirely. No token is created.

B — DB providers: Move JobSearch:Providers from appsettings/env vars into a new cvSearch.JobProviders DB table, seeded with the existing three defaults (all disabled). The session-snapshot mechanism (ProviderConfigJson) is preserved unchanged.

Why

  • Users currently receive the job-search CTA link even when the feature is not configured, leading to confusing zero-results emails.
  • Config-file providers require a full redeploy to change. DB-backed providers allow future admin tooling without touching environment variables.

Scope

In:

  • New JobProviderEntity + AddJobProviders migration (cvSearch schema, seeded with 3 disabled defaults)
  • CvSearchDbContext.JobProviders DbSet
  • IJobTokenService.CreateTokenAsync returns Task<string?> — null when no enabled providers
  • CreateJobSearchTokenResponse.TokenId becomes string?
  • JobTokenService.TriggerStartAsync reads providers from DB, not from appsettings
  • JobSearchSettings.Providers list removed
  • CvMatcherController (api): guard link-building on non-null TokenId
  • CvSearchJobTask.GetProviders fallback simplified to empty list + warning

Out: Admin API/UI for provider management; changes to other JobSearchSettings fields.

Success criteria

  1. Solution builds with zero warnings
  2. cvSearch.JobProviders table exists with 3 rows (all disabled)
  3. No providers enabled → match email has no job-search link, no token created
  4. Provider enabled → link appears, session snapshot captures DB state at trigger time

Time tracking

Started: 2026-05-29

## What Two linked changes to the job-search subsystem. **A — Guard**: When no job providers are enabled in the DB, the "Start a job search" CTA link is suppressed from match emails entirely. No token is created. **B — DB providers**: Move `JobSearch:Providers` from appsettings/env vars into a new `cvSearch.JobProviders` DB table, seeded with the existing three defaults (all disabled). The session-snapshot mechanism (`ProviderConfigJson`) is preserved unchanged. ## Why - Users currently receive the job-search CTA link even when the feature is not configured, leading to confusing zero-results emails. - Config-file providers require a full redeploy to change. DB-backed providers allow future admin tooling without touching environment variables. ## Scope **In:** - New `JobProviderEntity` + `AddJobProviders` migration (`cvSearch` schema, seeded with 3 disabled defaults) - `CvSearchDbContext.JobProviders` DbSet - `IJobTokenService.CreateTokenAsync` returns `Task<string?>` — null when no enabled providers - `CreateJobSearchTokenResponse.TokenId` becomes `string?` - `JobTokenService.TriggerStartAsync` reads providers from DB, not from appsettings - `JobSearchSettings.Providers` list removed - `CvMatcherController` (api): guard link-building on non-null TokenId - `CvSearchJobTask.GetProviders` fallback simplified to empty list + warning **Out:** Admin API/UI for provider management; changes to other JobSearchSettings fields. ## Success criteria 1. Solution builds with zero warnings 2. `cvSearch.JobProviders` table exists with 3 rows (all disabled) 3. No providers enabled → match email has no job-search link, no token created 4. Provider enabled → link appears, session snapshot captures DB state at trigger time ## Time tracking Started: 2026-05-29
gelu closed this issue 2026-05-29 10:07:17 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: AI/myAi#35