Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Unike
/
UnikeInspection-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7fe4d144
authored
Apr 23, 2025
by
Augusto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP
parent
65bf6dc7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
12 deletions
+39
-12
src/modules/candidates/candidates.service.ts
+7
-0
src/modules/candidates/dto/candidate-response.dto.ts
+17
-2
src/modules/sites/sites.service.ts
+15
-10
No files found.
src/modules/candidates/candidates.service.ts
View file @
7fe4d144
...
...
@@ -107,6 +107,7 @@ export class CandidatesService {
}
},
comments
:
{
take
:
1
,
include
:
{
createdBy
:
{
select
:
{
...
...
@@ -139,7 +140,13 @@ export class CandidatesService {
const
candidate
=
await
this
.
prisma
.
candidate
.
findUnique
({
where
:
{
id
},
include
:
{
sites
:
{
include
:
{
site
:
true
}
},
comments
:
{
take
:
1
,
include
:
{
createdBy
:
{
select
:
{
...
...
src/modules/candidates/dto/candidate-response.dto.ts
View file @
7fe4d144
import
{
ApiProperty
}
from
'@nestjs/swagger'
;
import
{
CandidateType
,
CandidateStatus
}
from
'./create-candidate.dto'
;
import
{
CommentResponseDto
}
from
'../../comments/dto/comment-response.dto'
;
import
{
SiteResponseDto
}
from
'../../sites/dto/site-response.dto'
;
export
class
CandidateSiteDto
{
@
ApiProperty
({
description
:
'CandidateSite ID'
})
id
:
number
;
@
ApiProperty
({
description
:
'Site associated with this candidate'
})
site
:
SiteResponseDto
;
@
ApiProperty
({
description
:
'Creation timestamp'
})
createdAt
:
Date
;
@
ApiProperty
({
description
:
'Last update timestamp'
})
updatedAt
:
Date
;
}
export
class
CandidateResponseDto
{
@
ApiProperty
({
description
:
'Candidate ID'
})
...
...
@@ -27,8 +42,8 @@ export class CandidateResponseDto {
@
ApiProperty
({
description
:
'Whether the candidate is ongoing'
})
onGoing
:
boolean
;
@
ApiProperty
({
description
:
'
ID of the site this candidate belongs to'
})
site
Id
:
number
;
@
ApiProperty
({
description
:
'
Sites associated with this candidate'
,
type
:
[
CandidateSiteDto
]
})
site
s
:
CandidateSiteDto
[]
;
@
ApiProperty
({
description
:
'Creation timestamp'
})
createdAt
:
Date
;
...
...
src/modules/sites/sites.service.ts
View file @
7fe4d144
...
...
@@ -195,19 +195,24 @@ export class SitesService {
email
:
true
,
},
},
comments
:
{
take
:
1
,
include
:
{
createdBy
:
{
select
:
{
id
:
true
,
name
:
true
,
email
:
true
,
},
},
},
orderBy
:
{
createdAt
:
'desc'
,
},
},
},
},
},
orderBy
:
{
candidate
:
{
candidateCode
:
'asc'
,
},
},
},
_count
:
{
select
:
{
candidates
:
true
,
},
},
},
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment