Skip to content

Commit 384eb46

Browse files
chore: create room api dto
1 parent f24e4ef commit 384eb46

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
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 application.presenter.api.model
10+
11+
import kotlinx.serialization.SerialName
12+
import kotlinx.serialization.Serializable
13+
14+
/**
15+
* Presenter class to be able to deserialize data that comes from API.
16+
* It deserializes [id], [name], [zoneId] and the [type] of the room.
17+
*/
18+
@Serializable
19+
data class RoomApiDto(
20+
val id: String,
21+
val name: String,
22+
@SerialName("zone-id") val zoneId: String,
23+
val type: RoomApiDtoType
24+
)
25+
26+
/**
27+
* Presenter enum class to deserialize room type that comes from API.
28+
*/
29+
@Serializable
30+
enum class RoomApiDtoType {
31+
/** Operating room type. */
32+
OPERATING_ROOM,
33+
/** Pre-operating room type. */
34+
PRE_OPERATING_ROOM
35+
}

0 commit comments

Comments
 (0)