Junior — Senior
Repository methods rewriting – task 4
livecode
Task condition
In the project, there is a repository with poorly named methods, uninformative parameters, and redundant functions. It is required to refactor the interface, making method names and their arguments more understandable while preserving the original signature and behavior.
interface ConferenceRepository {
suspend fun startConference(
conferenceId: String?,
participantId: Long,
legacyEnabled: Int,
authToken: String
)
suspend fun retrieveAllData(
conferenceId: String,
flags: Map<String, String>,
expansionDepth: Int
): Any?
suspend fun obtainSchedule(
conferenceCode: Int,
includePartial: Boolean
): List<Any>
suspend fun validateTicket(
email: String,
seatsRequested: Int,
conferenceId: Long,
forceCheck: Boolean
): Boolean?
suspend fun loadChatMessages(
conferenceId: String,
startOffset: Int,
pageSize: Int,
includeRead: Int,
fromHistory: Boolean
): Map<String, Any?>
suspend fun sendChatMessage(
text: String,
conferenceSlug: String,
userAuthToken: String,
attachmentUrls: List<String>?
): Any
suspend fun modifySpeaker(
speakerId: Int,
updatedFields: Map<String, Any>,
silentMode: Boolean
): Int
suspend fun changeUserPassword(oldPassword: String, newPassword: String, username: String)
suspend fun reloadAllData(): Unit
suspend fun supportLegacyMode(
conferenceId: Int,
operationMode: String,
optionalParam: String?,
quantity: Int
): Long
}