[offers][chore] Rename level params

pull/501/head
Bryann Yeap Kok Keong 3 years ago committed by Stuart Long Chay Boon
parent 3477012686
commit 9eb7b18554

@ -88,6 +88,23 @@ const getYoe = (type: string) => {
} }
}; };
const getLevel = (type: string) => {
const processedType = type.toUpperCase().trim();
if (
processedType.includes('FRESH GRAD') ||
processedType.includes('JUNIOR')
) {
return 'L1';
} else if (processedType.includes('MID')) {
return 'L2';
} else if (processedType.includes('SENIOR')) {
return 'L4';
} else {
return 'L0';
}
};
const createdProfileIds: Array<string> = []; const createdProfileIds: Array<string> = [];
const seedSalaries = async () => { const seedSalaries = async () => {
@ -107,6 +124,7 @@ const seedSalaries = async () => {
const jobTitle = getJobTitle(data.Role); const jobTitle = getJobTitle(data.Role);
const yoe = getYoe(data.Type); const yoe = getYoe(data.Type);
const level = getLevel(data.Type);
// check if we have company id // check if we have company id
if (companyIdMappings[data.Company]) { if (companyIdMappings[data.Company]) {
@ -228,7 +246,7 @@ const seedSalaries = async () => {
: 0, : 0,
}, },
}, },
level: data.Type, level: level,
stocks: { stocks: {
create: { create: {
baseCurrency: baseCurrencyString, baseCurrency: baseCurrencyString,

Loading…
Cancel
Save