Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.
TypeScript ai-agentai-resume-analyzerapplication-trackerapplication-tracking-systematscareerjob-applicationjob-automationjob-huntingjob-searchjob-seeker-toolsjob-trackerjob-trackingjobsearchjobseekersmcpollamaresumeresume-reviewself-hosted
feat(jobs): default due date to 3 days out for MCP/agent add_job and automation-discovered jobs via shared DEFAULT_JOB_DUE_DAYS; update jobs, MCP and automations help pages
Khuram Niaza21dcb109366
diff --git a/__tests__/agentAddJobTool.spec.ts b/__tests__/agentAddJobTool.spec.tsindex 4dc5bf7..78d8e8b 100644--- a/__tests__/agentAddJobTool.spec.ts+++ b/__tests__/agentAddJobTool.spec.ts@@ -68,6 +68,17 @@ describe("add_job agent tool", () => {expect((createJobFromNames as any).mock.calls[0][0].jobDescription).toBe(longDescription);});+ // An omitted dueDate must arrive as undefined so createJobFromNames'+ // 3-day default applies; a supplied one arrives parsed.+ it("passes dueDate through, parsed, and leaves an omitted one to the default", async () => {+ const tool = buildAddJobTool("user-1", "posting");+ await execute(tool, { company: "Acme", jobTitle: "Engineer", dueDate: "2030-02-01T00:00:00Z" });+ await execute(tool, { company: "Acme", jobTitle: "Engineer" });+ const calls = (createJobFromNames as any).mock.calls;+ expect(calls[0][0].dueDate).toEqual(new Date("2030-02-01T00:00:00Z"));+ expect(calls[1][0].dueDate).toBeUndefined();+ });+it('sets createdVia to "chat"', async () => {await execute(buildAddJobTool("user-1", "posting"), { company: "Acme", jobTitle: "Engineer" });expect((createJobFromNames as any).mock.calls[0][0].createdVia).toBe("chat");diff --git a/__tests__/createJobFromNames.spec.ts b/__tests__/createJobFromNames.spec.tsindex 0eed21d..c6fbfe8 100644--- a/__tests__/createJobFromNames.spec.ts+++ b/__tests__/createJobFromNames.spec.ts@@ -60,6 +60,29 @@ describe("createJobFromNames", () => {(createJobRecord as any).mockResolvedValue({ id: "job-1" });});+ it("defaults dueDate to 3 days from now when omitted", async () => {+ vi.useFakeTimers();+ vi.setSystemTime(new Date("2030-01-10T12:00:00Z"));+ try {+ await createJobFromNames(baseInput, userId);+ } finally {+ vi.useRealTimers();+ }++ expect(createJobRecord).toHaveBeenCalledWith(+ expect.objectContaining({ dueDate: new Date("2030-01-13T12:00:00Z") }),+ );+ });++ it("keeps a supplied dueDate", async () => {+ const dueDate = new Date("2030-02-01T00:00:00Z");+ await createJobFromNames({ ...baseInput, dueDate }, userId);++ expect(createJobRecord).toHaveBeenCalledWith(+ expect.objectContaining({ dueDate }),+ );+ });+it("creates a job and reports matched/created resolutions in the message", async () => {const result = await createJobFromNames(baseInput, userId);diff --git a/__tests__/mcpAddJob.spec.ts b/__tests__/mcpAddJob.spec.tsindex 0ec317d..ae78dd7 100644--- a/__tests__/mcpAddJob.spec.ts+++ b/__tests__/mcpAddJob.spec.ts@@ -84,6 +84,19 @@ describe("handleAddJob match gating", () => {expect(text).not.toContain("PARTIAL DESCRIPTION WARNING");});+ it("passes dueDate to createJobFromNames unchanged, leaving an omitted one to its default", async () => {+ mockCreated("full");+ mockUsableResume();+ const dueDate = new Date("2030-02-01T00:00:00Z");++ await handleAddJob({ ...baseInput, dueDate } as any, "user-1", "my-token");+ await handleAddJob(baseInput as any, "user-1", "my-token");++ const calls = (createJobFromNames as any).mock.calls;+ expect(calls[0][0].dueDate).toBe(dueDate);+ expect(calls[1][0].dueDate).toBeUndefined();+ });+it("issues a directive WITH a provisional warning for a partial description", async () => {mockCreated("partial");mockUsableResume();diff --git a/__tests__/scraper-mapper.spec.ts b/__tests__/scraper-mapper.spec.tsindex b3dfc41..5639259 100644--- a/__tests__/scraper-mapper.spec.ts+++ b/__tests__/scraper-mapper.spec.ts@@ -116,6 +116,17 @@ describe("mapScrapedJobToJobRecord - entity delegation", () => {expect(result.statusId).toBe("status-1");});+ it("sets dueDate to DEFAULT_JOB_DUE_DAYS from now", async () => {+ vi.useFakeTimers();+ vi.setSystemTime(new Date("2030-01-10T12:00:00Z"));+ try {+ const result = await mapScrapedJobToJobRecord(baseInput);+ expect(result.dueDate).toEqual(new Date("2030-01-13T12:00:00Z"));+ } finally {+ vi.useRealTimers();+ }+ });+it("resolves title/company by their raw labels for the user", async () => {await mapScrapedJobToJobRecord(baseInput);diff --git a/src/components/myjobs/AddJob.tsx b/src/components/myjobs/AddJob.tsxindex 9f6a0bc..09e568a 100644--- a/src/components/myjobs/AddJob.tsx+++ b/src/components/myjobs/AddJob.tsx@@ -121,7 +121,7 @@ export function AddJob({const newJobDefaultValues = {type: Object.keys(JOB_TYPES)[0],workplaceType: "ONSITE",- dueDate: addDays(new Date(), 3),+ dueDate: addDays(new Date(), APP_CONSTANTS.DEFAULT_JOB_DUE_DAYS),status: draftStatusId,salaryRange: "",jobUrl: "",diff --git a/src/lib/constants.ts b/src/lib/constants.tsindex 60ddf27..275865e 100644--- a/src/lib/constants.ts+++ b/src/lib/constants.ts@@ -18,6 +18,8 @@ export const APP_CONSTANTS = {ATS_COMPANY_PAGE_SIZE: 50,MAX_AUTOMATIONS_PER_USER: 10,MAX_JOB_TAGS: 10,+ // Due date given to a new job when none is supplied, on every creation path+ DEFAULT_JOB_DUE_DAYS: 3,MIN_QUESTION_LENGTH: 5,MAX_QUESTION_LENGTH: 500,MIN_QUESTION_ANSWER_LENGTH: 10,diff --git a/src/lib/jobs/createJobFromNames.ts b/src/lib/jobs/createJobFromNames.tsindex fe72eae..7bcb0e5 100644--- a/src/lib/jobs/createJobFromNames.ts+++ b/src/lib/jobs/createJobFromNames.ts@@ -1,4 +1,5 @@import MarkdownIt from "markdown-it";+import { addDays } from "date-fns";import prisma from "@/lib/db";import { APP_CONSTANTS } from "@/lib/constants";import { normalizeJobUrl } from "@/lib/scraper/utils";@@ -63,7 +64,7 @@ export async function createJobFromNames(jobType,workplaceType,status,- dueDate = null,+ dueDate = addDays(new Date(), APP_CONSTANTS.DEFAULT_JOB_DUE_DAYS),applied = false,appliedDate,jobUrl,diff --git a/src/lib/scraper/mapper.ts b/src/lib/scraper/mapper.tsindex 80381d1..821b726 100644--- a/src/lib/scraper/mapper.ts+++ b/src/lib/scraper/mapper.ts@@ -1,5 +1,7 @@import type { ScrapedJobData, DiscoveryStatus } from "@/models/automation.model";+import { addDays } from "date-fns";import db from "@/lib/db";+import { APP_CONSTANTS } from "@/lib/constants";import { capitalize } from "@/lib/utils";import {resolveCompany,@@ -55,6 +57,7 @@ interface MapperOutput {companyId: string;jobSourceId: string;locationId: string | null;+ dueDate: Date;matchScore: number;matchData: string;discoveryStatus: DiscoveryStatus;@@ -106,6 +109,7 @@ export async function mapScrapedJobToJobRecord(companyId: company.id,jobSourceId: source.id,locationId: location?.id ?? null,+ dueDate: addDays(new Date(), APP_CONSTANTS.DEFAULT_JOB_DUE_DAYS),matchScore,matchData,discoveryStatus: "new",diff --git a/src/models/mcp.schema.ts b/src/models/mcp.schema.tsindex fd6ca6b..8f70d70 100644--- a/src/models/mcp.schema.ts+++ b/src/models/mcp.schema.ts@@ -45,7 +45,7 @@ export const McpAddJobInputShape = {.describe(`Application status. One of: ${JOB_STATUS_VALUES.join(", ")}. Defaults to '${APP_CONSTANTS.MCP_DEFAULT_STATUS}'.`,),- dueDate: z.string().datetime({ offset: true }).optional().describe("Application deadline as an ISO-8601 datetime string"),+ dueDate: z.string().datetime({ offset: true }).optional().describe("Application deadline as an ISO-8601 datetime string. Defaults to 3 days from now if omitted."),applied: z.boolean().optional().describe("Set true if you have already submitted the application"),appliedDate: z.string().datetime({ offset: true }).optional().describe("Date the application was submitted as an ISO-8601 datetime string"),jobUrl: z.string().url().optional().describe("Direct URL to the job posting"),diff --git a/wiki/automations.md b/wiki/automations.mdindex e3674fd..cb1f5ea 100644--- a/wiki/automations.md+++ b/wiki/automations.md@@ -86,7 +86,7 @@ The automation's page has three tabs: **Logs** (live output from the current or## What do I do with a discovered job?-Every discovered job starts as **new**. Open the **Discovered Jobs** tab and, for each one, choose:+Every discovered job starts as **new**, with a due date three days from the day it was found — the same default as a job you add by hand, and accepting it keeps that date. Open the **Discovered Jobs** tab and, for each one, choose:- **Accept** — copies it into your tracked jobs, where it behaves like any job you added by hand.- **Dismiss** — marks it dismissed so it stops cluttering the list. It is not deleted.diff --git a/wiki/jobs.md b/wiki/jobs.mdindex 7715717..aa6e9c7 100644--- a/wiki/jobs.md+++ b/wiki/jobs.md@@ -21,7 +21,7 @@ Paste the full posting text into Job Description if you have it. The AI features## How do I add a job by pasting a posting into AI chat?-Click **Chat AI** in the header to open the assistant panel, paste the full text of a job posting into the message box, and send it. The assistant extracts the title, company, location and description and shows you an approval card with exactly what it found. Nothing is saved to your tracker until you approve that card, and you can edit the details before you do.+Click **Chat AI** in the header to open the assistant panel, paste the full text of a job posting into the message box, and send it. The assistant extracts the title, company, location and description and shows you an approval card with exactly what it found. Nothing is saved to your tracker until you approve that card, and you can edit the details before you do. Unless the posting or your message gives a deadline, the job is saved with a due date three days from today, the same as the Add Job form.This requires an AI provider and model to be set under **Settings → AI Provider**; without them the panel tells you so instead of starting. A long paste is attached as a chip rather than inlined into the message — that is expected, and the full text still reaches the extraction.diff --git a/wiki/mcp.md b/wiki/mcp.mdindex d4cd6ab..f6c9cba 100644--- a/wiki/mcp.md+++ b/wiki/mcp.md@@ -73,7 +73,7 @@ Both snippets are shown in the token dialog with your real URL and token alreadyNine, all of them writes to your own data:-- **add_job** — adds a job, resolving or creating company, title, location, source and tags by name, and reporting back what it matched versus created.+- **add_job** — adds a job, resolving or creating company, title, location, source and tags by name, and reporting back what it matched versus created. If the agent sends no due date, the job gets one three days from today, the same as the Add Job form.- **add_jobs_batch** — the same thing for up to 10 jobs in one call, for a scheduled run.- **find_job** — checks by URL whether a posting is already saved, before adding it again.- **update_job** — corrects or enriches a job that was added through MCP. Only the fields supplied change.