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

pull/471/head
Bryann Yeap Kok Keong 3 years ago committed by Ai Ling
parent d0b5867dd7
commit 5a6a24a907

@ -395,7 +395,9 @@ model OffersFullTime {
} }
model OffersAnalysis { model OffersAnalysis {
id String @id @default(cuid()) id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
profile OffersProfile @relation(fields: [profileId], references: [id], onDelete: Cascade) profile OffersProfile @relation(fields: [profileId], references: [id], onDelete: Cascade)
profileId String @unique profileId String @unique

@ -234,12 +234,14 @@ export const profileAnalysisDtoMapper = (
companyAnalysis: analysis.companyAnalysis.map((analysisUnit) => companyAnalysis: analysis.companyAnalysis.map((analysisUnit) =>
analysisUnitDtoMapper(analysisUnit), analysisUnitDtoMapper(analysisUnit),
), ),
createdAt: analysis.createdAt,
id: analysis.id, id: analysis.id,
overallAnalysis: analysisUnitDtoMapper(analysis.overallAnalysis), overallAnalysis: analysisUnitDtoMapper(analysis.overallAnalysis),
overallHighestOffer: analysisHighestOfferDtoMapper( overallHighestOffer: analysisHighestOfferDtoMapper(
analysis.overallHighestOffer, analysis.overallHighestOffer,
), ),
profileId: analysis.profileId, profileId: analysis.profileId,
updatedAt: analysis.updatedAt,
}; };
return profileAnalysisDto; return profileAnalysisDto;
}; };

@ -144,10 +144,12 @@ export type OffersDiscussion = {
export type ProfileAnalysis = { export type ProfileAnalysis = {
companyAnalysis: Array<AnalysisUnit>; companyAnalysis: Array<AnalysisUnit>;
createdAt: Date;
id: string; id: string;
overallAnalysis: AnalysisUnit; overallAnalysis: AnalysisUnit;
overallHighestOffer: AnalysisHighestOffer; overallHighestOffer: AnalysisHighestOffer;
profileId: string; profileId: string;
updatedAt: Date;
}; };
export type AnalysisUnit = { export type AnalysisUnit = {

Loading…
Cancel
Save