eac34705e3
Unblocks the documented core workflow and closes the AI-service exposure, without changing existing behaviour. Job/JobApplication split (additive; see ADR-002): - New Job entity (the opportunity) with owner-scoped query filter; nullable JobApplication.JobId FK. Nothing reads Job yet. - Migration AddJobEntityAndProspectStages, hand-edited to drop reconciler-owned tables the scaffolder re-emitted; verified against the real dev DB. Pipeline: 10 internal stages across three concerns kept separate — PipelineStage (workflow) / PipelineGroup (UI: NotApplied/Active/Closed) / PipelineCategory (analytics). Adds Saved/Interested/Preparing/Withdrawn; keeps Waiting and Ghosted. Kanban shows 3 grouped columns; cards keep a stage chip and full transitions; drag applies only safe transitions (never infers Ghosted/Withdrawn). DateApplied nullable + SavedAt. Cleared when leaving Applied so analytics stay accurate; the discarded date is preserved as an AppliedDateCleared JobEvent. AI service lockdown: no host port; private ai_internal network (backend is the only other member); X-Ai-Service-Token required on all non-/health endpoints; AI_SERVICE_TOKEN mandatory via compose. Verified backend-only against the live stack. Also carries two pre-existing working-tree files (views/ProfilePage.tsx, views/CareerWorkspacePage.tsx) so the tree is clean for the branch integration. Tests: +40 backend (247 total), +5 sidecar (16), +15 frontend. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
237 lines
9.3 KiB
C#
237 lines
9.3 KiB
C#
using JobTrackerApi.Models;
|
|
|
|
namespace JobTrackerApi.Controllers
|
|
{
|
|
public sealed record TailoredCvPreviewDto(string TemplateId, string Html, string SuggestedFileName);
|
|
|
|
public sealed record TailoredCvRenderRequest(
|
|
string? TemplateId,
|
|
string? Headline,
|
|
List<string>? Summary,
|
|
List<string>? SelectedSkills,
|
|
List<TailoredCvExperienceItem>? Experience,
|
|
List<TailoredCvEducationItem>? Education,
|
|
List<TailoredCvCustomSection>? CustomSections,
|
|
TailoredCvRenderOptions? RenderOptions,
|
|
string? PhotoDataUrl,
|
|
bool? UseProfileAvatar);
|
|
|
|
public sealed record AttachmentContextResult(string Context, List<string> Signals, List<string> UsedFiles);
|
|
public sealed record CorrespondenceContextResult(string Context, List<string> Signals, List<string> Participants, List<string> ThreadIds);
|
|
|
|
public sealed record WorkflowSignalDto(
|
|
string ActionKey,
|
|
string Reason,
|
|
string WorkspaceTab,
|
|
string? FollowMode,
|
|
bool NeedsAttention,
|
|
bool HasPackageGap,
|
|
bool NeedsInterviewPrep,
|
|
bool NeedsFollowUpAction,
|
|
bool HasTailoredCv,
|
|
bool HasSavedApplicationAnswerDraft,
|
|
bool HasInterviewPrepNotes
|
|
);
|
|
|
|
public sealed record PagedResult<T>(List<T> Items, int Total, int Page, int PageSize);
|
|
|
|
public sealed record JobApplicationDto(
|
|
int Id,
|
|
int CompanyId,
|
|
Company Company,
|
|
string JobTitle,
|
|
string Status,
|
|
// Null while the job is in a pre-application (Prospect) stage — nothing submitted yet.
|
|
DateTime? DateApplied,
|
|
// When the user captured the job. Always set, so clients have a date to sort/show for
|
|
// jobs that have no DateApplied yet.
|
|
DateTime SavedAt,
|
|
bool ResponseReceived,
|
|
DateTime? ResponseDate,
|
|
string? Notes,
|
|
string? CoverLetterText,
|
|
string? JobUrl,
|
|
string? Description,
|
|
string? TranslatedDescription,
|
|
string? DescriptionLanguage,
|
|
string? Tags,
|
|
DateTime? Deadline,
|
|
string? Location,
|
|
string? Salary,
|
|
decimal? SalaryMin,
|
|
decimal? SalaryMax,
|
|
string? SalaryCurrency,
|
|
string? SalaryPeriod,
|
|
string? NextAction,
|
|
DateTime? FollowUpAt,
|
|
DateTime? FeedbackRequestedAt,
|
|
bool HasResume,
|
|
bool HasCoverLetter,
|
|
bool HasPortfolio,
|
|
bool HasOtherAttachment,
|
|
bool IsDeleted,
|
|
DateTime? DeletedAt,
|
|
// Null when DateApplied is null: no elapsed time to report before applying.
|
|
int? DaysSince,
|
|
bool NeedsFollowUp,
|
|
string? FollowUpReason,
|
|
string? TailoredCvText,
|
|
WorkflowSignalDto WorkflowSignal,
|
|
string? ShortSummary,
|
|
string? FullSummary
|
|
);
|
|
|
|
public sealed record CreateJobApplicationRequest(
|
|
string JobTitle,
|
|
int CompanyId,
|
|
string? Status,
|
|
string? Location,
|
|
string? Salary,
|
|
decimal? SalaryMin,
|
|
decimal? SalaryMax,
|
|
string? SalaryCurrency,
|
|
string? SalaryPeriod,
|
|
string? NextAction,
|
|
DateTime? FollowUpAt,
|
|
string? Notes,
|
|
string? Description,
|
|
string? TranslatedDescription,
|
|
string? DescriptionLanguage,
|
|
string? Tags,
|
|
DateTime? Deadline,
|
|
string? CoverLetterText,
|
|
string? JobUrl,
|
|
DateTime? DateApplied,
|
|
DateTime? FeedbackRequestedAt
|
|
);
|
|
|
|
public sealed record UpdateJobApplicationRequest(
|
|
string JobTitle,
|
|
int CompanyId,
|
|
string Status,
|
|
bool ResponseReceived,
|
|
DateTime? ResponseDate,
|
|
string? Location,
|
|
string? Salary,
|
|
decimal? SalaryMin,
|
|
decimal? SalaryMax,
|
|
string? SalaryCurrency,
|
|
string? SalaryPeriod,
|
|
string? NextAction,
|
|
DateTime? FollowUpAt,
|
|
string? Notes,
|
|
string? Description,
|
|
string? TranslatedDescription,
|
|
string? DescriptionLanguage,
|
|
string? Tags,
|
|
DateTime? Deadline,
|
|
string? CoverLetterText,
|
|
string? JobUrl,
|
|
DateTime? DateApplied,
|
|
DateTime? FeedbackRequestedAt,
|
|
DateTime? StatusChangedAt
|
|
);
|
|
|
|
public sealed record UpdateStatusRequest(string Status);
|
|
|
|
// Category = analytics semantics (Prospect/Active/Success/Closed).
|
|
// Group = how the board collapses stages (NotApplied/Active/Closed). Different axes on purpose
|
|
// — Offer is Success but still actively worked. See JobPipeline.PipelineGroup.
|
|
public sealed record PipelineStageDto(string Key, int Order, string Category, string Group);
|
|
|
|
public sealed record StatusSuggestionDto(
|
|
bool HasSuggestion,
|
|
string? SuggestedStatus,
|
|
string? CurrentStatus,
|
|
string? Signal,
|
|
string? Confidence,
|
|
DateTime? MessageDate,
|
|
string? MessageSubject);
|
|
|
|
public sealed record FollowUpRequest(DateTime? FollowUpAt);
|
|
|
|
public sealed record JobEventDto(int Id, string Type, string? OldValue, string? NewValue, string? Note, DateTime At);
|
|
|
|
public sealed record TimelineItemDto(string Kind, DateTime At, object Data);
|
|
|
|
public sealed record AnalyticsPoint(string Month, int Applied, int Responses);
|
|
|
|
public sealed record TagPoint(string Tag, int Count);
|
|
|
|
public sealed record TagTrendSeries(string Tag, List<int> Counts);
|
|
public sealed record TagTrendPoint(string Month, List<int> Counts);
|
|
public sealed record DuplicateCandidateDto(int Id, string JobTitle, string Company, string? JobUrl, string Status, DateTime? DateApplied, string Reason);
|
|
public sealed record DuplicateCheckResult(bool HasDuplicates, List<DuplicateCandidateDto> Matches);
|
|
public sealed record FollowUpDraftDto(string Subject, string Body, string Reason, DateTime SuggestedSendOn, string ContextSummary, List<string> ContextSignals, string? ThreadSubject, string? LastCorrespondenceFrom, DateTime? LastCorrespondenceAt);
|
|
public sealed record FocusPlanDto(
|
|
List<string> ImmediatePriorities,
|
|
List<string> CvBulletIdeas,
|
|
List<string> ProofPointsToLeadWith,
|
|
List<string> CoverLetterAngles,
|
|
List<string> FollowUpApproach,
|
|
string StrategicSummary);
|
|
public sealed record SendFollowUpRequest(string? ToEmail, string Subject, string Body, DateTime? NextFollowUpAt);
|
|
public sealed record TagTrendResponse(List<string> Months, List<TagTrendSeries> Series);
|
|
public sealed record CandidateFitChannelGuidanceDto(List<string> Cv, List<string> CoverLetter, List<string> Interview, List<string> RecruiterMessage);
|
|
public sealed record CandidateFitDto(
|
|
string MatchSummary,
|
|
string FitLevel,
|
|
int MatchScore,
|
|
List<string> Strengths,
|
|
List<string> Gaps,
|
|
List<string> Mention,
|
|
List<string> Avoid,
|
|
List<string> CvImprovements,
|
|
List<string> MissingKeywords,
|
|
List<string> InterviewPrep,
|
|
string TailoredPitch,
|
|
CandidateFitChannelGuidanceDto Guidance,
|
|
string? CoverLetterDraft,
|
|
string? RecruiterMessageDraft);
|
|
public sealed record SaveTailoredCvRequest(string? TailoredCvText);
|
|
public sealed record TailoredCvDraftDto(
|
|
int? Id,
|
|
int? CanonicalProfileVersion,
|
|
string TemplateId,
|
|
string? Headline,
|
|
List<string> Summary,
|
|
List<string> SelectedSkills,
|
|
List<TailoredCvExperienceItem> Experience,
|
|
List<TailoredCvEducationItem> Education,
|
|
List<TailoredCvCustomSection> CustomSections,
|
|
TailoredCvRenderOptions RenderOptions,
|
|
string? GenerationContextHash,
|
|
DateTimeOffset? LastGeneratedAtUtc,
|
|
DateTimeOffset? LastEditedAtUtc,
|
|
string Status,
|
|
string RenderedText,
|
|
bool IsLegacyFallback);
|
|
public sealed record SaveTailoredCvDraftRequest(
|
|
string? TemplateId,
|
|
string? Headline,
|
|
List<string>? Summary,
|
|
List<string>? SelectedSkills,
|
|
List<TailoredCvExperienceItem>? Experience,
|
|
List<TailoredCvEducationItem>? Education,
|
|
List<TailoredCvCustomSection>? CustomSections,
|
|
TailoredCvRenderOptions? RenderOptions,
|
|
string? Status);
|
|
public sealed record GenerateApplicationPackageDto(string TailoredCvText, string? CoverLetterDraft, string? ApplicationAnswerDraft, string? RecruiterMessageDraft, List<string> KeyPoints, List<string> AttachmentSignals, List<string> AttachmentFilesUsed, List<string> CoverLetterVariants, List<string> RecruiterMessageVariants);
|
|
public sealed record SaveApplicationDraftsRequest(string? CoverLetterText, string? Notes, string? RecruiterMessageDraft);
|
|
public sealed record SavedPackageMaterial(string? TailoredCvText, string? CoverLetterText, string? RecruiterMessageDraft, string? Notes);
|
|
public sealed record InterviewPrepDto(string Summary, List<string> TalkingPoints, List<string> LikelyQuestions, List<string> WeakSpots);
|
|
public sealed record ReadinessDto(int Score, string Level, List<string> Completed, List<string> Missing, List<string> Reminders, WorkflowSignalDto WorkflowSignal);
|
|
|
|
public sealed record MatchScoreDto(
|
|
int Score,
|
|
string Band,
|
|
int MatchedCount,
|
|
int TotalKeywords,
|
|
List<string> MatchedKeywords,
|
|
List<string> MissingKeywords,
|
|
List<MatchSectionCoverageDto> SectionCoverage,
|
|
bool HasEnoughSignal);
|
|
|
|
public sealed record MatchSectionCoverageDto(string Section, int Matched, int Total);
|
|
}
|