Skip to content

Commit b71ffcf

Browse files
giacomoaccursiandrea-acampora
authored andcommitted
chore: create dto for health professional tracking info
1 parent f95d790 commit b71ffcf

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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.tracking
10+
11+
import entity.tracking.HealthProfessionalTrackingInfo
12+
import kotlinx.serialization.Serializable
13+
14+
/**
15+
* Dto for tracking info of a health professional.
16+
* @param healthProfessionalId the id of the health professional.
17+
* @param healthProfessionalName the name of the health professional.
18+
* @param healthProfessionalSurname the surname of the health professional.
19+
* @param healthProfessionalRole the role of the health professional.
20+
* @param room the room where is the health professional.
21+
*/
22+
@Serializable
23+
data class TrackingInfoDto(
24+
val healthProfessionalId: String,
25+
val healthProfessionalName: String,
26+
val healthProfessionalSurname: String,
27+
val healthProfessionalRole: String,
28+
val room: String,
29+
)
30+
31+
/**
32+
* Extension function to convert [HealthProfessionalTrackingInfo] in a [TrackingInfoDto].
33+
*/
34+
fun HealthProfessionalTrackingInfo.toTrackingInfoDto(): TrackingInfoDto =
35+
TrackingInfoDto(
36+
this.healthProfessionalId.id,
37+
this.name.name,
38+
this.surname.surname,
39+
this.role.role,
40+
this.roomId.id,
41+
)

0 commit comments

Comments
 (0)