-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic auditing #27
Conversation
…ic audit to audit basic details like job start and end times.
import jakarta.persistence.MappedSuperclass | ||
|
||
@MappedSuperclass | ||
abstract class AbstractIdEntity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copied this over from visit-scheduler
import java.time.LocalDateTime | ||
|
||
@MappedSuperclass | ||
abstract class AbstractReferenceEntity( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copied this over from visit-scheduler
@@ -43,7 +43,7 @@ class StartVisitAllocationByPrisonController( | |||
], | |||
) | |||
fun triggerVisitAllocationByPrison(): ResponseEntity<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have a DTO here instead of a ResponseEntity. DTO can contain the id / reference, and you can still log to LOG.info the success message + id / reference, within the service
@Table(name = "VISIT_ORDER_ALLOCATION_PRISON_JOB") | ||
class VisitOrderAllocationPrisonJob( | ||
@Column(nullable = false) | ||
val allocationJobReference: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a reference? Or can we use the ID column to keep in theme with the rest of the service? A reference would be good if we're exposing it to end users etc, but I don't think we'll ever do this?
log.info("Total active prisons for visit allocation job = ${activePrisons.size}") | ||
|
||
activePrisons.forEach { | ||
sendSqsMessageForPrison(it.prisonCode) | ||
val prisonCode = it.prisonCode | ||
auditOrderAllocationPrisonJob(allocationJobReference, prisonCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we create the job before it's run, should we do this at the end? What happens if a job is saved, but it errors / fails to complete?
Add VisitOrderAllocationJob and VisitOrderPrisonAllocationJob for basic audit to audit basic details like job start and end times.