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
2b389c43
authored
Oct 06, 2025
by
Augusto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inspection Object update
parent
ede124b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
src/modules/inspection/dto/inspection-response.dto.ts
+34
-0
src/modules/inspection/inspection.service.ts
+11
-0
No files found.
src/modules/inspection/dto/inspection-response.dto.ts
View file @
2b389c43
...
...
@@ -85,6 +85,30 @@ export class InspectionPhotoDto {
type
:
String
,
})
description
?:
string
;
@
ApiProperty
({
description
:
'Order/position of the photo within the inspection (for sorting)'
,
example
:
1
,
type
:
Number
,
})
order
:
number
;
@
ApiProperty
({
description
:
'Whether this photo is the principal/cover photo for the inspection'
,
example
:
false
,
type
:
Boolean
,
})
isPrincipal
:
boolean
;
@
ApiProperty
({
description
:
'Whether this photo is one of the 6 resume photos for the inspection'
,
example
:
false
,
type
:
Boolean
,
})
isResume
:
boolean
;
}
export
class
InspectionDto
{
...
...
@@ -169,12 +193,17 @@ export class InspectionDto {
id
:
{
type
:
'number'
,
example
:
1
},
name
:
{
type
:
'string'
,
example
:
'John Doe'
},
email
:
{
type
:
'string'
,
example
:
'john.doe@example.com'
},
signature
:
{
type
:
'string'
,
example
:
'/uploads/signatures/user_1_signature.png'
,
},
},
})
submittedBy
?:
{
id
:
number
;
name
:
string
;
email
:
string
;
signature
?:
string
;
};
@
ApiPropertyOptional
({
...
...
@@ -184,12 +213,17 @@ export class InspectionDto {
id
:
{
type
:
'number'
,
example
:
2
},
name
:
{
type
:
'string'
,
example
:
'Jane Smith'
},
email
:
{
type
:
'string'
,
example
:
'jane.smith@example.com'
},
signature
:
{
type
:
'string'
,
example
:
'/uploads/signatures/user_2_signature.png'
,
},
},
})
approvedBy
?:
{
id
:
number
;
name
:
string
;
email
:
string
;
signature
?:
string
;
};
@
ApiProperty
({
...
...
src/modules/inspection/inspection.service.ts
View file @
2b389c43
...
...
@@ -274,6 +274,7 @@ export class InspectionService {
userId
:
users
.
id
,
userName
:
users
.
name
,
userEmail
:
users
.
email
,
userSignature
:
users
.
signature
,
})
.
from
(
inspections
)
.
leftJoin
(
users
,
eq
(
users
.
id
,
inspections
.
submittedById
))
...
...
@@ -286,6 +287,7 @@ export class InspectionService {
userId
:
users
.
id
,
userName
:
users
.
name
,
userEmail
:
users
.
email
,
userSignature
:
users
.
signature
,
})
.
from
(
inspections
)
.
leftJoin
(
users
,
eq
(
users
.
id
,
inspections
.
approvedById
))
...
...
@@ -298,6 +300,7 @@ export class InspectionService {
id
:
user
.
userId
,
name
:
user
.
userName
,
email
:
user
.
userEmail
,
signature
:
user
.
userSignature
,
});
}
});
...
...
@@ -308,6 +311,7 @@ export class InspectionService {
id
:
user
.
userId
,
name
:
user
.
userName
,
email
:
user
.
userEmail
,
signature
:
user
.
userSignature
,
});
}
});
...
...
@@ -365,6 +369,7 @@ export class InspectionService {
userId
:
users
.
id
,
userName
:
users
.
name
,
userEmail
:
users
.
email
,
userSignature
:
users
.
signature
,
})
.
from
(
inspections
)
.
leftJoin
(
users
,
eq
(
users
.
id
,
inspections
.
submittedById
))
...
...
@@ -377,6 +382,7 @@ export class InspectionService {
userId
:
users
.
id
,
userName
:
users
.
name
,
userEmail
:
users
.
email
,
userSignature
:
users
.
signature
,
})
.
from
(
inspections
)
.
leftJoin
(
users
,
eq
(
users
.
id
,
inspections
.
approvedById
))
...
...
@@ -388,6 +394,7 @@ export class InspectionService {
id
:
submittedByUser
[
0
].
userId
,
name
:
submittedByUser
[
0
].
userName
,
email
:
submittedByUser
[
0
].
userEmail
,
signature
:
submittedByUser
[
0
].
userSignature
,
});
}
...
...
@@ -396,6 +403,7 @@ export class InspectionService {
id
:
approvedByUser
[
0
].
userId
,
name
:
approvedByUser
[
0
].
userName
,
email
:
approvedByUser
[
0
].
userEmail
,
signature
:
approvedByUser
[
0
].
userSignature
,
});
}
...
...
@@ -986,6 +994,9 @@ export class InspectionService {
url
:
photo
.
url
,
filename
:
photo
.
filename
,
description
:
photo
.
description
,
order
:
photo
.
order
,
isPrincipal
:
photo
.
isPrincipal
,
isResume
:
photo
.
isResume
,
})),
};
}
...
...
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