Skip to content

Review apis methods #101

@trema96

Description

@trema96

Order of parameters

Many situations where a mandatory parameter comes after (some) defaults, example:

suspend fun listAllHcpsByStatus(
	status: String,
	from: Long? = null,
	to: Long? = null,
	hcpIds: List<String>
): List<E>

This means that if a user wants to call the method and wants to use the default from and to he will have to use a named argument for hcpIds

listAllHcpsByStatus("", hcpIds = emptyList())

Defaults that should not be defaults

	suspend fun findPatientsByNameBirthSsinAuto(
		healthcarePartyId: String? = null,
		filterValue: String,
		startKey: String? = null,
		startDocumentId: String? = null,
		limit: Int? = null,
		sortDirection: SortDirection = SortDirection.Asc,
	): PaginatedList<E>

healthcarePartyId here: should it really have a null default? If it means "use my current hcp id" yes, but if it has other meaning no

General review

Make sure that all methods and parameters actually make sense, if we have some methods that we only need for compatibility with v8 let's keep them but let's mark them as deprecated.

Document

We need to add KDoc to all methods

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions