Skip to content

Commit

Permalink
refactor InterestSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
brignano authored Jul 22, 2024
1 parent d134657 commit d426dca
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions app/_utils/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,18 @@ const JobSchema = z.object({
export type LevelSchema = z.infer<typeof LevelSchema>;
const LevelSchema = z.enum(["Basic", "Intermediate", "Advanced"]);

export type InterestSchema = z.infer<typeof InterestSchema>;
const InterestSchema = z.object({
export type SkillSchema = z.infer<typeof SkillSchema>;
const SkillSchema = z.object({
name: z.string(),
keywords: z.array(z.string()),
level: LevelSchema,
});

export type SkillSchema = z.infer<typeof SkillSchema>;
const SkillSchema = InterestSchema.merge(
z.object({
level: LevelSchema,
})
);

export type ResumeSchema = z.infer<typeof ResumeSchema>;
export const ResumeSchema = z.object({
about: AboutSchema,
jobs: z.optional(z.array(JobSchema)),
skills: z.optional(z.array(SkillSchema)),
interest: z.optional(z.array(InterestSchema)),
interest: z.optional(z.array(z.string())),
});

/**
Expand Down

0 comments on commit d426dca

Please sign in to comment.