-
- Forgot your password?
-
+
+ setIsHr(checked)}
+ />
+
+
+ {isHr && (
+
+ (
+
+ Company Name
+
+
+
+
+
+ )}
+ />
+ (
+
+ Company Website
+
+
+
+
+
+ )}
+ />
+ (
+
+ Company Description
+
+
+
+
+
+ )}
+ />
+
+
+ )}
+
-
-
-
-
- Already have an account?{' '}
-
- Sign In
-
-
-
>
);
};
diff --git a/src/components/image-upload.tsx b/src/components/image-upload.tsx
new file mode 100644
index 00000000..2c1e9d91
--- /dev/null
+++ b/src/components/image-upload.tsx
@@ -0,0 +1,72 @@
+import { useState } from 'react';
+import Image from 'next/image';
+import { Button } from '@/components/ui/button';
+import { FormItem, FormLabel, FormMessage } from '@/components/ui/form';
+import { Upload } from 'lucide-react';
+
+export default function ImageUpload() {
+ const [logoPreview, setLogoPreview] = useState
(null);
+
+ const handleLogoChange = (event: React.ChangeEvent) => {
+ const file = event.target.files?.[0];
+ if (file) {
+ const reader = new FileReader();
+ reader.onloadend = () => {
+ setLogoPreview(reader.result as string);
+ };
+ reader.readAsDataURL(file);
+ }
+ };
+
+ return (
+
+ Company Logo
+
+
+
+ {logoPreview && (
+
+ )}
+
+
+ );
+}
diff --git a/src/components/profile/forms/EditProfileForm.tsx b/src/components/profile/forms/EditProfileForm.tsx
index ae0380f5..c2786c7e 100644
--- a/src/components/profile/forms/EditProfileForm.tsx
+++ b/src/components/profile/forms/EditProfileForm.tsx
@@ -41,7 +41,7 @@ const EditProfileForm = ({
const form = useForm({
resolver: zodResolver(profileSchema),
defaultValues: {
- aboutMe: userdetails.aboutMe || '',
+ aboutMe: userdetails.about || '',
email: userdetails.email || '',
contactEmail: userdetails.contactEmail || '',
avatar: userdetails.avatar || '',
diff --git a/src/config/path.config.ts b/src/config/path.config.ts
index 31ebd971..c5699881 100644
--- a/src/config/path.config.ts
+++ b/src/config/path.config.ts
@@ -21,5 +21,6 @@ const APP_PATHS = {
RESUME: '/profile/resume',
EXPERIENCE: '/profile/experience',
SKILLS: '/profile/skills',
+ ONBOARDING: '/onboarding',
};
export default APP_PATHS;
diff --git a/src/lib/validators/auth.validator.ts b/src/lib/validators/auth.validator.ts
index a88e89bb..5a9e59bb 100644
--- a/src/lib/validators/auth.validator.ts
+++ b/src/lib/validators/auth.validator.ts
@@ -7,10 +7,29 @@ export const SigninSchema = z.object({
export type SigninSchemaType = z.infer;
+// Define the company info schema
+export const companyInfoSchema = z.object({
+ name: z.string().min(1, 'Company name is required'),
+ website: z
+ .string()
+ .url('Website URL is invalid')
+ .refine((url) => url.startsWith('https'), {
+ message: 'Website URL must start with https://',
+ }),
+
+ description: z.string().min(10, 'Description must be at least 10 characters'),
+ logo: z.string().optional(),
+});
+
+// Extend the base signup schema
export const SignupSchema = z.object({
name: z.string().min(1, 'Name is required'),
- email: z.string().email('Email is invalid').min(1, 'Email is required'),
- password: z.string().min(1, 'Password is required'),
+ email: z.string().email('Invalid email address'),
+ password: z.string().min(6, 'Password must be at least 6 characters'),
+ role: z.enum(['USER', 'HR']).default('USER'),
+ companyInfo: companyInfoSchema.optional(),
});
+export type CompanyInfo = z.infer;
+export type SignupData = z.infer;
export type SignupSchemaType = z.infer;
diff --git a/src/lib/validators/jobs.validator.ts b/src/lib/validators/jobs.validator.ts
index 83f9385c..b2e24819 100644
--- a/src/lib/validators/jobs.validator.ts
+++ b/src/lib/validators/jobs.validator.ts
@@ -17,6 +17,7 @@ export const JobPostSchema = z
message: 'Curreny is required',
}),
skills: z.array(z.string()).optional(),
+ companyId: z.string(),
category: z.string(),
companyEmail: z.string().email('Invalid email').min(1, 'Email is required'),
companyBio: z.string().min(1, 'Company Bio is required'),
diff --git a/src/types/recruiters.types.ts b/src/types/recruiters.types.ts
index a4152150..56958392 100644
--- a/src/types/recruiters.types.ts
+++ b/src/types/recruiters.types.ts
@@ -7,8 +7,8 @@ export type RecruitersTypes = {
jobs: number;
};
company: {
- companyName: string;
- companyEmail: string;
+ name: string; // changed from companyName to match Prisma schema
+ website: string | null; // changed from companyEmail to match Prisma schema
} | null;
};
diff --git a/src/types/user.types.ts b/src/types/user.types.ts
index e0369982..8493d836 100644
--- a/src/types/user.types.ts
+++ b/src/types/user.types.ts
@@ -44,7 +44,7 @@ export interface UserType {
contactEmail: string | null;
resume: string | null;
avatar: string | null;
- aboutMe: string | null;
+ about: string | null;
experience: ExperienceType[];
education: EducationType[];
project: ProjectType[];