Skip to content

Commit 80f6206

Browse files
chore: create room repository interface
1 parent 8c9cc16 commit 80f6206

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Diff for: src/main/kotlin/usecase/repository/RoomRepository.kt

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.zone.Room
12+
import entity.zone.RoomID
13+
14+
/**
15+
* Interface that models the repository to manage Rooms.
16+
*/
17+
interface RoomRepository {
18+
/**
19+
* Create a [room].
20+
* @return null if the room already exists, the room created otherwise.
21+
*/
22+
fun createRoom(room: Room): Room?
23+
24+
/**
25+
* Delete a room by its [roomId].
26+
* @return true if correctly deleted, false otherwise.
27+
*/
28+
fun deleteRoom(roomId: RoomID): Boolean
29+
30+
/**
31+
* Find a room by its [roomId].
32+
* @return the room if present, null otherwise.
33+
*/
34+
fun findBy(roomId: RoomID): Room?
35+
}

0 commit comments

Comments
 (0)