Skip to content

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.

Add models

Khuram Niaza5f73c25bc7c
diff --git a/README.md b/README.md
index aa57373..c403366 100644
--- a/README.md
+++ b/README.md
@@ -34,19 +34,3 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
-
-
-Add/edit job solution
-
-1. Move code from page.tsx (for myjobs page) and create new Myjobs (make it client component) component to hold both table and form
-2. Fetch jobs data in page.tsx and pass to myjobs as props
-3.
-```typescript
-const StateManager = ({ initialRecords }) => {
- const [records, setRecords] = useState(initialRecords);
- const addRecord = (newRecord) => { setRecords([...records, newRecord]); };
- return (
- <div> <Table records={records} /> <FormaddRecord={addRecord} /> </div>
- );
-};
-```
diff --git a/src/components/AddJob.tsx b/src/components/AddJob.tsx
index 3310a54..0043bc6 100644
--- a/src/components/AddJob.tsx
+++ b/src/components/AddJob.tsx
@@ -15,7 +15,15 @@ import { useForm } from "react-hook-form";
import { useEffect, useState, useTransition } from "react";
import { AddJobFormSchema } from "@/models/addJobForm.schema";
import { zodResolver } from "@hookform/resolvers/zod";
-import { JOB_TYPES } from "@/models/job.model";
+import {
+ Company,
+ JOB_TYPES,
+ JobLocation,
+ JobResponse,
+ JobSource,
+ JobStatus,
+ JobTitle,
+} from "@/models/job.model";
import { addDays } from "date-fns";
import { z } from "zod";
import { toast } from "./ui/use-toast";
@@ -35,13 +43,13 @@ import { SALARY_RANGES } from "@/lib/data/salaryRangeData";
import TiptapEditor from "./TiptapEditor";
type AddJobProps = {
- jobStatuses: { id: string; label: string; value: string }[];
- companies: any[];
- jobTitles: { id: string; label: string; value: string }[];
- locations: { id: string; label: string; value: string }[];
- jobSources: { id: string; label: string; value: string }[];
+ jobStatuses: JobStatus[];
+ companies: Company[];
+ jobTitles: JobTitle[];
+ locations: JobLocation[];
+ jobSources: JobSource[];
reloadJobs: () => void;
- editJob?: any;
+ editJob?: JobResponse | null;
resetEditJob: () => void;
};
diff --git a/src/components/CompaniesTable.tsx b/src/components/CompaniesTable.tsx
index 84d2fd5..9267114 100644
--- a/src/components/CompaniesTable.tsx
+++ b/src/components/CompaniesTable.tsx
@@ -27,8 +27,9 @@ import {
CardTitle,
} from "./ui/card";
import { Dialog, DialogContent, DialogTrigger } from "./ui/dialog";
+import { Company } from "@/models/job.model";
-function CompaniesTable({ companies }: { companies: any[] }) {
+function CompaniesTable({ companies }: { companies: Company[] }) {
return (
<div className="col-span-3">
<Card x-chunk="dashboard-06-chunk-0">
diff --git a/src/components/JobsContainer.tsx b/src/components/JobsContainer.tsx
index 601f08e..062ae35 100644
--- a/src/components/JobsContainer.tsx
+++ b/src/components/JobsContainer.tsx
@@ -25,13 +25,21 @@ import {
getJobsList,
} from "@/actions/job.actions";
import { toast } from "./ui/use-toast";
+import {
+ Company,
+ JobLocation,
+ JobResponse,
+ JobSource,
+ JobStatus,
+ JobTitle,
+} from "@/models/job.model";
type MyJobsProps = {
- statuses: { id: string; label: string; value: string }[];
- companies: any[];
- titles: { id: string; label: string; value: string }[];
- locations: { id: string; label: string; value: string }[];
- sources: { id: string; label: string; value: string }[];
+ statuses: JobStatus[];
+ companies: Company[];
+ titles: JobTitle[];
+ locations: JobLocation[];
+ sources: JobSource[];
};
function JobsContainer({
@@ -41,7 +49,7 @@ function JobsContainer({
locations,
sources,
}: MyJobsProps) {
- const [jobs, setJobs] = useState<any[]>([]);
+ const [jobs, setJobs] = useState<JobResponse[]>([]);
const [currentPage, setCurrentPage] = useState(1);
const [totalJobs, setTotalJobs] = useState(0);
const [editJob, setEditJob] = useState(null);
diff --git a/src/components/MyJobsTable.tsx b/src/components/MyJobsTable.tsx
index 2fbc654..134d274 100644
--- a/src/components/MyJobsTable.tsx
+++ b/src/components/MyJobsTable.tsx
@@ -53,9 +53,10 @@ import {
AlertDialogHeader,
AlertDialogTitle,
} from "./ui/alert-dialog";
+import { JobResponse } from "@/models/job.model";
type MyJobsTableProps = {
- jobs: any[];
+ jobs: JobResponse[];
currentPage: number;
totalPages: number;
totalJobs: number;
@@ -188,7 +189,10 @@ function MyJobsTable({
<ListCollapse className="mr-2 h-4 w-4" />
View Details
</DropdownMenuItem>
- <DropdownMenuItem onClick={() => editJob(job.id)}>
+ <DropdownMenuItem
+ className="cursor-pointer"
+ onClick={() => editJob(job.id)}
+ >
<Pencil className="mr-2 h-4 w-4" />
Edit Job
</DropdownMenuItem>
diff --git a/src/components/RecentJobsCard.tsx b/src/components/RecentJobsCard.tsx
index 2ad5212..8fc157d 100644
--- a/src/components/RecentJobsCard.tsx
+++ b/src/components/RecentJobsCard.tsx
@@ -1,8 +1,9 @@
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { JobResponse } from "@/models/job.model";
import { format } from "date-fns";
-export default function RecentJobsCard({ jobs }: { jobs: any[] }) {
+export default function RecentJobsCard({ jobs }: { jobs: JobResponse[] }) {
return (
<Card>
<CardHeader>
diff --git a/src/models/job.model.ts b/src/models/job.model.ts
index 37ae37d..caf586c 100644
--- a/src/models/job.model.ts
+++ b/src/models/job.model.ts
@@ -13,9 +13,62 @@ export interface JobForm {
jobDescription: string;
}
+export interface JobTitle {
+ id: string;
+ label: string;
+ value: string;
+ createdBy: string;
+}
+
+export interface Company {
+ id: string;
+ label: string;
+ value: string;
+ createdBy: string;
+ logoUrl?: string;
+}
+
+export interface JobStatus {
+ id: string;
+ label: string;
+ value: string;
+}
+
+export interface JobSource {
+ id: string;
+ label: string;
+ value: string;
+}
+
+export interface JobLocation {
+ id: string;
+ label: string;
+ value: string;
+ stateProv?: string;
+ country?: string;
+ createdBy: string;
+}
+
+export interface Country {
+ id: string;
+ label: string;
+ value: string;
+}
+
export interface JobResponse {
id: string;
userId: string;
+ JobTitle: JobTitle;
+ Company: Company;
+ Status: JobStatus;
+ Location: JobLocation;
+ JobSource: JobSource;
+ jobType: string;
+ createdAt: Date;
+ appliedDate: Date;
+ dueDate: Date;
+ salaryRange: string;
+ description: string;
}
export enum JOB_TYPES {