Files
Stuart Long 8864a47400 [offers][feat] add script to seed salaries from tech salaries excel sheet (#501)
* [offers][feat] add file to read tech salaries sheet WIP

* [offers][chore] read from correct file while seeding

* [offers][chore] Add company seed

* [offers][feat] add data seeding code to fetch from excel

* [offers[chore] Generate analysis for seeded data

* [offers][chore] Merge main into branch

* [offers][fix] Fix incorrect name

* [offers][fix] integrate random name generator to profile seeding

* [offers][chore] Set job title in seeding

* [offers][chore] Removed specialization

* [offers][chore] Add yoe ranges for seeded data

* [offers][chore] Rename level params

* [offers][chore]normalise salaries

* [offers][fix] add checks for data.income

* [offers][chore] Allow analysis to analyse all companies in the backend

* [offers][chore] Add createdAt and updatedAt to analysis

* [offers][chore] Add company name to analysis unit

* [offers][feat] Add multiple company analysis UI

* [offers][fix] Fix bug where company analysis shows wrong company

* [offers][fix] Fix company analysis percentile calculation

* [offers][fix] Fix empty analysis

* [offers][chore] Change user relation in OffersProfile from one-to-many to many-to-many

* [offers][chore] Change location in schema

* Include City, State, and Country in profileDtoMapper params

* [offers][fix] Fix merge conflict

* [offers][chore] Change backend endpoints to new location field

* [offers][feat] integrate cityId into create profile endpoint

* [offers][feat] integrate location with update profile endpoint

* [offers][fix] update seeding issue where fulltime base is not year

* [offers][fix] update seed script to integrate with city

* [offers][feat] integrate location for offer table and profile

* [offers][chore] fix import of cities typeahead

* [offers][feat] Use city typeahead for location field

* [offers][fix] fix merge conflict

* [offers][fix] fix incorrect salary normalisation

* [offers][fix] fix base salary for fulltime

* [offers][fix] fix bonus

* [offers][chore] add console log to print status while seeding

* [offers][feat] normalise sheet to incorporate slug

* [offers][feat] read companies from salary sheet

* [offers][fix] remove prisma/companySeed.ts from tsconfig.json

* [offers][refactor] standardise seed script with question

* [resume][refactor] tweak resume submission UI

* [offers][chore] Provide more information to frontend in AnalysisUnit

* [offers][fix] fix import for salaries script

* [offers][feat] add file to read tech salaries sheet WIP

* [offers][chore] read from correct file while seeding

* [offers][chore] Add company seed

* [offers][feat] add data seeding code to fetch from excel

* [offers[chore] Generate analysis for seeded data

* [offers][chore] Merge main into branch

* [offers][fix] Fix incorrect name

* [offers][fix] integrate random name generator to profile seeding

* [offers][chore] Set job title in seeding

* [offers][chore] Removed specialization

* [offers][chore] Add yoe ranges for seeded data

* [offers][chore] Rename level params

* [offers][chore]normalise salaries

* [offers][fix] add checks for data.income

* [offers][chore] Allow analysis to analyse all companies in the backend

* [offers][feat] Add multiple company analysis UI

* [offers][fix] Fix empty analysis

* [offers][chore] Change user relation in OffersProfile from one-to-many to many-to-many

* [offers][fix] Fix merge conflict

* [offers][fix] update seeding issue where fulltime base is not year

* [offers][fix] update seed script to integrate with city

* [offers][chore] Change backend endpoints to new location field

* [offers][feat] integrate location for offer table and profile

* [offers][chore] fix import of cities typeahead

* [offers][feat] Use city typeahead for location field

* [offers][fix] fix merge conflict

* [offers][fix] fix incorrect salary normalisation

* [offers][fix] fix base salary for fulltime

* [offers][fix] fix bonus

* [offers][chore] add console log to print status while seeding

* [offers][feat] normalise sheet to incorporate slug

* [offers][feat] read companies from salary sheet

* [offers][fix] remove prisma/companySeed.ts from tsconfig.json

* [offers][refactor] standardise seed script with question

* [offers][fix] fix import for salaries script

* [offers][fix] fix merge conflicts

* [offers][feat] add file to read tech salaries sheet WIP

* [offers][chore] read from correct file while seeding

* [offers][chore] Add company seed

* [offers][feat] add data seeding code to fetch from excel

* [offers[chore] Generate analysis for seeded data

* [offers][chore] Merge main into branch

* [offers][fix] Fix incorrect name

* [offers][fix] integrate random name generator to profile seeding

* [offers][chore] Set job title in seeding

* [offers][chore] Removed specialization

* [offers][chore] Add yoe ranges for seeded data

* [offers][chore] Rename level params

* [offers][fix] add checks for data.income

* [offers][chore] Allow analysis to analyse all companies in the backend

* [offers][fix] Fix merge conflict

* [offers][fix] update seed script to integrate with city

* [offers][feat] integrate location for offer table and profile

* [offers][feat] Use city typeahead for location field

* [offers][chore] add console log to print status while seeding

* [offers][feat] normalise sheet to incorporate slug

* [offers][feat] read companies from salary sheet

* [offers][fix] remove prisma/companySeed.ts from tsconfig.json

* [offers][refactor] standardise seed script with question

* [offers][fix] fix merge conflicts

Co-authored-by: Bryann Yeap Kok Keong <bryannyeapkk@gmail.com>
Co-authored-by: Ai Ling <hong-ailing@hotmail.com>
Co-authored-by: Zhang Ziqing <zhangziqing9926@gmail.com>
Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2022-11-04 14:55:00 +08:00

19 lines
408 B
TypeScript

import reader from 'xlsx';
const file = reader.readFile('prisma/salaries.xlsx');
export const COMPANIES: Array<CompanyData> = []
type CompanyData = {
Finalized: string;
description: string;
logoUrl: string;
name: string;
slug: string;
website: string;
};
const temp = reader.utils.sheet_to_json(file.Sheets[file.SheetNames[1]]);
temp.forEach((res: CompanyData) => {
COMPANIES.push(res);
});