mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-29 13:13:54 +08:00
[offers][chore] Add location to experience in the back end
This commit is contained in:
@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "OffersExperience" ADD COLUMN "location" TEXT;
|
@ -91,17 +91,17 @@ enum TodoStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model Company {
|
model Company {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String @db.Text
|
name String @db.Text
|
||||||
slug String @unique
|
slug String @unique
|
||||||
description String? @db.Text
|
description String? @db.Text
|
||||||
logoUrl String?
|
logoUrl String?
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
questionsQuestionEncounter QuestionsQuestionEncounter[]
|
questionsQuestionEncounter QuestionsQuestionEncounter[]
|
||||||
OffersExperience OffersExperience[]
|
OffersExperience OffersExperience[]
|
||||||
OffersOffer OffersOffer[]
|
OffersOffer OffersOffer[]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start of Resumes project models.
|
// Start of Resumes project models.
|
||||||
@ -232,6 +232,7 @@ model OffersExperience {
|
|||||||
// Add more fields
|
// Add more fields
|
||||||
durationInMonths Int?
|
durationInMonths Int?
|
||||||
specialization String?
|
specialization String?
|
||||||
|
location String?
|
||||||
|
|
||||||
// FULLTIME fields
|
// FULLTIME fields
|
||||||
level String?
|
level String?
|
||||||
@ -405,20 +406,20 @@ model QuestionsQuestion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model QuestionsQuestionEncounter {
|
model QuestionsQuestionEncounter {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
questionId String
|
questionId String
|
||||||
userId String?
|
userId String?
|
||||||
// TODO: sync with models (location, role)
|
// TODO: sync with models (location, role)
|
||||||
companyId String
|
companyId String
|
||||||
location String @db.Text
|
location String @db.Text
|
||||||
role String @db.Text
|
role String @db.Text
|
||||||
seenAt DateTime
|
seenAt DateTime
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull)
|
company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull)
|
||||||
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
|
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
|
||||||
question QuestionsQuestion @relation(fields: [questionId], references: [id], onDelete: Cascade)
|
question QuestionsQuestion @relation(fields: [questionId], references: [id], onDelete: Cascade)
|
||||||
}
|
}
|
||||||
|
|
||||||
model QuestionsQuestionVote {
|
model QuestionsQuestionVote {
|
||||||
|
@ -267,6 +267,7 @@ export const experienceDtoMapper = (
|
|||||||
id: experience.id,
|
id: experience.id,
|
||||||
jobType: experience.jobType,
|
jobType: experience.jobType,
|
||||||
level: experience.level,
|
level: experience.level,
|
||||||
|
location: experience.location,
|
||||||
monthlySalary: experience.monthlySalary
|
monthlySalary: experience.monthlySalary
|
||||||
? valuationDtoMapper(experience.monthlySalary)
|
? valuationDtoMapper(experience.monthlySalary)
|
||||||
: experience.monthlySalary,
|
: experience.monthlySalary,
|
||||||
|
@ -103,7 +103,7 @@ function Test() {
|
|||||||
],
|
],
|
||||||
experiences: [
|
experiences: [
|
||||||
{
|
{
|
||||||
companyId: 'cl9ec1mgg0000w33hg1a3612r',
|
companyId: 'cl9h0bqu50000txxwkhmshhxz',
|
||||||
durationInMonths: 24,
|
durationInMonths: 24,
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
level: 'Junior',
|
level: 'Junior',
|
||||||
@ -132,7 +132,7 @@ function Test() {
|
|||||||
{
|
{
|
||||||
comments: 'I am a Raffles Institution almumni',
|
comments: 'I am a Raffles Institution almumni',
|
||||||
// Comments: '',
|
// Comments: '',
|
||||||
companyId: 'cl98yuqk80007txhgjtjp8fk4',
|
companyId: 'cl9h0bqu50000txxwkhmshhxz',
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
location: 'Singapore, Singapore',
|
location: 'Singapore, Singapore',
|
||||||
monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
|
monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
|
||||||
@ -161,7 +161,7 @@ function Test() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
comments: '',
|
comments: '',
|
||||||
companyId: 'cl98yuqk80007txhgjtjp8fk4',
|
companyId: 'cl9h0bqu50000txxwkhmshhxz',
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
location: 'Singapore, Singapore',
|
location: 'Singapore, Singapore',
|
||||||
monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
|
monthYearReceived: new Date('2022-09-30T07:58:54.000Z'),
|
||||||
@ -263,7 +263,7 @@ function Test() {
|
|||||||
slug: 'meta',
|
slug: 'meta',
|
||||||
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
||||||
},
|
},
|
||||||
companyId: 'cl9ec1mgg0000w33hg1a3612r',
|
companyId: 'cl9h0bqu50000txxwkhmshhxz',
|
||||||
durationInMonths: 24,
|
durationInMonths: 24,
|
||||||
id: 'cl96stky6002iw32gpt6t87s2',
|
id: 'cl96stky6002iw32gpt6t87s2',
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
@ -339,7 +339,7 @@ function Test() {
|
|||||||
slug: 'meta',
|
slug: 'meta',
|
||||||
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
||||||
},
|
},
|
||||||
companyId: 'cl9ec1mgg0000w33hg1a3612r',
|
companyId: 'cl9h0bqu50000txxwkhmshhxz',
|
||||||
id: 'cl976t4de00047iygl0zbce11',
|
id: 'cl976t4de00047iygl0zbce11',
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
location: 'Singapore, Singapore',
|
location: 'Singapore, Singapore',
|
||||||
@ -392,7 +392,7 @@ function Test() {
|
|||||||
slug: 'meta',
|
slug: 'meta',
|
||||||
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
||||||
},
|
},
|
||||||
companyId: 'cl9ec1mgg0000w33hg1a3612r',
|
companyId: 'cl9h0bqu50000txxwkhmshhxz',
|
||||||
id: 'cl96stky80031w32gau9mu1gs',
|
id: 'cl96stky80031w32gau9mu1gs',
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
location: 'Singapore, Singapore',
|
location: 'Singapore, Singapore',
|
||||||
@ -445,7 +445,7 @@ function Test() {
|
|||||||
slug: 'meta',
|
slug: 'meta',
|
||||||
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
||||||
},
|
},
|
||||||
companyId: 'cl9ec1mgg0000w33hg1a3612r',
|
companyId: 'cl9h0bqu50000txxwkhmshhxz',
|
||||||
id: 'cl96stky9003bw32gc3l955vr',
|
id: 'cl96stky9003bw32gc3l955vr',
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
location: 'Singapore, Singapore',
|
location: 'Singapore, Singapore',
|
||||||
@ -498,7 +498,7 @@ function Test() {
|
|||||||
slug: 'meta',
|
slug: 'meta',
|
||||||
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
||||||
},
|
},
|
||||||
companyId: 'cl9ec1mgg0000w33hg1a3612r',
|
companyId: 'cl9h0bqu50000txxwkhmshhxz',
|
||||||
id: 'cl976wf28000t7iyga4noyz7s',
|
id: 'cl976wf28000t7iyga4noyz7s',
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
location: 'Singapore, Singapore',
|
location: 'Singapore, Singapore',
|
||||||
@ -551,7 +551,7 @@ function Test() {
|
|||||||
slug: 'meta',
|
slug: 'meta',
|
||||||
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
updatedAt: new Date('2022-10-12T16:19:05.196Z'),
|
||||||
},
|
},
|
||||||
companyId: 'cl9ec1mgg0000w33hg1a3612r',
|
companyId: 'cl9h0bqu50000txxwkhmshhxz',
|
||||||
id: 'cl96tbb3o0051w32gjrpaiiit',
|
id: 'cl96tbb3o0051w32gjrpaiiit',
|
||||||
jobType: 'FULLTIME',
|
jobType: 'FULLTIME',
|
||||||
location: 'Singapore, Singapore',
|
location: 'Singapore, Singapore',
|
||||||
|
@ -8,7 +8,7 @@ function GenerateAnalysis() {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{JSON.stringify(
|
{JSON.stringify(
|
||||||
analysisMutation.mutate({ profileId: 'cl98ywtbv0000tx1s4p18eol1' }),
|
analysisMutation.mutate({ profileId: 'cl9gvjn8b004di96vd1hhh9c4' }),
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -75,6 +75,7 @@ const experience = z.object({
|
|||||||
id: z.string().optional(),
|
id: z.string().optional(),
|
||||||
jobType: z.string().nullish(),
|
jobType: z.string().nullish(),
|
||||||
level: z.string().nullish(),
|
level: z.string().nullish(),
|
||||||
|
location: z.string().nullish(),
|
||||||
monthlySalary: valuation.nullish(),
|
monthlySalary: valuation.nullish(),
|
||||||
monthlySalaryId: z.string().nullish(),
|
monthlySalaryId: z.string().nullish(),
|
||||||
specialization: z.string().nullish(),
|
specialization: z.string().nullish(),
|
||||||
|
1
apps/portal/src/types/offers.d.ts
vendored
1
apps/portal/src/types/offers.d.ts
vendored
@ -24,6 +24,7 @@ export type Experience = {
|
|||||||
id: string;
|
id: string;
|
||||||
jobType: JobType?;
|
jobType: JobType?;
|
||||||
level: string?;
|
level: string?;
|
||||||
|
location: string?;
|
||||||
monthlySalary: Valuation?;
|
monthlySalary: Valuation?;
|
||||||
specialization: string?;
|
specialization: string?;
|
||||||
title: string?;
|
title: string?;
|
||||||
|
Reference in New Issue
Block a user