Something went wrong. Try again.
because I got bored of customising my CV for every job
Something went wrong. Try again.
TypeScript
1234567891011121314151617181920212223242526272829303132333435363738import type { User as DomainUser } from "@cv/core";import { JwtAuthGuard } from "@cv/auth";import { UseGuards } from "@nestjs/common";import { Args, Mutation, Resolver } from "@nestjs/graphql";import { CurrentUser } from "../current-user/current-user.decorator";import { CVParserService } from "./cv-parser.service";import { DraftEducationType, DraftJobExperienceType, ParsedCVDataWithResolutionType,} from "./types/draft.types";
@Resolver()export class CVParserResolver { constructor(private readonly cvParserService: CVParserService) {}
/** * Parse story text and resolve entities to existing database records * Returns draft data with entity IDs where matches were found */ @Mutation(() => ParsedCVDataWithResolutionType) @UseGuards(JwtAuthGuard) async parseStory( @CurrentUser() user: DomainUser, @Args("storyText") storyText: string, ): Promise<ParsedCVDataWithResolutionType> { const resolved = await this.cvParserService.parseStoryWithResolution( user, storyText, );
return new ParsedCVDataWithResolutionType( resolved.jobExperiences.map(DraftJobExperienceType.fromResolved), resolved.education.map(DraftEducationType.fromResolved), ); }}