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/Edit work experience

Khuram Niaz614799e94eb6
diff --git a/src/actions/profile.actions.ts b/src/actions/profile.actions.ts
index b3fa93d..bd20d38 100644
--- a/src/actions/profile.actions.ts
+++ b/src/actions/profile.actions.ts
@@ -1,6 +1,7 @@
"use server";
import prisma from "@/lib/db";
import { AddContactInfoFormSchema } from "@/models/addContactInfoForm.schema";
+import { AddExperienceFormSchema } from "@/models/addExperienceForm.schema";
import { AddSummarySectionFormSchema } from "@/models/addSummaryForm.schema";
import { CreateResumeFormSchema } from "@/models/createResumeForm.schema";
import { ResumeSection, SectionType, Summary } from "@/models/profile.model";
@@ -73,6 +74,14 @@ export const getResumeById = async (
ResumeSections: {
include: {
summary: true,
+ workExperiences: {
+ include: {
+ jobTitle: true,
+ Company: true,
+ location: true,
+ },
+ },
+ educations: true,
},
},
},
@@ -322,3 +331,92 @@ export const updateResumeSummary = async (
}
}
};
+
+export const addExperience = async (
+ data: z.infer<typeof AddExperienceFormSchema>
+): Promise<any | undefined> => {
+ try {
+ const user = await getCurrentUser();
+
+ if (!user) {
+ throw new Error("Not authenticated");
+ }
+ const section = !data.sectionId
+ ? await prisma.resumeSection.create({
+ data: {
+ resumeId: data.resumeId!,
+ sectionTitle: data.sectionTitle!,
+ sectionType: SectionType.EXPERIENCE,
+ },
+ })
+ : undefined;
+
+ const experience = await prisma.resumeSection.update({
+ where: {
+ id: section ? section.id : data.sectionId,
+ },
+ data: {
+ workExperiences: {
+ create: {
+ jobTitleId: data.title,
+ companyId: data.company,
+ locationId: data.location,
+ startDate: data.startDate,
+ endDate: data.endDate,
+ description: data.jobDescription,
+ },
+ },
+ },
+ });
+ revalidatePath("/dashboard/profile/resume/[id]");
+ return { data: experience, success: true };
+ } catch (error) {
+ const msg = "Failed to create experience.";
+ console.error(msg, error);
+ if (error instanceof Error) {
+ return { success: false, message: error.message };
+ }
+ }
+};
+
+export const updateExperience = async (
+ data: z.infer<typeof AddExperienceFormSchema>
+): Promise<any | undefined> => {
+ try {
+ const user = await getCurrentUser();
+
+ if (!user) {
+ throw new Error("Not authenticated");
+ }
+ // const res = await prisma.resumeSection.update({
+ // where: {
+ // id: data.id,
+ // },
+ // data: {
+ // sectionTitle: data.sectionTitle!,
+ // },
+ // });
+
+ const summary = await prisma.workExperience.update({
+ where: {
+ id: data.id,
+ },
+ data: {
+ jobTitleId: data.title,
+ companyId: data.company,
+ locationId: data.location,
+ startDate: data.startDate,
+ endDate: data.endDate,
+ description: data.jobDescription,
+ },
+ });
+ revalidatePath("/dashboard/profile/resume/[id]");
+ return { data: summary, success: true };
+ } catch (error) {
+ const msg = "Failed to update experience.";
+ console.error(msg, error);
+ if (error instanceof Error) {
+ return { success: false, message: error.message };
+ }
+ }
+};
diff --git a/src/app/globals.css b/src/app/globals.css
index 8b0af44..221d925 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -138,3 +138,15 @@
@apply flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground md:h-8 md:w-8;
}
}
+
+/* Override: For Calender component to hide month, year labels */
+.rdp-vhidden {
+ @apply hidden;
+}
+
+.rdp-dropdown_month > div {
+ @apply hidden;
+}
+.rdp-dropdown_year > div {
+ @apply hidden;
+}
diff --git a/src/components/DatePicker.tsx b/src/components/DatePicker.tsx
index 8067170..900521b 100644
--- a/src/components/DatePicker.tsx
+++ b/src/components/DatePicker.tsx
@@ -27,9 +27,15 @@ interface DatePickerProps {
field: ControllerRenderProps<any, any>;
presets: boolean;
isEnabled: boolean;
+ captionLayout?: boolean;
}
-export function DatePicker({ field, presets, isEnabled }: DatePickerProps) {
+export function DatePicker({
+ field,
+ presets,
+ isEnabled,
+ captionLayout,
+}: DatePickerProps) {
const [isPopoverOpen, setIsPopoverOpen] = useState<boolean>(false);
return (
@@ -71,6 +77,9 @@ export function DatePicker({ field, presets, isEnabled }: DatePickerProps) {
<div className="rounded-md border">
<Calendar
mode="single"
+ captionLayout={captionLayout ? "dropdown-buttons" : undefined}
+ fromYear={captionLayout ? 1970 : undefined}
+ toYear={captionLayout ? new Date().getFullYear() : undefined}
selected={field.value}
onSelect={(value) => {
field.onChange(value);
diff --git a/src/components/profile/AddExperience.tsx b/src/components/profile/AddExperience.tsx
index 69d100a..56ac4e5 100644
--- a/src/components/profile/AddExperience.tsx
+++ b/src/components/profile/AddExperience.tsx
@@ -1,6 +1,6 @@
"use client";
import { AddExperienceFormSchema } from "@/models/addExperienceForm.schema";
-import { WorkExperience } from "@/models/profile.model";
+import { ResumeSection, WorkExperience } from "@/models/profile.model";
import { useCallback, useEffect, useState, useTransition } from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
@@ -32,17 +32,25 @@ import { Company, JobLocation, JobTitle } from "@/models/job.model";
import { getAllCompanies } from "@/actions/company.actions";
import { getAllJobTitles } from "@/actions/jobtitle.actions";
import { getAllJobLocations } from "@/actions/jobLocation.actions";
+import { Switch } from "../ui/switch";
+import { addExperience, updateExperience } from "@/actions/profile.actions";
type AddExperienceProps = {
+ resumeId: string | undefined;
+ sectionId: string | undefined;
dialogOpen: boolean;
setDialogOpen: (e: boolean) => void;
- experienceToEdit?: WorkExperience;
+ experienceToEdit?: ResumeSection;
+ resetExperienceToEdit: () => void;
};
function AddExperience({
+ resumeId,
+ sectionId,
dialogOpen,
setDialogOpen,
experienceToEdit,
+ resetExperienceToEdit,
}: AddExperienceProps) {
const [companies, setCompanies] = useState<Company[]>([]);
const [locations, setLocations] = useState<JobLocation[]>([]);
@@ -50,7 +58,6 @@ function AddExperience({
const pageTitle = experienceToEdit ? "Edit Experience" : "Add Experience";
const [isPending, startTransition] = useTransition();
const getTitleCompanyAndLocationData = useCallback(async () => {
- console.log("get titles, companies and locations");
const [_companies, _titles, _locations] = await Promise.all([
getAllCompanies(),
getAllJobTitles(),
@@ -63,20 +70,50 @@ function AddExperience({
const form = useForm<z.infer<typeof AddExperienceFormSchema>>({
resolver: zodResolver(AddExperienceFormSchema),
- defaultValues: {},
+ defaultValues: {
+ resumeId,
+ sectionId,
+ },
});
- const { setValue, reset, formState, clearErrors } = form;
+ const { setValue, watch, reset, formState, resetField, clearErrors } = form;
+
+ const currentJobValue = watch("currentJob");
useEffect(() => {
getTitleCompanyAndLocationData();
- }, [getTitleCompanyAndLocationData]);
+ if (experienceToEdit) {
+ clearErrors();
+ const experience: WorkExperience =
+ experienceToEdit.workExperiences?.pop()!;
+ setValue("id", experience?.id);
+ setValue("title", experience?.jobTitle.id);
+ setValue("company", experience?.Company.id);
+ setValue("location", experience?.location.id);
+ setValue("startDate", experience?.startDate);
+ setValue("endDate", experience?.endDate);
+ setValue("jobDescription", experience?.description);
+ setValue("currentJob", !!!experience?.endDate);
+ } else {
+ reset();
+ resetExperienceToEdit();
+ }
+ setValue("sectionId", sectionId);
+ }, [
+ getTitleCompanyAndLocationData,
+ experienceToEdit,
+ clearErrors,
+ setValue,
+ sectionId,
+ reset,
+ resetExperienceToEdit,
+ ]);
const onSubmit = (data: z.infer<typeof AddExperienceFormSchema>) => {
startTransition(async () => {
- const res = { res: experienceToEdit, success: true, message: "" };
- // ? await updateResumeSummary(data)
- // : await addResumeSummary(data);
+ const res = experienceToEdit?.workExperiences?.length
+ ? await updateExperience(data)
+ : await addExperience(data);
if (!res.success) {
toast({
variant: "destructive",
@@ -96,9 +133,15 @@ function AddExperience({
});
};
+ const onCurrentJob = (current: boolean) => {
+ if (current) {
+ resetField("endDate");
+ }
+ };
+
return (
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
- <DialogContent className="h-full lg:max-h-screen md:max-w-[40rem] overflow-y-scroll">
+ <DialogContent className="h-full md:h-[85%] lg:max-h-screen md:max-w-[40rem] overflow-y-scroll">
<DialogHeader>
<DialogTitle>{pageTitle}</DialogTitle>
</DialogHeader>
@@ -108,24 +151,29 @@ function AddExperience({
className="grid grid-cols-1 md:grid-cols-2 gap-4 p-2"
>
{/* SECTION TITLE */}
- <div className="md:col-span-2">
- <FormField
- control={form.control}
- name="sectionTitle"
- render={({ field }) => (
- <FormItem>
- <FormLabel>Section Title</FormLabel>
- <FormControl>
- <Input {...field} placeholder="Ex: Experience" />
- </FormControl>
- <FormMessage />
- </FormItem>
- )}
- />
- </div>
- <hr className="md:col-span-2" />
+ {!sectionId ? (
+ <>
+ <div className="md:col-span-2">
+ <FormField
+ control={form.control}
+ name="sectionTitle"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Section Title</FormLabel>
+ <FormControl>
+ <Input {...field} placeholder="Ex: Experience" />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ </div>
+ <hr className="md:col-span-2" />
+ </>
+ ) : null}
+
{/* JOB TITLE */}
- <div className="md:col-span-2">
+ <div>
<FormField
control={form.control}
name="title"
@@ -186,7 +234,32 @@ function AddExperience({
field={field}
presets={false}
isEnabled={true}
+ captionLayout={true}
+ />
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ </div>
+
+ {/* CURRENT JOB */}
+ <div className="flex items-center">
+ <FormField
+ control={form.control}
+ name="currentJob"
+ render={({ field }) => (
+ <FormItem className="flex flex-row">
+ <Switch
+ checked={field.value}
+ onCheckedChange={(c) => {
+ field.onChange(c);
+ onCurrentJob(c);
+ }}
/>
+ <FormLabel className="flex items-center ml-4 mb-2">
+ {field.value ? "Current Job" : "Job Ended"}
+ </FormLabel>
+
<FormMessage />
</FormItem>
)}
@@ -204,7 +277,8 @@ function AddExperience({
<DatePicker
field={field}
presets={false}
- isEnabled={true}
+ isEnabled={!currentJobValue!}
+ captionLayout={true}
/>
<FormMessage />
</FormItem>
diff --git a/src/components/profile/AddResumeSection.tsx b/src/components/profile/AddResumeSection.tsx
index 37630c7..81eb250 100644
--- a/src/components/profile/AddResumeSection.tsx
+++ b/src/components/profile/AddResumeSection.tsx
@@ -26,6 +26,7 @@ interface AddResumeSectionProps {
export interface AddResumeSectionRef {
openContactInfoDialog: (c: ContactInfo) => void;
openSummaryDialog: (s: ResumeSection) => void;
+ openExperienceDialog: (s: ResumeSection) => void;
}
const AddResumeSection = forwardRef<AddResumeSectionRef, AddResumeSectionProps>(
@@ -38,6 +39,8 @@ const AddResumeSection = forwardRef<AddResumeSectionRef, AddResumeSectionProps>(
const [summaryToEdit, setSummaryToEdit] = useState<ResumeSection | null>(
null
);
+ const [experienceToEdit, setExperienceToEdit] =
+ useState<ResumeSection | null>(null);
useImperativeHandle(ref, () => ({
openContactInfoDialog(contactInfo: ContactInfo) {
setContactInfoDialogOpen(true);
@@ -47,10 +50,20 @@ const AddResumeSection = forwardRef<AddResumeSectionRef, AddResumeSectionProps>(
setSummaryDialogOpen(true);
setSummaryToEdit({ ...summarySection });
},
+ openExperienceDialog(experienceSection: ResumeSection) {
+ setExperienceDialogOpen(true);
+ setExperienceToEdit({ ...experienceSection });
+ },
}));
const summarySection = resume.ResumeSections?.find(
(section) => section.sectionType === SectionType.SUMMARY
);
+ const experienceSection = resume.ResumeSections?.find(
+ (section) => section.sectionType === SectionType.EXPERIENCE
+ );
+ const resetExperienceToEdit = () => {
+ setExperienceToEdit(null);
+ };
return (
<>
<DropdownMenu>
@@ -101,8 +114,12 @@ const AddResumeSection = forwardRef<AddResumeSectionRef, AddResumeSectionProps>(
summaryToEdit={summaryToEdit}
/>
<AddExperience
+ resumeId={resume.id}
+ sectionId={experienceSection?.id}
dialogOpen={experienceDialogOpen}
setDialogOpen={setExperienceDialogOpen}
+ experienceToEdit={experienceToEdit!}
+ resetExperienceToEdit={resetExperienceToEdit}
/>
</>
);
diff --git a/src/components/profile/ExperienceCard.tsx b/src/components/profile/ExperienceCard.tsx
new file mode 100644
index 0000000..348e0a2
--- /dev/null
+++ b/src/components/profile/ExperienceCard.tsx
@@ -0,0 +1,75 @@
+"use client";
+import { ResumeSection } from "@/models/profile.model";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "../ui/card";
+import { Button } from "../ui/button";
+import { Edit } from "lucide-react";
+import { format } from "date-fns";
+import { Editor, EditorContent } from "@tiptap/react";
+import StarterKit from "@tiptap/starter-kit";
+
+interface ExperienceCardProps {
+ experienceSection: ResumeSection | undefined;
+ openDialogForEdit: (id: string) => void;
+}
+
+function ExperienceCard({
+ experienceSection,
+ openDialogForEdit,
+}: ExperienceCardProps) {
+ return (
+ <>
+ <CardTitle className="pl-6 py-3">
+ {experienceSection?.sectionTitle}
+ </CardTitle>
+ {experienceSection?.workExperiences?.map((experience) => (
+ <Card key={experience.id}>
+ <CardHeader className="p-2 pb-0 flex-row justify-between relative">
+ <CardTitle className="text-xl pl-4">
+ {experience.jobTitle.label}
+ </CardTitle>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-8 gap-1 absolute top-0 right-1"
+ onClick={() => openDialogForEdit(experience.id!)}
+ >
+ <Edit className="h-3.5 w-3.5" />
+ <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">
+ Edit
+ </span>
+ </Button>
+ </CardHeader>
+ <CardContent>
+ <h3>{experience.Company.label}</h3>
+ <CardDescription>
+ {format(experience.startDate, "MMM, yyyy")} -{" "}
+ {experience.endDate
+ ? format(experience.endDate, "MMM, yyyy")
+ : "Present"}
+ <div>{experience.location.label}</div>
+ </CardDescription>
+ <div className="pt-2">
+ <EditorContent
+ editor={
+ new Editor({
+ extensions: [StarterKit],
+ content: experience.description,
+ editable: false,
+ })
+ }
+ />
+ </div>
+ </CardContent>
+ </Card>
+ ))}
+ </>
+ );
+}
+
+export default ExperienceCard;
diff --git a/src/components/profile/ResumeContainer.tsx b/src/components/profile/ResumeContainer.tsx
index c2413fb..4d88daa 100644
--- a/src/components/profile/ResumeContainer.tsx
+++ b/src/components/profile/ResumeContainer.tsx
@@ -1,22 +1,35 @@
"use client";
-import { Resume, SectionType } from "@/models/profile.model";
+import { Resume, ResumeSection, SectionType } from "@/models/profile.model";
import { Card, CardDescription, CardHeader, CardTitle } from "../ui/card";
import AddResumeSection, { AddResumeSectionRef } from "./AddResumeSection";
import ContactInfoCard from "./ContactInfoCard";
import { useRef } from "react";
import SummarySectionCard from "./SummarySectionCard";
+import ExperienceCard from "./ExperienceCard";
function ResumeContainer({ resume }: { resume: Resume }) {
const resumeSectionRef = useRef<AddResumeSectionRef>(null);
const summarySection = resume.ResumeSections?.find(
(section) => section.sectionType === SectionType.SUMMARY
);
+ const experienceSection = resume.ResumeSections?.find(
+ (section) => section.sectionType === SectionType.EXPERIENCE
+ );
const openContactInfoDialog = () => {
resumeSectionRef.current?.openContactInfoDialog(resume.ContactInfo!);
};
const openSummaryDialogForEdit = () => {
resumeSectionRef.current?.openSummaryDialog(summarySection!);
};
+ const openExperienceDialogForEdit = (experienceId: string) => {
+ const section: ResumeSection = {
+ ...experienceSection!,
+ workExperiences: experienceSection?.workExperiences?.filter(
+ (exp) => exp.id === experienceId
+ ),
+ };
+ resumeSectionRef.current?.openExperienceDialog(section);
+ };
return (
<>
<Card>
@@ -40,6 +53,12 @@ function ResumeContainer({ resume }: { resume: Resume }) {
openDialogForEdit={openSummaryDialogForEdit}
/>
) : null}
+ {experienceSection ? (
+ <ExperienceCard
+ experienceSection={experienceSection}
+ openDialogForEdit={openExperienceDialogForEdit}
+ />
+ ) : null}
</>
);
}
diff --git a/src/components/profile/SummarySectionCard.tsx b/src/components/profile/SummarySectionCard.tsx
index 2d96468..a483ead 100644
--- a/src/components/profile/SummarySectionCard.tsx
+++ b/src/components/profile/SummarySectionCard.tsx
@@ -29,9 +29,7 @@ function SummarySectionCard({
<>
<Card>
<CardHeader className="flex-row justify-between relative">
- <div>
- <CardTitle>{summarySection?.sectionTitle}</CardTitle>
- </div>
+ <CardTitle>{summarySection?.sectionTitle}</CardTitle>
<Button
variant="ghost"
size="sm"
diff --git a/src/components/ui/calendar.tsx b/src/components/ui/calendar.tsx
index 2f02434..3b8fcef 100644
--- a/src/components/ui/calendar.tsx
+++ b/src/components/ui/calendar.tsx
@@ -1,13 +1,13 @@
-"use client"
+"use client";
-import * as React from "react"
-import { ChevronLeft, ChevronRight } from "lucide-react"
-import { DayPicker } from "react-day-picker"
+import * as React from "react";
+import { ChevronLeft, ChevronRight } from "lucide-react";
+import { DayPicker } from "react-day-picker";
-import { cn } from "@/lib/utils"
-import { buttonVariants } from "@/components/ui/button"
+import { cn } from "@/lib/utils";
+import { buttonVariants } from "@/components/ui/button";
-export type CalendarProps = React.ComponentProps<typeof DayPicker>
+export type CalendarProps = React.ComponentProps<typeof DayPicker>;
function Calendar({
className,
@@ -24,6 +24,7 @@ function Calendar({
month: "space-y-4",
caption: "flex justify-center pt-1 relative items-center",
caption_label: "text-sm font-medium",
+ caption_dropdowns: "flex justify-center gap-1",
nav: "space-x-1 flex items-center",
nav_button: cn(
buttonVariants({ variant: "outline" }),
@@ -59,8 +60,8 @@ function Calendar({
}}
{...props}
/>
- )
+ );
}
-Calendar.displayName = "Calendar"
+Calendar.displayName = "Calendar";
-export { Calendar }
+export { Calendar };
diff --git a/src/components/ui/calendar2.tsx b/src/components/ui/calendar2.tsx
new file mode 100644
index 0000000..b4bdba9
--- /dev/null
+++ b/src/components/ui/calendar2.tsx
@@ -0,0 +1,110 @@
+"use client";
+
+import * as React from "react";
+import { ChevronLeft, ChevronRight } from "lucide-react";
+import { DayPicker, DropdownProps } from "react-day-picker";
+
+import { cn } from "@/lib/utils";
+import { buttonVariants } from "@/components/ui/button";
+import { ScrollArea } from "@/components/ui/scroll-area";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
+
+export type CalendarProps = React.ComponentProps<typeof DayPicker>;
+
+function Calendar({
+ className,
+ classNames,
+ showOutsideDays = true,
+ ...props
+}: CalendarProps) {
+ return (
+ <DayPicker
+ showOutsideDays={showOutsideDays}
+ className={cn("p-3", className)}
+ classNames={{
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
+ month: "space-y-4",
+ caption: "flex justify-center pt-1 relative items-center",
+ caption_label: "text-sm font-medium",
+ caption_dropdowns: "flex justify-center gap-1",
+ nav: "space-x-1 flex items-center",
+ nav_button: cn(
+ buttonVariants({ variant: "outline" }),
+ "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
+ ),
+ nav_button_previous: "absolute left-1",
+ nav_button_next: "absolute right-1",
+ table: "w-full border-collapse space-y-1",
+ head_row: "flex",
+ head_cell:
+ "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
+ row: "flex w-full mt-2",
+ cell: "text-center text-sm p-0 relative [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
+ day: cn(
+ buttonVariants({ variant: "ghost" }),
+ "h-9 w-9 p-0 font-normal aria-selected:opacity-100"
+ ),
+ day_range_end: "day-range-end",
+ day_selected:
+ "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
+ day_today: "bg-accent text-accent-foreground",
+ day_outside: "text-muted-foreground opacity-50",
+ day_disabled: "text-muted-foreground opacity-50",
+ day_range_middle:
+ "aria-selected:bg-accent aria-selected:text-accent-foreground",
+ day_hidden: "invisible",
+ ...classNames,
+ }}
+ components={{
+ Dropdown: ({ value, onChange, children, ...props }: DropdownProps) => {
+ const options = React.Children.toArray(
+ children
+ ) as React.ReactElement<React.HTMLProps<HTMLOptionElement>>[];
+ const selected = options.find((child) => child.props.value === value);
+ const handleChange = (value: string) => {
+ const changeEvent = {
+ target: { value },
+ } as React.ChangeEvent<HTMLSelectElement>;
+ onChange?.(changeEvent);
+ };
+ return (
+ <Select
+ value={value?.toString()}
+ onValueChange={(value) => {
+ handleChange(value);
+ }}
+ >
+ <SelectTrigger className="pr-1.5 focus:ring-0">
+ <SelectValue>{selected?.props?.children}</SelectValue>
+ </SelectTrigger>
+ <SelectContent position="popper">
+ <ScrollArea className="h-80">
+ {options.map((option, id: number) => (
+ <SelectItem
+ key={`${option.props.value}-${id}`}
+ value={option.props.value?.toString() ?? ""}
+ >
+ {option.props.children}
+ </SelectItem>
+ ))}
+ </ScrollArea>
+ </SelectContent>
+ </Select>
+ );
+ },
+ IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
+ IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
+ }}
+ {...props}
+ />
+ );
+}
+Calendar.displayName = "Calendar";
+
+export { Calendar };
diff --git a/src/models/addExperienceForm.schema.ts b/src/models/addExperienceForm.schema.ts
index b524e0b..1901dc3 100644
--- a/src/models/addExperienceForm.schema.ts
+++ b/src/models/addExperienceForm.schema.ts
@@ -2,11 +2,9 @@ import { z } from "zod";
export const AddExperienceFormSchema = z.object({
id: z.string().optional(),
- sectionTitle: z
- .string({
- required_error: "Section title is required.",
- })
- .min(1),
+ resumeId: z.string().optional(),
+ sectionId: z.string().optional(),
+ sectionTitle: z.string().default("Experience").optional(),
sectionType: z.string().optional(),
title: z
.string({
@@ -34,4 +32,5 @@ export const AddExperienceFormSchema = z.object({
}),
startDate: z.date(),
endDate: z.date().optional(),
+ currentJob: z.boolean().default(false).optional(),
});
diff --git a/src/models/profile.model.ts b/src/models/profile.model.ts
index bb6ca1b..0f95fde 100644
--- a/src/models/profile.model.ts
+++ b/src/models/profile.model.ts
@@ -62,9 +62,11 @@ export interface WorkExperience {
id?: string;
createdAt?: string;
updatedAt?: string;
- company: Company;
- title: JobTitle;
+ Company: Company;
+ jobTitle: JobTitle;
location: JobLocation;
startDate: Date;
endDate: Date;
+ currentJob?: Boolean;
+ description: string;
}