mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-28 12:43:12 +08:00
[offers][fix] Fix UI and remove specialization on the backend (#426)
* [offers][fix] Remove specialization on the frontend * [offers][fix] Rename refresh OEA button * [offers][chore] Remove specialisation and make bonus, stocks and baseSalary optional * [offers][fix] Fix OEA profile job title Co-authored-by: Bryann Yeap Kok Keong <bryannyeapkk@gmail.com>
This commit is contained in:
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to drop the column `specialization` on the `OffersExperience` table. All the data in the column will be lost.
|
||||||
|
- You are about to drop the column `specialization` on the `OffersFullTime` table. All the data in the column will be lost.
|
||||||
|
- You are about to drop the column `specialization` on the `OffersIntern` table. All the data in the column will be lost.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "OffersExperience" DROP COLUMN "specialization";
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "OffersFullTime" DROP COLUMN "specialization",
|
||||||
|
ALTER COLUMN "baseSalaryId" DROP NOT NULL,
|
||||||
|
ALTER COLUMN "bonusId" DROP NOT NULL,
|
||||||
|
ALTER COLUMN "stocksId" DROP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "OffersIntern" DROP COLUMN "specialization";
|
@ -234,7 +234,6 @@ model OffersExperience {
|
|||||||
|
|
||||||
// Add more fields
|
// Add more fields
|
||||||
durationInMonths Int?
|
durationInMonths Int?
|
||||||
specialization String?
|
|
||||||
location String?
|
location String?
|
||||||
|
|
||||||
// FULLTIME fields
|
// FULLTIME fields
|
||||||
@ -340,7 +339,6 @@ model OffersIntern {
|
|||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
|
|
||||||
title String
|
title String
|
||||||
specialization String
|
|
||||||
internshipCycle String
|
internshipCycle String
|
||||||
startYear Int
|
startYear Int
|
||||||
monthlySalary OffersCurrency @relation(fields: [monthlySalaryId], references: [id], onDelete: Cascade)
|
monthlySalary OffersCurrency @relation(fields: [monthlySalaryId], references: [id], onDelete: Cascade)
|
||||||
@ -352,16 +350,15 @@ model OffersIntern {
|
|||||||
model OffersFullTime {
|
model OffersFullTime {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
title String
|
title String
|
||||||
specialization String
|
|
||||||
level String
|
level String
|
||||||
totalCompensation OffersCurrency @relation("OfferTotalCompensation", fields: [totalCompensationId], references: [id], onDelete: Cascade)
|
totalCompensation OffersCurrency @relation("OfferTotalCompensation", fields: [totalCompensationId], references: [id], onDelete: Cascade)
|
||||||
totalCompensationId String @unique
|
totalCompensationId String @unique
|
||||||
baseSalary OffersCurrency @relation("OfferBaseSalary", fields: [baseSalaryId], references: [id], onDelete: Cascade)
|
baseSalary OffersCurrency? @relation("OfferBaseSalary", fields: [baseSalaryId], references: [id], onDelete: Cascade)
|
||||||
baseSalaryId String @unique
|
baseSalaryId String? @unique
|
||||||
bonus OffersCurrency @relation("OfferBonus", fields: [bonusId], references: [id], onDelete: Cascade)
|
bonus OffersCurrency? @relation("OfferBonus", fields: [bonusId], references: [id], onDelete: Cascade)
|
||||||
bonusId String @unique
|
bonusId String? @unique
|
||||||
stocks OffersCurrency @relation("OfferStocks", fields: [stocksId], references: [id], onDelete: Cascade)
|
stocks OffersCurrency? @relation("OfferStocks", fields: [stocksId], references: [id], onDelete: Cascade)
|
||||||
stocksId String @unique
|
stocksId String? @unique
|
||||||
|
|
||||||
OffersOffer OffersOffer?
|
OffersOffer OffersOffer?
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,9 @@ import {
|
|||||||
} from '@heroicons/react/24/outline';
|
} from '@heroicons/react/24/outline';
|
||||||
import { JobType } from '@prisma/client';
|
import { JobType } from '@prisma/client';
|
||||||
|
|
||||||
|
import type { JobTitleType } from '~/components/shared/JobTitles';
|
||||||
|
import { getLabelForJobTitleType } from '~/components/shared/JobTitles';
|
||||||
|
|
||||||
import { HorizontalDivider } from '~/../../../packages/ui/dist';
|
import { HorizontalDivider } from '~/../../../packages/ui/dist';
|
||||||
import { convertMoneyToString } from '~/utils/offers/currency';
|
import { convertMoneyToString } from '~/utils/offers/currency';
|
||||||
import { formatDate } from '~/utils/offers/time';
|
import { formatDate } from '~/utils/offers/time';
|
||||||
@ -54,7 +57,9 @@ export default function OfferProfileCard({
|
|||||||
<HorizontalDivider />
|
<HorizontalDivider />
|
||||||
<div className="flex items-end justify-between">
|
<div className="flex items-end justify-between">
|
||||||
<div className="col-span-1 row-span-3">
|
<div className="col-span-1 row-span-3">
|
||||||
<p className="font-bold">{title}</p>
|
<p className="font-bold">
|
||||||
|
{getLabelForJobTitleType(title as JobTitleType)}
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Company: {company.name}, {location}
|
Company: {company.name}, {location}
|
||||||
</p>
|
</p>
|
||||||
|
@ -236,7 +236,7 @@ export default function OffersSubmissionForm({
|
|||||||
<FormProvider {...formMethods}>
|
<FormProvider {...formMethods}>
|
||||||
<form onSubmit={handleSubmit(onSubmit)}>
|
<form onSubmit={handleSubmit(onSubmit)}>
|
||||||
{formSteps[formStep].component}
|
{formSteps[formStep].component}
|
||||||
<pre>{JSON.stringify(formMethods.watch(), null, 2)}</pre>
|
{/* <pre>{JSON.stringify(formMethods.watch(), null, 2)}</pre> */}
|
||||||
{formSteps[formStep].hasNext && (
|
{formSteps[formStep].hasNext && (
|
||||||
<div className="flex justify-end">
|
<div className="flex justify-end">
|
||||||
<Button
|
<Button
|
||||||
|
@ -140,24 +140,19 @@ function FullTimeJobFields() {
|
|||||||
</div>
|
</div>
|
||||||
<Collapsible label="Add more details">
|
<Collapsible label="Add more details">
|
||||||
<div className="mb-5 grid grid-cols-2 space-x-3">
|
<div className="mb-5 grid grid-cols-2 space-x-3">
|
||||||
<FormTextInput
|
|
||||||
label="Focus / Specialization"
|
|
||||||
placeholder="e.g. Front End"
|
|
||||||
{...register(`background.experiences.0.specialization`)}
|
|
||||||
/>
|
|
||||||
<FormTextInput
|
<FormTextInput
|
||||||
label="Level"
|
label="Level"
|
||||||
placeholder="e.g. L4, Junior"
|
placeholder="e.g. L4, Junior"
|
||||||
{...register(`background.experiences.0.level`)}
|
{...register(`background.experiences.0.level`)}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<div className="mb-5 grid grid-cols-2 space-x-3">
|
|
||||||
<FormSelect
|
<FormSelect
|
||||||
display="block"
|
display="block"
|
||||||
label="Location"
|
label="Location"
|
||||||
options={locationOptions}
|
options={locationOptions}
|
||||||
{...register(`background.experiences.0.location`)}
|
{...register(`background.experiences.0.location`)}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="mb-5 grid grid-cols-2 space-x-3">
|
||||||
<FormTextInput
|
<FormTextInput
|
||||||
errorMessage={experiencesField?.durationInMonths?.message}
|
errorMessage={experiencesField?.durationInMonths?.message}
|
||||||
label="Duration (months)"
|
label="Duration (months)"
|
||||||
@ -224,11 +219,6 @@ function InternshipJobFields() {
|
|||||||
</div>
|
</div>
|
||||||
<Collapsible label="Add more details">
|
<Collapsible label="Add more details">
|
||||||
<div className="mb-5 grid grid-cols-2 space-x-3">
|
<div className="mb-5 grid grid-cols-2 space-x-3">
|
||||||
<FormTextInput
|
|
||||||
label="Focus / Specialization"
|
|
||||||
placeholder="e.g. Front End"
|
|
||||||
{...register(`background.experiences.0.specialization`)}
|
|
||||||
/>
|
|
||||||
<FormSelect
|
<FormSelect
|
||||||
display="block"
|
display="block"
|
||||||
label="Location"
|
label="Location"
|
||||||
|
@ -72,8 +72,7 @@ export default function OfferCard({
|
|||||||
<HorizontalDivider />
|
<HorizontalDivider />
|
||||||
<div className="px-8">
|
<div className="px-8">
|
||||||
<div className="flex flex-col py-2">
|
<div className="flex flex-col py-2">
|
||||||
{totalCompensation ||
|
{(totalCompensation || monthlySalary) && (
|
||||||
(monthlySalary && (
|
|
||||||
<div className="flex flex-row">
|
<div className="flex flex-row">
|
||||||
<CurrencyDollarIcon className="mr-1 h-5" />
|
<CurrencyDollarIcon className="mr-1 h-5" />
|
||||||
<p>
|
<p>
|
||||||
@ -81,9 +80,9 @@ export default function OfferCard({
|
|||||||
{monthlySalary && `Monthly Salary: ${monthlySalary}`}
|
{monthlySalary && `Monthly Salary: ${monthlySalary}`}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
))}
|
)}
|
||||||
{totalCompensation && (
|
{totalCompensation && (
|
||||||
<div className="ml-6 flex flex-row font-light text-slate-400">
|
<div className="ml-6 flex flex-row font-light">
|
||||||
<p>
|
<p>
|
||||||
Base / year: {base} ⋅ Stocks / year: {stocks} ⋅ Bonus / year:{' '}
|
Base / year: {base} ⋅ Stocks / year: {stocks} ⋅ Bonus / year:{' '}
|
||||||
{bonus}
|
{bonus}
|
||||||
|
@ -121,7 +121,7 @@ function ProfileAnalysis({
|
|||||||
<Button
|
<Button
|
||||||
addonPosition="start"
|
addonPosition="start"
|
||||||
icon={ArrowPathIcon}
|
icon={ArrowPathIcon}
|
||||||
label="Refresh Analysis"
|
label="Regenerate Analysis"
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
onClick={() => generateAnalysisMutation.mutate({ profileId })}
|
onClick={() => generateAnalysisMutation.mutate({ profileId })}
|
||||||
/>
|
/>
|
||||||
|
@ -51,7 +51,6 @@ type ExperiencePostData = {
|
|||||||
level?: string | null;
|
level?: string | null;
|
||||||
location?: string | null;
|
location?: string | null;
|
||||||
monthlySalary?: Money | null;
|
monthlySalary?: Money | null;
|
||||||
specialization?: string | null;
|
|
||||||
title?: string | null;
|
title?: string | null;
|
||||||
totalCompensation?: Money | null;
|
totalCompensation?: Money | null;
|
||||||
totalCompensationId?: string | null;
|
totalCompensationId?: string | null;
|
||||||
@ -91,12 +90,11 @@ export type OfferFormData = Omit<OfferPostData, 'monthYearReceived'> & {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type OfferFullTimePostData = {
|
export type OfferFullTimePostData = {
|
||||||
baseSalary: Money;
|
baseSalary: Money | null;
|
||||||
bonus: Money;
|
bonus: Money | null;
|
||||||
id?: string;
|
id?: string;
|
||||||
level: string;
|
level: string;
|
||||||
specialization: string;
|
stocks: Money | null;
|
||||||
stocks: Money;
|
|
||||||
title: string;
|
title: string;
|
||||||
totalCompensation: Money;
|
totalCompensation: Money;
|
||||||
};
|
};
|
||||||
@ -105,7 +103,6 @@ export type OfferInternPostData = {
|
|||||||
id?: string;
|
id?: string;
|
||||||
internshipCycle: string;
|
internshipCycle: string;
|
||||||
monthlySalary: Money;
|
monthlySalary: Money;
|
||||||
specialization: string;
|
|
||||||
startYear: number;
|
startYear: number;
|
||||||
title: string;
|
title: string;
|
||||||
};
|
};
|
||||||
|
@ -73,10 +73,6 @@ const analysisOfferDtoMapper = (
|
|||||||
?.filter((exp) => exp.company != null)
|
?.filter((exp) => exp.company != null)
|
||||||
.map((exp) => exp.company?.name ?? '') ?? [],
|
.map((exp) => exp.company?.name ?? '') ?? [],
|
||||||
profileName,
|
profileName,
|
||||||
specialization:
|
|
||||||
offer.jobType === JobType.FULLTIME
|
|
||||||
? offer.offersFullTime?.specialization ?? ''
|
|
||||||
: offer.offersIntern?.specialization ?? '',
|
|
||||||
title:
|
title:
|
||||||
offer.jobType === JobType.FULLTIME
|
offer.jobType === JobType.FULLTIME
|
||||||
? offer.offersFullTime?.title ?? ''
|
? offer.offersFullTime?.title ?? ''
|
||||||
@ -120,22 +116,14 @@ const analysisDtoMapper = (
|
|||||||
OffersOffer & {
|
OffersOffer & {
|
||||||
company: Company;
|
company: Company;
|
||||||
offersFullTime:
|
offersFullTime:
|
||||||
| (OffersFullTime & {
|
| (OffersFullTime & { totalCompensation: OffersCurrency })
|
||||||
totalCompensation: OffersCurrency;
|
|
||||||
})
|
|
||||||
| null;
|
|
||||||
offersIntern:
|
|
||||||
| (OffersIntern & {
|
|
||||||
monthlySalary: OffersCurrency;
|
|
||||||
})
|
|
||||||
| null;
|
| null;
|
||||||
|
offersIntern: (OffersIntern & { monthlySalary: OffersCurrency }) | null;
|
||||||
profile: OffersProfile & {
|
profile: OffersProfile & {
|
||||||
background:
|
background:
|
||||||
| (OffersBackground & {
|
| (OffersBackground & {
|
||||||
experiences: Array<
|
experiences: Array<
|
||||||
OffersExperience & {
|
OffersExperience & { company: Company | null }
|
||||||
company: Company | null;
|
|
||||||
}
|
|
||||||
>;
|
>;
|
||||||
})
|
})
|
||||||
| null;
|
| null;
|
||||||
@ -168,10 +156,6 @@ const analysisHighestOfferDtoMapper = (
|
|||||||
id: offer.id,
|
id: offer.id,
|
||||||
level: offer.offersFullTime?.level ?? '',
|
level: offer.offersFullTime?.level ?? '',
|
||||||
location: offer.location,
|
location: offer.location,
|
||||||
specialization:
|
|
||||||
offer.jobType === JobType.FULLTIME
|
|
||||||
? offer.offersFullTime?.specialization ?? ''
|
|
||||||
: offer.offersIntern?.specialization ?? '',
|
|
||||||
totalYoe: offer.profile.background?.totalYoe ?? -1,
|
totalYoe: offer.profile.background?.totalYoe ?? -1,
|
||||||
};
|
};
|
||||||
return analysisHighestOfferDto;
|
return analysisHighestOfferDto;
|
||||||
@ -327,12 +311,11 @@ export const experienceDtoMapper = (
|
|||||||
location: experience.location,
|
location: experience.location,
|
||||||
monthlySalary: experience.monthlySalary
|
monthlySalary: experience.monthlySalary
|
||||||
? valuationDtoMapper(experience.monthlySalary)
|
? valuationDtoMapper(experience.monthlySalary)
|
||||||
: experience.monthlySalary,
|
: null,
|
||||||
specialization: experience.specialization,
|
|
||||||
title: experience.title,
|
title: experience.title,
|
||||||
totalCompensation: experience.totalCompensation
|
totalCompensation: experience.totalCompensation
|
||||||
? valuationDtoMapper(experience.totalCompensation)
|
? valuationDtoMapper(experience.totalCompensation)
|
||||||
: experience.totalCompensation,
|
: null,
|
||||||
};
|
};
|
||||||
return experienceDto;
|
return experienceDto;
|
||||||
};
|
};
|
||||||
@ -398,9 +381,9 @@ export const profileOfferDtoMapper = (
|
|||||||
company: Company;
|
company: Company;
|
||||||
offersFullTime:
|
offersFullTime:
|
||||||
| (OffersFullTime & {
|
| (OffersFullTime & {
|
||||||
baseSalary: OffersCurrency;
|
baseSalary: OffersCurrency | null;
|
||||||
bonus: OffersCurrency;
|
bonus: OffersCurrency | null;
|
||||||
stocks: OffersCurrency;
|
stocks: OffersCurrency | null;
|
||||||
totalCompensation: OffersCurrency;
|
totalCompensation: OffersCurrency;
|
||||||
})
|
})
|
||||||
| null;
|
| null;
|
||||||
@ -421,12 +404,20 @@ export const profileOfferDtoMapper = (
|
|||||||
|
|
||||||
if (offer.offersFullTime) {
|
if (offer.offersFullTime) {
|
||||||
profileOfferDto.offersFullTime = {
|
profileOfferDto.offersFullTime = {
|
||||||
baseSalary: valuationDtoMapper(offer.offersFullTime.baseSalary),
|
baseSalary:
|
||||||
bonus: valuationDtoMapper(offer.offersFullTime.bonus),
|
offer.offersFullTime?.baseSalary != null
|
||||||
|
? valuationDtoMapper(offer.offersFullTime.baseSalary)
|
||||||
|
: null,
|
||||||
|
bonus:
|
||||||
|
offer.offersFullTime?.bonus != null
|
||||||
|
? valuationDtoMapper(offer.offersFullTime.bonus)
|
||||||
|
: null,
|
||||||
id: offer.offersFullTime.id,
|
id: offer.offersFullTime.id,
|
||||||
level: offer.offersFullTime.level,
|
level: offer.offersFullTime.level,
|
||||||
specialization: offer.offersFullTime.specialization,
|
stocks:
|
||||||
stocks: valuationDtoMapper(offer.offersFullTime.stocks),
|
offer.offersFullTime?.stocks != null
|
||||||
|
? valuationDtoMapper(offer.offersFullTime.stocks)
|
||||||
|
: null,
|
||||||
title: offer.offersFullTime.title,
|
title: offer.offersFullTime.title,
|
||||||
totalCompensation: valuationDtoMapper(
|
totalCompensation: valuationDtoMapper(
|
||||||
offer.offersFullTime.totalCompensation,
|
offer.offersFullTime.totalCompensation,
|
||||||
@ -437,7 +428,6 @@ export const profileOfferDtoMapper = (
|
|||||||
id: offer.offersIntern.id,
|
id: offer.offersIntern.id,
|
||||||
internshipCycle: offer.offersIntern.internshipCycle,
|
internshipCycle: offer.offersIntern.internshipCycle,
|
||||||
monthlySalary: valuationDtoMapper(offer.offersIntern.monthlySalary),
|
monthlySalary: valuationDtoMapper(offer.offersIntern.monthlySalary),
|
||||||
specialization: offer.offersIntern.specialization,
|
|
||||||
startYear: offer.offersIntern.startYear,
|
startYear: offer.offersIntern.startYear,
|
||||||
title: offer.offersIntern.title,
|
title: offer.offersIntern.title,
|
||||||
};
|
};
|
||||||
@ -527,9 +517,9 @@ export const profileDtoMapper = (
|
|||||||
company: Company;
|
company: Company;
|
||||||
offersFullTime:
|
offersFullTime:
|
||||||
| (OffersFullTime & {
|
| (OffersFullTime & {
|
||||||
baseSalary: OffersCurrency;
|
baseSalary: OffersCurrency | null;
|
||||||
bonus: OffersCurrency;
|
bonus: OffersCurrency | null;
|
||||||
stocks: OffersCurrency;
|
stocks: OffersCurrency | null;
|
||||||
totalCompensation: OffersCurrency;
|
totalCompensation: OffersCurrency;
|
||||||
})
|
})
|
||||||
| null;
|
| null;
|
||||||
@ -550,7 +540,7 @@ export const profileDtoMapper = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (inputToken === profile.editToken) {
|
if (inputToken === profile.editToken) {
|
||||||
profileDto.editToken = profile.editToken;
|
profileDto.editToken = profile.editToken ?? null;
|
||||||
profileDto.isEditable = true;
|
profileDto.isEditable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,9 +577,9 @@ export const dashboardOfferDtoMapper = (
|
|||||||
company: Company;
|
company: Company;
|
||||||
offersFullTime:
|
offersFullTime:
|
||||||
| (OffersFullTime & {
|
| (OffersFullTime & {
|
||||||
baseSalary: OffersCurrency;
|
baseSalary: OffersCurrency | null;
|
||||||
bonus: OffersCurrency;
|
bonus: OffersCurrency | null;
|
||||||
stocks: OffersCurrency;
|
stocks: OffersCurrency | null;
|
||||||
totalCompensation: OffersCurrency;
|
totalCompensation: OffersCurrency;
|
||||||
})
|
})
|
||||||
| null;
|
| null;
|
||||||
|
@ -60,8 +60,14 @@ export default function OfferProfile() {
|
|||||||
? data?.offers.map((res: ProfileOffer) => {
|
? data?.offers.map((res: ProfileOffer) => {
|
||||||
if (res.offersFullTime) {
|
if (res.offersFullTime) {
|
||||||
const filteredOffer: OfferDisplayData = {
|
const filteredOffer: OfferDisplayData = {
|
||||||
base: convertMoneyToString(res.offersFullTime.baseSalary),
|
base:
|
||||||
bonus: convertMoneyToString(res.offersFullTime.bonus),
|
res.offersFullTime.baseSalary != null
|
||||||
|
? convertMoneyToString(res.offersFullTime.baseSalary)
|
||||||
|
: undefined,
|
||||||
|
bonus:
|
||||||
|
res.offersFullTime.bonus != null
|
||||||
|
? convertMoneyToString(res.offersFullTime.bonus)
|
||||||
|
: undefined,
|
||||||
companyName: res.company.name,
|
companyName: res.company.name,
|
||||||
id: res.offersFullTime.id,
|
id: res.offersFullTime.id,
|
||||||
jobLevel: res.offersFullTime.level,
|
jobLevel: res.offersFullTime.level,
|
||||||
@ -72,7 +78,10 @@ export default function OfferProfile() {
|
|||||||
negotiationStrategy: res.negotiationStrategy,
|
negotiationStrategy: res.negotiationStrategy,
|
||||||
otherComment: res.comments,
|
otherComment: res.comments,
|
||||||
receivedMonth: formatDate(res.monthYearReceived),
|
receivedMonth: formatDate(res.monthYearReceived),
|
||||||
stocks: convertMoneyToString(res.offersFullTime.stocks),
|
stocks:
|
||||||
|
res.offersFullTime.stocks != null
|
||||||
|
? convertMoneyToString(res.offersFullTime.stocks)
|
||||||
|
: undefined,
|
||||||
totalCompensation: convertMoneyToString(
|
totalCompensation: convertMoneyToString(
|
||||||
res.offersFullTime.totalCompensation,
|
res.offersFullTime.totalCompensation,
|
||||||
),
|
),
|
||||||
|
@ -107,8 +107,7 @@ function Test() {
|
|||||||
durationInMonths: 24,
|
durationInMonths: 24,
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
level: 'Junior',
|
level: 'Junior',
|
||||||
specialization: 'Front End',
|
title: 'software-engineer',
|
||||||
title: 'Software Engineer',
|
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
currency: 'SGD',
|
currency: 'SGD',
|
||||||
value: 104100,
|
value: 104100,
|
||||||
@ -146,12 +145,11 @@ function Test() {
|
|||||||
value: 2222,
|
value: 2222,
|
||||||
},
|
},
|
||||||
level: 'Junior',
|
level: 'Junior',
|
||||||
specialization: 'Front End',
|
|
||||||
stocks: {
|
stocks: {
|
||||||
currency: 'SGD',
|
currency: 'SGD',
|
||||||
value: 0,
|
value: 0,
|
||||||
},
|
},
|
||||||
title: 'Software Engineer',
|
title: 'software-engineer',
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
currency: 'SGD',
|
currency: 'SGD',
|
||||||
value: 4444,
|
value: 4444,
|
||||||
@ -175,12 +173,11 @@ function Test() {
|
|||||||
value: 20000,
|
value: 20000,
|
||||||
},
|
},
|
||||||
level: 'Junior',
|
level: 'Junior',
|
||||||
specialization: 'Front End',
|
|
||||||
stocks: {
|
stocks: {
|
||||||
currency: 'SGD',
|
currency: 'SGD',
|
||||||
value: 100,
|
value: 100,
|
||||||
},
|
},
|
||||||
title: 'Software Engineer',
|
title: 'software-engineer',
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
currency: 'SGD',
|
currency: 'SGD',
|
||||||
value: 104100,
|
value: 104100,
|
||||||
@ -269,8 +266,7 @@ function Test() {
|
|||||||
level: 'Junior',
|
level: 'Junior',
|
||||||
monthlySalary: null,
|
monthlySalary: null,
|
||||||
monthlySalaryId: null,
|
monthlySalaryId: null,
|
||||||
specialization: 'Front End',
|
title: 'software-engineer',
|
||||||
title: 'Software Engineer',
|
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
currency: 'SGD',
|
currency: 'SGD',
|
||||||
id: 'cl9i68fvc0005tthj7r1rhvb1',
|
id: 'cl9i68fvc0005tthj7r1rhvb1',
|
||||||
@ -335,14 +331,13 @@ function Test() {
|
|||||||
bonusId: 'cl9i68fve000rtthjqo2ktljt',
|
bonusId: 'cl9i68fve000rtthjqo2ktljt',
|
||||||
id: 'cl9i68fve000otthjqk0g01k0',
|
id: 'cl9i68fve000otthjqk0g01k0',
|
||||||
level: 'EXPERT',
|
level: 'EXPERT',
|
||||||
specialization: 'FRONTEND',
|
|
||||||
stocks: {
|
stocks: {
|
||||||
currency: 'SGD',
|
currency: 'SGD',
|
||||||
id: 'cl9i68fvf000ttthjt2ode0cc',
|
id: 'cl9i68fvf000ttthjt2ode0cc',
|
||||||
value: -558038585,
|
value: -558038585,
|
||||||
},
|
},
|
||||||
stocksId: 'cl9i68fvf000ttthjt2ode0cc',
|
stocksId: 'cl9i68fvf000ttthjt2ode0cc',
|
||||||
title: 'Software Engineer',
|
title: 'software-engineer',
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
currency: 'SGD',
|
currency: 'SGD',
|
||||||
id: 'cl9i68fvf000vtthjg90s48nj',
|
id: 'cl9i68fvf000vtthjg90s48nj',
|
||||||
@ -355,220 +350,8 @@ function Test() {
|
|||||||
offersInternId: null,
|
offersInternId: null,
|
||||||
profileId: 'cl9i68fv60000tthj8t3zkox0',
|
profileId: 'cl9i68fv60000tthj8t3zkox0',
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// comments: '',
|
|
||||||
// company: {
|
|
||||||
// createdAt: new Date('2022-10-12T16:19:05.196Z'),
|
|
||||||
// description:
|
|
||||||
// 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
|
|
||||||
// id: 'cl9j4yawz0003utlp1uaa1t8o',
|
|
||||||
// logoUrl: 'https://logo.clearbit.com/meta.com',
|
|
||||||
// name: 'Meta',
|
|
||||||
// slug: 'meta',
|
|
||||||
// updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
|
||||||
// },
|
|
||||||
// companyId: 'cl9j4yawz0003utlp1uaa1t8o',
|
|
||||||
// id: 'cl9i68fvf000ytthj0ltsqt1d',
|
|
||||||
// jobType: 'FULLTIME',
|
|
||||||
// location: 'Singapore, Singapore',
|
|
||||||
// monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
|
|
||||||
// negotiationStrategy: 'Leveraged having million offers',
|
|
||||||
// offersFullTime: {
|
|
||||||
// baseSalary: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl9i68fvf0010tthj0iym6woh',
|
|
||||||
// value: 84000,
|
|
||||||
// },
|
|
||||||
// baseSalaryId: 'cl9i68fvf0010tthj0iym6woh',
|
|
||||||
// bonus: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl9i68fvf0012tthjioltnspk',
|
|
||||||
// value: 123456789,
|
|
||||||
// },
|
|
||||||
// bonusId: 'cl9i68fvf0012tthjioltnspk',
|
|
||||||
// id: 'cl9i68fvf000ztthjcovbiehc',
|
|
||||||
// level: 'Junior',
|
|
||||||
// specialization: 'Front End',
|
|
||||||
// stocks: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl9i68fvf0014tthjz2gff3hs',
|
|
||||||
// value: 100,
|
|
||||||
// },
|
|
||||||
// stocksId: 'cl9i68fvf0014tthjz2gff3hs',
|
|
||||||
// title: 'Software Engineer',
|
|
||||||
// totalCompensation: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl9i68fvf0016tthjrtb7iuvj',
|
|
||||||
// value: 104100,
|
|
||||||
// },
|
|
||||||
// totalCompensationId: 'cl9i68fvf0016tthjrtb7iuvj',
|
|
||||||
// },
|
|
||||||
// offersFullTimeId: 'cl9i68fvf000ztthjcovbiehc',
|
|
||||||
// offersIntern: null,
|
|
||||||
// offersInternId: null,
|
|
||||||
// profileId: 'cl9i68fv60000tthj8t3zkox0',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// comments: '',
|
|
||||||
// company: {
|
|
||||||
// createdAt: new Date('2022-10-12T16:19:05.196Z'),
|
|
||||||
// description:
|
|
||||||
// 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
|
|
||||||
// id: 'cl9j4yawz0003utlp1uaa1t8o',
|
|
||||||
// logoUrl: 'https://logo.clearbit.com/meta.com',
|
|
||||||
// name: 'Meta',
|
|
||||||
// slug: 'meta',
|
|
||||||
// updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
|
||||||
// },
|
|
||||||
// companyId: 'cl9j4yawz0003utlp1uaa1t8o',
|
|
||||||
// id: 'cl96stky9003bw32gc3l955vr',
|
|
||||||
// jobType: 'FULLTIME',
|
|
||||||
// location: 'Singapore, Singapore',
|
|
||||||
// monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
|
|
||||||
// negotiationStrategy: 'LOst out having multiple offers',
|
|
||||||
// offersFullTime: {
|
|
||||||
// baseSalary: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl96stky9003dw32gcvqbijlo',
|
|
||||||
// value: 1,
|
|
||||||
// },
|
|
||||||
// baseSalaryId: 'cl96stky9003dw32gcvqbijlo',
|
|
||||||
// bonus: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl96stky9003fw32goc3zqxwr',
|
|
||||||
// value: 0,
|
|
||||||
// },
|
|
||||||
// bonusId: 'cl96stky9003fw32goc3zqxwr',
|
|
||||||
// id: 'cl96stky9003cw32g5v10izfu',
|
|
||||||
// level: 'Senior',
|
|
||||||
// specialization: 'Front End',
|
|
||||||
// stocks: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl96stky9003hw32g1lbbkqqr',
|
|
||||||
// value: 999999,
|
|
||||||
// },
|
|
||||||
// stocksId: 'cl96stky9003hw32g1lbbkqqr',
|
|
||||||
// title: 'Software Engineer DOG',
|
|
||||||
// totalCompensation: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl96stky9003jw32gzumcoi7v',
|
|
||||||
// value: 999999,
|
|
||||||
// },
|
|
||||||
// totalCompensationId: 'cl96stky9003jw32gzumcoi7v',
|
|
||||||
// },
|
|
||||||
// offersFullTimeId: 'cl96stky9003cw32g5v10izfu',
|
|
||||||
// offersIntern: null,
|
|
||||||
// offersInternId: null,
|
|
||||||
// profileId: 'cl96stky5002ew32gx2kale2x',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// comments: 'this IS SO COOL',
|
|
||||||
// company: {
|
|
||||||
// createdAt: new Date('2022-10-12T16:19:05.196Z'),
|
|
||||||
// description:
|
|
||||||
// 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
|
|
||||||
// id: 'cl9j4yawz0003utlp1uaa1t8o',
|
|
||||||
// logoUrl: 'https://logo.clearbit.com/meta.com',
|
|
||||||
// name: 'Meta',
|
|
||||||
// slug: 'meta',
|
|
||||||
// updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
|
||||||
// },
|
|
||||||
// companyId: 'cl9j4yawz0003utlp1uaa1t8o',
|
|
||||||
// id: 'cl976wf28000t7iyga4noyz7s',
|
|
||||||
// jobType: 'FULLTIME',
|
|
||||||
// location: 'Singapore, Singapore',
|
|
||||||
// monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
|
|
||||||
// negotiationStrategy: 'Charmed the guy with my face',
|
|
||||||
// offersFullTime: {
|
|
||||||
// baseSalary: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl976wf28000v7iygmk1b7qaq',
|
|
||||||
// value: 1999999999,
|
|
||||||
// },
|
|
||||||
// baseSalaryId: 'cl976wf28000v7iygmk1b7qaq',
|
|
||||||
// bonus: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl976wf28000x7iyg63w7kcli',
|
|
||||||
// value: 1410065407,
|
|
||||||
// },
|
|
||||||
// bonusId: 'cl976wf28000x7iyg63w7kcli',
|
|
||||||
// id: 'cl976wf28000u7iyg6euei8e9',
|
|
||||||
// level: 'EXPERT',
|
|
||||||
// specialization: 'FRONTEND',
|
|
||||||
// stocks: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl976wf28000z7iyg9ivun6ap',
|
|
||||||
// value: 111222333,
|
|
||||||
// },
|
|
||||||
// stocksId: 'cl976wf28000z7iyg9ivun6ap',
|
|
||||||
// title: 'Software Engineer',
|
|
||||||
// totalCompensation: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl976wf2800117iygmzsc0xit',
|
|
||||||
// value: 55555555,
|
|
||||||
// },
|
|
||||||
// totalCompensationId: 'cl976wf2800117iygmzsc0xit',
|
|
||||||
// },
|
|
||||||
// offersFullTimeId: 'cl976wf28000u7iyg6euei8e9',
|
|
||||||
// offersIntern: null,
|
|
||||||
// offersInternId: null,
|
|
||||||
// profileId: 'cl96stky5002ew32gx2kale2x',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// comments: 'this rocks',
|
|
||||||
// company: {
|
|
||||||
// createdAt: new Date('2022-10-12T16:19:05.196Z'),
|
|
||||||
// description:
|
|
||||||
// 'Meta Platforms, Inc., doing business as Meta and formerly named Facebook, Inc., and TheFacebook, Inc., is an American multinational technology conglomerate based in Menlo Park, California. The company owns Facebook, Instagram, and WhatsApp, among other products and services.',
|
|
||||||
// id: 'cl9j4yawz0003utlp1uaa1t8o',
|
|
||||||
// logoUrl: 'https://logo.clearbit.com/meta.com',
|
|
||||||
// name: 'Meta',
|
|
||||||
// slug: 'meta',
|
|
||||||
// updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
|
||||||
// },
|
|
||||||
// companyId: 'cl9j4yawz0003utlp1uaa1t8o',
|
|
||||||
// id: 'cl96tbb3o0051w32gjrpaiiit',
|
|
||||||
// jobType: 'FULLTIME',
|
|
||||||
// location: 'Singapore, Singapore',
|
|
||||||
// monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
|
|
||||||
// negotiationStrategy: 'Charmed the guy with my face',
|
|
||||||
// offersFullTime: {
|
|
||||||
// baseSalary: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl96tbb3o0053w32gz11paaxu',
|
|
||||||
// value: 1999999999,
|
|
||||||
// },
|
|
||||||
// baseSalaryId: 'cl96tbb3o0053w32gz11paaxu',
|
|
||||||
// bonus: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl96tbb3o0055w32gpyqgz5hx',
|
|
||||||
// value: 1410065407,
|
|
||||||
// },
|
|
||||||
// bonusId: 'cl96tbb3o0055w32gpyqgz5hx',
|
|
||||||
// id: 'cl96tbb3o0052w32guguajzin',
|
|
||||||
// level: 'EXPERT',
|
|
||||||
// specialization: 'FRONTEND',
|
|
||||||
// stocks: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl96tbb3o0057w32gu4nyxguf',
|
|
||||||
// value: 500,
|
|
||||||
// },
|
|
||||||
// stocksId: 'cl96tbb3o0057w32gu4nyxguf',
|
|
||||||
// title: 'Software Engineer',
|
|
||||||
// totalCompensation: {
|
|
||||||
// currency: 'SGD',
|
|
||||||
// id: 'cl96tbb3o0059w32gm3iy1zk4',
|
|
||||||
// value: 55555555,
|
|
||||||
// },
|
|
||||||
// totalCompensationId: 'cl96tbb3o0059w32gm3iy1zk4',
|
|
||||||
// },
|
|
||||||
// offersFullTimeId: 'cl96tbb3o0052w32guguajzin',
|
|
||||||
// offersIntern: null,
|
|
||||||
// offersInternId: null,
|
|
||||||
// profileId: 'cl96stky5002ew32gx2kale2x',
|
|
||||||
// },
|
|
||||||
],
|
],
|
||||||
// ProfileName: 'ailing bryann stuart ziqing',
|
|
||||||
token: '24bafa6fef803f447d7f2e229b14cb8ee43f0c22dffbe41ee1c1e5e6e870f117',
|
token: '24bafa6fef803f447d7f2e229b14cb8ee43f0c22dffbe41ee1c1e5e6e870f117',
|
||||||
userId: null,
|
userId: null,
|
||||||
});
|
});
|
||||||
|
@ -19,9 +19,9 @@ const searchOfferPercentile = (
|
|||||||
company: Company;
|
company: Company;
|
||||||
offersFullTime:
|
offersFullTime:
|
||||||
| (OffersFullTime & {
|
| (OffersFullTime & {
|
||||||
baseSalary: OffersCurrency;
|
baseSalary: OffersCurrency | null;
|
||||||
bonus: OffersCurrency;
|
bonus: OffersCurrency | null;
|
||||||
stocks: OffersCurrency;
|
stocks: OffersCurrency | null;
|
||||||
totalCompensation: OffersCurrency;
|
totalCompensation: OffersCurrency;
|
||||||
})
|
})
|
||||||
| null;
|
| null;
|
||||||
|
@ -10,7 +10,10 @@ import {
|
|||||||
} from '~/mappers/offers-mappers';
|
} from '~/mappers/offers-mappers';
|
||||||
import { baseCurrencyString } from '~/utils/offers/currency';
|
import { baseCurrencyString } from '~/utils/offers/currency';
|
||||||
import { convert } from '~/utils/offers/currency/currencyExchange';
|
import { convert } from '~/utils/offers/currency/currencyExchange';
|
||||||
import { generateRandomName, generateRandomStringForToken } from '~/utils/offers/randomGenerator';
|
import {
|
||||||
|
generateRandomName,
|
||||||
|
generateRandomStringForToken,
|
||||||
|
} from '~/utils/offers/randomGenerator';
|
||||||
import { createValidationRegex } from '~/utils/offers/zodRegex';
|
import { createValidationRegex } from '~/utils/offers/zodRegex';
|
||||||
|
|
||||||
import { createRouter } from '../context';
|
import { createRouter } from '../context';
|
||||||
@ -48,7 +51,6 @@ const offer = z.object({
|
|||||||
bonusId: z.string().nullish(),
|
bonusId: z.string().nullish(),
|
||||||
id: z.string().optional(),
|
id: z.string().optional(),
|
||||||
level: z.string().nullish(),
|
level: z.string().nullish(),
|
||||||
specialization: z.string(),
|
|
||||||
stocks: valuation.nullish(),
|
stocks: valuation.nullish(),
|
||||||
stocksId: z.string().nullish(),
|
stocksId: z.string().nullish(),
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
@ -62,7 +64,6 @@ const offer = z.object({
|
|||||||
id: z.string().optional(),
|
id: z.string().optional(),
|
||||||
internshipCycle: z.string().nullish(),
|
internshipCycle: z.string().nullish(),
|
||||||
monthlySalary: valuation.nullish(),
|
monthlySalary: valuation.nullish(),
|
||||||
specialization: z.string(),
|
|
||||||
startYear: z.number().nullish(),
|
startYear: z.number().nullish(),
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
totalCompensation: valuation.nullish(), // Full time
|
totalCompensation: valuation.nullish(), // Full time
|
||||||
@ -86,7 +87,6 @@ const experience = z.object({
|
|||||||
location: z.string().nullish(),
|
location: z.string().nullish(),
|
||||||
monthlySalary: valuation.nullish(),
|
monthlySalary: valuation.nullish(),
|
||||||
monthlySalaryId: z.string().nullish(),
|
monthlySalaryId: z.string().nullish(),
|
||||||
specialization: z.string().nullish(),
|
|
||||||
title: z.string().nullish(),
|
title: z.string().nullish(),
|
||||||
totalCompensation: valuation.nullish(),
|
totalCompensation: valuation.nullish(),
|
||||||
totalCompensationId: z.string().nullish(),
|
totalCompensationId: z.string().nullish(),
|
||||||
@ -300,7 +300,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
durationInMonths: x.durationInMonths,
|
durationInMonths: x.durationInMonths,
|
||||||
jobType: x.jobType,
|
jobType: x.jobType,
|
||||||
level: x.level,
|
level: x.level,
|
||||||
specialization: x.specialization,
|
|
||||||
title: x.title,
|
title: x.title,
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
create: {
|
create: {
|
||||||
@ -321,7 +320,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
jobType: x.jobType,
|
jobType: x.jobType,
|
||||||
level: x.level,
|
level: x.level,
|
||||||
location: x.location,
|
location: x.location,
|
||||||
specialization: x.specialization,
|
|
||||||
title: x.title,
|
title: x.title,
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
create: {
|
create: {
|
||||||
@ -363,7 +361,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
value: x.monthlySalary.value,
|
value: x.monthlySalary.value,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
specialization: x.specialization,
|
|
||||||
title: x.title,
|
title: x.title,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -382,7 +379,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
value: x.monthlySalary.value,
|
value: x.monthlySalary.value,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
specialization: x.specialization,
|
|
||||||
title: x.title,
|
title: x.title,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -442,7 +438,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
value: x.offersIntern.monthlySalary.value,
|
value: x.offersIntern.monthlySalary.value,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
specialization: x.offersIntern.specialization,
|
|
||||||
startYear: x.offersIntern.startYear,
|
startYear: x.offersIntern.startYear,
|
||||||
title: x.offersIntern.title,
|
title: x.offersIntern.title,
|
||||||
},
|
},
|
||||||
@ -452,17 +447,10 @@ export const offersProfileRouter = createRouter()
|
|||||||
if (
|
if (
|
||||||
x.jobType === JobType.FULLTIME &&
|
x.jobType === JobType.FULLTIME &&
|
||||||
x.offersFullTime &&
|
x.offersFullTime &&
|
||||||
x.offersFullTime.baseSalary?.currency != null &&
|
|
||||||
x.offersFullTime.baseSalary?.value != null &&
|
|
||||||
x.offersFullTime.bonus?.currency != null &&
|
|
||||||
x.offersFullTime.bonus?.value != null &&
|
|
||||||
x.offersFullTime.stocks?.currency != null &&
|
|
||||||
x.offersFullTime.stocks?.value != null &&
|
|
||||||
x.offersFullTime.totalCompensation?.currency != null &&
|
x.offersFullTime.totalCompensation?.currency != null &&
|
||||||
x.offersFullTime.totalCompensation?.value != null &&
|
x.offersFullTime.totalCompensation?.value != null &&
|
||||||
x.offersFullTime.level != null &&
|
x.offersFullTime.level != null &&
|
||||||
x.offersFullTime.title != null &&
|
x.offersFullTime.title != null
|
||||||
x.offersFullTime.specialization != null
|
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
comments: x.comments,
|
comments: x.comments,
|
||||||
@ -477,7 +465,9 @@ export const offersProfileRouter = createRouter()
|
|||||||
negotiationStrategy: x.negotiationStrategy,
|
negotiationStrategy: x.negotiationStrategy,
|
||||||
offersFullTime: {
|
offersFullTime: {
|
||||||
create: {
|
create: {
|
||||||
baseSalary: {
|
baseSalary:
|
||||||
|
x.offersFullTime?.baseSalary != null
|
||||||
|
? {
|
||||||
create: {
|
create: {
|
||||||
baseCurrency: baseCurrencyString,
|
baseCurrency: baseCurrencyString,
|
||||||
baseValue: await convert(
|
baseValue: await convert(
|
||||||
@ -485,11 +475,15 @@ export const offersProfileRouter = createRouter()
|
|||||||
x.offersFullTime.baseSalary.currency,
|
x.offersFullTime.baseSalary.currency,
|
||||||
baseCurrencyString,
|
baseCurrencyString,
|
||||||
),
|
),
|
||||||
currency: x.offersFullTime.baseSalary.currency,
|
currency:
|
||||||
|
x.offersFullTime.baseSalary.currency,
|
||||||
value: x.offersFullTime.baseSalary.value,
|
value: x.offersFullTime.baseSalary.value,
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
bonus: {
|
: undefined,
|
||||||
|
bonus:
|
||||||
|
x.offersFullTime?.bonus != null
|
||||||
|
? {
|
||||||
create: {
|
create: {
|
||||||
baseCurrency: baseCurrencyString,
|
baseCurrency: baseCurrencyString,
|
||||||
baseValue: await convert(
|
baseValue: await convert(
|
||||||
@ -500,10 +494,12 @@ export const offersProfileRouter = createRouter()
|
|||||||
currency: x.offersFullTime.bonus.currency,
|
currency: x.offersFullTime.bonus.currency,
|
||||||
value: x.offersFullTime.bonus.value,
|
value: x.offersFullTime.bonus.value,
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
|
: undefined,
|
||||||
level: x.offersFullTime.level,
|
level: x.offersFullTime.level,
|
||||||
specialization: x.offersFullTime.specialization,
|
stocks:
|
||||||
stocks: {
|
x.offersFullTime?.stocks != null
|
||||||
|
? {
|
||||||
create: {
|
create: {
|
||||||
baseCurrency: baseCurrencyString,
|
baseCurrency: baseCurrencyString,
|
||||||
baseValue: await convert(
|
baseValue: await convert(
|
||||||
@ -514,7 +510,8 @@ export const offersProfileRouter = createRouter()
|
|||||||
currency: x.offersFullTime.stocks.currency,
|
currency: x.offersFullTime.stocks.currency,
|
||||||
value: x.offersFullTime.stocks.value,
|
value: x.offersFullTime.stocks.value,
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
|
: undefined,
|
||||||
title: x.offersFullTime.title,
|
title: x.offersFullTime.title,
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
create: {
|
create: {
|
||||||
@ -714,7 +711,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
companyId: exp.companyId, // TODO: check if can change with connect or whether there is a difference
|
companyId: exp.companyId, // TODO: check if can change with connect or whether there is a difference
|
||||||
durationInMonths: exp.durationInMonths,
|
durationInMonths: exp.durationInMonths,
|
||||||
level: exp.level,
|
level: exp.level,
|
||||||
specialization: exp.specialization,
|
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
id: exp.id,
|
id: exp.id,
|
||||||
@ -821,7 +817,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
jobType: exp.jobType,
|
jobType: exp.jobType,
|
||||||
level: exp.level,
|
level: exp.level,
|
||||||
location: exp.location,
|
location: exp.location,
|
||||||
specialization: exp.specialization,
|
|
||||||
title: exp.title,
|
title: exp.title,
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
create: {
|
create: {
|
||||||
@ -851,7 +846,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
jobType: exp.jobType,
|
jobType: exp.jobType,
|
||||||
level: exp.level,
|
level: exp.level,
|
||||||
location: exp.location,
|
location: exp.location,
|
||||||
specialization: exp.specialization,
|
|
||||||
title: exp.title,
|
title: exp.title,
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
create: {
|
create: {
|
||||||
@ -887,7 +881,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
jobType: exp.jobType,
|
jobType: exp.jobType,
|
||||||
level: exp.level,
|
level: exp.level,
|
||||||
location: exp.location,
|
location: exp.location,
|
||||||
specialization: exp.specialization,
|
|
||||||
title: exp.title,
|
title: exp.title,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -905,7 +898,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
jobType: exp.jobType,
|
jobType: exp.jobType,
|
||||||
level: exp.level,
|
level: exp.level,
|
||||||
location: exp.location,
|
location: exp.location,
|
||||||
specialization: exp.specialization,
|
|
||||||
title: exp.title,
|
title: exp.title,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -945,7 +937,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
value: exp.monthlySalary.value,
|
value: exp.monthlySalary.value,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
specialization: exp.specialization,
|
|
||||||
title: exp.title,
|
title: exp.title,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -974,7 +965,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
value: exp.monthlySalary.value,
|
value: exp.monthlySalary.value,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
specialization: exp.specialization,
|
|
||||||
title: exp.title,
|
title: exp.title,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -997,7 +987,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
durationInMonths: exp.durationInMonths,
|
durationInMonths: exp.durationInMonths,
|
||||||
jobType: exp.jobType,
|
jobType: exp.jobType,
|
||||||
location: exp.location,
|
location: exp.location,
|
||||||
specialization: exp.specialization,
|
|
||||||
title: exp.title,
|
title: exp.title,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1014,7 +1003,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
durationInMonths: exp.durationInMonths,
|
durationInMonths: exp.durationInMonths,
|
||||||
jobType: exp.jobType,
|
jobType: exp.jobType,
|
||||||
location: exp.location,
|
location: exp.location,
|
||||||
specialization: exp.specialization,
|
|
||||||
title: exp.title,
|
title: exp.title,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1121,7 +1109,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
data: {
|
data: {
|
||||||
internshipCycle:
|
internshipCycle:
|
||||||
offerToUpdate.offersIntern.internshipCycle ?? undefined,
|
offerToUpdate.offersIntern.internshipCycle ?? undefined,
|
||||||
specialization: offerToUpdate.offersIntern.specialization,
|
|
||||||
startYear: offerToUpdate.offersIntern.startYear ?? undefined,
|
startYear: offerToUpdate.offersIntern.startYear ?? undefined,
|
||||||
title: offerToUpdate.offersIntern.title,
|
title: offerToUpdate.offersIntern.title,
|
||||||
},
|
},
|
||||||
@ -1150,7 +1137,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
await ctx.prisma.offersFullTime.update({
|
await ctx.prisma.offersFullTime.update({
|
||||||
data: {
|
data: {
|
||||||
level: offerToUpdate.offersFullTime.level ?? undefined,
|
level: offerToUpdate.offersFullTime.level ?? undefined,
|
||||||
specialization: offerToUpdate.offersFullTime.specialization,
|
|
||||||
title: offerToUpdate.offersFullTime.title,
|
title: offerToUpdate.offersFullTime.title,
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
@ -1174,7 +1160,7 @@ export const offersProfileRouter = createRouter()
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (offerToUpdate.offersFullTime.bonus) {
|
if (offerToUpdate.offersFullTime.bonus != null) {
|
||||||
await ctx.prisma.offersCurrency.update({
|
await ctx.prisma.offersCurrency.update({
|
||||||
data: {
|
data: {
|
||||||
baseCurrency: baseCurrencyString,
|
baseCurrency: baseCurrencyString,
|
||||||
@ -1191,7 +1177,7 @@ export const offersProfileRouter = createRouter()
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (offerToUpdate.offersFullTime.stocks) {
|
if (offerToUpdate.offersFullTime.stocks != null) {
|
||||||
await ctx.prisma.offersCurrency.update({
|
await ctx.prisma.offersCurrency.update({
|
||||||
data: {
|
data: {
|
||||||
baseCurrency: baseCurrencyString,
|
baseCurrency: baseCurrencyString,
|
||||||
@ -1269,8 +1255,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
offerToUpdate.offersIntern.monthlySalary.value,
|
offerToUpdate.offersIntern.monthlySalary.value,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
specialization:
|
|
||||||
offerToUpdate.offersIntern.specialization,
|
|
||||||
startYear: offerToUpdate.offersIntern.startYear,
|
startYear: offerToUpdate.offersIntern.startYear,
|
||||||
title: offerToUpdate.offersIntern.title,
|
title: offerToUpdate.offersIntern.title,
|
||||||
},
|
},
|
||||||
@ -1286,12 +1270,6 @@ export const offersProfileRouter = createRouter()
|
|||||||
if (
|
if (
|
||||||
offerToUpdate.jobType === JobType.FULLTIME &&
|
offerToUpdate.jobType === JobType.FULLTIME &&
|
||||||
offerToUpdate.offersFullTime &&
|
offerToUpdate.offersFullTime &&
|
||||||
offerToUpdate.offersFullTime.baseSalary?.currency != null &&
|
|
||||||
offerToUpdate.offersFullTime.baseSalary?.value != null &&
|
|
||||||
offerToUpdate.offersFullTime.bonus?.currency != null &&
|
|
||||||
offerToUpdate.offersFullTime.bonus?.value != null &&
|
|
||||||
offerToUpdate.offersFullTime.stocks?.currency != null &&
|
|
||||||
offerToUpdate.offersFullTime.stocks?.value != null &&
|
|
||||||
offerToUpdate.offersFullTime.totalCompensation?.currency !=
|
offerToUpdate.offersFullTime.totalCompensation?.currency !=
|
||||||
null &&
|
null &&
|
||||||
offerToUpdate.offersFullTime.totalCompensation?.value != null &&
|
offerToUpdate.offersFullTime.totalCompensation?.value != null &&
|
||||||
@ -1313,11 +1291,14 @@ export const offersProfileRouter = createRouter()
|
|||||||
negotiationStrategy: offerToUpdate.negotiationStrategy,
|
negotiationStrategy: offerToUpdate.negotiationStrategy,
|
||||||
offersFullTime: {
|
offersFullTime: {
|
||||||
create: {
|
create: {
|
||||||
baseSalary: {
|
baseSalary:
|
||||||
|
offerToUpdate.offersFullTime?.baseSalary != null
|
||||||
|
? {
|
||||||
create: {
|
create: {
|
||||||
baseCurrency: baseCurrencyString,
|
baseCurrency: baseCurrencyString,
|
||||||
baseValue: await convert(
|
baseValue: await convert(
|
||||||
offerToUpdate.offersFullTime.baseSalary.value,
|
offerToUpdate.offersFullTime.baseSalary
|
||||||
|
.value,
|
||||||
offerToUpdate.offersFullTime.baseSalary
|
offerToUpdate.offersFullTime.baseSalary
|
||||||
.currency,
|
.currency,
|
||||||
baseCurrencyString,
|
baseCurrencyString,
|
||||||
@ -1326,38 +1307,50 @@ export const offersProfileRouter = createRouter()
|
|||||||
offerToUpdate.offersFullTime.baseSalary
|
offerToUpdate.offersFullTime.baseSalary
|
||||||
.currency,
|
.currency,
|
||||||
value:
|
value:
|
||||||
offerToUpdate.offersFullTime.baseSalary.value,
|
offerToUpdate.offersFullTime.baseSalary
|
||||||
|
.value,
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
bonus: {
|
: undefined,
|
||||||
|
bonus:
|
||||||
|
offerToUpdate.offersFullTime?.bonus != null
|
||||||
|
? {
|
||||||
create: {
|
create: {
|
||||||
baseCurrency: baseCurrencyString,
|
baseCurrency: baseCurrencyString,
|
||||||
baseValue: await convert(
|
baseValue: await convert(
|
||||||
offerToUpdate.offersFullTime.bonus.value,
|
offerToUpdate.offersFullTime.bonus.value,
|
||||||
offerToUpdate.offersFullTime.bonus.currency,
|
offerToUpdate.offersFullTime.bonus
|
||||||
|
.currency,
|
||||||
baseCurrencyString,
|
baseCurrencyString,
|
||||||
),
|
),
|
||||||
currency:
|
currency:
|
||||||
offerToUpdate.offersFullTime.bonus.currency,
|
offerToUpdate.offersFullTime.bonus
|
||||||
value: offerToUpdate.offersFullTime.bonus.value,
|
.currency,
|
||||||
},
|
value:
|
||||||
|
offerToUpdate.offersFullTime.bonus.value,
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
level: offerToUpdate.offersFullTime.level,
|
level: offerToUpdate.offersFullTime.level,
|
||||||
specialization:
|
stocks:
|
||||||
offerToUpdate.offersFullTime.specialization,
|
offerToUpdate.offersFullTime?.stocks != null
|
||||||
stocks: {
|
? {
|
||||||
create: {
|
create: {
|
||||||
baseCurrency: baseCurrencyString,
|
baseCurrency: baseCurrencyString,
|
||||||
baseValue: await convert(
|
baseValue: await convert(
|
||||||
offerToUpdate.offersFullTime.stocks.value,
|
offerToUpdate.offersFullTime.stocks.value,
|
||||||
offerToUpdate.offersFullTime.stocks.currency,
|
offerToUpdate.offersFullTime.stocks
|
||||||
|
.currency,
|
||||||
baseCurrencyString,
|
baseCurrencyString,
|
||||||
),
|
),
|
||||||
currency:
|
currency:
|
||||||
offerToUpdate.offersFullTime.stocks.currency,
|
offerToUpdate.offersFullTime.stocks
|
||||||
value: offerToUpdate.offersFullTime.stocks.value,
|
.currency,
|
||||||
},
|
value:
|
||||||
|
offerToUpdate.offersFullTime.stocks.value,
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
title: offerToUpdate.offersFullTime.title,
|
title: offerToUpdate.offersFullTime.title,
|
||||||
totalCompensation: {
|
totalCompensation: {
|
||||||
create: {
|
create: {
|
||||||
|
@ -317,6 +317,8 @@ export const offersRouter = createRouter().query('list', {
|
|||||||
offer.offersFullTime.totalCompensation.updatedAt,
|
offer.offersFullTime.totalCompensation.updatedAt,
|
||||||
);
|
);
|
||||||
offer.offersFullTime.totalCompensation.currency = currency;
|
offer.offersFullTime.totalCompensation.currency = currency;
|
||||||
|
|
||||||
|
if (offer.offersFullTime?.baseSalary != null) {
|
||||||
offer.offersFullTime.baseSalary.value = await convertWithDate(
|
offer.offersFullTime.baseSalary.value = await convertWithDate(
|
||||||
offer.offersFullTime.baseSalary.value,
|
offer.offersFullTime.baseSalary.value,
|
||||||
offer.offersFullTime.baseSalary.currency,
|
offer.offersFullTime.baseSalary.currency,
|
||||||
@ -324,6 +326,9 @@ export const offersRouter = createRouter().query('list', {
|
|||||||
offer.offersFullTime.baseSalary.updatedAt,
|
offer.offersFullTime.baseSalary.updatedAt,
|
||||||
);
|
);
|
||||||
offer.offersFullTime.baseSalary.currency = currency;
|
offer.offersFullTime.baseSalary.currency = currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (offer.offersFullTime?.stocks != null) {
|
||||||
offer.offersFullTime.stocks.value = await convertWithDate(
|
offer.offersFullTime.stocks.value = await convertWithDate(
|
||||||
offer.offersFullTime.stocks.value,
|
offer.offersFullTime.stocks.value,
|
||||||
offer.offersFullTime.stocks.currency,
|
offer.offersFullTime.stocks.currency,
|
||||||
@ -331,6 +336,9 @@ export const offersRouter = createRouter().query('list', {
|
|||||||
offer.offersFullTime.stocks.updatedAt,
|
offer.offersFullTime.stocks.updatedAt,
|
||||||
);
|
);
|
||||||
offer.offersFullTime.stocks.currency = currency;
|
offer.offersFullTime.stocks.currency = currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (offer.offersFullTime?.bonus != null) {
|
||||||
offer.offersFullTime.bonus.value = await convertWithDate(
|
offer.offersFullTime.bonus.value = await convertWithDate(
|
||||||
offer.offersFullTime.bonus.value,
|
offer.offersFullTime.bonus.value,
|
||||||
offer.offersFullTime.bonus.currency,
|
offer.offersFullTime.bonus.currency,
|
||||||
@ -338,6 +346,7 @@ export const offersRouter = createRouter().query('list', {
|
|||||||
offer.offersFullTime.bonus.updatedAt,
|
offer.offersFullTime.bonus.updatedAt,
|
||||||
);
|
);
|
||||||
offer.offersFullTime.bonus.currency = currency;
|
offer.offersFullTime.bonus.currency = currency;
|
||||||
|
}
|
||||||
} else if (offer.offersIntern?.monthlySalary != null) {
|
} else if (offer.offersIntern?.monthlySalary != null) {
|
||||||
offer.offersIntern.monthlySalary.value = await convertWithDate(
|
offer.offersIntern.monthlySalary.value = await convertWithDate(
|
||||||
offer.offersIntern.monthlySalary.value,
|
offer.offersIntern.monthlySalary.value,
|
||||||
|
11
apps/portal/src/types/offers.d.ts
vendored
11
apps/portal/src/types/offers.d.ts
vendored
@ -26,7 +26,6 @@ export type Experience = {
|
|||||||
level: string?;
|
level: string?;
|
||||||
location: string?;
|
location: string?;
|
||||||
monthlySalary: Valuation?;
|
monthlySalary: Valuation?;
|
||||||
specialization: string?;
|
|
||||||
title: string?;
|
title: string?;
|
||||||
totalCompensation: Valuation?;
|
totalCompensation: Valuation?;
|
||||||
};
|
};
|
||||||
@ -87,12 +86,11 @@ export type ProfileOffer = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type FullTime = {
|
export type FullTime = {
|
||||||
baseSalary: Valuation;
|
baseSalary: Valuation?;
|
||||||
bonus: Valuation;
|
bonus: Valuation?;
|
||||||
id: string;
|
id: string;
|
||||||
level: string;
|
level: string;
|
||||||
specialization: string;
|
stocks: Valuation?;
|
||||||
stocks: Valuation;
|
|
||||||
title: string;
|
title: string;
|
||||||
totalCompensation: Valuation;
|
totalCompensation: Valuation;
|
||||||
};
|
};
|
||||||
@ -101,7 +99,6 @@ export type Intern = {
|
|||||||
id: string;
|
id: string;
|
||||||
internshipCycle: string;
|
internshipCycle: string;
|
||||||
monthlySalary: Valuation;
|
monthlySalary: Valuation;
|
||||||
specialization: string;
|
|
||||||
startYear: number;
|
startYear: number;
|
||||||
title: string;
|
title: string;
|
||||||
};
|
};
|
||||||
@ -163,7 +160,6 @@ export type AnalysisHighestOffer = {
|
|||||||
id: string;
|
id: string;
|
||||||
level: string;
|
level: string;
|
||||||
location: string;
|
location: string;
|
||||||
specialization: string;
|
|
||||||
totalYoe: number;
|
totalYoe: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -178,7 +174,6 @@ export type AnalysisOffer = {
|
|||||||
negotiationStrategy: string;
|
negotiationStrategy: string;
|
||||||
previousCompanies: Array<string>;
|
previousCompanies: Array<string>;
|
||||||
profileName: string;
|
profileName: string;
|
||||||
specialization: string;
|
|
||||||
title: string;
|
title: string;
|
||||||
totalYoe: number;
|
totalYoe: number;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user