diff --git a/apps/portal/prisma/schema.prisma b/apps/portal/prisma/schema.prisma index 069cdca3..0293af00 100644 --- a/apps/portal/prisma/schema.prisma +++ b/apps/portal/prisma/schema.prisma @@ -366,7 +366,9 @@ model OffersFullTime { } 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) profileId String @unique diff --git a/apps/portal/src/mappers/offers-mappers.ts b/apps/portal/src/mappers/offers-mappers.ts index aa4b178a..76cc2286 100644 --- a/apps/portal/src/mappers/offers-mappers.ts +++ b/apps/portal/src/mappers/offers-mappers.ts @@ -234,12 +234,14 @@ export const profileAnalysisDtoMapper = ( companyAnalysis: analysis.companyAnalysis.map((analysisUnit) => analysisUnitDtoMapper(analysisUnit), ), + createdAt: analysis.createdAt, id: analysis.id, overallAnalysis: analysisUnitDtoMapper(analysis.overallAnalysis), overallHighestOffer: analysisHighestOfferDtoMapper( analysis.overallHighestOffer, ), profileId: analysis.profileId, + updatedAt: analysis.updatedAt, }; return profileAnalysisDto; }; diff --git a/apps/portal/src/types/offers.d.ts b/apps/portal/src/types/offers.d.ts index 670627a6..2676545b 100644 --- a/apps/portal/src/types/offers.d.ts +++ b/apps/portal/src/types/offers.d.ts @@ -144,10 +144,12 @@ export type OffersDiscussion = { export type ProfileAnalysis = { companyAnalysis: Array; + createdAt: Date; id: string; overallAnalysis: AnalysisUnit; overallHighestOffer: AnalysisHighestOffer; profileId: string; + updatedAt: Date; }; export type AnalysisUnit = {