File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
src/main/kotlin/application/presenter/api/tracking Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 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+ )
You can’t perform that action at this time.
0 commit comments