generated from SmartOperatingBlock/kotlin-template-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create health professional application service
- Loading branch information
1 parent
73c7b46
commit 737cdbd
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/main/kotlin/application/service/HealthProfessionalService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2023. Smart Operating Block | ||
* | ||
* Use of this source code is governed by an MIT-style | ||
* license that can be found in the LICENSE file or at | ||
* https://opensource.org/licenses/MIT. | ||
*/ | ||
|
||
package application.service | ||
|
||
import entity.healthprofessional.HealthProfessional | ||
import usecase.repository.HealthProfessionalRepository | ||
|
||
/** | ||
* The application service for health professionals management. | ||
* @param healthProfessionalRepository the repository to access health professionals data. | ||
*/ | ||
class HealthProfessionalService(private val healthProfessionalRepository: HealthProfessionalRepository) { | ||
|
||
/** Get a health professional given its [healthProfessionalId]. */ | ||
fun getHealthProfessional(healthProfessionalId: String): HealthProfessional? = | ||
healthProfessionalRepository.getHealthProfessional(healthProfessionalId) | ||
|
||
/** Create a [HealthProfessional]. */ | ||
fun createHealthProfessional(healthProfessional: HealthProfessional): HealthProfessional? = | ||
healthProfessionalRepository.createHealthProfessional(healthProfessional) | ||
|
||
/** Delete a [HealthProfessional] given its [healthProfessionalId]. */ | ||
fun deleteHealthProfessional(healthProfessionalId: String): Boolean = | ||
healthProfessionalRepository.deleteHealthProfessional(healthProfessionalId) | ||
} |