[offers][chore] Add baseCurrency and baseValue to Valuation DTO

pull/413/head
Bryann Yeap Kok Keong 2 years ago
parent 2c7f349043
commit 13f40ab6ae

@ -50,7 +50,7 @@ const analysisOfferDtoMapper = (
const analysisOfferDto: AnalysisOffer = {
company: offersCompanyDtoMapper(offer.company),
id: offer.id,
income: { currency: '', value: -1 },
income: { baseCurrency: '', baseValue: -1, currency: '', value: -1 },
jobType: offer.jobType,
level: offer.offersFullTime?.level ?? '',
location: offer.location,
@ -219,11 +219,15 @@ export const profileAnalysisDtoMapper = (
};
export const valuationDtoMapper = (currency: {
baseCurrency: string;
baseValue: number;
currency: string;
id?: string;
value: number;
}) => {
const valuationDto: Valuation = {
baseCurrency: currency.baseCurrency,
baseValue: currency.baseValue,
currency: currency.currency,
value: currency.value,
};
@ -554,7 +558,12 @@ export const dashboardOfferDtoMapper = (
const dashboardOfferDto: DashboardOffer = {
company: offersCompanyDtoMapper(offer.company),
id: offer.id,
income: valuationDtoMapper({ currency: '', value: -1 }),
income: valuationDtoMapper({
baseCurrency: '',
baseValue: -1,
currency: '',
value: -1,
}),
monthYearReceived: offer.monthYearReceived,
profileId: offer.profileId,
title: offer.offersFullTime?.title ?? '',

@ -139,22 +139,22 @@ function Test() {
offersFullTime: {
baseSalary: {
currency: 'SGD',
value: 84000,
value: 2222,
},
bonus: {
currency: 'SGD',
value: 20000,
value: 2222,
},
level: 'Junior',
specialization: 'Front End',
stocks: {
currency: 'SGD',
value: 100,
value: 0,
},
title: 'Software Engineer',
totalCompensation: {
currency: 'SGD',
value: 104100,
value: 4444,
},
},
},

@ -9,8 +9,8 @@ function Test() {
limit: 100,
location: 'Singapore, Singapore',
offset: 0,
sortBy: '-monthYearReceived',
yoeCategory: 0,
sortBy: '-totalCompensation',
yoeCategory: 2,
},
]);

@ -42,6 +42,8 @@ export type OffersCompany = {
};
export type Valuation = {
baseCurrency: string;
baseValue: number;
currency: string;
value: number;
};

Loading…
Cancel
Save