Skip to content

Commit

Permalink
[ANDROSDK-1954] Add kdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
vgarciabnz committed Dec 12, 2024
1 parent 65caf29 commit b223e47
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,37 @@ package org.hisp.dhis.android.core.relationship
interface RelationshipService {
fun hasAccessPermission(relationshipType: RelationshipType): Boolean

/**
* Returns all the relationship types relevant to the given trackedEntityType and program (optional).
* The list includes the side of the TrackedEntity (FROM or TO). If the TrackedEntity might be in both sides,
* the list will include two entries for the same relationship type, one for each side.
*
* @param trackedEntityType the trackedEntityType uid
* @param programUid optional program uid
*/
fun getRelationshipTypesForTrackedEntities(
trackedEntityType: String,
programUid: String? = null,
): List<RelationshipTypeWithEntitySide>

/**
* Returns all the relationship types relevant to the given enrollment (program uid).
* The list includes the side of the Enrollment (FROM or TO). If the Enrollment might be in both sides,
* the list will include two entries for the same relationship type, one for each side.
*
* @param programUid the program uid
*/
fun getRelationshipTypesForEnrollments(
programUid: String,
): List<RelationshipTypeWithEntitySide>

/**
* Returns all the relationship types relevant to the given event (program stage uid).
* The list includes the side of the Event (FROM or TO). If the Event might be in both sides,
* the list will include two entries for the same relationship type, one for each side.
*
* @param programStageUid the program stage uid
*/
fun getRelationshipTypesForEvents(
programStageUid: String,
): List<RelationshipTypeWithEntitySide>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class RelationshipServiceShould {
mock(defaultAnswer = Mockito.RETURNS_DEEP_STUBS)
private val trackedEntityTypeRepository: TrackedEntityTypeCollectionRepository =
mock(defaultAnswer = Mockito.RETURNS_DEEP_STUBS)
private val relationshipTypeRepository: RelationshipTypeCollectionRepository = mock()
private lateinit var relationshipService: RelationshipService

@Before
Expand All @@ -35,6 +36,7 @@ class RelationshipServiceShould {
programRepository,
programStageRepository,
trackedEntityTypeRepository,
relationshipTypeRepository,
)
}

Expand Down

0 comments on commit b223e47

Please sign in to comment.