Skip to content

Commit

Permalink
chore: create repository to get processStep and processState
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomoaccursi authored and andrea-acampora committed May 8, 2023
1 parent 975976b commit 4052ce5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,14 @@ class SurgicalProcessController(
override fun updateSurgicalProcessRoom(processId: ProcessData.ProcessId, room: Room): Boolean =
this.processDigitalTwinManager.updateSurgicalProcessRoom(processId, room) &&
this.processDatabaseManager.updateSurgicalProcessRoom(processId, room)

override fun getSurgicalProcessStates(
surgicalProcessId: ProcessData.ProcessId
): List<Pair<Instant, ProcessData.ProcessState>> =
this.processDatabaseManager.getSurgicalProcessStates(surgicalProcessId)

override fun getSurgicalProcessSteps(
surgicalProcessId: ProcessData.ProcessId
): List<Pair<Instant, ProcessData.ProcessStep>> =
this.processDatabaseManager.getSurgicalProcessSteps(surgicalProcessId)
}
14 changes: 14 additions & 0 deletions src/main/kotlin/usecase/repository/SurgicalProcessRepository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,18 @@ interface SurgicalProcessRepository {
processId: ProcessData.ProcessId,
room: Room
): Boolean

/**
* Get a list of pair of [Instant] and [ProcessData.ProcessState] given the [ProcessData.ProcessId].
*/
fun getSurgicalProcessStates(
surgicalProcessId: ProcessData.ProcessId
): List<Pair<Instant, ProcessData.ProcessState>>

/**
* Get a list of pair of [Instant] and [ProcessData.ProcessStep] given the [ProcessData.ProcessId].
*/
fun getSurgicalProcessSteps(
surgicalProcessId: ProcessData.ProcessId
): List<Pair<Instant, ProcessData.ProcessStep>>
}

0 comments on commit 4052ce5

Please sign in to comment.