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

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

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

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

Loading…
Cancel
Save