Skip to content

Commit

Permalink
feat: add delete process application service
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-acampora committed May 8, 2023
1 parent 92820cb commit 98f4ef2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ class SurgicalProcessController(
surgicalProcessId: ProcessData.ProcessId
): List<Pair<Instant, ProcessData.ProcessStep>> =
this.processDatabaseManager.getSurgicalProcessSteps(surgicalProcessId)

override fun deleteSurgicalProcess(surgicalProcessId: ProcessData.ProcessId): Boolean =
this.processDigitalTwinManager.deleteSurgicalProcess(surgicalProcessId)
}
12 changes: 12 additions & 0 deletions src/main/kotlin/application/service/SurgicalProcessServices.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,16 @@ object SurgicalProcessServices {
override fun execute(): List<Pair<Instant, ProcessData.ProcessStep>> =
surgicalProcessRepository.getSurgicalProcessSteps(surgicalProcessId)
}

/**
* The Application Service to delete a [SurgicalProcess] by its [surgicalProcessId]
* using the [surgicalProcessRepository].
*/
class DeleteSurgicalProcess(
private val surgicalProcessId: ProcessData.ProcessId,
private val surgicalProcessRepository: SurgicalProcessRepository
) : ApplicationService<Boolean> {
override fun execute(): Boolean =
surgicalProcessRepository.deleteSurgicalProcess(surgicalProcessId)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,11 @@ interface SurgicalProcessRepository {
fun getSurgicalProcessSteps(
surgicalProcessId: ProcessData.ProcessId
): List<Pair<Instant, ProcessData.ProcessStep>>

/**
* Delete a [SurgicalProcess] by it [surgicalProcessId].
*/
fun deleteSurgicalProcess(
surgicalProcessId: ProcessData.ProcessId
): Boolean
}

0 comments on commit 98f4ef2

Please sign in to comment.