diff --git a/apps/portal/prisma/migrations/20221020115540_/migration.sql b/apps/portal/prisma/migrations/20221020115540_/migration.sql new file mode 100644 index 00000000..a70f2aa5 --- /dev/null +++ b/apps/portal/prisma/migrations/20221020115540_/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "OffersExperience" ADD COLUMN "location" TEXT; diff --git a/apps/portal/prisma/schema.prisma b/apps/portal/prisma/schema.prisma index 2857204b..48e068ca 100644 --- a/apps/portal/prisma/schema.prisma +++ b/apps/portal/prisma/schema.prisma @@ -91,17 +91,17 @@ enum TodoStatus { } model Company { - id String @id @default(cuid()) - name String @db.Text - slug String @unique - description String? @db.Text - logoUrl String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + id String @id @default(cuid()) + name String @db.Text + slug String @unique + description String? @db.Text + logoUrl String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - questionsQuestionEncounter QuestionsQuestionEncounter[] - OffersExperience OffersExperience[] - OffersOffer OffersOffer[] + questionsQuestionEncounter QuestionsQuestionEncounter[] + OffersExperience OffersExperience[] + OffersOffer OffersOffer[] } // Start of Resumes project models. @@ -232,6 +232,7 @@ model OffersExperience { // Add more fields durationInMonths Int? specialization String? + location String? // FULLTIME fields level String? @@ -405,20 +406,20 @@ model QuestionsQuestion { } model QuestionsQuestionEncounter { - id String @id @default(cuid()) - questionId String - userId String? - // TODO: sync with models (location, role) - companyId String - location String @db.Text - role String @db.Text - seenAt DateTime - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull) - user User? @relation(fields: [userId], references: [id], onDelete: SetNull) - question QuestionsQuestion @relation(fields: [questionId], references: [id], onDelete: Cascade) + id String @id @default(cuid()) + questionId String + userId String? + // TODO: sync with models (location, role) + companyId String + location String @db.Text + role String @db.Text + seenAt DateTime + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull) + user User? @relation(fields: [userId], references: [id], onDelete: SetNull) + question QuestionsQuestion @relation(fields: [questionId], references: [id], onDelete: Cascade) } model QuestionsQuestionVote { diff --git a/apps/portal/src/mappers/offers-mappers.ts b/apps/portal/src/mappers/offers-mappers.ts index 82a7a915..3933ab61 100644 --- a/apps/portal/src/mappers/offers-mappers.ts +++ b/apps/portal/src/mappers/offers-mappers.ts @@ -267,6 +267,7 @@ export const experienceDtoMapper = ( id: experience.id, jobType: experience.jobType, level: experience.level, + location: experience.location, monthlySalary: experience.monthlySalary ? valuationDtoMapper(experience.monthlySalary) : experience.monthlySalary, diff --git a/apps/portal/src/pages/offers/test/createProfile.tsx b/apps/portal/src/pages/offers/test/createProfile.tsx index 128960ff..ad891ce1 100644 --- a/apps/portal/src/pages/offers/test/createProfile.tsx +++ b/apps/portal/src/pages/offers/test/createProfile.tsx @@ -103,7 +103,7 @@ function Test() { ], experiences: [ { - companyId: 'cl9ec1mgg0000w33hg1a3612r', + companyId: 'cl9h0bqu50000txxwkhmshhxz', durationInMonths: 24, jobType: 'FULLTIME', level: 'Junior', @@ -132,7 +132,7 @@ function Test() { { comments: 'I am a Raffles Institution almumni', // Comments: '', - companyId: 'cl98yuqk80007txhgjtjp8fk4', + companyId: 'cl9h0bqu50000txxwkhmshhxz', jobType: 'FULLTIME', location: 'Singapore, Singapore', monthYearReceived: new Date('2022-09-30T07:58:54.000Z'), @@ -161,7 +161,7 @@ function Test() { }, { comments: '', - companyId: 'cl98yuqk80007txhgjtjp8fk4', + companyId: 'cl9h0bqu50000txxwkhmshhxz', jobType: 'FULLTIME', location: 'Singapore, Singapore', monthYearReceived: new Date('2022-09-30T07:58:54.000Z'), @@ -263,7 +263,7 @@ function Test() { slug: 'meta', updatedAt: new Date('2022-10-12T16:19:05.196Z'), }, - companyId: 'cl9ec1mgg0000w33hg1a3612r', + companyId: 'cl9h0bqu50000txxwkhmshhxz', durationInMonths: 24, id: 'cl96stky6002iw32gpt6t87s2', jobType: 'FULLTIME', @@ -339,7 +339,7 @@ function Test() { slug: 'meta', updatedAt: new Date('2022-10-12T16:19:05.196Z'), }, - companyId: 'cl9ec1mgg0000w33hg1a3612r', + companyId: 'cl9h0bqu50000txxwkhmshhxz', id: 'cl976t4de00047iygl0zbce11', jobType: 'FULLTIME', location: 'Singapore, Singapore', @@ -392,7 +392,7 @@ function Test() { slug: 'meta', updatedAt: new Date('2022-10-12T16:19:05.196Z'), }, - companyId: 'cl9ec1mgg0000w33hg1a3612r', + companyId: 'cl9h0bqu50000txxwkhmshhxz', id: 'cl96stky80031w32gau9mu1gs', jobType: 'FULLTIME', location: 'Singapore, Singapore', @@ -445,7 +445,7 @@ function Test() { slug: 'meta', updatedAt: new Date('2022-10-12T16:19:05.196Z'), }, - companyId: 'cl9ec1mgg0000w33hg1a3612r', + companyId: 'cl9h0bqu50000txxwkhmshhxz', id: 'cl96stky9003bw32gc3l955vr', jobType: 'FULLTIME', location: 'Singapore, Singapore', @@ -498,7 +498,7 @@ function Test() { slug: 'meta', updatedAt: new Date('2022-10-12T16:19:05.196Z'), }, - companyId: 'cl9ec1mgg0000w33hg1a3612r', + companyId: 'cl9h0bqu50000txxwkhmshhxz', id: 'cl976wf28000t7iyga4noyz7s', jobType: 'FULLTIME', location: 'Singapore, Singapore', @@ -551,7 +551,7 @@ function Test() { slug: 'meta', updatedAt: new Date('2022-10-12T16:19:05.196Z'), }, - companyId: 'cl9ec1mgg0000w33hg1a3612r', + companyId: 'cl9h0bqu50000txxwkhmshhxz', id: 'cl96tbb3o0051w32gjrpaiiit', jobType: 'FULLTIME', location: 'Singapore, Singapore', diff --git a/apps/portal/src/pages/offers/test/generateAnalysis.tsx b/apps/portal/src/pages/offers/test/generateAnalysis.tsx index 5172175b..8fe0d84f 100644 --- a/apps/portal/src/pages/offers/test/generateAnalysis.tsx +++ b/apps/portal/src/pages/offers/test/generateAnalysis.tsx @@ -8,7 +8,7 @@ function GenerateAnalysis() { return (