11import { ApplicationScored } from '@dailydotdev/schema' ;
22import { TypedWorker } from './worker' ;
3- import { truncateText , webhooks } from '../common' ;
3+ import { ONE_DAY_IN_MINUTES , truncateText , webhooks } from '../common' ;
44import { generateResumeSignedUrl } from '../common/googleCloud' ;
55import { OpportunityMatch } from '../entity/OpportunityMatch' ;
66import { OpportunityJob } from '../entity/opportunities/OpportunityJob' ;
@@ -13,7 +13,12 @@ const worker: TypedWorker<'gondul.v1.candidate-application-scored'> = {
1313 handler : async ( { data } , con ) : Promise < void > => {
1414 if ( process . env . NODE_ENV === 'development' ) return ;
1515
16- const { opportunityId, userId } = data ;
16+ const {
17+ opportunityId,
18+ userId,
19+ score : applicationScore ,
20+ description,
21+ } = data ;
1722 const match = await con . getRepository ( OpportunityMatch ) . findOne ( {
1823 where : { opportunityId, userId } ,
1924 relations : [ 'opportunity' , 'user' ] ,
@@ -42,10 +47,9 @@ const worker: TypedWorker<'gondul.v1.candidate-application-scored'> = {
4247 const salary = pref ?. salaryExpectation ;
4348 const cv = pref ?. cv ;
4449 const cvSignedUrl = cv ?. blob
45- ? await generateResumeSignedUrl ( cv . blob )
50+ ? await generateResumeSignedUrl ( cv . blob , 2 * ONE_DAY_IN_MINUTES )
4651 : null ;
4752 const matchScore = match . description ?. matchScore ;
48- const applicationScore = match . applicationRank ?. score ;
4953
5054 await webhooks . recruiterReview . send ( {
5155 blocks : [
@@ -113,13 +117,13 @@ const worker: TypedWorker<'gondul.v1.candidate-application-scored'> = {
113117 text : `*CV:*\n${ cvSignedUrl ? `<${ cvSignedUrl } |Download CV>` : 'N/A' } ` ,
114118 } ,
115119 } ,
116- ...( match . applicationRank ?. description
120+ ...( description
117121 ? [
118122 {
119123 type : 'section' as const ,
120124 text : {
121125 type : 'mrkdwn' as const ,
122- text : `*Application Summary:*\n${ truncateText ( match . applicationRank . description ) } ` ,
126+ text : `*Application Summary:*\n${ truncateText ( description ) } ` ,
123127 } ,
124128 } ,
125129 ]
0 commit comments