Skip to content

Commit 79ca86f

Browse files
chore: create medical technology repository interface
1 parent 80f6206 commit 79ca86f

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2023. Smart Operating Block
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
8+
9+
package usecase.repository
10+
11+
import entity.medicaltechnology.MedicalTechnology
12+
import entity.medicaltechnology.MedicalTechnologyID
13+
import entity.zone.RoomID
14+
15+
/**
16+
* Interface that models the repository to manage Medical Technologies.
17+
*/
18+
interface MedicalTechnologyRepository {
19+
/**
20+
* Create a [medicalTechnology].
21+
* @return null if the medical technology already exists, the medical technology created otherwise.
22+
*/
23+
fun createMedicalTechnology(medicalTechnology: MedicalTechnology): MedicalTechnology?
24+
25+
/**
26+
* Delete a medical technology by its [medicalTechnologyId].
27+
* @return true if correctly deleted, false otherwise.
28+
*/
29+
fun deleteMedicalTechnology(medicalTechnologyId: MedicalTechnologyID): Boolean
30+
31+
/**
32+
* Find a medical technology by its [medicalTechnologyId].
33+
* @return the medical technology if present, null otherwise.
34+
*/
35+
fun findBy(medicalTechnologyId: MedicalTechnologyID): MedicalTechnology?
36+
37+
/**
38+
* Map a medical technology identified by its [medicalTechnologyId] to another [roomId].
39+
* NB: the roomId existence isn't checked. You need to check its existence on your own.
40+
* @return false if the medical technology does not exist, true otherwise.
41+
*/
42+
fun mapTechnologyTo(medicalTechnologyId: MedicalTechnologyID, roomId: RoomID): Boolean
43+
}

0 commit comments

Comments
 (0)