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(companies): add notes, size and LinkedIn URL to companies
Khuram Niazf12b2d494471
diff --git a/__tests__/AddCompany.spec.tsx b/__tests__/AddCompany.spec.tsxindex a50fb3a..a8619a7 100644--- a/__tests__/AddCompany.spec.tsx+++ b/__tests__/AddCompany.spec.tsx@@ -139,6 +139,9 @@ describe("AddCompany Component", () => {websiteUrl: "",careersUrl: "",industry: "",+ linkedinUrl: "",+ size: "",+ notes: "",});});});@@ -189,6 +192,9 @@ describe("AddCompany Component", () => {websiteUrl: "",careersUrl: "",industry: "",+ linkedinUrl: "",+ size: "",+ notes: "",});});});diff --git a/__tests__/CompanyDetails.spec.tsx b/__tests__/CompanyDetails.spec.tsxindex a8f88d9..1482400 100644--- a/__tests__/CompanyDetails.spec.tsx+++ b/__tests__/CompanyDetails.spec.tsx@@ -71,6 +71,9 @@ const makeDetails = (overrides: Record<string, unknown> = {}) =>websiteUrl: null,careersUrl: null,industry: null,+ linkedinUrl: null,+ size: null,+ notes: null,jobs: [],appliedCount: 0,dismissedJobsCount: 0,@@ -226,6 +229,27 @@ describe("CompanyDetails – summary card", () => {expect(fact("Industry")).toHaveTextContent("—");expect(fact("Website")).toHaveTextContent("—");expect(fact("Careers page")).toHaveTextContent("—");+ expect(fact("Size")).toHaveTextContent("—");+ expect(fact("LinkedIn")).toHaveTextContent("—");+ expect(screen.queryByTestId("company-notes")).not.toBeInTheDocument();+ });++ it("shows size, LinkedIn host and notes when set", () => {+ render(+ <CompanyDetails+ details={makeDetails({+ size: "51-200",+ linkedinUrl: "https://www.linkedin.com/company/stripe",+ notes: "Great culture",+ })}+ />,+ );++ expect(fact("Size")).toHaveTextContent("51-200");+ expect(fact("LinkedIn")).toHaveTextContent("www.linkedin.com");+ expect(screen.getByTestId("company-notes")).toHaveTextContent(+ "Great culture",+ );});it("counts jobs, applied jobs and distinct contacts", () => {diff --git a/__tests__/addCompanyForm.schema.spec.ts b/__tests__/addCompanyForm.schema.spec.tsindex fbef80a..cca60f1 100644--- a/__tests__/addCompanyForm.schema.spec.ts+++ b/__tests__/addCompanyForm.schema.spec.ts@@ -208,7 +208,55 @@ describe("AddCompanyFormSchema", () => {websiteUrl: "",careersUrl: "",industry: "",+ linkedinUrl: "",+ notes: "",});});});++ describe("linkedinUrl, size and notes fields", () => {+ it("accepts a LinkedIn URL, a listed size and notes", () => {+ const result = AddCompanyFormSchema.parse({+ company: "Tech Company",+ linkedinUrl: "https://www.linkedin.com/company/tech",+ size: "51-200",+ notes: "Good culture",+ });+ expect(result.linkedinUrl).toBe("https://www.linkedin.com/company/tech");+ expect(result.size).toBe("51-200");+ expect(result.notes).toBe("Good culture");+ });++ it("accepts an empty size", () => {+ const result = AddCompanyFormSchema.parse({+ company: "Tech Company",+ size: "",+ });+ expect(result.size).toBe("");+ });++ it("rejects a non-http LinkedIn URL", () => {+ expect(() =>+ AddCompanyFormSchema.parse({+ company: "Tech Company",+ linkedinUrl: "linkedin.com/company/tech",+ }),+ ).toThrow();+ });++ it("rejects a size outside the listed bands", () => {+ expect(() =>+ AddCompanyFormSchema.parse({ company: "Tech Company", size: "huge" }),+ ).toThrow();+ });++ it("rejects notes over the length cap", () => {+ expect(() =>+ AddCompanyFormSchema.parse({+ company: "Tech Company",+ notes: "x".repeat(5001),+ }),+ ).toThrow();+ });+ });});diff --git a/__tests__/backupRoundTrip.spec.ts b/__tests__/backupRoundTrip.spec.tsindex e50ae49..133c21e 100644--- a/__tests__/backupRoundTrip.spec.ts+++ b/__tests__/backupRoundTrip.spec.ts@@ -62,6 +62,9 @@ async function seedFullAccount() {websiteUrl: "https://acme.example.com",careersUrl: "https://acme.example.com/careers",industry: "Widgets",+ linkedinUrl: "https://www.linkedin.com/company/acme",+ size: "51-200",+ notes: "Strong engineering culture",},});const title = await prisma.jobTitle.create({@@ -337,6 +340,9 @@ describe("backup round trip", () => {expect(restored.websiteUrl).toBe("https://acme.example.com");expect(restored.careersUrl).toBe("https://acme.example.com/careers");expect(restored.industry).toBe("Widgets");+ expect(restored.linkedinUrl).toBe("https://www.linkedin.com/company/acme");+ expect(restored.size).toBe("51-200");+ expect(restored.notes).toBe("Strong engineering culture");});it("restores a contact with its company, standing role and job link remapped", async () => {diff --git a/__tests__/company.actions.spec.ts b/__tests__/company.actions.spec.tsindex 16e42be..0029a0c 100644--- a/__tests__/company.actions.spec.ts+++ b/__tests__/company.actions.spec.ts@@ -414,6 +414,48 @@ describe("Company Actions", () => {});});+ it("persists linkedinUrl, size and notes", async () => {+ (getCurrentUser as any).mockResolvedValue(mockUser);+ (prisma.company.findFirst as any).mockResolvedValue(null);+ (prisma.company.create as any).mockResolvedValue({ id: "c1" });++ await addCompany({+ company: "Acme",+ linkedinUrl: "https://www.linkedin.com/company/acme",+ size: "51-200",+ notes: "Strong engineering culture",+ } as any);++ expect(prisma.company.create).toHaveBeenCalledWith({+ data: expect.objectContaining({+ linkedinUrl: "https://www.linkedin.com/company/acme",+ size: "51-200",+ notes: "Strong engineering culture",+ }),+ });+ });++ it("rejects a non-http LinkedIn URL", async () => {+ (getCurrentUser as any).mockResolvedValue(mockUser);++ const res = await addCompany({+ company: "Acme",+ linkedinUrl: "javascript:alert(1)",+ } as any);++ expect(res.success).toBe(false);+ expect(prisma.company.create).not.toHaveBeenCalled();+ });++ it("rejects a size outside the listed bands", async () => {+ (getCurrentUser as any).mockResolvedValue(mockUser);++ const res = await addCompany({ company: "Acme", size: "huge" } as any);++ expect(res.success).toBe(false);+ expect(prisma.company.create).not.toHaveBeenCalled();+ });+it("rejects a site-relative website URL", async () => {(getCurrentUser as any).mockResolvedValue(mockUser);diff --git a/prisma/migrations/20261002141429_company_notes_size_linkedin/migration.sql b/prisma/migrations/20261002141429_company_notes_size_linkedin/migration.sqlnew file mode 100644index 0000000..4703e83--- /dev/null+++ b/prisma/migrations/20261002141429_company_notes_size_linkedin/migration.sql@@ -0,0 +1,4 @@+-- AlterTable+ALTER TABLE "Company" ADD COLUMN "linkedinUrl" TEXT;+ALTER TABLE "Company" ADD COLUMN "notes" TEXT;+ALTER TABLE "Company" ADD COLUMN "size" TEXT;diff --git a/prisma/schema.prisma b/prisma/schema.prismaindex 00aa7f5..222d360 100644--- a/prisma/schema.prisma+++ b/prisma/schema.prisma@@ -341,6 +341,9 @@ model Company {websiteUrl String?careersUrl String?industry String?+ linkedinUrl String?+ size String?+ notes String?@@unique([value, createdBy])@@unique([createdBy, atsProvider, atsToken])diff --git a/src/actions/company/mutations.ts b/src/actions/company/mutations.tsindex df4e126..0395b32 100644--- a/src/actions/company/mutations.ts+++ b/src/actions/company/mutations.ts@@ -2,6 +2,7 @@import prisma from "@/lib/db";import { handleError } from "@/lib/utils";import { canonicalizeEntityValue } from "@/lib/jobs/canonicalize";+import { COMPANY_NOTES_MAX_LENGTH, COMPANY_SIZES } from "@/lib/constants";import { AddCompanyFormSchema } from "@/models/addCompanyForm.schema";import { revalidatePath } from "next/cache";import { z } from "zod";@@ -32,13 +33,40 @@ const isValidHttpUrl = (url: string): boolean => {}};+const assertLinkedinSizeNotes = (+ linkedinUrl?: string,+ size?: string,+ notes?: string,+) => {+ if (linkedinUrl && !isValidHttpUrl(linkedinUrl)) {+ throw new Error("LinkedIn page must be a full http or https URL.");+ }+ if (size && !(COMPANY_SIZES as readonly string[]).includes(size)) {+ throw new Error("Invalid company size.");+ }+ if (notes && notes.length > COMPANY_NOTES_MAX_LENGTH) {+ throw new Error(+ `Notes must be ${COMPANY_NOTES_MAX_LENGTH} characters or fewer.`,+ );+ }+};+export const addCompany = async (data: z.infer<typeof AddCompanyFormSchema>,): Promise<any | undefined> => {try {const user = await requireUser();- const { company, logoUrl, websiteUrl, careersUrl, industry } = data;+ const {+ company,+ logoUrl,+ websiteUrl,+ careersUrl,+ industry,+ linkedinUrl,+ size,+ notes,+ } = data;// Validate image URLif (logoUrl && !isValidImageUrl(logoUrl)) {@@ -53,6 +81,7 @@ export const addCompany = async (if (careersUrl && !isValidHttpUrl(careersUrl)) {throw new Error("Careers page must be a full http or https URL.");}+ assertLinkedinSizeNotes(linkedinUrl, size, notes);const value = canonicalizeEntityValue(company.trim(), { stripLegalSuffix: true });@@ -76,6 +105,9 @@ export const addCompany = async (websiteUrl,careersUrl,industry,+ linkedinUrl,+ size,+ notes,},});revalidatePath("/dashboard/myjobs", "page");@@ -92,8 +124,18 @@ export const updateCompany = async (try {const user = await requireUser();- const { id, company, logoUrl, createdBy, websiteUrl, careersUrl, industry } =- data;+ const {+ id,+ company,+ logoUrl,+ createdBy,+ websiteUrl,+ careersUrl,+ industry,+ linkedinUrl,+ size,+ notes,+ } = data;if (!id) {throw new Error("Company id is required");@@ -112,6 +154,7 @@ export const updateCompany = async (if (careersUrl && !isValidHttpUrl(careersUrl)) {throw new Error("Careers page must be a full http or https URL.");}+ assertLinkedinSizeNotes(linkedinUrl, size, notes);const existingCompany = await prisma.company.findFirst({where: {@@ -158,6 +201,9 @@ export const updateCompany = async (websiteUrl,careersUrl,industry,+ linkedinUrl,+ size,+ notes,},});diff --git a/src/components/admin/AddCompany.tsx b/src/components/admin/AddCompany.tsxindex fc173e4..fe2b635 100644--- a/src/components/admin/AddCompany.tsx+++ b/src/components/admin/AddCompany.tsx@@ -23,6 +23,9 @@ import {FormMessage,} from "../ui/form";import { Input } from "../ui/input";+import { Textarea } from "../ui/textarea";+import SelectFormCtrl from "../Select";+import { COMPANY_SIZES } from "@/lib/constants";import { toastActionResult } from "@/lib/toast";import { addCompany, updateCompany } from "@/actions/company.actions";import { Company } from "@/models/job.model";@@ -56,6 +59,9 @@ function AddCompany({websiteUrl: "",careersUrl: "",industry: "",+ linkedinUrl: "",+ size: "",+ notes: "",id: undefined,createdBy: undefined,},@@ -74,6 +80,11 @@ function AddCompany({websiteUrl: editCompany?.websiteUrl ?? "",careersUrl: editCompany?.careersUrl ?? "",industry: editCompany?.industry ?? "",+ linkedinUrl: editCompany?.linkedinUrl ?? "",+ size: (editCompany?.size ?? "") as z.infer<+ typeof AddCompanyFormSchema+ >["size"],+ notes: editCompany?.notes ?? "",},{ keepDefaultValues: true },);@@ -205,15 +216,71 @@ function AddCompany({/>{/* INDUSTRY */}+ <FormField+ control={form.control}+ name="industry"+ render={({ field }) => (+ <FormItem>+ <FormLabel>Industry</FormLabel>+ <FormControl>+ <Input placeholder="Financial Services" {...field} />+ </FormControl>+ <FormMessage />+ </FormItem>+ )}+ />++ {/* SIZE */}+ <FormField+ control={form.control}+ name="size"+ render={({ field }) => (+ <FormItem className="flex flex-col">+ <FormLabel>Size</FormLabel>+ <SelectFormCtrl+ label="size"+ options={COMPANY_SIZES.map((s) => ({ id: s, label: s }))}+ field={field}+ />+ <FormMessage />+ </FormItem>+ )}+ />++ {/* LINKEDIN */}+ <div className="md:col-span-2">+ <FormField+ control={form.control}+ name="linkedinUrl"+ render={({ field }) => (+ <FormItem>+ <FormLabel>LinkedIn</FormLabel>+ <FormControl>+ <Input+ placeholder="https://www.linkedin.com/company/example"+ {...field}+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ )}+ />+ </div>++ {/* NOTES */}<div className="md:col-span-2"><FormFieldcontrol={form.control}- name="industry"+ name="notes"render={({ field }) => (<FormItem>- <FormLabel>Industry</FormLabel>+ <FormLabel>Notes</FormLabel><FormControl>- <Input placeholder="Financial Services" {...field} />+ <Textarea+ className="min-h-24"+ placeholder="Culture, red flags, what you learned on calls..."+ {...field}+ /></FormControl><FormMessage /></FormItem>diff --git a/src/components/admin/company-details/CompanyDetailsHeader.tsx b/src/components/admin/company-details/CompanyDetailsHeader.tsxindex 38389d6..cd3d05b 100644--- a/src/components/admin/company-details/CompanyDetailsHeader.tsx+++ b/src/components/admin/company-details/CompanyDetailsHeader.tsx@@ -53,6 +53,7 @@ export function CompanyDetailsHeader({const links = [{ label: "Open website", href: company.websiteUrl ? formatUrl(company.websiteUrl) : null },{ label: "Open careers page", href: company.careersUrl ? formatUrl(company.careersUrl) : null },+ { label: "Open LinkedIn", href: company.linkedinUrl ? formatUrl(company.linkedinUrl) : null },{ label: "Open job board", href: boardUrl },].filter((link): link is { label: string; href: string } => !!link.href);diff --git a/src/components/admin/company-details/CompanySummaryCard.tsx b/src/components/admin/company-details/CompanySummaryCard.tsxindex 5e61322..31d91da 100644--- a/src/components/admin/company-details/CompanySummaryCard.tsx+++ b/src/components/admin/company-details/CompanySummaryCard.tsx@@ -68,16 +68,26 @@ export function CompanySummaryCard({<BoardCell company={company} /></Fact><Fact label="Industry">{company.industry || "—"}</Fact>+ <Fact label="Size">{company.size || "—"}</Fact><Fact label="Website"><HostLink url={company.websiteUrl} /></Fact><Fact label="Careers page"><HostLink url={company.careersUrl} /></Fact>+ <Fact label="LinkedIn">+ <HostLink url={company.linkedinUrl} />+ </Fact><Fact label="Jobs">{jobsCount}</Fact><Fact label="Applied">{appliedCount}</Fact><Fact label="Contacts">{contactsCount}</Fact></div>+ {company.notes && (+ <div className="mt-4 border-t pt-4" data-testid="company-notes">+ <p className="text-sm text-muted-foreground">Notes</p>+ <p className="mt-1 whitespace-pre-wrap">{company.notes}</p>+ </div>+ )}</CardContent></Card>);diff --git a/src/lib/backup/schema.ts b/src/lib/backup/schema.tsindex 9bbb2f1..234dee0 100644--- a/src/lib/backup/schema.ts+++ b/src/lib/backup/schema.ts@@ -37,6 +37,9 @@ const Company = z.object({websiteUrl: optStr.optional(),careersUrl: optStr.optional(),industry: optStr.optional(),+ linkedinUrl: optStr.optional(),+ size: optStr.optional(),+ notes: optStr.optional(),});const JobTitle = z.object({ id, label: str, value: str });const Location = z.object({diff --git a/src/lib/constants.ts b/src/lib/constants.tsindex 02e59c7..8af0884 100644--- a/src/lib/constants.ts+++ b/src/lib/constants.ts@@ -298,6 +298,17 @@ export const CONTACT_ROLES = [{ label: "Reference", value: "reference" },] as const;+export const COMPANY_SIZES = [+ "1-10",+ "11-50",+ "51-200",+ "201-1000",+ "1001-5000",+ "5000+",+] as const;++export const COMPANY_NOTES_MAX_LENGTH = 5000;+export const JOB_STATUSES = [{ label: "New", value: "new" },{ label: "Draft", value: "draft" },diff --git a/src/models/addCompanyForm.schema.ts b/src/models/addCompanyForm.schema.tsindex 58099e0..c3fae33 100644--- a/src/models/addCompanyForm.schema.ts+++ b/src/models/addCompanyForm.schema.ts@@ -1,4 +1,5 @@import { z } from "zod";+import { COMPANY_NOTES_MAX_LENGTH, COMPANY_SIZES } from "@/lib/constants";const isValidUrl = (url: string) => {try {@@ -49,4 +50,7 @@ export const AddCompanyFormSchema = z.object({websiteUrl: httpUrlField("website"),careersUrl: httpUrlField("careers page"),industry: z.string().default("").optional(),+ linkedinUrl: httpUrlField("LinkedIn page"),+ size: z.enum(COMPANY_SIZES).or(z.literal("")).optional(),+ notes: z.string().max(COMPANY_NOTES_MAX_LENGTH).default("").optional(),});diff --git a/src/models/job.model.ts b/src/models/job.model.tsindex 979ec12..a5a6cee 100644--- a/src/models/job.model.ts+++ b/src/models/job.model.ts@@ -108,6 +108,9 @@ export interface Company {websiteUrl?: string | null;careersUrl?: string | null;industry?: string | null;+ linkedinUrl?: string | null;+ size?: string | null;+ notes?: string | null;_count?: {jobsApplied: number;jobsRejected?: number;diff --git a/wiki/companies.md b/wiki/companies.mdindex c88c18e..608ae97 100644--- a/wiki/companies.md+++ b/wiki/companies.md@@ -13,9 +13,9 @@ stale_after: 2027-09-13## What is on a company's details page?-Three parts, top to bottom. A **header row** with the company's logo and name, a line with its industry and website, and the actions: **Watch** (or **Unwatch**), **Edit**, **Delete** and a **⋮** menu linking to the company's website, careers page and job board. Each link appears only when the company has one, and the menu is hidden when it has none.+Three parts, top to bottom. A **header row** with the company's logo and name, a line with its industry and website, and the actions: **Watch** (or **Unwatch**), **Edit**, **Delete** and a **⋮** menu linking to the company's website, careers page, LinkedIn page and job board. Each link appears only when the company has one, and the menu is hidden when it has none.-Below it a **summary card** of eight facts: Watchlist, Board, Industry, Website, Careers page, Jobs, Applied and Contacts. Jobs and Applied count the jobs listed on the page, which leaves out jobs you dismissed from an automation — so Jobs can be lower than **Total Jobs** in **Library → Companies**, which counts them. Contacts counts everyone on the Contacts tab once, even someone who both works there and worked with you there — so it can be higher than the Contacts column in **Library → Companies**, which counts only the people who work there now.+Below it a **summary card** of ten facts: Watchlist, Board, Industry, Size, Website, Careers page, LinkedIn, Jobs, Applied and Contacts. Size is picked from a list of headcount ranges when you edit the company, and your **Notes** about it appear under the facts once you have written some. Jobs and Applied count the jobs listed on the page, which leaves out jobs you dismissed from an automation — so Jobs can be lower than **Total Jobs** in **Library → Companies**, which counts them. Contacts counts everyone on the Contacts tab once, even someone who both works there and worked with you there — so it can be higher than the Contacts column in **Library → Companies**, which counts only the people who work there now.Below that, two **tabs**. **Jobs** lists your jobs at the company, newest first, with status, location, applied date, AI match score and source; click a title to open the job. Jobs you dismissed from an automation are left out, the same as on the Jobs page. **Contacts** splits the people into **Works here** and **Worked with you here**, and a person who is both appears in both. Each tab carries a count badge once it has anything, and the tab you are on is kept in the address bar.