Skip to content

Commit

Permalink
Add audit log
Browse files Browse the repository at this point in the history
  • Loading branch information
patari committed Jan 27, 2025
1 parent 24098fe commit 37b893a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions service/src/main/kotlin/fi/espoo/evaka/Audit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ enum class Audit(
PlacementTerminate,
PlacementChildPlacementPeriodsRead,
PlacementTool,
PlacementToolValidate,
PreschoolAbsenceReport,
PreschoolAssistanceCreate,
PreschoolAssistanceUpdate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ class PlacementToolController(
@RequestPart("file") file: MultipartFile,
): PlacementToolValidation {
return db.connect { dbc ->
dbc.transaction { tx ->
accessControl.requirePermissionFor(tx, user, clock, Action.Global.PLACEMENT_TOOL)
val placements = file.inputStream.use { parsePlacementToolCsv(it) }
PlacementToolValidation(count = placements.size)
dbc.transaction { tx ->
accessControl.requirePermissionFor(
tx,
user,
clock,
Action.Global.PLACEMENT_TOOL,
)
val placements = file.inputStream.use { parsePlacementToolCsv(it) }
PlacementToolValidation(count = placements.size)
}
}
}
.also { Audit.PlacementToolValidate.log() }
}

@PostMapping(consumes = [MediaType.MULTIPART_FORM_DATA_VALUE])
Expand Down

0 comments on commit 37b893a

Please sign in to comment.