From 76610c5153752e3e46b678e7fcc08e9b2d6be303 Mon Sep 17 00:00:00 2001 From: Siddharth Agarwal Date: Thu, 18 Jul 2024 13:06:56 +0530 Subject: [PATCH] Replace object with data object --- .../java/org/simple/clinic/ContactType.kt | 4 +-- .../simple/clinic/appupdate/AppUpdateState.kt | 2 +- .../CriticalAppUpdateEffect.kt | 6 ++-- .../CriticalAppUpdateEvent.kt | 4 +-- .../bloodsugar/BloodSugarMeasurementType.kt | 8 ++--- .../bloodsugar/entry/BloodSugarEntryEffect.kt | 14 ++++---- .../bloodsugar/entry/BloodSugarEntryEvent.kt | 12 +++---- .../bloodsugar/entry/ValidationResult.kt | 2 +- .../ConfirmRemoveBloodSugarEffect.kt | 2 +- .../ConfirmRemoveBloodSugarEvent.kt | 4 +-- .../history/BloodSugarHistoryScreenEvent.kt | 2 +- .../adapter/BloodSugarHistoryListItem.kt | 2 +- .../bloodsugar/history/adapter/Event.kt | 2 +- .../BloodSugarUnitSelectionEffect.kt | 2 +- .../BloodSugarUnitSelectionEvent.kt | 2 +- .../org/simple/clinic/bp/ValidationResult.kt | 14 ++++---- .../bp/entry/BloodPressureEntryEffect.kt | 16 ++++----- .../bp/entry/BloodPressureEntryEvent.kt | 12 +++---- .../ConfirmRemoveBloodPressureEffect.kt | 2 +- .../ConfirmRemoveBloodPressureEvent.kt | 4 +-- .../BloodPressureHistoryScreenEvent.kt | 2 +- .../adapter/BloodPressureHistoryListItem.kt | 2 +- .../simple/clinic/bp/history/adapter/Event.kt | 2 +- .../contactpatient/ContactPatientEffect.kt | 4 +-- .../contactpatient/ContactPatientEvent.kt | 20 +++++------ .../simple/clinic/deeplink/DeepLinkEffect.kt | 10 +++--- .../simple/clinic/deeplink/DeepLinkResult.kt | 6 ++-- .../clinic/drugs/EditMedicinesEffect.kt | 4 +-- .../simple/clinic/drugs/EditMedicinesEvent.kt | 8 ++--- .../org/simple/clinic/drugs/search/Answer.kt | 6 ++-- .../clinic/drugs/search/DrugCategory.kt | 14 ++++---- .../clinic/drugs/search/DrugFrequency.kt | 8 ++--- .../clinic/drugs/search/DrugSearchListItem.kt | 6 ++-- .../clinic/drugs/selection/DrugListItem.kt | 4 +-- .../selection/custom/CustomDrugEntryEffect.kt | 10 +++--- .../selection/custom/CustomDrugEntryEvent.kt | 10 +++--- .../drugs/selection/dosage/DosageListItem.kt | 2 +- .../selection/dosage/DosagePickerEffect.kt | 2 +- .../selection/dosage/DosagePickerEvent.kt | 8 ++--- .../drugstockreminders/DrugStockReminder.kt | 4 +-- .../enterdrugstock/EnterDrugStockEffect.kt | 2 +- .../clinic/editpatient/EditPatientEffect.kt | 12 +++---- .../clinic/editpatient/EditPatientEvent.kt | 6 ++-- .../deletepatient/DeletePatientEffect.kt | 2 +- .../deletepatient/DeletePatientEvent.kt | 6 ++-- .../simple/clinic/enterotp/AsyncOpError.kt | 4 +-- .../simple/clinic/enterotp/EnterOtpEffect.kt | 24 ++++++------- .../simple/clinic/enterotp/EnterOtpEvent.kt | 2 +- .../simple/clinic/enterotp/OtpEntryMode.kt | 2 +- .../clinic/facility/FacilityPullResult.kt | 6 ++-- .../facility/change/FacilityChangeEffect.kt | 4 +-- .../confirm/ConfirmFacilityChangeEffect.kt | 6 ++-- .../confirm/ConfirmFacilityChangeEvent.kt | 2 +- .../confirmpin/ForgotPinConfirmPinEffect.kt | 16 ++++----- .../createnewpin/ForgotPinCreateNewEffect.kt | 8 ++--- .../createnewpin/ForgotPinCreateNewEvent.kt | 2 +- .../org/simple/clinic/help/HelpPullResult.kt | 6 ++-- .../java/org/simple/clinic/home/HomeScreen.kt | 2 +- .../simple/clinic/home/HomeScreenEffect.kt | 6 ++-- .../org/simple/clinic/home/HomeScreenEvent.kt | 2 +- .../org/simple/clinic/home/HomeScreenKey.kt | 2 +- .../clinic/home/help/HelpScreenEffect.kt | 6 ++-- .../clinic/home/help/HelpScreenEvent.kt | 2 +- .../overdue/OverdueAppointmentListItem.kt | 6 ++-- .../clinic/home/overdue/OverdueEffect.kt | 16 ++++----- .../clinic/home/overdue/OverdueEvent.kt | 6 ++-- .../OverdueAppointmentSearchListItem.kt | 2 +- .../overdue/search/OverdueSearchEffect.kt | 16 ++++----- .../home/overdue/search/OverdueSearchEvent.kt | 4 +-- .../clinic/home/patients/PatientsTabEffect.kt | 36 +++++++++---------- .../clinic/home/patients/PatientsTabEvent.kt | 6 ++-- .../patients/links/PatientsTabLinkEffect.kt | 14 ++++---- .../patients/links/PatientsTabLinkEvent.kt | 6 ++-- .../clinic/home/report/ReportsEffect.kt | 2 +- .../simple/clinic/home/report/ReportsEvent.kt | 2 +- .../instantsearch/InstantSearchEffect.kt | 8 ++--- .../instantsearch/InstantSearchEvent.kt | 8 ++--- .../InstantSearchResultsItemType.kt | 2 +- .../instantsearch/InstantSearchValidator.kt | 4 +-- .../introvideoscreen/IntroVideoEffect.kt | 4 +-- .../introvideoscreen/IntroVideoEvent.kt | 4 +-- .../simple/clinic/location/LocationUpdate.kt | 2 +- .../org/simple/clinic/login/LoginResult.kt | 6 ++-- .../clinic/login/activateuser/ActivateUser.kt | 4 +-- .../clinic/login/applock/AppLockEffect.kt | 18 +++++----- .../clinic/login/applock/AppLockEvent.kt | 12 +++---- .../simple/clinic/login/pin/LoginPinEffect.kt | 8 ++--- .../simple/clinic/login/pin/LoginPinEvent.kt | 6 ++-- .../simple/clinic/main/TheActivityEffect.kt | 18 +++++----- .../simple/clinic/main/TheActivityEvent.kt | 8 ++--- .../simple/clinic/medicalhistory/Answer.kt | 6 ++-- .../newentry/NewMedicalHistoryEffect.kt | 14 ++++---- .../newentry/NewMedicalHistoryEvent.kt | 2 +- .../complete/MonthlyReportCompleteEffect.kt | 2 +- .../complete/MonthlyReportCompleteEvent.kt | 2 +- .../form/QuestionnaireEntryEffect.kt | 8 ++--- .../form/QuestionnaireEntryEvent.kt | 6 ++-- .../list/MonthlyReportsEffect.kt | 4 +-- .../list/MonthlyReportsEvent.kt | 2 +- .../clinic/newentry/PatientEntryEffect.kt | 10 +++--- .../clinic/newentry/PatientEntryEvent.kt | 4 +-- .../clinic/newentry/form/ValidationError.kt | 10 +++--- .../clinic/onboarding/OnboardingEvent.kt | 2 +- .../org/simple/clinic/overdue/Appointment.kt | 10 +++--- .../clinic/overdue/AppointmentCancelReason.kt | 14 ++++---- .../clinic/overdue/callresult/Outcome.kt | 6 ++-- .../download/OverdueListDownloadResult.kt | 4 +-- .../overdue/download/formatdialog/OpenAs.kt | 6 ++-- .../SelectOverdueDownloadFormatEffect.kt | 8 ++--- .../SelectOverdueDownloadFormatEvent.kt | 6 ++-- .../simple/clinic/patient/DeletedReason.kt | 4 +-- .../java/org/simple/clinic/patient/Gender.kt | 6 ++-- .../clinic/patient/PatientPhoneNumberType.kt | 4 +-- .../simple/clinic/patient/PatientStatus.kt | 10 +++--- .../simple/clinic/patient/ReminderConsent.kt | 4 +-- .../clinic/patient/businessid/BusinessId.kt | 12 +++---- .../clinic/patient/businessid/Identifier.kt | 12 +++---- .../download/PatientLineListDownloadResult.kt | 4 +-- .../SelectLineListFormatEffect.kt | 2 +- .../formatdialog/SelectLineListFormatEvent.kt | 4 +-- .../onlinelookup/api/LookupPatientOnline.kt | 2 +- .../clinic/questionnaire/QuestionnaireType.kt | 6 ++-- .../component/properties/InputFieldType.kt | 6 ++-- .../recentpatient/AllRecentPatientsEffect.kt | 2 +- .../LatestRecentPatientsEffect.kt | 2 +- .../LatestRecentPatientsEvent.kt | 2 +- .../recentpatientsview/RecentPatientItem.kt | 2 +- .../registerorlogin/AuthenticationEffect.kt | 4 +-- .../RegistrationConfirmPinEffect.kt | 2 +- .../RegistrationLocationPermissionEvent.kt | 2 +- .../phone/PhoneNumberValidator.kt | 4 +-- .../phone/RegistrationPhoneEffect.kt | 8 ++--- .../phone/RegistrationPhoneEvent.kt | 14 ++++---- .../RegistrationPhoneValidationResult.kt | 6 ++-- .../loggedout/LoggedOutOfDeviceEffect.kt | 2 +- .../register/RegistrationLoadingEffect.kt | 2 +- .../register/RegistrationLoadingEvent.kt | 2 +- .../RemoveOverdueEffect.kt | 4 +-- .../RemoveOverdueEvent.kt | 8 ++--- .../simple/clinic/scanid/EnteredCodeInput.kt | 6 ++-- .../org/simple/clinic/scanid/OpenedFrom.kt | 8 ++--- .../simple/clinic/scanid/ScanErrorState.kt | 4 +-- .../simple/clinic/scanid/ScanSearchState.kt | 4 +-- .../clinic/scanid/ScanSimpleIdEffect.kt | 6 ++-- .../simple/clinic/scanid/ScanSimpleIdEvent.kt | 8 ++--- .../scannedqrcode/BlankScannedQRCodeResult.kt | 4 +-- .../scannedqrcode/ScannedQrCodeEvent.kt | 6 ++-- .../ScheduleAppointmentEffect.kt | 6 ++-- .../ScheduleAppointmentEvent.kt | 16 ++++----- .../ScheduleAppointmentSheet.kt | 4 +-- .../clinic/security/pin/PinEntryEffect.kt | 20 +++++------ .../clinic/security/pin/PinEntryEvent.kt | 2 +- .../simple/clinic/security/pin/PinEntryUi.kt | 4 +-- .../pin/verification/PinVerificationMethod.kt | 4 +-- .../selectcountry/ManifestFetchError.kt | 6 ++-- .../selectcountry/SelectCountryEffect.kt | 4 +-- .../selectcountry/SelectCountryEvent.kt | 4 +-- .../clinic/selectstate/SelectStateEffect.kt | 6 ++-- .../clinic/selectstate/SelectStateEvent.kt | 4 +-- .../clinic/selectstate/StatesFetchError.kt | 6 ++-- .../org/simple/clinic/settings/Language.kt | 2 +- .../simple/clinic/settings/SettingsEffect.kt | 20 +++++------ .../simple/clinic/settings/SettingsEvent.kt | 8 ++--- .../changelanguage/ChangeLanguageEffect.kt | 10 +++--- .../changelanguage/ChangeLanguageEvent.kt | 4 +-- .../clinic/setup/SetupActivityEffect.kt | 22 ++++++------ .../simple/clinic/setup/SetupActivityEvent.kt | 10 +++--- .../clinic/setup/runcheck/AllowedToRun.kt | 2 +- .../clinic/signature/SignatureEffect.kt | 6 ++-- .../simple/clinic/signature/SignatureEvent.kt | 4 +-- .../simple/clinic/summary/OpenIntention.kt | 4 +-- .../clinic/summary/PatientSummaryEffect.kt | 22 ++++++------ .../clinic/summary/PatientSummaryEvent.kt | 16 ++++----- .../summary/addphone/AddPhoneNumberEffect.kt | 2 +- .../summary/addphone/AddPhoneNumberEvent.kt | 2 +- .../AssignedFacilityEffect.kt | 2 +- .../assignedfacility/AssignedFacilityEvent.kt | 2 +- .../BloodPressureSummaryViewEffect.kt | 2 +- .../BloodPressureSummaryViewEvent.kt | 4 +-- .../bloodsugar/BloodSugarSummaryViewEffect.kt | 2 +- .../bloodsugar/BloodSugarSummaryViewEvent.kt | 4 +-- .../summary/linkId/LinkIdWithPatientEffect.kt | 4 +-- .../summary/linkId/LinkIdWithPatientEvent.kt | 6 ++-- .../MedicalHistorySummaryEffect.kt | 2 +- .../nextappointment/NextAppointmentEvent.kt | 2 +- .../prescribeddrugs/DrugSummaryEffect.kt | 2 +- .../contactdoctor/ContactDoctorEffect.kt | 2 +- .../status/TeleconsultStatusEffect.kt | 2 +- .../status/TeleconsultStatusEvent.kt | 4 +-- .../updatephone/UpdatePhoneNumberEffect.kt | 4 +-- .../updatephone/UpdatePhoneNumberEvent.kt | 6 ++-- .../sync/indicator/SyncIndicatorEffect.kt | 8 ++--- .../sync/indicator/SyncIndicatorEvent.kt | 2 +- .../sync/indicator/SyncIndicatorState.kt | 6 ++-- .../drugduration/DrugDurationEvent.kt | 2 +- .../DrugDurationValidationResult.kt | 4 +-- .../medicinefrequency/MedicineFrequency.kt | 8 ++--- .../MedicineFrequencyEvent.kt | 2 +- .../TeleconsultPrescriptionEffect.kt | 6 ++-- .../TeleconsultPrescriptionEvent.kt | 2 +- .../doctorinfo/TeleconsultDoctorInfoEffect.kt | 10 +++--- .../doctorinfo/TeleconsultDoctorInfoEvent.kt | 4 +-- .../medicines/TeleconsultMedicinesEvent.kt | 2 +- .../TeleconsultSharePrescriptionEffect.kt | 10 +++--- .../TeleconsultSharePrescriptionEvent.kt | 8 ++--- .../success/TeleConsultSuccessEffect.kt | 2 +- .../success/TeleConsultSuccessEvent.kt | 4 +-- .../teleconsultrecord/Answer.kt | 4 +-- .../teleconsultrecord/TeleconsultStatus.kt | 6 ++-- .../teleconsultrecord/TeleconsultationType.kt | 6 ++-- .../screen/TeleconsultRecordEffect.kt | 6 ++-- .../screen/TeleconsultRecordEvent.kt | 4 +-- .../TextInputDatePickerEffect.kt | 4 +-- .../TextInputDatePickerEvent.kt | 4 +-- .../TextInputDatePickerValidator.kt | 6 ++-- .../main/java/org/simple/clinic/user/User.kt | 4 +-- .../org/simple/clinic/user/UserSession.kt | 2 +- .../java/org/simple/clinic/user/UserStatus.kt | 6 ++-- .../clinic/user/finduser/FindUserResult.kt | 6 ++-- .../user/registeruser/RegistrationResult.kt | 6 ++-- .../clinic/user/resetpin/ResetPinResult.kt | 6 ++-- .../clinic/util/RelativeTimestampGenerator.kt | 4 +-- .../UserInputAgeValidator.kt | 6 ++-- .../UserInputDateValidator.kt | 4 +-- .../clinic/util/RequestPermissionsTest.kt | 4 +-- .../clinic/util/RuntimeNetworkStatusTest.kt | 4 +-- .../clinic/util/SafeEnumTypeAdapterTest.kt | 4 +-- .../006-forward-compatibility-for-enums.md | 4 +-- doc/arch/011-screen-navigation-v2.md | 2 +- doc/mobius/implementing-a-new-screen.md | 12 +++---- .../simple/mobius/migration/fix/Counter.kt | 6 ++-- .../mobius/migration/fix/EventsViaEffects.kt | 8 ++--- 232 files changed, 699 insertions(+), 699 deletions(-) diff --git a/app/src/main/java/org/simple/clinic/ContactType.kt b/app/src/main/java/org/simple/clinic/ContactType.kt index df4e362a251..08f903f40f3 100644 --- a/app/src/main/java/org/simple/clinic/ContactType.kt +++ b/app/src/main/java/org/simple/clinic/ContactType.kt @@ -9,10 +9,10 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class ContactType : Parcelable { @Parcelize - object WhatsApp : ContactType() + data object WhatsApp : ContactType() @Parcelize - object Telegram : ContactType() + data object Telegram : ContactType() @Parcelize data class Unknown(val actualValue: String) : ContactType() diff --git a/app/src/main/java/org/simple/clinic/appupdate/AppUpdateState.kt b/app/src/main/java/org/simple/clinic/appupdate/AppUpdateState.kt index 301c7e35197..c6dfaf1e00e 100644 --- a/app/src/main/java/org/simple/clinic/appupdate/AppUpdateState.kt +++ b/app/src/main/java/org/simple/clinic/appupdate/AppUpdateState.kt @@ -15,5 +15,5 @@ sealed class AppUpdateState : Parcelable { data class AppUpdateStateError(val exception: Throwable) : AppUpdateState() @Parcelize - object DontShowAppUpdate : AppUpdateState() + data object DontShowAppUpdate : AppUpdateState() } diff --git a/app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEffect.kt b/app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEffect.kt index 287aaa86e5f..03555c4223e 100644 --- a/app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEffect.kt +++ b/app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEffect.kt @@ -2,12 +2,12 @@ package org.simple.clinic.appupdate.criticalupdatedialog sealed class CriticalAppUpdateEffect -object LoadAppUpdateHelpContact : CriticalAppUpdateEffect() +data object LoadAppUpdateHelpContact : CriticalAppUpdateEffect() sealed class CriticalAppUpdateViewEffect : CriticalAppUpdateEffect() data class OpenHelpContactUrl(val contactUrl: String) : CriticalAppUpdateViewEffect() -object OpenSimpleInGooglePlay : CriticalAppUpdateViewEffect() +data object OpenSimpleInGooglePlay : CriticalAppUpdateViewEffect() -object LoadAppStaleness : CriticalAppUpdateEffect() +data object LoadAppStaleness : CriticalAppUpdateEffect() diff --git a/app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEvent.kt b/app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEvent.kt index 94765cfa123..c8e0ad9ad7b 100644 --- a/app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEvent.kt +++ b/app/src/main/java/org/simple/clinic/appupdate/criticalupdatedialog/CriticalAppUpdateEvent.kt @@ -8,11 +8,11 @@ sealed class CriticalAppUpdateEvent : UiEvent data class AppUpdateHelpContactLoaded(val appUpdateHelpContact: Optional) : CriticalAppUpdateEvent() -object ContactHelpClicked : CriticalAppUpdateEvent() { +data object ContactHelpClicked : CriticalAppUpdateEvent() { override val analyticsName: String = "Critical App Update Dialog:Contact Help Clicked" } -object UpdateAppClicked : CriticalAppUpdateEvent() { +data object UpdateAppClicked : CriticalAppUpdateEvent() { override val analyticsName: String = "Critical App Update Dialog:Update App Clicked" } diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurementType.kt b/app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurementType.kt index 148d4c6e1ca..47304d6e1b6 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurementType.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/BloodSugarMeasurementType.kt @@ -46,16 +46,16 @@ sealed class BloodSugarMeasurementType : Parcelable { } @Parcelize -object Random : BloodSugarMeasurementType() +data object Random : BloodSugarMeasurementType() @Parcelize -object PostPrandial : BloodSugarMeasurementType() +data object PostPrandial : BloodSugarMeasurementType() @Parcelize -object Fasting : BloodSugarMeasurementType() +data object Fasting : BloodSugarMeasurementType() @Parcelize -object HbA1c : BloodSugarMeasurementType() +data object HbA1c : BloodSugarMeasurementType() @Parcelize data class Unknown(val actualValue: String) : BloodSugarMeasurementType() diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEffect.kt b/app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEffect.kt index f384ef59832..cdffd02d0a2 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEffect.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEffect.kt @@ -20,7 +20,7 @@ sealed class PrefillDate : BloodSugarEntryEffect() { } } - object PrefillCurrentDate : PrefillDate() + data object PrefillCurrentDate : PrefillDate() data class PrefillSpecificDate(val date: Instant) : PrefillDate() } @@ -47,21 +47,21 @@ data class UpdateBloodSugarEntry( data class FetchBloodSugarMeasurement(val bloodSugarMeasurementUuid: UUID) : BloodSugarEntryEffect() -object LoadBloodSugarUnitPreference : BloodSugarEntryEffect() +data object LoadBloodSugarUnitPreference : BloodSugarEntryEffect() sealed class BloodSugarEntryViewEffect : BloodSugarEntryEffect() data class SetBloodSugarReading(val bloodSugarReading: String) : BloodSugarEntryViewEffect() -object HideBloodSugarErrorMessage : BloodSugarEntryViewEffect() +data object HideBloodSugarErrorMessage : BloodSugarEntryViewEffect() -object HideDateErrorMessage : BloodSugarEntryViewEffect() +data object HideDateErrorMessage : BloodSugarEntryViewEffect() -object Dismiss : BloodSugarEntryViewEffect() +data object Dismiss : BloodSugarEntryViewEffect() -object ShowDateEntryScreen : BloodSugarEntryViewEffect() +data object ShowDateEntryScreen : BloodSugarEntryViewEffect() -object SetBloodSugarSavedResultAndFinish : BloodSugarEntryViewEffect() +data object SetBloodSugarSavedResultAndFinish : BloodSugarEntryViewEffect() data class ShowConfirmRemoveBloodSugarDialog(val bloodSugarMeasurementUuid: UUID) : BloodSugarEntryViewEffect() diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEvent.kt b/app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEvent.kt index 9b6d3aa7bb0..5b3b4cb9ee0 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEvent.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/entry/BloodSugarEntryEvent.kt @@ -37,22 +37,22 @@ data class BloodSugarSaved(val wasDateChanged: Boolean) : BloodSugarEntryEvent() data class DatePrefilled(val prefilledDate: LocalDate) : BloodSugarEntryEvent() -object BackPressed : BloodSugarEntryEvent() +data object BackPressed : BloodSugarEntryEvent() -object ChangeDateClicked : BloodSugarEntryEvent() +data object ChangeDateClicked : BloodSugarEntryEvent() -object ShowBloodSugarEntryClicked : BloodSugarEntryEvent() +data object ShowBloodSugarEntryClicked : BloodSugarEntryEvent() -object SaveClicked : BloodSugarEntryEvent() { +data object SaveClicked : BloodSugarEntryEvent() { override val analyticsName: String = "Blood Sugar Entry:Save Clicked" } data class BloodSugarMeasurementFetched(val bloodSugarMeasurement: BloodSugarMeasurement) : BloodSugarEntryEvent() -object RemoveBloodSugarClicked : BloodSugarEntryEvent() { +data object RemoveBloodSugarClicked : BloodSugarEntryEvent() { override val analyticsName: String = "Blood Sugar Entry: Remove clicked" } data class BloodSugarUnitPreferenceLoaded(val bloodSugarUnitPreference: BloodSugarUnitPreference) : BloodSugarEntryEvent() -object BloodSugarReadingUnitButtonClicked : BloodSugarEntryEvent() +data object BloodSugarReadingUnitButtonClicked : BloodSugarEntryEvent() diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/entry/ValidationResult.kt b/app/src/main/java/org/simple/clinic/bloodsugar/entry/ValidationResult.kt index 6e0dc2c7182..2fdd9455014 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/entry/ValidationResult.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/entry/ValidationResult.kt @@ -5,7 +5,7 @@ import org.simple.clinic.bloodsugar.BloodSugarMeasurementType sealed class ValidationResult { data class Valid(val bloodSugarReading: Float) : ValidationResult() - object ErrorBloodSugarEmpty : ValidationResult() + data object ErrorBloodSugarEmpty : ValidationResult() data class ErrorBloodSugarTooHigh(val measurementType: BloodSugarMeasurementType) : ValidationResult() data class ErrorBloodSugarTooLow(val measurementType: BloodSugarMeasurementType) : ValidationResult() } diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarEffect.kt b/app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarEffect.kt index 506d0d1e820..80ac8fffee1 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarEffect.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarEffect.kt @@ -6,4 +6,4 @@ sealed class ConfirmRemoveBloodSugarEffect data class MarkBloodSugarAsDeleted(val bloodSugarMeasurementUuid: UUID) : ConfirmRemoveBloodSugarEffect() -object CloseConfirmRemoveBloodSugarDialog : ConfirmRemoveBloodSugarEffect() +data object CloseConfirmRemoveBloodSugarDialog : ConfirmRemoveBloodSugarEffect() diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarEvent.kt b/app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarEvent.kt index 5d59c80339a..38d281c95b2 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarEvent.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/entry/confirmremovebloodsugar/ConfirmRemoveBloodSugarEvent.kt @@ -4,6 +4,6 @@ import org.simple.clinic.widgets.UiEvent sealed class ConfirmRemoveBloodSugarEvent : UiEvent -object BloodSugarMarkedAsDeleted : ConfirmRemoveBloodSugarEvent() +data object BloodSugarMarkedAsDeleted : ConfirmRemoveBloodSugarEvent() -object RemoveBloodSugarClicked : ConfirmRemoveBloodSugarEvent() +data object RemoveBloodSugarClicked : ConfirmRemoveBloodSugarEvent() diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenEvent.kt b/app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenEvent.kt index b87f722adad..9ef5257105d 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenEvent.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/history/BloodSugarHistoryScreenEvent.kt @@ -9,7 +9,7 @@ sealed class BloodSugarHistoryScreenEvent : UiEvent data class PatientLoaded(val patient: Patient) : BloodSugarHistoryScreenEvent() -object AddNewBloodSugarClicked : BloodSugarHistoryScreenEvent() { +data object AddNewBloodSugarClicked : BloodSugarHistoryScreenEvent() { override val analyticsName: String = "Blood Sugar History:Add New Blood Sugar" } diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt b/app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt index 6aea225bbb3..b35f84b8bd3 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/BloodSugarHistoryListItem.kt @@ -19,7 +19,7 @@ import org.simple.clinic.widgets.visibleOrGone sealed class BloodSugarHistoryListItem : PagingItemAdapter_old.Item { - object NewBloodSugarButton : BloodSugarHistoryListItem() { + data object NewBloodSugarButton : BloodSugarHistoryListItem() { override fun layoutResId(): Int = R.layout.list_new_blood_sugar_button override fun render(holder: BindingViewHolder, subject: Subject) { diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/Event.kt b/app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/Event.kt index c576e5142e6..99527a369f5 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/Event.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/history/adapter/Event.kt @@ -4,6 +4,6 @@ import org.simple.clinic.bloodsugar.BloodSugarMeasurement sealed class Event -object NewBloodSugarClicked : Event() +data object NewBloodSugarClicked : Event() data class BloodSugarHistoryItemClicked(val measurement: BloodSugarMeasurement) : Event() diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/unitselection/BloodSugarUnitSelectionEffect.kt b/app/src/main/java/org/simple/clinic/bloodsugar/unitselection/BloodSugarUnitSelectionEffect.kt index 77f9636939a..445126c6336 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/unitselection/BloodSugarUnitSelectionEffect.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/unitselection/BloodSugarUnitSelectionEffect.kt @@ -8,6 +8,6 @@ data class SaveBloodSugarUnitSelection(val bloodSugarUnitSelection: BloodSugarUn sealed class BloodSugarUnitSelectionViewEffect : BloodSugarUnitSelectionEffect() -object CloseDialog : BloodSugarUnitSelectionViewEffect() +data object CloseDialog : BloodSugarUnitSelectionViewEffect() data class PreFillBloodSugarUnitSelected(val bloodSugarUnitPreference: BloodSugarUnitPreference) : BloodSugarUnitSelectionViewEffect() diff --git a/app/src/main/java/org/simple/clinic/bloodsugar/unitselection/BloodSugarUnitSelectionEvent.kt b/app/src/main/java/org/simple/clinic/bloodsugar/unitselection/BloodSugarUnitSelectionEvent.kt index b54f2fb7c2d..d6f3a7cacb3 100644 --- a/app/src/main/java/org/simple/clinic/bloodsugar/unitselection/BloodSugarUnitSelectionEvent.kt +++ b/app/src/main/java/org/simple/clinic/bloodsugar/unitselection/BloodSugarUnitSelectionEvent.kt @@ -4,7 +4,7 @@ import org.simple.clinic.bloodsugar.BloodSugarUnitPreference sealed class BloodSugarUnitSelectionEvent -object BloodSugarUnitSelectionUpdated : BloodSugarUnitSelectionEvent() +data object BloodSugarUnitSelectionUpdated : BloodSugarUnitSelectionEvent() data class DoneClicked(val bloodSugarUnitSelection: BloodSugarUnitPreference) : BloodSugarUnitSelectionEvent() diff --git a/app/src/main/java/org/simple/clinic/bp/ValidationResult.kt b/app/src/main/java/org/simple/clinic/bp/ValidationResult.kt index d5a1385dfb1..7cd6bbbd46e 100644 --- a/app/src/main/java/org/simple/clinic/bp/ValidationResult.kt +++ b/app/src/main/java/org/simple/clinic/bp/ValidationResult.kt @@ -3,11 +3,11 @@ package org.simple.clinic.bp sealed class ValidationResult { data class Valid(val reading: BloodPressureReading) : ValidationResult() - object ErrorSystolicEmpty : ValidationResult() - object ErrorDiastolicEmpty : ValidationResult() - object ErrorSystolicTooHigh : ValidationResult() - object ErrorSystolicTooLow : ValidationResult() - object ErrorDiastolicTooHigh : ValidationResult() - object ErrorDiastolicTooLow : ValidationResult() - object ErrorSystolicLessThanDiastolic : ValidationResult() + data object ErrorSystolicEmpty : ValidationResult() + data object ErrorDiastolicEmpty : ValidationResult() + data object ErrorSystolicTooHigh : ValidationResult() + data object ErrorSystolicTooLow : ValidationResult() + data object ErrorDiastolicTooHigh : ValidationResult() + data object ErrorDiastolicTooLow : ValidationResult() + data object ErrorSystolicLessThanDiastolic : ValidationResult() } diff --git a/app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEffect.kt b/app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEffect.kt index a028aef94c7..8ab46bd8d6d 100644 --- a/app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEffect.kt +++ b/app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEffect.kt @@ -20,16 +20,16 @@ sealed class PrefillDate : BloodPressureEntryEffect() { } } - object PrefillCurrentDate : PrefillDate() + data object PrefillCurrentDate : PrefillDate() data class PrefillSpecificDate(val date: Instant) : PrefillDate() } -object HideBpErrorMessage : BloodPressureEntryEffect() +data object HideBpErrorMessage : BloodPressureEntryEffect() -object ChangeFocusToDiastolic : BloodPressureEntryEffect() +data object ChangeFocusToDiastolic : BloodPressureEntryEffect() -object ChangeFocusToSystolic : BloodPressureEntryEffect() +data object ChangeFocusToSystolic : BloodPressureEntryEffect() data class SetSystolic(val systolic: String) : BloodPressureEntryEffect() @@ -39,13 +39,13 @@ data class SetDiastolic(val diastolic: String) : BloodPressureEntryEffect() data class ShowConfirmRemoveBloodPressureDialog(val bpUuid: UUID) : BloodPressureEntryEffect() -object Dismiss : BloodPressureEntryEffect() +data object Dismiss : BloodPressureEntryEffect() -object HideDateErrorMessage : BloodPressureEntryEffect() +data object HideDateErrorMessage : BloodPressureEntryEffect() data class ShowBpValidationError(val result: ValidationResult) : BloodPressureEntryEffect() -object ShowDateEntryScreen : BloodPressureEntryEffect() +data object ShowDateEntryScreen : BloodPressureEntryEffect() data class ShowBpEntryScreen(val date: LocalDate) : BloodPressureEntryEffect() @@ -62,7 +62,7 @@ data class CreateNewBpEntry( get() = userEnteredDate != prefilledDate } -object SetBpSavedResultAndFinish : BloodPressureEntryEffect() +data object SetBpSavedResultAndFinish : BloodPressureEntryEffect() data class UpdateBpEntry( val bpUuid: UUID, diff --git a/app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEvent.kt b/app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEvent.kt index f359a4da985..a91500a2834 100644 --- a/app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEvent.kt +++ b/app/src/main/java/org/simple/clinic/bp/entry/BloodPressureEntryEvent.kt @@ -15,15 +15,15 @@ data class DiastolicChanged(val diastolic: String) : BloodPressureEntryEvent() { override val analyticsName = "Blood Pressure Entry:Diastolic Text Changed" } -object SaveClicked : BloodPressureEntryEvent() { +data object SaveClicked : BloodPressureEntryEvent() { override val analyticsName = "Blood Pressure Entry:Save Clicked" } -object RemoveBloodPressureClicked : BloodPressureEntryEvent() { +data object RemoveBloodPressureClicked : BloodPressureEntryEvent() { override val analyticsName = "Blood Pressure Entry:Remove Clicked" } -object DiastolicBackspaceClicked : BloodPressureEntryEvent() +data object DiastolicBackspaceClicked : BloodPressureEntryEvent() data class ScreenChanged(val type: ScreenType) : BloodPressureEntryEvent() @@ -40,15 +40,15 @@ data class BloodPressureSaved(val wasDateChanged: Boolean) : BloodPressureEntryE } } -object ChangeDateClicked : BloodPressureEntryEvent() { +data object ChangeDateClicked : BloodPressureEntryEvent() { override val analyticsName = "Blood Pressure Entry:Next Arrow Clicked" } -object ShowBpClicked : BloodPressureEntryEvent() { +data object ShowBpClicked : BloodPressureEntryEvent() { override val analyticsName = "Blood Pressure Entry:Previous Arrow Clicked" } -object BackPressed : BloodPressureEntryEvent() { +data object BackPressed : BloodPressureEntryEvent() { override val analyticsName = "Blood Pressure Entry:Hardware Back Pressed" } diff --git a/app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureEffect.kt b/app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureEffect.kt index 5798d79d632..b3c39a88d53 100644 --- a/app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureEffect.kt +++ b/app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureEffect.kt @@ -4,6 +4,6 @@ import java.util.UUID sealed class ConfirmRemoveBloodPressureEffect -object CloseDialog : ConfirmRemoveBloodPressureEffect() +data object CloseDialog : ConfirmRemoveBloodPressureEffect() data class DeleteBloodPressure(val bloodPressureMeasurementUuid: UUID) : ConfirmRemoveBloodPressureEffect() diff --git a/app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureEvent.kt b/app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureEvent.kt index 768ee1a1fba..00b25fcf6c0 100644 --- a/app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureEvent.kt +++ b/app/src/main/java/org/simple/clinic/bp/entry/confirmremovebloodpressure/ConfirmRemoveBloodPressureEvent.kt @@ -4,8 +4,8 @@ import org.simple.clinic.widgets.UiEvent sealed class ConfirmRemoveBloodPressureEvent : UiEvent -object BloodPressureDeleted : ConfirmRemoveBloodPressureEvent() +data object BloodPressureDeleted : ConfirmRemoveBloodPressureEvent() -object ConfirmRemoveBloodPressureDialogRemoveClicked : ConfirmRemoveBloodPressureEvent() { +data object ConfirmRemoveBloodPressureDialogRemoveClicked : ConfirmRemoveBloodPressureEvent() { override val analyticsName = "Confirm Remove Blood Pressure:Remove Clicked" } diff --git a/app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreenEvent.kt b/app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreenEvent.kt index d3fe570b15f..ee128a27cbd 100644 --- a/app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreenEvent.kt +++ b/app/src/main/java/org/simple/clinic/bp/history/BloodPressureHistoryScreenEvent.kt @@ -9,7 +9,7 @@ sealed class BloodPressureHistoryScreenEvent : UiEvent data class PatientLoaded(val patient: Patient) : BloodPressureHistoryScreenEvent() -object NewBloodPressureClicked : BloodPressureHistoryScreenEvent() +data object NewBloodPressureClicked : BloodPressureHistoryScreenEvent() data class BloodPressureClicked(val bloodPressureMeasurement: BloodPressureMeasurement) : BloodPressureHistoryScreenEvent() diff --git a/app/src/main/java/org/simple/clinic/bp/history/adapter/BloodPressureHistoryListItem.kt b/app/src/main/java/org/simple/clinic/bp/history/adapter/BloodPressureHistoryListItem.kt index 4ec546ec20f..a758de502e5 100644 --- a/app/src/main/java/org/simple/clinic/bp/history/adapter/BloodPressureHistoryListItem.kt +++ b/app/src/main/java/org/simple/clinic/bp/history/adapter/BloodPressureHistoryListItem.kt @@ -18,7 +18,7 @@ import org.simple.clinic.widgets.visibleOrGone sealed class BloodPressureHistoryListItem : PagingItemAdapter_old.Item { - object NewBpButton : BloodPressureHistoryListItem() { + data object NewBpButton : BloodPressureHistoryListItem() { override fun layoutResId(): Int = R.layout.list_new_bp_button diff --git a/app/src/main/java/org/simple/clinic/bp/history/adapter/Event.kt b/app/src/main/java/org/simple/clinic/bp/history/adapter/Event.kt index bb91632793c..8caf7703a3d 100644 --- a/app/src/main/java/org/simple/clinic/bp/history/adapter/Event.kt +++ b/app/src/main/java/org/simple/clinic/bp/history/adapter/Event.kt @@ -3,6 +3,6 @@ package org.simple.clinic.bp.history.adapter import org.simple.clinic.bp.BloodPressureMeasurement sealed class Event { - object AddNewBpClicked : Event() + data object AddNewBpClicked : Event() data class BloodPressureHistoryItemClicked(val measurement: BloodPressureMeasurement) : Event() } diff --git a/app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEffect.kt b/app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEffect.kt index fbe989ea8eb..717ba5df827 100644 --- a/app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEffect.kt +++ b/app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEffect.kt @@ -10,7 +10,7 @@ data class LoadContactPatientProfile(val patientUuid: UUID) : ContactPatientEffe data class LoadLatestOverdueAppointment(val patientUuid: UUID) : ContactPatientEffect() -object LoadCurrentFacility : ContactPatientEffect() +data object LoadCurrentFacility : ContactPatientEffect() data class MarkPatientAsAgreedToVisit(val appointment: Appointment) : ContactPatientEffect() @@ -37,7 +37,7 @@ data class MaskedCallWithManualDialer( val proxyPhoneNumber: String ) : ContactPatientViewEffect() -object CloseScreen : ContactPatientViewEffect() +data object CloseScreen : ContactPatientViewEffect() data class ShowManualDatePicker( val preselectedDate: LocalDate, diff --git a/app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEvent.kt b/app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEvent.kt index 2dd8c483f63..62b46f33b5f 100644 --- a/app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEvent.kt +++ b/app/src/main/java/org/simple/clinic/contactpatient/ContactPatientEvent.kt @@ -42,17 +42,17 @@ data class SecureCallClicked( override val analyticsName: String = "Contact Patient:Secure Call Clicked" } -object PatientMarkedAsAgreedToVisit : ContactPatientEvent() +data object PatientMarkedAsAgreedToVisit : ContactPatientEvent() -object PatientAgreedToVisitClicked : ContactPatientEvent() { +data object PatientAgreedToVisitClicked : ContactPatientEvent() { override val analyticsName: String = "Contact Patient:Agreed to visit clicked" } -object NextReminderDateClicked : ContactPatientEvent() { +data object NextReminderDateClicked : ContactPatientEvent() { override val analyticsName: String = "Contact Patient:Next appointment date clicked" } -object PreviousReminderDateClicked : ContactPatientEvent() { +data object PreviousReminderDateClicked : ContactPatientEvent() { override val analyticsName: String = "Contact Patient:Previous appointment date clicked" } @@ -63,22 +63,22 @@ data class ManualDateSelected( override val analyticsName: String = "Contact Patient:Manual date selected" } -object AppointmentDateClicked : ContactPatientEvent() { +data object AppointmentDateClicked : ContactPatientEvent() { override val analyticsName: String = "Contact Patient:Appointment date clicked" } -object ReminderSetForAppointment : ContactPatientEvent() +data object ReminderSetForAppointment : ContactPatientEvent() -object SaveAppointmentReminderClicked : ContactPatientEvent() { +data object SaveAppointmentReminderClicked : ContactPatientEvent() { override val analyticsName: String = "Contact Patient:Save appointment reminder clicked" } -object RemindToCallLaterClicked : ContactPatientEvent() { +data object RemindToCallLaterClicked : ContactPatientEvent() { override val analyticsName: String = "Contact Patient:Remind to call later clicked" } -object BackClicked : ContactPatientEvent() +data object BackClicked : ContactPatientEvent() -object RemoveFromOverdueListClicked : ContactPatientEvent() +data object RemoveFromOverdueListClicked : ContactPatientEvent() data class CallResultForAppointmentLoaded(val callResult: Optional) : ContactPatientEvent() diff --git a/app/src/main/java/org/simple/clinic/deeplink/DeepLinkEffect.kt b/app/src/main/java/org/simple/clinic/deeplink/DeepLinkEffect.kt index ac1a1b0ce22..12b85fce333 100644 --- a/app/src/main/java/org/simple/clinic/deeplink/DeepLinkEffect.kt +++ b/app/src/main/java/org/simple/clinic/deeplink/DeepLinkEffect.kt @@ -4,9 +4,9 @@ import java.util.UUID sealed class DeepLinkEffect -object FetchUser : DeepLinkEffect() +data object FetchUser : DeepLinkEffect() -object NavigateToSetupActivity : DeepLinkEffect() +data object NavigateToSetupActivity : DeepLinkEffect() data class FetchPatient(val patientUuid: UUID) : DeepLinkEffect() @@ -17,9 +17,9 @@ data class NavigateToPatientSummaryWithTeleconsultLog( val teleconsultRecordId: UUID ) : DeepLinkEffect() -object ShowPatientDoesNotExist : DeepLinkEffect() +data object ShowPatientDoesNotExist : DeepLinkEffect() // We will show this error when patient uuid is null -object ShowNoPatientUuidError : DeepLinkEffect() +data object ShowNoPatientUuidError : DeepLinkEffect() -object ShowTeleconsultLogNotAllowed : DeepLinkEffect() +data object ShowTeleconsultLogNotAllowed : DeepLinkEffect() diff --git a/app/src/main/java/org/simple/clinic/deeplink/DeepLinkResult.kt b/app/src/main/java/org/simple/clinic/deeplink/DeepLinkResult.kt index 60eef1078a8..7181d164f65 100644 --- a/app/src/main/java/org/simple/clinic/deeplink/DeepLinkResult.kt +++ b/app/src/main/java/org/simple/clinic/deeplink/DeepLinkResult.kt @@ -10,10 +10,10 @@ sealed class DeepLinkResult : Parcelable data class OpenPatientSummary(val patientUuid: UUID) : DeepLinkResult() @Parcelize -object ShowPatientNotFound : DeepLinkResult() +data object ShowPatientNotFound : DeepLinkResult() @Parcelize -object ShowNoPatientUuid : DeepLinkResult() +data object ShowNoPatientUuid : DeepLinkResult() @Parcelize data class OpenPatientSummaryWithTeleconsultLog( @@ -22,4 +22,4 @@ data class OpenPatientSummaryWithTeleconsultLog( ) : DeepLinkResult() @Parcelize -object ShowTeleconsultNotAllowed : DeepLinkResult() +data object ShowTeleconsultNotAllowed : DeepLinkResult() diff --git a/app/src/main/java/org/simple/clinic/drugs/EditMedicinesEffect.kt b/app/src/main/java/org/simple/clinic/drugs/EditMedicinesEffect.kt index 27e2b934826..2668256895b 100644 --- a/app/src/main/java/org/simple/clinic/drugs/EditMedicinesEffect.kt +++ b/app/src/main/java/org/simple/clinic/drugs/EditMedicinesEffect.kt @@ -8,7 +8,7 @@ data class FetchPrescribedAndProtocolDrugs(val patientUuid: UUID) : EditMedicine data class RefillMedicines(val patientUuid: UUID) : EditMedicinesEffect() -object LoadDrugFrequencyChoiceItems : EditMedicinesEffect() +data object LoadDrugFrequencyChoiceItems : EditMedicinesEffect() sealed class EditMedicinesViewEffect : EditMedicinesEffect() @@ -22,4 +22,4 @@ data class OpenDosagePickerSheet( data class ShowUpdateCustomPrescriptionSheet(val prescribedDrug: PrescribedDrug) : EditMedicinesViewEffect() -object GoBackToPatientSummary : EditMedicinesViewEffect() +data object GoBackToPatientSummary : EditMedicinesViewEffect() diff --git a/app/src/main/java/org/simple/clinic/drugs/EditMedicinesEvent.kt b/app/src/main/java/org/simple/clinic/drugs/EditMedicinesEvent.kt index 82ebbf79e33..a3af3157369 100644 --- a/app/src/main/java/org/simple/clinic/drugs/EditMedicinesEvent.kt +++ b/app/src/main/java/org/simple/clinic/drugs/EditMedicinesEvent.kt @@ -7,7 +7,7 @@ import org.simple.clinic.widgets.UiEvent sealed class EditMedicinesEvent : UiEvent -object AddNewPrescriptionClicked : EditMedicinesEvent() { +data object AddNewPrescriptionClicked : EditMedicinesEvent() { override val analyticsName = "Drugs:Protocol:Add Custom Clicked" } @@ -22,18 +22,18 @@ data class CustomPrescriptionClicked(val prescribedDrug: PrescribedDrug) : EditM override val analyticsName = "Drugs:Protocol:Edit CustomPrescription Clicked" } -object PrescribedDrugsDoneClicked : EditMedicinesEvent() { +data object PrescribedDrugsDoneClicked : EditMedicinesEvent() { override val analyticsName = "Drugs:Protocol:Save Clicked" } -object PresribedDrugsRefillClicked : EditMedicinesEvent() +data object PresribedDrugsRefillClicked : EditMedicinesEvent() data class DrugsListFetched( val protocolDrugs: List, val prescribedDrugs: List ) : EditMedicinesEvent() -object PrescribedMedicinesRefilled : EditMedicinesEvent() +data object PrescribedMedicinesRefilled : EditMedicinesEvent() data class DrugFrequencyChoiceItemsLoaded( val drugFrequencyToLabelMap: Map diff --git a/app/src/main/java/org/simple/clinic/drugs/search/Answer.kt b/app/src/main/java/org/simple/clinic/drugs/search/Answer.kt index 4d351cb8e70..868128b5e12 100644 --- a/app/src/main/java/org/simple/clinic/drugs/search/Answer.kt +++ b/app/src/main/java/org/simple/clinic/drugs/search/Answer.kt @@ -11,13 +11,13 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class Answer : Parcelable { @Parcelize - object Yes : Answer() + data object Yes : Answer() @Parcelize - object No : Answer() + data object No : Answer() @Parcelize - object Unanswered : Answer() + data object Unanswered : Answer() @Parcelize data class Unknown(val actualValue: String) : Answer() diff --git a/app/src/main/java/org/simple/clinic/drugs/search/DrugCategory.kt b/app/src/main/java/org/simple/clinic/drugs/search/DrugCategory.kt index 3c69e000681..fce45113a76 100644 --- a/app/src/main/java/org/simple/clinic/drugs/search/DrugCategory.kt +++ b/app/src/main/java/org/simple/clinic/drugs/search/DrugCategory.kt @@ -10,20 +10,20 @@ sealed class DrugCategory { sealed class Hypertension : DrugCategory() { - object CCB : Hypertension() + data object CCB : Hypertension() - object ARB : Hypertension() + data object ARB : Hypertension() - object ACE : Hypertension() + data object ACE : Hypertension() - object Diuretic : Hypertension() + data object Diuretic : Hypertension() - object Other : Hypertension() + data object Other : Hypertension() } - object Diabetes : DrugCategory() + data object Diabetes : DrugCategory() - object Other : DrugCategory() + data object Other : DrugCategory() data class Unknown(val actualValue: String) : DrugCategory() diff --git a/app/src/main/java/org/simple/clinic/drugs/search/DrugFrequency.kt b/app/src/main/java/org/simple/clinic/drugs/search/DrugFrequency.kt index ce6b6474229..0b028d1e282 100644 --- a/app/src/main/java/org/simple/clinic/drugs/search/DrugFrequency.kt +++ b/app/src/main/java/org/simple/clinic/drugs/search/DrugFrequency.kt @@ -11,22 +11,22 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class DrugFrequency : Parcelable { @Parcelize - object OD : DrugFrequency() { + data object OD : DrugFrequency() { override fun toString() = "OD" } @Parcelize - object BD : DrugFrequency() { + data object BD : DrugFrequency() { override fun toString() = "BD" } @Parcelize - object TDS : DrugFrequency() { + data object TDS : DrugFrequency() { override fun toString() = "TDS" } @Parcelize - object QDS : DrugFrequency() { + data object QDS : DrugFrequency() { override fun toString() = "QDS" } diff --git a/app/src/main/java/org/simple/clinic/drugs/search/DrugSearchListItem.kt b/app/src/main/java/org/simple/clinic/drugs/search/DrugSearchListItem.kt index 4556af4d7d6..016d44507d8 100644 --- a/app/src/main/java/org/simple/clinic/drugs/search/DrugSearchListItem.kt +++ b/app/src/main/java/org/simple/clinic/drugs/search/DrugSearchListItem.kt @@ -87,7 +87,7 @@ sealed class DrugSearchListItem : PagingItemAdapter.Item { } } - object Divider : DrugSearchListItem() { + data object Divider : DrugSearchListItem() { override fun layoutResId() = R.layout.list_item_drug_search_divider @@ -112,7 +112,7 @@ sealed class DrugSearchListItem : PagingItemAdapter.Item { } } - object TopCornerCapItem : DrugSearchListItem() { + data object TopCornerCapItem : DrugSearchListItem() { override fun layoutResId() = R.layout.list_item_drug_search_corner_cap @@ -126,7 +126,7 @@ sealed class DrugSearchListItem : PagingItemAdapter.Item { } } - object BottomCornerCapItem : DrugSearchListItem() { + data object BottomCornerCapItem : DrugSearchListItem() { override fun layoutResId() = R.layout.list_item_drug_search_corner_cap diff --git a/app/src/main/java/org/simple/clinic/drugs/selection/DrugListItem.kt b/app/src/main/java/org/simple/clinic/drugs/selection/DrugListItem.kt index fdd2b0dbc54..460200d6a7c 100644 --- a/app/src/main/java/org/simple/clinic/drugs/selection/DrugListItem.kt +++ b/app/src/main/java/org/simple/clinic/drugs/selection/DrugListItem.kt @@ -91,7 +91,7 @@ data class CustomPrescribedDrugListItem( } } -object AddNewPrescriptionListItem : DrugListItem() { +data object AddNewPrescriptionListItem : DrugListItem() { override fun layoutResId() = R.layout.list_prescribeddrugs_new_custom_drug @@ -122,5 +122,5 @@ sealed class DrugListItemClicked { data class CustomPrescriptionClicked(val prescribedDrug: PrescribedDrug) : DrugListItemClicked() - object AddNewPrescriptionClicked : DrugListItemClicked() + data object AddNewPrescriptionClicked : DrugListItemClicked() } diff --git a/app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffect.kt b/app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffect.kt index b58a7fc7daf..4fffbf82ed0 100644 --- a/app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffect.kt +++ b/app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEffect.kt @@ -28,7 +28,7 @@ data class FetchDrug(val drugUuid: UUID) : CustomDrugEntryEffect() data class RemoveDrugFromPrescription(val drugUuid: UUID) : CustomDrugEntryEffect() -object LoadDrugFrequencyChoiceItems : CustomDrugEntryEffect() +data object LoadDrugFrequencyChoiceItems : CustomDrugEntryEffect() sealed class CustomDrugEntryViewEffect : CustomDrugEntryEffect() @@ -38,12 +38,12 @@ data class SetDrugFrequency(val frequencyLabel: String) : CustomDrugEntryViewEff data class SetDrugDosage(val dosage: String?) : CustomDrugEntryViewEffect() -object CloseSheetAndGoToEditMedicineScreen : CustomDrugEntryViewEffect() +data object CloseSheetAndGoToEditMedicineScreen : CustomDrugEntryViewEffect() -object HideKeyboard : CustomDrugEntryViewEffect() +data object HideKeyboard : CustomDrugEntryViewEffect() -object ShowKeyboard : CustomDrugEntryViewEffect() +data object ShowKeyboard : CustomDrugEntryViewEffect() -object ClearFocusFromDosageEditText : CustomDrugEntryViewEffect() +data object ClearFocusFromDosageEditText : CustomDrugEntryViewEffect() data class SetCursorPosition(val position: Int) : CustomDrugEntryViewEffect() diff --git a/app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEvent.kt b/app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEvent.kt index 10cf9ebff07..c502613f79f 100644 --- a/app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEvent.kt +++ b/app/src/main/java/org/simple/clinic/drugs/selection/custom/CustomDrugEntryEvent.kt @@ -13,19 +13,19 @@ data class DosageEdited(val dosage: String) : CustomDrugEntryEvent() data class DosageFocusChanged(val hasFocus: Boolean) : CustomDrugEntryEvent() -object EditFrequencyClicked : CustomDrugEntryEvent() +data object EditFrequencyClicked : CustomDrugEntryEvent() data class FrequencyEdited(val frequency: DrugFrequency?) : CustomDrugEntryEvent() data class AddMedicineButtonClicked(val patientUuid: UUID) : CustomDrugEntryEvent() -object CustomDrugSaved : CustomDrugEntryEvent() +data object CustomDrugSaved : CustomDrugEntryEvent() data class PrescribedDrugFetched(val prescription: PrescribedDrug) : CustomDrugEntryEvent() -object ExistingDrugRemoved : CustomDrugEntryEvent() +data object ExistingDrugRemoved : CustomDrugEntryEvent() -object RemoveDrugButtonClicked : CustomDrugEntryEvent() +data object RemoveDrugButtonClicked : CustomDrugEntryEvent() data class DrugFetched(val drug: Drug) : CustomDrugEntryEvent() @@ -33,4 +33,4 @@ data class DrugFrequencyChoiceItemsLoaded( val drugFrequencyToLabelMap: Map ) : CustomDrugEntryEvent() -object ImeActionDoneClicked : CustomDrugEntryEvent() +data object ImeActionDoneClicked : CustomDrugEntryEvent() diff --git a/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosageListItem.kt b/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosageListItem.kt index 11ddb4acfbd..0dd0f818558 100644 --- a/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosageListItem.kt +++ b/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosageListItem.kt @@ -77,7 +77,7 @@ sealed class DosageListItem : ItemAdapter.Item { } sealed class Event { - object NoneClicked : Event() + data object NoneClicked : Event() data class DosageClicked(val protocolDrug: ProtocolDrug) : Event() } } diff --git a/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEffect.kt b/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEffect.kt index fdb178b98f6..2d6013c2a71 100644 --- a/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEffect.kt +++ b/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEffect.kt @@ -9,7 +9,7 @@ data class LoadProtocolDrugsByName(val drugName: String) : DosagePickerEffect() data class DeleteExistingPrescription(val prescriptionUuid: UUID) : DosagePickerEffect() -object CloseScreen : DosagePickerEffect() +data object CloseScreen : DosagePickerEffect() data class CreateNewPrescription( val patientUuid: UUID, diff --git a/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEvent.kt b/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEvent.kt index cb73a4b0b3e..0e656ee0a11 100644 --- a/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEvent.kt +++ b/app/src/main/java/org/simple/clinic/drugs/selection/dosage/DosagePickerEvent.kt @@ -7,18 +7,18 @@ sealed class DosagePickerEvent : UiEvent data class DrugsLoaded(val protocolDrugs: List) : DosagePickerEvent() -object NoneSelected : DosagePickerEvent() { +data object NoneSelected : DosagePickerEvent() { override val analyticsName: String get() = "Protocol Drug Dosage Selection:None Selected" } -object ExistingPrescriptionDeleted : DosagePickerEvent() +data object ExistingPrescriptionDeleted : DosagePickerEvent() data class DosageSelected(val protocolDrug: ProtocolDrug) : DosagePickerEvent() { override val analyticsName: String get() = "Protocol Drug Dosage Selection:Dosage Selected" } -object NewPrescriptionCreated : DosagePickerEvent() +data object NewPrescriptionCreated : DosagePickerEvent() -object ExistingPrescriptionChanged : DosagePickerEvent() +data object ExistingPrescriptionChanged : DosagePickerEvent() diff --git a/app/src/main/java/org/simple/clinic/drugstockreminders/DrugStockReminder.kt b/app/src/main/java/org/simple/clinic/drugstockreminders/DrugStockReminder.kt index 8cabf8abd63..f980525d2f9 100644 --- a/app/src/main/java/org/simple/clinic/drugstockreminders/DrugStockReminder.kt +++ b/app/src/main/java/org/simple/clinic/drugstockreminders/DrugStockReminder.kt @@ -65,7 +65,7 @@ class DrugStockReminder @Inject constructor( sealed class Result { data class Found(val drugStockReminderResponse: DrugStockReminderResponsePayload) : Result() - object NotFound : Result() - object OtherError : Result() + data object NotFound : Result() + data object OtherError : Result() } } diff --git a/app/src/main/java/org/simple/clinic/drugstockreminders/enterdrugstock/EnterDrugStockEffect.kt b/app/src/main/java/org/simple/clinic/drugstockreminders/enterdrugstock/EnterDrugStockEffect.kt index 4392b5891bc..aa0c94739ec 100644 --- a/app/src/main/java/org/simple/clinic/drugstockreminders/enterdrugstock/EnterDrugStockEffect.kt +++ b/app/src/main/java/org/simple/clinic/drugstockreminders/enterdrugstock/EnterDrugStockEffect.kt @@ -2,4 +2,4 @@ package org.simple.clinic.drugstockreminders.enterdrugstock sealed class EnterDrugStockEffect -object LoadDrugStockFormUrl : EnterDrugStockEffect() +data object LoadDrugStockFormUrl : EnterDrugStockEffect() diff --git a/app/src/main/java/org/simple/clinic/editpatient/EditPatientEffect.kt b/app/src/main/java/org/simple/clinic/editpatient/EditPatientEffect.kt index 856005d0e40..cf22fc3bcbf 100644 --- a/app/src/main/java/org/simple/clinic/editpatient/EditPatientEffect.kt +++ b/app/src/main/java/org/simple/clinic/editpatient/EditPatientEffect.kt @@ -19,9 +19,9 @@ data class SavePatientEffect( val saveAlternativeId: BusinessId? ) : EditPatientEffect() -object LoadInputFields : EditPatientEffect() +data object LoadInputFields : EditPatientEffect() -object FetchColonyOrVillagesEffect : EditPatientEffect() +data object FetchColonyOrVillagesEffect : EditPatientEffect() sealed class EditPatientViewEffect : EditPatientEffect() @@ -33,12 +33,12 @@ data class ShowValidationErrorsEffect( val validationErrors: Set ) : EditPatientViewEffect() -object ShowDatePatternInDateOfBirthLabelEffect : EditPatientViewEffect() +data object ShowDatePatternInDateOfBirthLabelEffect : EditPatientViewEffect() -object HideDatePatternInDateOfBirthLabelEffect : EditPatientViewEffect() +data object HideDatePatternInDateOfBirthLabelEffect : EditPatientViewEffect() -object GoBackEffect : EditPatientViewEffect() +data object GoBackEffect : EditPatientViewEffect() -object ShowDiscardChangesAlertEffect : EditPatientViewEffect() +data object ShowDiscardChangesAlertEffect : EditPatientViewEffect() data class OpenSimpleScanIdScreen(val openedFrom: OpenedFrom) : EditPatientViewEffect() diff --git a/app/src/main/java/org/simple/clinic/editpatient/EditPatientEvent.kt b/app/src/main/java/org/simple/clinic/editpatient/EditPatientEvent.kt index 0c949175d14..6a1dac63f0b 100644 --- a/app/src/main/java/org/simple/clinic/editpatient/EditPatientEvent.kt +++ b/app/src/main/java/org/simple/clinic/editpatient/EditPatientEvent.kt @@ -58,15 +58,15 @@ data class StreetAddressChanged(val streetAddress: String) : EditPatientEvent() override val analyticsName = "Edit Patient Entry:Street Address Text Changed" } -object SaveClicked : EditPatientEvent() { +data object SaveClicked : EditPatientEvent() { override val analyticsName = "Edit Patient Entry:Save Clicked" } -object PatientSaved : EditPatientEvent() { +data object PatientSaved : EditPatientEvent() { override val analyticsName = "Edit Patient Entry:Patient Saved" } -object BackClicked : EditPatientEvent() { +data object BackClicked : EditPatientEvent() { override val analyticsName = "Edit Patient Entry:Back Clicked" } diff --git a/app/src/main/java/org/simple/clinic/editpatient/deletepatient/DeletePatientEffect.kt b/app/src/main/java/org/simple/clinic/editpatient/deletepatient/DeletePatientEffect.kt index 410c4d39b90..0ab749e4964 100644 --- a/app/src/main/java/org/simple/clinic/editpatient/deletepatient/DeletePatientEffect.kt +++ b/app/src/main/java/org/simple/clinic/editpatient/deletepatient/DeletePatientEffect.kt @@ -23,4 +23,4 @@ data class ShowConfirmDeleteDialog( data class ShowConfirmDiedDialog(val patientName: String) : DeletePatientViewEffect() -object ShowHomeScreen : DeletePatientViewEffect() +data object ShowHomeScreen : DeletePatientViewEffect() diff --git a/app/src/main/java/org/simple/clinic/editpatient/deletepatient/DeletePatientEvent.kt b/app/src/main/java/org/simple/clinic/editpatient/deletepatient/DeletePatientEvent.kt index 11a9ea077a7..3d5d976dcc5 100644 --- a/app/src/main/java/org/simple/clinic/editpatient/deletepatient/DeletePatientEvent.kt +++ b/app/src/main/java/org/simple/clinic/editpatient/deletepatient/DeletePatientEvent.kt @@ -6,9 +6,9 @@ import org.simple.clinic.widgets.UiEvent sealed class DeletePatientEvent : UiEvent -object PatientDeleted : DeletePatientEvent() +data object PatientDeleted : DeletePatientEvent() -object PatientMarkedAsDead : DeletePatientEvent() +data object PatientMarkedAsDead : DeletePatientEvent() data class PatientDeleteReasonClicked(val patientDeleteReason: PatientDeleteReason) : DeletePatientEvent() @@ -16,4 +16,4 @@ data class PatientLoaded(val patient: Patient) : DeletePatientEvent() data class ConfirmPatientDeleteClicked(val deletedReason: DeletedReason) : DeletePatientEvent() -object ConfirmPatientDiedClicked : DeletePatientEvent() +data object ConfirmPatientDiedClicked : DeletePatientEvent() diff --git a/app/src/main/java/org/simple/clinic/enterotp/AsyncOpError.kt b/app/src/main/java/org/simple/clinic/enterotp/AsyncOpError.kt index 20cfdb38d61..a946d14d078 100644 --- a/app/src/main/java/org/simple/clinic/enterotp/AsyncOpError.kt +++ b/app/src/main/java/org/simple/clinic/enterotp/AsyncOpError.kt @@ -28,10 +28,10 @@ sealed class AsyncOpError : Parcelable { } @Parcelize -object NetworkError : AsyncOpError() +data object NetworkError : AsyncOpError() @Parcelize data class ServerError(val errorMessage: String) : AsyncOpError() @Parcelize -object OtherError : AsyncOpError() +data object OtherError : AsyncOpError() diff --git a/app/src/main/java/org/simple/clinic/enterotp/EnterOtpEffect.kt b/app/src/main/java/org/simple/clinic/enterotp/EnterOtpEffect.kt index 1e252c9acc1..54543c05eea 100644 --- a/app/src/main/java/org/simple/clinic/enterotp/EnterOtpEffect.kt +++ b/app/src/main/java/org/simple/clinic/enterotp/EnterOtpEffect.kt @@ -4,32 +4,32 @@ import org.simple.clinic.login.LoginResult sealed class EnterOtpEffect -object LoadUser : EnterOtpEffect() +data object LoadUser : EnterOtpEffect() -object TriggerSync : EnterOtpEffect() +data object TriggerSync : EnterOtpEffect() -object ClearLoginEntry : EnterOtpEffect() +data object ClearLoginEntry : EnterOtpEffect() data class LoginUser(val otp: String) : EnterOtpEffect() -object ListenForUserBackgroundVerification : EnterOtpEffect() +data object ListenForUserBackgroundVerification : EnterOtpEffect() -object RequestLoginOtp : EnterOtpEffect() +data object RequestLoginOtp : EnterOtpEffect() data class FailedLoginOtpAttempt(val result: LoginResult) : EnterOtpEffect() -object LoadOtpEntryProtectedStates : EnterOtpEffect() +data object LoadOtpEntryProtectedStates : EnterOtpEffect() -object ResetOtpAttemptLimit : EnterOtpEffect() +data object ResetOtpAttemptLimit : EnterOtpEffect() sealed class EnterOtpViewEffect : EnterOtpEffect() -object ClearPin : EnterOtpViewEffect() +data object ClearPin : EnterOtpViewEffect() -object GoBack : EnterOtpViewEffect() +data object GoBack : EnterOtpViewEffect() -object ShowSmsSentMessage : EnterOtpViewEffect() +data object ShowSmsSentMessage : EnterOtpViewEffect() -object ShowNetworkError : EnterOtpViewEffect() +data object ShowNetworkError : EnterOtpViewEffect() -object ShowUnexpectedError : EnterOtpViewEffect() +data object ShowUnexpectedError : EnterOtpViewEffect() diff --git a/app/src/main/java/org/simple/clinic/enterotp/EnterOtpEvent.kt b/app/src/main/java/org/simple/clinic/enterotp/EnterOtpEvent.kt index 64e6dcaa8eb..f176c81175d 100644 --- a/app/src/main/java/org/simple/clinic/enterotp/EnterOtpEvent.kt +++ b/app/src/main/java/org/simple/clinic/enterotp/EnterOtpEvent.kt @@ -16,7 +16,7 @@ data class EnterOtpSubmitted(val otp: String) : EnterOtpEvent() { data class LoginUserCompleted(val result: LoginResult) : EnterOtpEvent() -object UserVerifiedInBackground : EnterOtpEvent() +data object UserVerifiedInBackground : EnterOtpEvent() data class RequestLoginOtpCompleted(val result: ActivateUser.Result) : EnterOtpEvent() diff --git a/app/src/main/java/org/simple/clinic/enterotp/OtpEntryMode.kt b/app/src/main/java/org/simple/clinic/enterotp/OtpEntryMode.kt index c1b6237fed9..b5f362dde45 100644 --- a/app/src/main/java/org/simple/clinic/enterotp/OtpEntryMode.kt +++ b/app/src/main/java/org/simple/clinic/enterotp/OtpEntryMode.kt @@ -7,7 +7,7 @@ import java.time.Instant sealed class OtpEntryMode : Parcelable { @Parcelize - object OtpEntry : OtpEntryMode() + data object OtpEntry : OtpEntryMode() @Parcelize data class BruteForceOtpEntryLocked(val lockUntil: Instant) : OtpEntryMode() diff --git a/app/src/main/java/org/simple/clinic/facility/FacilityPullResult.kt b/app/src/main/java/org/simple/clinic/facility/FacilityPullResult.kt index 47fb3a86edf..954cfdeec32 100644 --- a/app/src/main/java/org/simple/clinic/facility/FacilityPullResult.kt +++ b/app/src/main/java/org/simple/clinic/facility/FacilityPullResult.kt @@ -2,9 +2,9 @@ package org.simple.clinic.facility sealed class FacilityPullResult { - object Success : FacilityPullResult() + data object Success : FacilityPullResult() - object NetworkError : FacilityPullResult() + data object NetworkError : FacilityPullResult() - object UnexpectedError : FacilityPullResult() + data object UnexpectedError : FacilityPullResult() } diff --git a/app/src/main/java/org/simple/clinic/facility/change/FacilityChangeEffect.kt b/app/src/main/java/org/simple/clinic/facility/change/FacilityChangeEffect.kt index cf9fa0cc25e..78c9823ea00 100644 --- a/app/src/main/java/org/simple/clinic/facility/change/FacilityChangeEffect.kt +++ b/app/src/main/java/org/simple/clinic/facility/change/FacilityChangeEffect.kt @@ -4,8 +4,8 @@ import org.simple.clinic.facility.Facility sealed class FacilityChangeEffect -object LoadCurrentFacility : FacilityChangeEffect() +data object LoadCurrentFacility : FacilityChangeEffect() data class OpenConfirmFacilityChangeSheet(val facility: Facility) : FacilityChangeEffect() -object GoBack : FacilityChangeEffect() +data object GoBack : FacilityChangeEffect() diff --git a/app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEffect.kt b/app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEffect.kt index d922ebaa115..db4778ce104 100644 --- a/app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEffect.kt +++ b/app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEffect.kt @@ -6,8 +6,8 @@ sealed class ConfirmFacilityChangeEffect data class ChangeFacilityEffect(val selectedFacility: Facility) : ConfirmFacilityChangeEffect() -object CloseSheet : ConfirmFacilityChangeEffect() +data object CloseSheet : ConfirmFacilityChangeEffect() -object LoadCurrentFacility : ConfirmFacilityChangeEffect() +data object LoadCurrentFacility : ConfirmFacilityChangeEffect() -object TouchFacilitySyncGroupSwitchedAtTime : ConfirmFacilityChangeEffect() +data object TouchFacilitySyncGroupSwitchedAtTime : ConfirmFacilityChangeEffect() diff --git a/app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEvent.kt b/app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEvent.kt index 8b9929fddaf..1ff61fd93a2 100644 --- a/app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEvent.kt +++ b/app/src/main/java/org/simple/clinic/facility/change/confirm/ConfirmFacilityChangeEvent.kt @@ -11,4 +11,4 @@ data class FacilityChanged(val newFacility: Facility) : ConfirmFacilityChangeEve data class CurrentFacilityLoaded(val currentFacility: Facility) : ConfirmFacilityChangeEvent() -object FacilitySyncGroupSwitchedAtTimeTouched : ConfirmFacilityChangeEvent() +data object FacilitySyncGroupSwitchedAtTimeTouched : ConfirmFacilityChangeEvent() diff --git a/app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffect.kt b/app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffect.kt index fd2bb7b8324..4e1d3c03475 100644 --- a/app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffect.kt +++ b/app/src/main/java/org/simple/clinic/forgotpin/confirmpin/ForgotPinConfirmPinEffect.kt @@ -2,9 +2,9 @@ package org.simple.clinic.forgotpin.confirmpin sealed class ForgotPinConfirmPinEffect -object LoadLoggedInUser : ForgotPinConfirmPinEffect() +data object LoadLoggedInUser : ForgotPinConfirmPinEffect() -object LoadCurrentFacility : ForgotPinConfirmPinEffect() +data object LoadCurrentFacility : ForgotPinConfirmPinEffect() data class ValidatePinConfirmation( val previousPin: String, @@ -15,14 +15,14 @@ data class SyncPatientDataAndResetPin(val newPin: String) : ForgotPinConfirmPinE sealed class ForgotPinConfirmPinViewEffect : ForgotPinConfirmPinEffect() -object HideError : ForgotPinConfirmPinViewEffect() +data object HideError : ForgotPinConfirmPinViewEffect() -object ShowMismatchedError : ForgotPinConfirmPinViewEffect() +data object ShowMismatchedError : ForgotPinConfirmPinViewEffect() -object ShowProgress : ForgotPinConfirmPinViewEffect() +data object ShowProgress : ForgotPinConfirmPinViewEffect() -object ShowNetworkError : ForgotPinConfirmPinViewEffect() +data object ShowNetworkError : ForgotPinConfirmPinViewEffect() -object ShowUnexpectedError : ForgotPinConfirmPinViewEffect() +data object ShowUnexpectedError : ForgotPinConfirmPinViewEffect() -object GoToHomeScreen : ForgotPinConfirmPinViewEffect() +data object GoToHomeScreen : ForgotPinConfirmPinViewEffect() diff --git a/app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewEffect.kt b/app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewEffect.kt index c51bf2a5168..43784ba532b 100644 --- a/app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewEffect.kt +++ b/app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewEffect.kt @@ -2,16 +2,16 @@ package org.simple.clinic.forgotpin.createnewpin sealed class ForgotPinCreateNewEffect -object LoadLoggedInUser : ForgotPinCreateNewEffect() +data object LoadLoggedInUser : ForgotPinCreateNewEffect() -object LoadCurrentFacility : ForgotPinCreateNewEffect() +data object LoadCurrentFacility : ForgotPinCreateNewEffect() data class ValidatePin(val pin: String?) : ForgotPinCreateNewEffect() sealed class ForgotPinCreateNewViewEffect : ForgotPinCreateNewEffect() -object ShowInvalidPinError : ForgotPinCreateNewViewEffect() +data object ShowInvalidPinError : ForgotPinCreateNewViewEffect() data class ShowConfirmPinScreen(val pin: String) : ForgotPinCreateNewViewEffect() -object HideInvalidPinError : ForgotPinCreateNewViewEffect() +data object HideInvalidPinError : ForgotPinCreateNewViewEffect() diff --git a/app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewEvent.kt b/app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewEvent.kt index 8bb53c75dea..069d6fb4efc 100644 --- a/app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewEvent.kt +++ b/app/src/main/java/org/simple/clinic/forgotpin/createnewpin/ForgotPinCreateNewEvent.kt @@ -16,7 +16,7 @@ data class ForgotPinCreateNewPinTextChanged(val pin: String) : ForgotPinCreateNe override val analyticsName = "Forgot PIN:Create new PIN:Text Changed" } -object ForgotPinCreateNewPinSubmitClicked : ForgotPinCreateNewEvent() { +data object ForgotPinCreateNewPinSubmitClicked : ForgotPinCreateNewEvent() { override val analyticsName = "Forgot PIN:Create new PIN:Submit Clicked" } diff --git a/app/src/main/java/org/simple/clinic/help/HelpPullResult.kt b/app/src/main/java/org/simple/clinic/help/HelpPullResult.kt index 4d1cc32921d..6c9955a5de8 100644 --- a/app/src/main/java/org/simple/clinic/help/HelpPullResult.kt +++ b/app/src/main/java/org/simple/clinic/help/HelpPullResult.kt @@ -6,11 +6,11 @@ import kotlinx.parcelize.Parcelize sealed class HelpPullResult : Parcelable { @Parcelize - object Success : HelpPullResult() + data object Success : HelpPullResult() @Parcelize - object NetworkError : HelpPullResult() + data object NetworkError : HelpPullResult() @Parcelize - object OtherError : HelpPullResult() + data object OtherError : HelpPullResult() } diff --git a/app/src/main/java/org/simple/clinic/home/HomeScreen.kt b/app/src/main/java/org/simple/clinic/home/HomeScreen.kt index 421d7c032f5..9a3b01338f0 100644 --- a/app/src/main/java/org/simple/clinic/home/HomeScreen.kt +++ b/app/src/main/java/org/simple/clinic/home/HomeScreen.kt @@ -330,6 +330,6 @@ class HomeScreen : sealed class ScreenRequest : Parcelable { @Parcelize - object ChangeCurrentFacility : ScreenRequest() + data object ChangeCurrentFacility : ScreenRequest() } } diff --git a/app/src/main/java/org/simple/clinic/home/HomeScreenEffect.kt b/app/src/main/java/org/simple/clinic/home/HomeScreenEffect.kt index 0c4264cc058..45af0a3088a 100644 --- a/app/src/main/java/org/simple/clinic/home/HomeScreenEffect.kt +++ b/app/src/main/java/org/simple/clinic/home/HomeScreenEffect.kt @@ -2,10 +2,10 @@ package org.simple.clinic.home sealed class HomeScreenEffect -object LoadCurrentFacility : HomeScreenEffect() +data object LoadCurrentFacility : HomeScreenEffect() sealed class HomeScreenViewEffect : HomeScreenEffect() -object OpenFacilitySelection : HomeScreenViewEffect() +data object OpenFacilitySelection : HomeScreenViewEffect() -object ShowNotificationPermissionDenied : HomeScreenViewEffect() +data object ShowNotificationPermissionDenied : HomeScreenViewEffect() diff --git a/app/src/main/java/org/simple/clinic/home/HomeScreenEvent.kt b/app/src/main/java/org/simple/clinic/home/HomeScreenEvent.kt index 23ec03bbfbd..e6599332722 100644 --- a/app/src/main/java/org/simple/clinic/home/HomeScreenEvent.kt +++ b/app/src/main/java/org/simple/clinic/home/HomeScreenEvent.kt @@ -11,7 +11,7 @@ import org.simple.clinic.widgets.UiEvent sealed class HomeScreenEvent : UiEvent -object HomeFacilitySelectionClicked : HomeScreenEvent() { +data object HomeFacilitySelectionClicked : HomeScreenEvent() { override val analyticsName = "Home Screen:Facility Clicked" } diff --git a/app/src/main/java/org/simple/clinic/home/HomeScreenKey.kt b/app/src/main/java/org/simple/clinic/home/HomeScreenKey.kt index e66ea594f35..82e7a19f50d 100644 --- a/app/src/main/java/org/simple/clinic/home/HomeScreenKey.kt +++ b/app/src/main/java/org/simple/clinic/home/HomeScreenKey.kt @@ -5,7 +5,7 @@ import kotlinx.parcelize.Parcelize import org.simple.clinic.navigation.v2.ScreenKey @Parcelize -object HomeScreenKey : ScreenKey() { +data object HomeScreenKey : ScreenKey() { @IgnoredOnParcel override val analyticsName = "Home" diff --git a/app/src/main/java/org/simple/clinic/home/help/HelpScreenEffect.kt b/app/src/main/java/org/simple/clinic/home/help/HelpScreenEffect.kt index de8b7368f49..0285ea697fb 100644 --- a/app/src/main/java/org/simple/clinic/home/help/HelpScreenEffect.kt +++ b/app/src/main/java/org/simple/clinic/home/help/HelpScreenEffect.kt @@ -2,10 +2,10 @@ package org.simple.clinic.home.help sealed class HelpScreenEffect -object LoadHelpContent : HelpScreenEffect() +data object LoadHelpContent : HelpScreenEffect() -object SyncHelp : HelpScreenEffect() +data object SyncHelp : HelpScreenEffect() sealed class HelpScreenViewEffect : HelpScreenEffect() -object ShowLoadingView : HelpScreenViewEffect() +data object ShowLoadingView : HelpScreenViewEffect() diff --git a/app/src/main/java/org/simple/clinic/home/help/HelpScreenEvent.kt b/app/src/main/java/org/simple/clinic/home/help/HelpScreenEvent.kt index 7bb8cec34bd..422d1ce1260 100644 --- a/app/src/main/java/org/simple/clinic/home/help/HelpScreenEvent.kt +++ b/app/src/main/java/org/simple/clinic/home/help/HelpScreenEvent.kt @@ -6,7 +6,7 @@ import java.util.Optional sealed class HelpScreenEvent : UiEvent -object HelpScreenTryAgainClicked : HelpScreenEvent() { +data object HelpScreenTryAgainClicked : HelpScreenEvent() { override val analyticsName: String = "Help Screen:Try Again Clicked" } diff --git a/app/src/main/java/org/simple/clinic/home/overdue/OverdueAppointmentListItem.kt b/app/src/main/java/org/simple/clinic/home/overdue/OverdueAppointmentListItem.kt index 495f31bbaef..65dffd07a6d 100644 --- a/app/src/main/java/org/simple/clinic/home/overdue/OverdueAppointmentListItem.kt +++ b/app/src/main/java/org/simple/clinic/home/overdue/OverdueAppointmentListItem.kt @@ -464,7 +464,7 @@ sealed class OverdueAppointmentListItem : ItemAdapter.Item { } } - object NoPendingPatients : OverdueAppointmentListItem() { + data object NoPendingPatients : OverdueAppointmentListItem() { override fun layoutResId(): Int = R.layout.list_item_no_pending_patients @@ -473,7 +473,7 @@ sealed class OverdueAppointmentListItem : ItemAdapter.Item { } } - object SearchOverduePatientsButtonItem : OverdueAppointmentListItem() { + data object SearchOverduePatientsButtonItem : OverdueAppointmentListItem() { override fun layoutResId(): Int = R.layout.list_item_search_overdue_patient_button @@ -485,7 +485,7 @@ sealed class OverdueAppointmentListItem : ItemAdapter.Item { } } - object Divider : OverdueAppointmentListItem() { + data object Divider : OverdueAppointmentListItem() { override fun layoutResId(): Int = R.layout.list_item_divider diff --git a/app/src/main/java/org/simple/clinic/home/overdue/OverdueEffect.kt b/app/src/main/java/org/simple/clinic/home/overdue/OverdueEffect.kt index 9860eaffb77..2d18641327b 100644 --- a/app/src/main/java/org/simple/clinic/home/overdue/OverdueEffect.kt +++ b/app/src/main/java/org/simple/clinic/home/overdue/OverdueEffect.kt @@ -7,7 +7,7 @@ import java.util.UUID sealed class OverdueEffect -object LoadCurrentFacility : OverdueEffect() +data object LoadCurrentFacility : OverdueEffect() data class LoadOverdueAppointments( val overdueSince: LocalDate, @@ -18,9 +18,9 @@ data class ScheduleDownload(val fileFormat: OverdueListFileFormat) : OverdueEffe data class ToggleOverdueAppointmentSelection(val appointmentId: UUID) : OverdueEffect() -object LoadSelectedOverdueAppointmentIds : OverdueEffect() +data object LoadSelectedOverdueAppointmentIds : OverdueEffect() -object ClearSelectedOverdueAppointments : OverdueEffect() +data object ClearSelectedOverdueAppointments : OverdueEffect() sealed class OverdueViewEffect : OverdueEffect() @@ -28,12 +28,12 @@ data class OpenContactPatientScreen(val patientUuid: UUID) : OverdueViewEffect() data class OpenPatientSummary(val patientUuid: UUID) : OverdueViewEffect() -object ShowNoActiveNetworkConnectionDialog : OverdueViewEffect() +data object ShowNoActiveNetworkConnectionDialog : OverdueViewEffect() -object OpenSelectDownloadFormatDialog : OverdueViewEffect() +data object OpenSelectDownloadFormatDialog : OverdueViewEffect() -object OpenSelectShareFormatDialog : OverdueViewEffect() +data object OpenSelectShareFormatDialog : OverdueViewEffect() -object OpenSharingInProgressDialog : OverdueViewEffect() +data object OpenSharingInProgressDialog : OverdueViewEffect() -object OpenOverdueSearch : OverdueViewEffect() +data object OpenOverdueSearch : OverdueViewEffect() diff --git a/app/src/main/java/org/simple/clinic/home/overdue/OverdueEvent.kt b/app/src/main/java/org/simple/clinic/home/overdue/OverdueEvent.kt index 0fbb66f0079..2c03b14849f 100644 --- a/app/src/main/java/org/simple/clinic/home/overdue/OverdueEvent.kt +++ b/app/src/main/java/org/simple/clinic/home/overdue/OverdueEvent.kt @@ -46,14 +46,14 @@ data class ShareOverdueListClicked( override val analyticsName = "Overdue Screen:Share clicked" } -object PendingListFooterClicked : OverdueEvent() +data object PendingListFooterClicked : OverdueEvent() data class ChevronClicked(val overdueAppointmentSectionTitle: OverdueAppointmentSectionTitle) : OverdueEvent() -object OverdueSearchButtonClicked : OverdueEvent() +data object OverdueSearchButtonClicked : OverdueEvent() data class OverdueAppointmentCheckBoxClicked(val appointmentId: UUID) : OverdueEvent() -object ClearSelectedOverdueAppointmentsClicked : OverdueEvent() +data object ClearSelectedOverdueAppointmentsClicked : OverdueEvent() data class SelectedOverdueAppointmentsLoaded(val selectedAppointmentIds: Set) : OverdueEvent() diff --git a/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueAppointmentSearchListItem.kt b/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueAppointmentSearchListItem.kt index d401a28b3b0..684303f8d24 100644 --- a/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueAppointmentSearchListItem.kt +++ b/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueAppointmentSearchListItem.kt @@ -197,7 +197,7 @@ sealed class OverdueAppointmentSearchListItem : PagingItemAdapter.Item } } - object SelectAllOverdueAppointmentButton : OverdueAppointmentSearchListItem() { + data object SelectAllOverdueAppointmentButton : OverdueAppointmentSearchListItem() { override fun layoutResId(): Int = R.layout.list_item_search_overdue_select_all_button diff --git a/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEffect.kt b/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEffect.kt index b7f9840425c..cc9768825f5 100644 --- a/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEffect.kt +++ b/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEffect.kt @@ -7,13 +7,13 @@ sealed class OverdueSearchEffect data class ToggleOverdueAppointmentSelection(val appointmentId: UUID) : OverdueSearchEffect() -object LoadSelectedOverdueAppointmentIds : OverdueSearchEffect() +data object LoadSelectedOverdueAppointmentIds : OverdueSearchEffect() -object ClearSelectedOverdueAppointments : OverdueSearchEffect() +data object ClearSelectedOverdueAppointments : OverdueSearchEffect() data class ReplaceSelectedAppointmentIds(val appointmentIds: Set, val type: OverdueButtonType) : OverdueSearchEffect() -object ScheduleDownload : OverdueSearchEffect() +data object ScheduleDownload : OverdueSearchEffect() data class SelectAllAppointmentIds(val appointmentIds: Set) : OverdueSearchEffect() @@ -23,7 +23,7 @@ data class LoadSearchResultsAppointmentIds( val since: LocalDate ) : OverdueSearchEffect() -object LoadVillageAndPatientNames : OverdueSearchEffect() +data object LoadVillageAndPatientNames : OverdueSearchEffect() data class SearchOverduePatients( val searchInputs: List, @@ -36,10 +36,10 @@ data class OpenPatientSummary(val patientUuid: UUID) : OverdueSearchViewEffect() data class OpenContactPatientSheet(val patientUuid: UUID) : OverdueSearchViewEffect() -object OpenSelectDownloadFormatDialog : OverdueSearchViewEffect() +data object OpenSelectDownloadFormatDialog : OverdueSearchViewEffect() -object OpenSelectShareFormatDialog : OverdueSearchViewEffect() +data object OpenSelectShareFormatDialog : OverdueSearchViewEffect() -object OpenShareInProgressDialog : OverdueSearchViewEffect() +data object OpenShareInProgressDialog : OverdueSearchViewEffect() -object ShowNoInternetConnectionDialog : OverdueSearchViewEffect() +data object ShowNoInternetConnectionDialog : OverdueSearchViewEffect() diff --git a/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEvent.kt b/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEvent.kt index 8cad561f069..cc7c0df401f 100644 --- a/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEvent.kt +++ b/app/src/main/java/org/simple/clinic/home/overdue/search/OverdueSearchEvent.kt @@ -23,7 +23,7 @@ data class OverdueSearchLoadStateChanged(val overdueSearchProgressState: Overdue data class OverdueAppointmentCheckBoxClicked(val appointmentId: UUID) : OverdueSearchEvent() -object ClearSelectedOverdueAppointmentsClicked : OverdueSearchEvent() +data object ClearSelectedOverdueAppointmentsClicked : OverdueSearchEvent() data class SelectedOverdueAppointmentsLoaded(val selectedAppointmentIds: Set) : OverdueSearchEvent() @@ -49,7 +49,7 @@ data class ShareButtonClicked( override val analyticsName = "Overdue Search Screen:Share Clicked" } -object SelectAllButtonClicked : OverdueSearchEvent() { +data object SelectAllButtonClicked : OverdueSearchEvent() { override val analyticsName = "Overdue Search Screen:Select All Clicked" } diff --git a/app/src/main/java/org/simple/clinic/home/patients/PatientsTabEffect.kt b/app/src/main/java/org/simple/clinic/home/patients/PatientsTabEffect.kt index 3613a611da3..bbeeb961d69 100644 --- a/app/src/main/java/org/simple/clinic/home/patients/PatientsTabEffect.kt +++ b/app/src/main/java/org/simple/clinic/home/patients/PatientsTabEffect.kt @@ -5,50 +5,50 @@ import org.simple.clinic.patient.businessid.Identifier sealed class PatientsTabEffect -object RefreshUserDetails : PatientsTabEffect() +data object RefreshUserDetails : PatientsTabEffect() -object LoadUser : PatientsTabEffect() +data object LoadUser : PatientsTabEffect() -object LoadInfoForShowingApprovalStatus : PatientsTabEffect() +data object LoadInfoForShowingApprovalStatus : PatientsTabEffect() data class SetDismissedApprovalStatus(val dismissedStatus: Boolean) : PatientsTabEffect() -object LoadInfoForShowingAppUpdateMessage : PatientsTabEffect() +data object LoadInfoForShowingAppUpdateMessage : PatientsTabEffect() -object TouchAppUpdateShownAtTime : PatientsTabEffect() +data object TouchAppUpdateShownAtTime : PatientsTabEffect() -object LoadAppStaleness : PatientsTabEffect() +data object LoadAppStaleness : PatientsTabEffect() -object ScheduleAppUpdateNotification : PatientsTabEffect() +data object ScheduleAppUpdateNotification : PatientsTabEffect() data class LoadDrugStockReportStatus(val date: String) : PatientsTabEffect() -object LoadInfoForShowingDrugStockReminder : PatientsTabEffect() +data object LoadInfoForShowingDrugStockReminder : PatientsTabEffect() -object TouchDrugStockReportLastCheckedAt : PatientsTabEffect() +data object TouchDrugStockReportLastCheckedAt : PatientsTabEffect() data class TouchIsDrugStockReportFilled(val isDrugStockReportFilled: Boolean) : PatientsTabEffect() sealed class PatientsTabViewEffect : PatientsTabEffect() -object OpenEnterOtpScreen : PatientsTabViewEffect() +data object OpenEnterOtpScreen : PatientsTabViewEffect() data class OpenPatientSearchScreen(val additionalIdentifier: Identifier?) : PatientsTabViewEffect() -object ShowUserWasApproved : PatientsTabViewEffect() +data object ShowUserWasApproved : PatientsTabViewEffect() -object HideUserAccountStatus : PatientsTabViewEffect() +data object HideUserAccountStatus : PatientsTabViewEffect() -object OpenScanBpPassportScreen : PatientsTabViewEffect() +data object OpenScanBpPassportScreen : PatientsTabViewEffect() -object ShowAppUpdateAvailable : PatientsTabViewEffect() +data object ShowAppUpdateAvailable : PatientsTabViewEffect() -object OpenSimpleOnPlayStore : PatientsTabViewEffect() +data object OpenSimpleOnPlayStore : PatientsTabViewEffect() data class ShowCriticalAppUpdateDialog(val appUpdateNudgePriority: AppUpdateNudgePriority) : PatientsTabViewEffect() -object OpenEnterDrugStockScreen : PatientsTabViewEffect() +data object OpenEnterDrugStockScreen : PatientsTabViewEffect() -object ShowNoActiveNetworkConnectionDialog : PatientsTabViewEffect() +data object ShowNoActiveNetworkConnectionDialog : PatientsTabViewEffect() -object OpenDrugStockReportsForm : PatientsTabViewEffect() +data object OpenDrugStockReportsForm : PatientsTabViewEffect() diff --git a/app/src/main/java/org/simple/clinic/home/patients/PatientsTabEvent.kt b/app/src/main/java/org/simple/clinic/home/patients/PatientsTabEvent.kt index dae38df332a..a5d793c5d73 100644 --- a/app/src/main/java/org/simple/clinic/home/patients/PatientsTabEvent.kt +++ b/app/src/main/java/org/simple/clinic/home/patients/PatientsTabEvent.kt @@ -19,13 +19,13 @@ class PatientsEnterCodeManuallyClicked : PatientsTabEvent() { override val analyticsName = "Patients:Enter Code Manually Clicked" } -object NewPatientClicked : PatientsTabEvent() { +data object NewPatientClicked : PatientsTabEvent() { override val analyticsName = "Patients:Search For Patient Clicked" } data class UserDetailsLoaded(val user: User) : PatientsTabEvent() -object ActivityResumed : PatientsTabEvent() +data object ActivityResumed : PatientsTabEvent() data class DataForShowingApprovedStatusLoaded( val currentTime: Instant, @@ -54,7 +54,7 @@ data class RequiredInfoForShowingAppUpdateLoaded( val appStaleness: Int? ) : PatientsTabEvent() -object UpdateNowButtonClicked : PatientsTabEvent() +data object UpdateNowButtonClicked : PatientsTabEvent() data class DrugStockReportLoaded(val result: DrugStockReminder.Result) : PatientsTabEvent() diff --git a/app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEffect.kt b/app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEffect.kt index a7c4140afe4..ac4fc3cda00 100644 --- a/app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEffect.kt +++ b/app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEffect.kt @@ -2,16 +2,16 @@ package org.simple.clinic.home.patients.links sealed class PatientsTabLinkEffect -object LoadCurrentFacility : PatientsTabLinkEffect() +data object LoadCurrentFacility : PatientsTabLinkEffect() -object LoadQuestionnaires : PatientsTabLinkEffect() +data object LoadQuestionnaires : PatientsTabLinkEffect() -object LoadQuestionnaireResponses : PatientsTabLinkEffect() +data object LoadQuestionnaireResponses : PatientsTabLinkEffect() -object OpenMonthlyScreeningReportsListScreen : PatientsTabLinkEffect() +data object OpenMonthlyScreeningReportsListScreen : PatientsTabLinkEffect() -object OpenMonthlySuppliesReportsListScreen : PatientsTabLinkEffect() +data object OpenMonthlySuppliesReportsListScreen : PatientsTabLinkEffect() -object OpenPatientLineListDownloadDialog : PatientsTabLinkEffect() +data object OpenPatientLineListDownloadDialog : PatientsTabLinkEffect() -object OpenDrugStockReportsScreen : PatientsTabLinkEffect() +data object OpenDrugStockReportsScreen : PatientsTabLinkEffect() diff --git a/app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEvent.kt b/app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEvent.kt index f0289c1ea73..3f123581907 100644 --- a/app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEvent.kt +++ b/app/src/main/java/org/simple/clinic/home/patients/links/PatientsTabLinkEvent.kt @@ -23,15 +23,15 @@ data class QuestionnaireResponsesLoaded( val questionnaireResponseSections: QuestionnaireResponseSections ) : PatientsTabLinkEvent() -object MonthlyScreeningReportsClicked : PatientsTabLinkEvent() { +data object MonthlyScreeningReportsClicked : PatientsTabLinkEvent() { override val analyticsName = "Link: Monthly Screening Report clicked" } -object MonthlySuppliesReportsClicked : PatientsTabLinkEvent() { +data object MonthlySuppliesReportsClicked : PatientsTabLinkEvent() { override val analyticsName = "Link: Monthly Supplies Report clicked" } -object MonthlyDrugStockReportsClicked : PatientsTabLinkEvent() { +data object MonthlyDrugStockReportsClicked : PatientsTabLinkEvent() { override val analyticsName = "Patient Tab Links:Monthly Drug Stock Report Clicked" } diff --git a/app/src/main/java/org/simple/clinic/home/report/ReportsEffect.kt b/app/src/main/java/org/simple/clinic/home/report/ReportsEffect.kt index a0948144a15..ae4a82c8e23 100644 --- a/app/src/main/java/org/simple/clinic/home/report/ReportsEffect.kt +++ b/app/src/main/java/org/simple/clinic/home/report/ReportsEffect.kt @@ -2,4 +2,4 @@ package org.simple.clinic.home.report sealed class ReportsEffect -object LoadReports : ReportsEffect() +data object LoadReports : ReportsEffect() diff --git a/app/src/main/java/org/simple/clinic/home/report/ReportsEvent.kt b/app/src/main/java/org/simple/clinic/home/report/ReportsEvent.kt index d760afbeee1..1a5f2e58847 100644 --- a/app/src/main/java/org/simple/clinic/home/report/ReportsEvent.kt +++ b/app/src/main/java/org/simple/clinic/home/report/ReportsEvent.kt @@ -7,7 +7,7 @@ sealed class ReportsEvent : UiEvent data class ReportsLoaded(val reportsContent: Optional) : ReportsEvent() -object WebBackClicked : ReportsEvent() { +data object WebBackClicked : ReportsEvent() { override val analyticsName = "Reports Screen:Back clicked" } diff --git a/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEffect.kt b/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEffect.kt index 12486638c51..7a995b10371 100644 --- a/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEffect.kt +++ b/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEffect.kt @@ -10,7 +10,7 @@ import java.util.UUID sealed class InstantSearchEffect -object LoadCurrentFacility : InstantSearchEffect() +data object LoadCurrentFacility : InstantSearchEffect() data class LoadAllPatients(val facility: Facility) : InstantSearchEffect() @@ -49,10 +49,10 @@ data class OpenScannedQrCodeSheet(val identifier: Identifier) : InstantSearchVie data class OpenPatientEntryScreen(val facility: Facility) : InstantSearchViewEffect() -object ShowKeyboard : InstantSearchViewEffect() +data object ShowKeyboard : InstantSearchViewEffect() -object OpenQrCodeScanner : InstantSearchViewEffect() +data object OpenQrCodeScanner : InstantSearchViewEffect() -object ShowNHIDErrorDialog : InstantSearchViewEffect() +data object ShowNHIDErrorDialog : InstantSearchViewEffect() data class PrefillSearchQuery(val searchQuery: String) : InstantSearchViewEffect() diff --git a/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEvent.kt b/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEvent.kt index 0644d7b7bf3..c7ab3e800fa 100644 --- a/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEvent.kt +++ b/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchEvent.kt @@ -28,9 +28,9 @@ data class SearchResultClicked(val patientId: UUID) : InstantSearchEvent() { data class SearchQueryChanged(val searchQuery: String) : InstantSearchEvent() -object SavedNewOngoingPatientEntry : InstantSearchEvent() +data object SavedNewOngoingPatientEntry : InstantSearchEvent() -object RegisterNewPatientClicked : InstantSearchEvent() { +data object RegisterNewPatientClicked : InstantSearchEvent() { override val analyticsName: String = "Instant Search: Register New Patient" } @@ -48,10 +48,10 @@ data class OpenQrCodeScannerClicked( override val analyticsName = "Instant Search Screen:Open QR code scanner" } -object PatientAlreadyHasAnExistingNHID : InstantSearchEvent() +data object PatientAlreadyHasAnExistingNHID : InstantSearchEvent() data class PatientDoesNotHaveAnExistingNHID(val patientId: UUID) : InstantSearchEvent() data class SearchResultsLoadStateChanged(val instantSearchProgressState: InstantSearchProgressState) : InstantSearchEvent() -object InstantSearchScreenShown : InstantSearchEvent() +data object InstantSearchScreenShown : InstantSearchEvent() diff --git a/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchResultsItemType.kt b/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchResultsItemType.kt index d26279be2da..29d32d02833 100644 --- a/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchResultsItemType.kt +++ b/app/src/main/java/org/simple/clinic/instantsearch/InstantSearchResultsItemType.kt @@ -78,7 +78,7 @@ sealed class InstantSearchResultsItemType : PagingItemAdapter.Item) : MonthlyReportsEvent() -object BackButtonClicked : MonthlyReportsEvent() { +data object BackButtonClicked : MonthlyReportsEvent() { override val analyticsName = "Monthly Reports List:Back Clicked" } diff --git a/app/src/main/java/org/simple/clinic/newentry/PatientEntryEffect.kt b/app/src/main/java/org/simple/clinic/newentry/PatientEntryEffect.kt index 0e580062e29..28fccd2cb55 100644 --- a/app/src/main/java/org/simple/clinic/newentry/PatientEntryEffect.kt +++ b/app/src/main/java/org/simple/clinic/newentry/PatientEntryEffect.kt @@ -5,23 +5,23 @@ import org.simple.clinic.patient.PatientEntryValidationError sealed class PatientEntryEffect -object FetchPatientEntry : PatientEntryEffect() +data object FetchPatientEntry : PatientEntryEffect() data class SavePatient(val entry: OngoingNewPatientEntry) : PatientEntryEffect() -object LoadInputFields : PatientEntryEffect() +data object LoadInputFields : PatientEntryEffect() -object FetchColonyOrVillagesEffect : PatientEntryEffect() +data object FetchColonyOrVillagesEffect : PatientEntryEffect() sealed class PatientEntryViewEffect : PatientEntryEffect() data class PrefillFields(val patientEntry: OngoingNewPatientEntry) : PatientEntryViewEffect() -object ScrollFormOnGenderSelection : PatientEntryViewEffect() +data object ScrollFormOnGenderSelection : PatientEntryViewEffect() data class ShowDatePatternInDateOfBirthLabel(val show: Boolean) : PatientEntryViewEffect() -object OpenMedicalHistoryEntryScreen : PatientEntryViewEffect() +data object OpenMedicalHistoryEntryScreen : PatientEntryViewEffect() data class HideValidationError(val field: Field) : PatientEntryViewEffect() diff --git a/app/src/main/java/org/simple/clinic/newentry/PatientEntryEvent.kt b/app/src/main/java/org/simple/clinic/newentry/PatientEntryEvent.kt index 6dfb0546e89..efbedc9068a 100644 --- a/app/src/main/java/org/simple/clinic/newentry/PatientEntryEvent.kt +++ b/app/src/main/java/org/simple/clinic/newentry/PatientEntryEvent.kt @@ -56,11 +56,11 @@ data class ZoneChanged(val zone: String) : PatientEntryEvent() { override val analyticsName = "Create Patient Entry:Zone Changed" } -object SaveClicked : PatientEntryEvent() { +data object SaveClicked : PatientEntryEvent() { override val analyticsName = "Create Patient Entry:Save Clicked" } -object PatientEntrySaved : PatientEntryEvent() { +data object PatientEntrySaved : PatientEntryEvent() { override val analyticsName = "Create Patient Entry:Patient Entry Saved" } diff --git a/app/src/main/java/org/simple/clinic/newentry/form/ValidationError.kt b/app/src/main/java/org/simple/clinic/newentry/form/ValidationError.kt index 1e9c2f6c235..9091c4f3d3a 100644 --- a/app/src/main/java/org/simple/clinic/newentry/form/ValidationError.kt +++ b/app/src/main/java/org/simple/clinic/newentry/form/ValidationError.kt @@ -1,9 +1,9 @@ package org.simple.clinic.newentry.form sealed class ValidationError { - object MissingValue : ValidationError() - object InvalidDateFormat : ValidationError() - object DateIsInFuture : ValidationError() - object LengthTooShort : ValidationError() - object LengthTooLong : ValidationError() + data object MissingValue : ValidationError() + data object InvalidDateFormat : ValidationError() + data object DateIsInFuture : ValidationError() + data object LengthTooShort : ValidationError() + data object LengthTooLong : ValidationError() } diff --git a/app/src/main/java/org/simple/clinic/onboarding/OnboardingEvent.kt b/app/src/main/java/org/simple/clinic/onboarding/OnboardingEvent.kt index f90aaa70be1..043f31f8611 100644 --- a/app/src/main/java/org/simple/clinic/onboarding/OnboardingEvent.kt +++ b/app/src/main/java/org/simple/clinic/onboarding/OnboardingEvent.kt @@ -4,6 +4,6 @@ import org.simple.clinic.widgets.UiEvent sealed class OnboardingEvent : UiEvent -object GetStartedClicked : OnboardingEvent() { +data object GetStartedClicked : OnboardingEvent() { override val analyticsName = "Onboarding:Get Started Clicked" } diff --git a/app/src/main/java/org/simple/clinic/overdue/Appointment.kt b/app/src/main/java/org/simple/clinic/overdue/Appointment.kt index 0dca0bba266..00f9a01ba4f 100644 --- a/app/src/main/java/org/simple/clinic/overdue/Appointment.kt +++ b/app/src/main/java/org/simple/clinic/overdue/Appointment.kt @@ -56,13 +56,13 @@ data class Appointment( sealed class Status : Parcelable { @Parcelize - object Scheduled : Status() + data object Scheduled : Status() @Parcelize - object Cancelled : Status() + data object Cancelled : Status() @Parcelize - object Visited : Status() + data object Visited : Status() @Parcelize data class Unknown(val actualValue: String) : Status() @@ -102,10 +102,10 @@ data class Appointment( sealed class AppointmentType : Parcelable { @Parcelize - object Manual : AppointmentType() + data object Manual : AppointmentType() @Parcelize - object Automatic : AppointmentType() + data object Automatic : AppointmentType() @Parcelize data class Unknown(val actual: String) : AppointmentType() diff --git a/app/src/main/java/org/simple/clinic/overdue/AppointmentCancelReason.kt b/app/src/main/java/org/simple/clinic/overdue/AppointmentCancelReason.kt index d64a600380b..0877de338b3 100644 --- a/app/src/main/java/org/simple/clinic/overdue/AppointmentCancelReason.kt +++ b/app/src/main/java/org/simple/clinic/overdue/AppointmentCancelReason.kt @@ -28,37 +28,37 @@ sealed class AppointmentCancelReason : Parcelable { abstract override fun toString(): String @Parcelize - object PatientNotResponding : AppointmentCancelReason() { + data object PatientNotResponding : AppointmentCancelReason() { override fun toString() = "PatientNotResponding" } @Parcelize - object InvalidPhoneNumber : AppointmentCancelReason() { + data object InvalidPhoneNumber : AppointmentCancelReason() { override fun toString() = "InvalidPhoneNumber" } @Parcelize - object TransferredToAnotherPublicHospital : AppointmentCancelReason() { + data object TransferredToAnotherPublicHospital : AppointmentCancelReason() { override fun toString() = "TransferredToAnotherPublicHospital" } @Parcelize - object MovedToPrivatePractitioner : AppointmentCancelReason() { + data object MovedToPrivatePractitioner : AppointmentCancelReason() { override fun toString() = "MovedToPrivatePractitioner" } @Parcelize - object RefusedToComeBack : AppointmentCancelReason() { + data object RefusedToComeBack : AppointmentCancelReason() { override fun toString() = "RefusedToComeBack" } @Parcelize - object Dead : AppointmentCancelReason() { + data object Dead : AppointmentCancelReason() { override fun toString() = "Dead" } @Parcelize - object Other : AppointmentCancelReason() { + data object Other : AppointmentCancelReason() { override fun toString() = "Other" } diff --git a/app/src/main/java/org/simple/clinic/overdue/callresult/Outcome.kt b/app/src/main/java/org/simple/clinic/overdue/callresult/Outcome.kt index b7c2eae2d11..0309df0e373 100644 --- a/app/src/main/java/org/simple/clinic/overdue/callresult/Outcome.kt +++ b/app/src/main/java/org/simple/clinic/overdue/callresult/Outcome.kt @@ -20,13 +20,13 @@ sealed class Outcome : Parcelable { ) @Parcelize - object AgreedToVisit : Outcome() + data object AgreedToVisit : Outcome() @Parcelize - object RemovedFromOverdueList : Outcome() + data object RemovedFromOverdueList : Outcome() @Parcelize - object RemindToCallLater : Outcome() + data object RemindToCallLater : Outcome() @Parcelize data class Unknown(val actualValue: String) : Outcome() diff --git a/app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloadResult.kt b/app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloadResult.kt index 82462f939ea..e055aca2520 100644 --- a/app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloadResult.kt +++ b/app/src/main/java/org/simple/clinic/overdue/download/OverdueListDownloadResult.kt @@ -6,7 +6,7 @@ sealed class OverdueListDownloadResult { data class DownloadSuccessful(val uri: Uri) : OverdueListDownloadResult() - object NotEnoughStorage : OverdueListDownloadResult() + data object NotEnoughStorage : OverdueListDownloadResult() - object DownloadFailed : OverdueListDownloadResult() + data object DownloadFailed : OverdueListDownloadResult() } diff --git a/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/OpenAs.kt b/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/OpenAs.kt index 745480bf4f7..cd832b511ba 100644 --- a/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/OpenAs.kt +++ b/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/OpenAs.kt @@ -6,10 +6,10 @@ import kotlinx.parcelize.Parcelize sealed class OpenAs : Parcelable @Parcelize -object Share : OpenAs() +data object Share : OpenAs() @Parcelize -object SharingInProgress : OpenAs() +data object SharingInProgress : OpenAs() @Parcelize -object Download : OpenAs() +data object Download : OpenAs() diff --git a/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/SelectOverdueDownloadFormatEffect.kt b/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/SelectOverdueDownloadFormatEffect.kt index 01224c1acb2..8697d900a3f 100644 --- a/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/SelectOverdueDownloadFormatEffect.kt +++ b/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/SelectOverdueDownloadFormatEffect.kt @@ -10,14 +10,14 @@ data class DownloadForShare(val fileFormat: OverdueListFileFormat, val selectedA data class ScheduleDownload(val fileFormat: OverdueListFileFormat) : SelectOverdueDownloadFormatEffect() -object LoadSelectedOverdueAppointmentIds : SelectOverdueDownloadFormatEffect() +data object LoadSelectedOverdueAppointmentIds : SelectOverdueDownloadFormatEffect() sealed class SelectOverdueDownloadFormatViewEffect : SelectOverdueDownloadFormatEffect() data class ShareDownloadedFile(val uri: Uri, val mimeType: String) : SelectOverdueDownloadFormatViewEffect() -object Dismiss : SelectOverdueDownloadFormatViewEffect() +data object Dismiss : SelectOverdueDownloadFormatViewEffect() -object OpenNotEnoughStorageErrorDialog : SelectOverdueDownloadFormatViewEffect() +data object OpenNotEnoughStorageErrorDialog : SelectOverdueDownloadFormatViewEffect() -object OpenDownloadFailedErrorDialog : SelectOverdueDownloadFormatViewEffect() +data object OpenDownloadFailedErrorDialog : SelectOverdueDownloadFormatViewEffect() diff --git a/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/SelectOverdueDownloadFormatEvent.kt b/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/SelectOverdueDownloadFormatEvent.kt index 5046264db4a..c21033f5585 100644 --- a/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/SelectOverdueDownloadFormatEvent.kt +++ b/app/src/main/java/org/simple/clinic/overdue/download/formatdialog/SelectOverdueDownloadFormatEvent.kt @@ -9,14 +9,14 @@ sealed class SelectOverdueDownloadFormatEvent : UiEvent data class FileDownloadedForSharing(val result: OverdueListDownloadResult) : SelectOverdueDownloadFormatEvent() -object DownloadOrShareClicked : SelectOverdueDownloadFormatEvent() { +data object DownloadOrShareClicked : SelectOverdueDownloadFormatEvent() { override val analyticsName = "Select Overdue Download Format : Download or share clicked" } -object OverdueDownloadScheduled : SelectOverdueDownloadFormatEvent() +data object OverdueDownloadScheduled : SelectOverdueDownloadFormatEvent() -object CancelClicked : SelectOverdueDownloadFormatEvent() { +data object CancelClicked : SelectOverdueDownloadFormatEvent() { override val analyticsName = "Select Overdue Download Format : Cancel clicked" } diff --git a/app/src/main/java/org/simple/clinic/patient/DeletedReason.kt b/app/src/main/java/org/simple/clinic/patient/DeletedReason.kt index ad48b80923b..486b0228650 100644 --- a/app/src/main/java/org/simple/clinic/patient/DeletedReason.kt +++ b/app/src/main/java/org/simple/clinic/patient/DeletedReason.kt @@ -11,10 +11,10 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class DeletedReason : Parcelable { @Parcelize - object Duplicate : DeletedReason() + data object Duplicate : DeletedReason() @Parcelize - object AccidentalRegistration : DeletedReason() + data object AccidentalRegistration : DeletedReason() @Parcelize data class Unknown(val actualValue: String) : DeletedReason() diff --git a/app/src/main/java/org/simple/clinic/patient/Gender.kt b/app/src/main/java/org/simple/clinic/patient/Gender.kt index 5bf21e250d2..faa1863326e 100644 --- a/app/src/main/java/org/simple/clinic/patient/Gender.kt +++ b/app/src/main/java/org/simple/clinic/patient/Gender.kt @@ -17,13 +17,13 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class Gender : Parcelable { @Parcelize - object Male : Gender() + data object Male : Gender() @Parcelize - object Female : Gender() + data object Female : Gender() @Parcelize - object Transgender : Gender() + data object Transgender : Gender() @Parcelize data class Unknown(val actualValue: String) : Gender() diff --git a/app/src/main/java/org/simple/clinic/patient/PatientPhoneNumberType.kt b/app/src/main/java/org/simple/clinic/patient/PatientPhoneNumberType.kt index 2ab2372fcd7..479b05eb8d1 100644 --- a/app/src/main/java/org/simple/clinic/patient/PatientPhoneNumberType.kt +++ b/app/src/main/java/org/simple/clinic/patient/PatientPhoneNumberType.kt @@ -11,10 +11,10 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class PatientPhoneNumberType : Parcelable { @Parcelize - object Mobile : PatientPhoneNumberType() + data object Mobile : PatientPhoneNumberType() @Parcelize - object Landline : PatientPhoneNumberType() + data object Landline : PatientPhoneNumberType() @Parcelize data class Unknown(val actualValue: String) : PatientPhoneNumberType() diff --git a/app/src/main/java/org/simple/clinic/patient/PatientStatus.kt b/app/src/main/java/org/simple/clinic/patient/PatientStatus.kt index 2c4df2c76f0..cebda54bf25 100644 --- a/app/src/main/java/org/simple/clinic/patient/PatientStatus.kt +++ b/app/src/main/java/org/simple/clinic/patient/PatientStatus.kt @@ -11,19 +11,19 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class PatientStatus : Parcelable { @Parcelize - object Active : PatientStatus() + data object Active : PatientStatus() @Parcelize - object Dead : PatientStatus() + data object Dead : PatientStatus() @Parcelize - object Migrated : PatientStatus() + data object Migrated : PatientStatus() @Parcelize - object Unresponsive : PatientStatus() + data object Unresponsive : PatientStatus() @Parcelize - object Inactive : PatientStatus() + data object Inactive : PatientStatus() @Parcelize data class Unknown(val actualValue: String) : PatientStatus() diff --git a/app/src/main/java/org/simple/clinic/patient/ReminderConsent.kt b/app/src/main/java/org/simple/clinic/patient/ReminderConsent.kt index 3664482c2b0..fe9447dec50 100644 --- a/app/src/main/java/org/simple/clinic/patient/ReminderConsent.kt +++ b/app/src/main/java/org/simple/clinic/patient/ReminderConsent.kt @@ -10,10 +10,10 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class ReminderConsent : Parcelable { @Parcelize - object Granted : ReminderConsent() + data object Granted : ReminderConsent() @Parcelize - object Denied : ReminderConsent() + data object Denied : ReminderConsent() @Parcelize data class Unknown(val actualValue: String) : ReminderConsent() diff --git a/app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt b/app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt index daece3dfc33..2b0dc5a9630 100644 --- a/app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt +++ b/app/src/main/java/org/simple/clinic/patient/businessid/BusinessId.kt @@ -114,22 +114,22 @@ data class BusinessId( } @Parcelize - object BpPassportMetaDataV1 : MetaDataVersion() + data object BpPassportMetaDataV1 : MetaDataVersion() @Parcelize - object BangladeshNationalIdMetaDataV1 : MetaDataVersion() + data object BangladeshNationalIdMetaDataV1 : MetaDataVersion() @Parcelize - object MedicalRecordNumberMetaDataV1 : MetaDataVersion() + data object MedicalRecordNumberMetaDataV1 : MetaDataVersion() @Parcelize - object IndiaNationalHealthIdMetaDataV1 : MetaDataVersion() + data object IndiaNationalHealthIdMetaDataV1 : MetaDataVersion() @Parcelize - object SriLankaNationIdMetaDataV1 : MetaDataVersion() + data object SriLankaNationIdMetaDataV1 : MetaDataVersion() @Parcelize - object SriLankaPersonalHealthNumberMetaDataV1 : MetaDataVersion() + data object SriLankaPersonalHealthNumberMetaDataV1 : MetaDataVersion() @Parcelize data class Unknown(val actual: String) : MetaDataVersion() diff --git a/app/src/main/java/org/simple/clinic/patient/businessid/Identifier.kt b/app/src/main/java/org/simple/clinic/patient/businessid/Identifier.kt index 8820d907fb4..b8f62c13800 100644 --- a/app/src/main/java/org/simple/clinic/patient/businessid/Identifier.kt +++ b/app/src/main/java/org/simple/clinic/patient/businessid/Identifier.kt @@ -81,7 +81,7 @@ data class Identifier( sealed class IdentifierType : Parcelable { @Parcelize - object BpPassport : IdentifierType() { + data object BpPassport : IdentifierType() { @IgnoredOnParcel const val SHORT_CODE_LENGTH = 7 @@ -96,19 +96,19 @@ data class Identifier( } @Parcelize - object BangladeshNationalId : IdentifierType() + data object BangladeshNationalId : IdentifierType() @Parcelize - object EthiopiaMedicalRecordNumber : IdentifierType() + data object EthiopiaMedicalRecordNumber : IdentifierType() @Parcelize - object IndiaNationalHealthId : IdentifierType() + data object IndiaNationalHealthId : IdentifierType() @Parcelize - object SriLankaNationalId : IdentifierType() + data object SriLankaNationalId : IdentifierType() @Parcelize - object SriLankaPersonalHealthNumber : IdentifierType() + data object SriLankaPersonalHealthNumber : IdentifierType() @Parcelize data class Unknown(val actual: String) : IdentifierType() diff --git a/app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloadResult.kt b/app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloadResult.kt index d2bd655f29b..d60c8766c38 100644 --- a/app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloadResult.kt +++ b/app/src/main/java/org/simple/clinic/patient/download/PatientLineListDownloadResult.kt @@ -6,7 +6,7 @@ sealed class PatientLineListDownloadResult { data class DownloadSuccessful(val uri: Uri) : PatientLineListDownloadResult() - object NotEnoughStorage : PatientLineListDownloadResult() + data object NotEnoughStorage : PatientLineListDownloadResult() - object DownloadFailed : PatientLineListDownloadResult() + data object DownloadFailed : PatientLineListDownloadResult() } diff --git a/app/src/main/java/org/simple/clinic/patient/download/formatdialog/SelectLineListFormatEffect.kt b/app/src/main/java/org/simple/clinic/patient/download/formatdialog/SelectLineListFormatEffect.kt index eead854bac6..f28541da130 100644 --- a/app/src/main/java/org/simple/clinic/patient/download/formatdialog/SelectLineListFormatEffect.kt +++ b/app/src/main/java/org/simple/clinic/patient/download/formatdialog/SelectLineListFormatEffect.kt @@ -10,4 +10,4 @@ data class SchedulePatientLineListDownload( sealed class SelectLineListFormatViewEffect : SelectLineListFormatEffect() -object Dismiss : SelectLineListFormatViewEffect() +data object Dismiss : SelectLineListFormatViewEffect() diff --git a/app/src/main/java/org/simple/clinic/patient/download/formatdialog/SelectLineListFormatEvent.kt b/app/src/main/java/org/simple/clinic/patient/download/formatdialog/SelectLineListFormatEvent.kt index 63679b13af3..9aa12fca3df 100644 --- a/app/src/main/java/org/simple/clinic/patient/download/formatdialog/SelectLineListFormatEvent.kt +++ b/app/src/main/java/org/simple/clinic/patient/download/formatdialog/SelectLineListFormatEvent.kt @@ -5,11 +5,11 @@ import org.simple.clinic.widgets.UiEvent sealed class SelectLineListFormatEvent : UiEvent -object DownloadButtonClicked : SelectLineListFormatEvent() { +data object DownloadButtonClicked : SelectLineListFormatEvent() { override val analyticsName = "Select Patient Line List Download Format:Download Button Clicked" } data class DownloadFileFormatChanged(val fileFormat: PatientLineListFileFormat) : SelectLineListFormatEvent() -object CancelButtonClicked : SelectLineListFormatEvent() +data object CancelButtonClicked : SelectLineListFormatEvent() diff --git a/app/src/main/java/org/simple/clinic/patient/onlinelookup/api/LookupPatientOnline.kt b/app/src/main/java/org/simple/clinic/patient/onlinelookup/api/LookupPatientOnline.kt index 2afb3bf9327..f03ad097141 100644 --- a/app/src/main/java/org/simple/clinic/patient/onlinelookup/api/LookupPatientOnline.kt +++ b/app/src/main/java/org/simple/clinic/patient/onlinelookup/api/LookupPatientOnline.kt @@ -188,6 +188,6 @@ class LookupPatientOnline @Inject constructor( sealed class Result { data class Found(val medicalRecords: List) : Result() data class NotFound(val identifier: String) : Result() - object OtherError : Result() + data object OtherError : Result() } } diff --git a/app/src/main/java/org/simple/clinic/questionnaire/QuestionnaireType.kt b/app/src/main/java/org/simple/clinic/questionnaire/QuestionnaireType.kt index 58a70540e7b..b47f0f8b692 100644 --- a/app/src/main/java/org/simple/clinic/questionnaire/QuestionnaireType.kt +++ b/app/src/main/java/org/simple/clinic/questionnaire/QuestionnaireType.kt @@ -45,13 +45,13 @@ sealed class QuestionnaireType : Parcelable { } @Parcelize -object MonthlyScreeningReports : QuestionnaireType() +data object MonthlyScreeningReports : QuestionnaireType() @Parcelize -object MonthlySuppliesReports : QuestionnaireType() +data object MonthlySuppliesReports : QuestionnaireType() @Parcelize -object DrugStockReports : QuestionnaireType() +data object DrugStockReports : QuestionnaireType() @Parcelize data class Unknown(val actualValue: String) : QuestionnaireType() diff --git a/app/src/main/java/org/simple/clinic/questionnaire/component/properties/InputFieldType.kt b/app/src/main/java/org/simple/clinic/questionnaire/component/properties/InputFieldType.kt index f39b9ce212b..472e823df6f 100644 --- a/app/src/main/java/org/simple/clinic/questionnaire/component/properties/InputFieldType.kt +++ b/app/src/main/java/org/simple/clinic/questionnaire/component/properties/InputFieldType.kt @@ -45,13 +45,13 @@ sealed class InputFieldType : Parcelable { } @Parcelize -object IntegerType : InputFieldType() +data object IntegerType : InputFieldType() @Parcelize -object StringType : InputFieldType() +data object StringType : InputFieldType() @Parcelize -object DateType : InputFieldType() +data object DateType : InputFieldType() @Parcelize data class UnknownType(val actualValue: String) : InputFieldType() diff --git a/app/src/main/java/org/simple/clinic/recentpatient/AllRecentPatientsEffect.kt b/app/src/main/java/org/simple/clinic/recentpatient/AllRecentPatientsEffect.kt index d1f7d83fc48..12ab9529e78 100644 --- a/app/src/main/java/org/simple/clinic/recentpatient/AllRecentPatientsEffect.kt +++ b/app/src/main/java/org/simple/clinic/recentpatient/AllRecentPatientsEffect.kt @@ -6,7 +6,7 @@ import java.util.UUID sealed class AllRecentPatientsEffect -object LoadAllRecentPatients : AllRecentPatientsEffect() +data object LoadAllRecentPatients : AllRecentPatientsEffect() sealed class AllRecentPatientsViewEffect : AllRecentPatientsEffect() diff --git a/app/src/main/java/org/simple/clinic/recentpatientsview/LatestRecentPatientsEffect.kt b/app/src/main/java/org/simple/clinic/recentpatientsview/LatestRecentPatientsEffect.kt index 9b92b9ea4b1..dedc88cfd3f 100644 --- a/app/src/main/java/org/simple/clinic/recentpatientsview/LatestRecentPatientsEffect.kt +++ b/app/src/main/java/org/simple/clinic/recentpatientsview/LatestRecentPatientsEffect.kt @@ -8,4 +8,4 @@ data class LoadRecentPatients(val count: Int) : LatestRecentPatientsEffect() data class OpenPatientSummary(val patientUuid: UUID) : LatestRecentPatientsEffect() -object OpenAllRecentPatientsScreen : LatestRecentPatientsEffect() +data object OpenAllRecentPatientsScreen : LatestRecentPatientsEffect() diff --git a/app/src/main/java/org/simple/clinic/recentpatientsview/LatestRecentPatientsEvent.kt b/app/src/main/java/org/simple/clinic/recentpatientsview/LatestRecentPatientsEvent.kt index ca95f8595d8..fd3ef505b22 100644 --- a/app/src/main/java/org/simple/clinic/recentpatientsview/LatestRecentPatientsEvent.kt +++ b/app/src/main/java/org/simple/clinic/recentpatientsview/LatestRecentPatientsEvent.kt @@ -12,6 +12,6 @@ data class RecentPatientItemClicked(val patientUuid: UUID) : LatestRecentPatient override val analyticsName = "Recent Patients: Item clicked" } -object SeeAllItemClicked : LatestRecentPatientsEvent() { +data object SeeAllItemClicked : LatestRecentPatientsEvent() { override val analyticsName = "Recent Patients: See all clicked" } diff --git a/app/src/main/java/org/simple/clinic/recentpatientsview/RecentPatientItem.kt b/app/src/main/java/org/simple/clinic/recentpatientsview/RecentPatientItem.kt index 0c3fc07e547..87159d57dc3 100644 --- a/app/src/main/java/org/simple/clinic/recentpatientsview/RecentPatientItem.kt +++ b/app/src/main/java/org/simple/clinic/recentpatientsview/RecentPatientItem.kt @@ -99,7 +99,7 @@ data class RecentPatientItem( } } -object SeeAllItem : RecentPatientItemType() { +data object SeeAllItem : RecentPatientItemType() { override fun layoutResId(): Int = R.layout.see_all_item_view override fun render(holder: BindingViewHolder, subject: Subject) { diff --git a/app/src/main/java/org/simple/clinic/registerorlogin/AuthenticationEffect.kt b/app/src/main/java/org/simple/clinic/registerorlogin/AuthenticationEffect.kt index 746197fa658..bb51e751774 100644 --- a/app/src/main/java/org/simple/clinic/registerorlogin/AuthenticationEffect.kt +++ b/app/src/main/java/org/simple/clinic/registerorlogin/AuthenticationEffect.kt @@ -2,6 +2,6 @@ package org.simple.clinic.registerorlogin sealed class AuthenticationEffect -object OpenCountrySelectionScreen : AuthenticationEffect() +data object OpenCountrySelectionScreen : AuthenticationEffect() -object OpenRegistrationPhoneScreen : AuthenticationEffect() +data object OpenRegistrationPhoneScreen : AuthenticationEffect() diff --git a/app/src/main/java/org/simple/clinic/registration/confirmpin/RegistrationConfirmPinEffect.kt b/app/src/main/java/org/simple/clinic/registration/confirmpin/RegistrationConfirmPinEffect.kt index f12d014ebf1..16e9d6ee14d 100644 --- a/app/src/main/java/org/simple/clinic/registration/confirmpin/RegistrationConfirmPinEffect.kt +++ b/app/src/main/java/org/simple/clinic/registration/confirmpin/RegistrationConfirmPinEffect.kt @@ -11,7 +11,7 @@ data class ValidatePinConfirmation( sealed class RegistrationConfirmPinViewEffect : RegistrationConfirmPinEffect() -object ClearPin : RegistrationConfirmPinViewEffect() +data object ClearPin : RegistrationConfirmPinViewEffect() data class OpenFacilitySelectionScreen(val entry: OngoingRegistrationEntry) : RegistrationConfirmPinViewEffect() diff --git a/app/src/main/java/org/simple/clinic/registration/location/RegistrationLocationPermissionEvent.kt b/app/src/main/java/org/simple/clinic/registration/location/RegistrationLocationPermissionEvent.kt index f6559be2daf..9a1ef43e776 100644 --- a/app/src/main/java/org/simple/clinic/registration/location/RegistrationLocationPermissionEvent.kt +++ b/app/src/main/java/org/simple/clinic/registration/location/RegistrationLocationPermissionEvent.kt @@ -16,6 +16,6 @@ data class RequestLocationPermission( override val analyticsName = "Registration:Location Access Clicked" } -object SkipClicked : RegistrationLocationPermissionEvent() { +data object SkipClicked : RegistrationLocationPermissionEvent() { override val analyticsName: String = "Registration:Location Permission:Skip Clicked" } diff --git a/app/src/main/java/org/simple/clinic/registration/phone/PhoneNumberValidator.kt b/app/src/main/java/org/simple/clinic/registration/phone/PhoneNumberValidator.kt index 962e93c9a9e..2b7e8d51319 100644 --- a/app/src/main/java/org/simple/clinic/registration/phone/PhoneNumberValidator.kt +++ b/app/src/main/java/org/simple/clinic/registration/phone/PhoneNumberValidator.kt @@ -12,13 +12,13 @@ class PhoneNumberValidator( sealed class Result : Parcelable { @Parcelize - object ValidNumber : Result() + data object ValidNumber : Result() @Parcelize data class LengthTooShort(val minimumAllowedNumberLength: Int) : Result() @Parcelize - object Blank : Result() + data object Blank : Result() } fun validate(number: String): Result { diff --git a/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneEffect.kt b/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneEffect.kt index d2f83158a7b..bd8063da6df 100644 --- a/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneEffect.kt +++ b/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneEffect.kt @@ -8,7 +8,7 @@ sealed class RegistrationPhoneEffect data class ValidateEnteredNumber(val number: String) : RegistrationPhoneEffect() -object SyncFacilities : RegistrationPhoneEffect() +data object SyncFacilities : RegistrationPhoneEffect() data class SearchForExistingUser(val number: String) : RegistrationPhoneEffect() @@ -18,7 +18,7 @@ data class CreateUserLocally( val status: UserStatus ) : RegistrationPhoneEffect() -object LoadCurrentUserUnauthorizedStatus : RegistrationPhoneEffect() +data object LoadCurrentUserUnauthorizedStatus : RegistrationPhoneEffect() sealed class RegistrationPhoneViewEffect : RegistrationPhoneEffect() @@ -26,8 +26,8 @@ data class PrefillFields(val entry: OngoingRegistrationEntry) : RegistrationPhon data class ShowAccessDeniedScreen(val number: String) : RegistrationPhoneViewEffect() -object ProceedToLogin : RegistrationPhoneViewEffect() +data object ProceedToLogin : RegistrationPhoneViewEffect() -object ShowUserLoggedOutAlert : RegistrationPhoneViewEffect() +data object ShowUserLoggedOutAlert : RegistrationPhoneViewEffect() data class ContinueRegistration(val entry: OngoingRegistrationEntry) : RegistrationPhoneViewEffect() diff --git a/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneEvent.kt b/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneEvent.kt index 150bf7a6696..24b6a9fc1c5 100644 --- a/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneEvent.kt +++ b/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneEvent.kt @@ -46,11 +46,11 @@ data class FacilitiesSynced(val result: Result) : RegistrationPhoneEvent() { sealed class Result { - object Synced : Result() + data object Synced : Result() - object NetworkError : Result() + data object NetworkError : Result() - object OtherError : Result() + data object OtherError : Result() } } @@ -73,11 +73,11 @@ data class SearchForExistingUserCompleted(val result: Result) : RegistrationPhon data class Found(val uuid: UUID, val status: UserStatus) : Result() - object NotFound : Result() + data object NotFound : Result() - object NetworkError : Result() + data object NetworkError : Result() - object OtherError : Result() + data object OtherError : Result() } } @@ -85,6 +85,6 @@ class RegistrationPhoneDoneClicked : RegistrationPhoneEvent() { override val analyticsName = "Registration:Phone Entry:Done Clicked" } -object UserCreatedLocally : RegistrationPhoneEvent() +data object UserCreatedLocally : RegistrationPhoneEvent() data class CurrentUserUnauthorizedStatusLoaded(val isUserUnauthorized: Boolean) : RegistrationPhoneEvent() diff --git a/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneValidationResult.kt b/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneValidationResult.kt index 929bd08e969..e960c4c3af4 100644 --- a/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneValidationResult.kt +++ b/app/src/main/java/org/simple/clinic/registration/phone/RegistrationPhoneValidationResult.kt @@ -6,14 +6,14 @@ import kotlinx.parcelize.Parcelize sealed class RegistrationPhoneValidationResult : Parcelable { @Parcelize - object Valid : RegistrationPhoneValidationResult() + data object Valid : RegistrationPhoneValidationResult() sealed class Invalid : RegistrationPhoneValidationResult() { @Parcelize - object TooShort : Invalid() + data object TooShort : Invalid() @Parcelize - object Blank : Invalid() + data object Blank : Invalid() } } diff --git a/app/src/main/java/org/simple/clinic/registration/phone/loggedout/LoggedOutOfDeviceEffect.kt b/app/src/main/java/org/simple/clinic/registration/phone/loggedout/LoggedOutOfDeviceEffect.kt index 843741f1d54..9dd6f38ddbc 100644 --- a/app/src/main/java/org/simple/clinic/registration/phone/loggedout/LoggedOutOfDeviceEffect.kt +++ b/app/src/main/java/org/simple/clinic/registration/phone/loggedout/LoggedOutOfDeviceEffect.kt @@ -2,6 +2,6 @@ package org.simple.clinic.registration.phone.loggedout sealed class LoggedOutOfDeviceEffect -object LogoutUser : LoggedOutOfDeviceEffect() +data object LogoutUser : LoggedOutOfDeviceEffect() data class ThrowError(val cause: Throwable) : LoggedOutOfDeviceEffect() diff --git a/app/src/main/java/org/simple/clinic/registration/register/RegistrationLoadingEffect.kt b/app/src/main/java/org/simple/clinic/registration/register/RegistrationLoadingEffect.kt index 1a8e6a0a751..df365f9ec89 100644 --- a/app/src/main/java/org/simple/clinic/registration/register/RegistrationLoadingEffect.kt +++ b/app/src/main/java/org/simple/clinic/registration/register/RegistrationLoadingEffect.kt @@ -11,4 +11,4 @@ data class ConvertRegistrationEntryToUserDetails(val registrationEntry: OngoingR sealed class RegistrationLoadingViewEffect : RegistrationLoadingEffect() -object GoToHomeScreen : RegistrationLoadingViewEffect() +data object GoToHomeScreen : RegistrationLoadingViewEffect() diff --git a/app/src/main/java/org/simple/clinic/registration/register/RegistrationLoadingEvent.kt b/app/src/main/java/org/simple/clinic/registration/register/RegistrationLoadingEvent.kt index c287578a318..965b2848fe4 100644 --- a/app/src/main/java/org/simple/clinic/registration/register/RegistrationLoadingEvent.kt +++ b/app/src/main/java/org/simple/clinic/registration/register/RegistrationLoadingEvent.kt @@ -7,7 +7,7 @@ sealed class RegistrationLoadingEvent : UiEvent data class UserRegistrationCompleted(val result: RegisterUserResult) : RegistrationLoadingEvent() -object RegisterErrorRetryClicked : RegistrationLoadingEvent() { +data object RegisterErrorRetryClicked : RegistrationLoadingEvent() { override val analyticsName: String = "Registration:Loading:Retry Clicked" } diff --git a/app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEffect.kt b/app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEffect.kt index f32f5ff3231..a2697a5d4f2 100644 --- a/app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEffect.kt +++ b/app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEffect.kt @@ -21,8 +21,8 @@ data class MarkPatientAsTransferredToAnotherFacility(val patientId: UUID) : Remo data class MarkPatientAsRefusedToComeBack(val patientId: UUID) : RemoveOverdueEffect() -object GoBack : RemoveOverdueEffect() +data object GoBack : RemoveOverdueEffect() sealed class RemoveOverdueViewEffect : RemoveOverdueEffect() -object GoBackAfterAppointmentRemoval : RemoveOverdueViewEffect() +data object GoBackAfterAppointmentRemoval : RemoveOverdueViewEffect() diff --git a/app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEvent.kt b/app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEvent.kt index 5e4ea63d7eb..0a95ba48242 100644 --- a/app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEvent.kt +++ b/app/src/main/java/org/simple/clinic/removeoverdueappointment/RemoveOverdueEvent.kt @@ -6,11 +6,11 @@ import org.simple.clinic.widgets.UiEvent sealed class RemoveOverdueEvent : UiEvent -object PatientMarkedAsVisited : RemoveOverdueEvent() +data object PatientMarkedAsVisited : RemoveOverdueEvent() -object PatientMarkedAsDead : RemoveOverdueEvent() +data object PatientMarkedAsDead : RemoveOverdueEvent() -object AppointmentMarkedAsCancelled : RemoveOverdueEvent() +data object AppointmentMarkedAsCancelled : RemoveOverdueEvent() data class PatientMarkedAsMigrated(val cancelReason: AppointmentCancelReason) : RemoveOverdueEvent() @@ -19,7 +19,7 @@ data class RemoveAppointmentReasonSelected(val reason: RemoveAppointmentReason) override val analyticsName = "Contact Patient:Appointment cancel reason selected:$reason" } -object DoneClicked : RemoveOverdueEvent() { +data object DoneClicked : RemoveOverdueEvent() { override val analyticsName = "Contact Patient:Done Clicked" } diff --git a/app/src/main/java/org/simple/clinic/scanid/EnteredCodeInput.kt b/app/src/main/java/org/simple/clinic/scanid/EnteredCodeInput.kt index f7961a7ea1f..ef60929a46d 100644 --- a/app/src/main/java/org/simple/clinic/scanid/EnteredCodeInput.kt +++ b/app/src/main/java/org/simple/clinic/scanid/EnteredCodeInput.kt @@ -28,10 +28,10 @@ data class EnteredCodeInput(val enteredCodeText: String) : Parcelable { } sealed class EnteredCodeValidationResult { - object Success : EnteredCodeValidationResult() + data object Success : EnteredCodeValidationResult() sealed class Failure : EnteredCodeValidationResult() { - object Empty : Failure() - object NotEqualToRequiredLength : Failure() + data object Empty : Failure() + data object NotEqualToRequiredLength : Failure() } } diff --git a/app/src/main/java/org/simple/clinic/scanid/OpenedFrom.kt b/app/src/main/java/org/simple/clinic/scanid/OpenedFrom.kt index f50b6dd4e02..5e731c96c6d 100644 --- a/app/src/main/java/org/simple/clinic/scanid/OpenedFrom.kt +++ b/app/src/main/java/org/simple/clinic/scanid/OpenedFrom.kt @@ -6,17 +6,17 @@ import kotlinx.parcelize.Parcelize sealed class OpenedFrom : Parcelable { @Parcelize - object PatientsTabScreen : OpenedFrom() + data object PatientsTabScreen : OpenedFrom() @Parcelize - object InstantSearchScreen : OpenedFrom() + data object InstantSearchScreen : OpenedFrom() sealed class EditPatientScreen : OpenedFrom() { @Parcelize - object ToAddNHID : EditPatientScreen() + data object ToAddNHID : EditPatientScreen() @Parcelize - object ToAddBpPassport : EditPatientScreen() + data object ToAddBpPassport : EditPatientScreen() } } diff --git a/app/src/main/java/org/simple/clinic/scanid/ScanErrorState.kt b/app/src/main/java/org/simple/clinic/scanid/ScanErrorState.kt index 223754a9a14..5444ea84afd 100644 --- a/app/src/main/java/org/simple/clinic/scanid/ScanErrorState.kt +++ b/app/src/main/java/org/simple/clinic/scanid/ScanErrorState.kt @@ -6,8 +6,8 @@ import kotlinx.parcelize.Parcelize sealed class ScanErrorState : Parcelable { @Parcelize - object InvalidQrCode : ScanErrorState() + data object InvalidQrCode : ScanErrorState() @Parcelize - object IdentifierAlreadyExists : ScanErrorState() + data object IdentifierAlreadyExists : ScanErrorState() } diff --git a/app/src/main/java/org/simple/clinic/scanid/ScanSearchState.kt b/app/src/main/java/org/simple/clinic/scanid/ScanSearchState.kt index 44a2dd07cc0..581e90de4a1 100644 --- a/app/src/main/java/org/simple/clinic/scanid/ScanSearchState.kt +++ b/app/src/main/java/org/simple/clinic/scanid/ScanSearchState.kt @@ -6,8 +6,8 @@ import kotlinx.parcelize.Parcelize sealed class ScanSearchState : Parcelable { @Parcelize - object Searching : ScanSearchState() + data object Searching : ScanSearchState() @Parcelize - object NotSearching : ScanSearchState() + data object NotSearching : ScanSearchState() } diff --git a/app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdEffect.kt b/app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdEffect.kt index 9e8238d1322..a2940256350 100644 --- a/app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdEffect.kt +++ b/app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdEffect.kt @@ -21,11 +21,11 @@ data class SaveCompleteMedicalRecords( sealed class ScanSimpleIdViewEffect : ScanSimpleIdEffect() -object ShowQrCodeScannerView : ScanSimpleIdViewEffect() +data object ShowQrCodeScannerView : ScanSimpleIdViewEffect() -object HideQrCodeScannerView : ScanSimpleIdViewEffect() +data object HideQrCodeScannerView : ScanSimpleIdViewEffect() -object HideEnteredCodeValidationError : ScanSimpleIdViewEffect() +data object HideEnteredCodeValidationError : ScanSimpleIdViewEffect() data class ShowEnteredCodeValidationError(val failure: EnteredCodeValidationResult) : ScanSimpleIdViewEffect() diff --git a/app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdEvent.kt b/app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdEvent.kt index 6b6cf1eb74d..fc9c5262d32 100644 --- a/app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdEvent.kt +++ b/app/src/main/java/org/simple/clinic/scanid/ScanSimpleIdEvent.kt @@ -9,17 +9,17 @@ import org.simple.clinic.widgets.UiEvent sealed class ScanSimpleIdEvent : UiEvent -object ShowKeyboard : ScanSimpleIdEvent() { +data object ShowKeyboard : ScanSimpleIdEvent() { override val analyticsName: String get() = "Scan Simple Card:Show keyboard" } -object HideKeyboard : ScanSimpleIdEvent() { +data object HideKeyboard : ScanSimpleIdEvent() { override val analyticsName: String get() = "Scan Simple Card:Hide keyboard" } -object EnteredCodeChanged : ScanSimpleIdEvent() { +data object EnteredCodeChanged : ScanSimpleIdEvent() { override val analyticsName: String get() = "Scan Simple Card:Entered code changed" } @@ -45,7 +45,7 @@ data class ScannedQRCodeJsonParsed( val healthIdNumber: String? ) : ScanSimpleIdEvent() -object InvalidQrCode : ScanSimpleIdEvent() { +data object InvalidQrCode : ScanSimpleIdEvent() { override val analyticsName = "Scan Simple Card:Invalid QR Code scanned" } diff --git a/app/src/main/java/org/simple/clinic/scanid/scannedqrcode/BlankScannedQRCodeResult.kt b/app/src/main/java/org/simple/clinic/scanid/scannedqrcode/BlankScannedQRCodeResult.kt index 68e476a23cc..5eed5fc2e98 100644 --- a/app/src/main/java/org/simple/clinic/scanid/scannedqrcode/BlankScannedQRCodeResult.kt +++ b/app/src/main/java/org/simple/clinic/scanid/scannedqrcode/BlankScannedQRCodeResult.kt @@ -6,7 +6,7 @@ import kotlinx.parcelize.Parcelize sealed class BlankScannedQRCodeResult : Parcelable @Parcelize -object AddToExistingPatient : BlankScannedQRCodeResult() +data object AddToExistingPatient : BlankScannedQRCodeResult() @Parcelize -object RegisterNewPatient : BlankScannedQRCodeResult() +data object RegisterNewPatient : BlankScannedQRCodeResult() diff --git a/app/src/main/java/org/simple/clinic/scanid/scannedqrcode/ScannedQrCodeEvent.kt b/app/src/main/java/org/simple/clinic/scanid/scannedqrcode/ScannedQrCodeEvent.kt index 19262ecad09..31d38762815 100644 --- a/app/src/main/java/org/simple/clinic/scanid/scannedqrcode/ScannedQrCodeEvent.kt +++ b/app/src/main/java/org/simple/clinic/scanid/scannedqrcode/ScannedQrCodeEvent.kt @@ -4,12 +4,12 @@ import org.simple.clinic.widgets.UiEvent sealed class ScannedQrCodeEvent : UiEvent -object NewOngoingPatientEntrySaved : ScannedQrCodeEvent() +data object NewOngoingPatientEntrySaved : ScannedQrCodeEvent() -object RegisterNewPatientClicked : ScannedQrCodeEvent() { +data object RegisterNewPatientClicked : ScannedQrCodeEvent() { override val analyticsName = "Blank BP passport sheet:Register new patient" } -object AddToExistingPatientClicked : ScannedQrCodeEvent() { +data object AddToExistingPatientClicked : ScannedQrCodeEvent() { override val analyticsName = "Blank BP passport sheet:Add to existing patient" } diff --git a/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffect.kt b/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffect.kt index 019c02fac69..c1ef5ad5dff 100644 --- a/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffect.kt +++ b/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEffect.kt @@ -7,7 +7,7 @@ import java.util.UUID sealed class ScheduleAppointmentEffect -object LoadDefaultAppointmentDate : ScheduleAppointmentEffect() +data object LoadDefaultAppointmentDate : ScheduleAppointmentEffect() data class LoadAppointmentFacilities(val patientUuid: UUID) : ScheduleAppointmentEffect() @@ -33,8 +33,8 @@ sealed class ScheduleAppointmentViewEffect : ScheduleAppointmentEffect() data class ShowDatePicker(val selectedDate: LocalDate) : ScheduleAppointmentViewEffect() -object CloseSheet : ScheduleAppointmentViewEffect() +data object CloseSheet : ScheduleAppointmentViewEffect() data class GoToTeleconsultStatusSheet(val teleconsultRecordUuid: UUID) : ScheduleAppointmentViewEffect() -object CloseSheetWithoutResult : ScheduleAppointmentViewEffect() +data object CloseSheetWithoutResult : ScheduleAppointmentViewEffect() diff --git a/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEvent.kt b/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEvent.kt index 16052d4ab50..fc00a3f6f2a 100644 --- a/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEvent.kt +++ b/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentEvent.kt @@ -10,11 +10,11 @@ sealed class ScheduleAppointmentEvent : UiEvent data class DefaultAppointmentDateLoaded(val potentialAppointmentDate: PotentialAppointmentDate) : ScheduleAppointmentEvent() -object AppointmentDateIncremented : ScheduleAppointmentEvent() { +data object AppointmentDateIncremented : ScheduleAppointmentEvent() { override val analyticsName = "Schedule Appointment:Increment appointment due date" } -object AppointmentDateDecremented : ScheduleAppointmentEvent() { +data object AppointmentDateDecremented : ScheduleAppointmentEvent() { override val analyticsName = "Schedule Appointment:Decrement appointment due date" } @@ -22,7 +22,7 @@ data class AppointmentCalendarDateSelected(val selectedDate: LocalDate) : Schedu override val analyticsName = "Schedule Appointment:Appointment calendar date selected" } -object ManuallySelectAppointmentDateClicked : ScheduleAppointmentEvent() { +data object ManuallySelectAppointmentDateClicked : ScheduleAppointmentEvent() { override val analyticsName = "Schedule Appointment:Manually Select Appointment Date" } @@ -35,23 +35,23 @@ data class PatientFacilityChanged(val facility: Facility) : ScheduleAppointmentE override val analyticsName = "Schedule Appointment: Patient facility changed" } -object AppointmentScheduled : ScheduleAppointmentEvent() +data object AppointmentScheduled : ScheduleAppointmentEvent() -object DoneClicked : ScheduleAppointmentEvent() { +data object DoneClicked : ScheduleAppointmentEvent() { override val analyticsName = "Schedule Appointment:Appointment done" } data class PatientDefaulterStatusLoaded(val isPatientADefaulter: Boolean) : ScheduleAppointmentEvent() -object SchedulingSkipped : ScheduleAppointmentEvent() { +data object SchedulingSkipped : ScheduleAppointmentEvent() { override val analyticsName = "Schedule Appointment:Scheduling skipped" } data class TeleconsultRecordLoaded(val teleconsultRecord: TeleconsultRecord?) : ScheduleAppointmentEvent() -object NextClicked : ScheduleAppointmentEvent() { +data object NextClicked : ScheduleAppointmentEvent() { override val analyticsName = "Schedule Appointment:Next clicked" } -object AppointmentScheduledForPatientFromNext : ScheduleAppointmentEvent() +data object AppointmentScheduledForPatientFromNext : ScheduleAppointmentEvent() diff --git a/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentSheet.kt b/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentSheet.kt index 4913c04d0fa..99d426bd47b 100644 --- a/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentSheet.kt +++ b/app/src/main/java/org/simple/clinic/scheduleappointment/ScheduleAppointmentSheet.kt @@ -340,10 +340,10 @@ class ScheduleAppointmentSheet : BaseBottomSheet< sealed class Request : Parcelable { @Parcelize - object SelectFacility : Request() + data object SelectFacility : Request() @Parcelize - object PickAppointmentDate : Request() + data object PickAppointmentDate : Request() } interface Injector { diff --git a/app/src/main/java/org/simple/clinic/security/pin/PinEntryEffect.kt b/app/src/main/java/org/simple/clinic/security/pin/PinEntryEffect.kt index aa4f59d0f7b..2779c7bcdad 100644 --- a/app/src/main/java/org/simple/clinic/security/pin/PinEntryEffect.kt +++ b/app/src/main/java/org/simple/clinic/security/pin/PinEntryEffect.kt @@ -4,9 +4,9 @@ import java.time.Instant sealed class PinEntryEffect -object LoadPinEntryProtectedStates : PinEntryEffect() +data object LoadPinEntryProtectedStates : PinEntryEffect() -object HideError : PinEntryEffect() +data object HideError : PinEntryEffect() data class ShowIncorrectPinError( val attemptsMade: Int, @@ -15,26 +15,26 @@ data class ShowIncorrectPinError( data class ShowIncorrectPinLimitReachedError(val attemptsMade: Int) : PinEntryEffect() -object AllowPinEntry : PinEntryEffect() +data object AllowPinEntry : PinEntryEffect() data class BlockPinEntryUntil(val blockTill: Instant) : PinEntryEffect() -object RecordSuccessfulAttempt : PinEntryEffect() +data object RecordSuccessfulAttempt : PinEntryEffect() -object RecordFailedAttempt : PinEntryEffect() +data object RecordFailedAttempt : PinEntryEffect() -object ShowProgress : PinEntryEffect() +data object ShowProgress : PinEntryEffect() -object ClearPin : PinEntryEffect() +data object ClearPin : PinEntryEffect() data class VerifyPin(val pin: String) : PinEntryEffect() data class CorrectPinEntered(val pinVerifiedData: Any?) : PinEntryEffect() -object ShowNetworkError : PinEntryEffect() +data object ShowNetworkError : PinEntryEffect() -object ShowServerError : PinEntryEffect() +data object ShowServerError : PinEntryEffect() -object ShowUnexpectedError : PinEntryEffect() +data object ShowUnexpectedError : PinEntryEffect() data class SaveDemoFacility(val data: Any?) : PinEntryEffect() diff --git a/app/src/main/java/org/simple/clinic/security/pin/PinEntryEvent.kt b/app/src/main/java/org/simple/clinic/security/pin/PinEntryEvent.kt index 427b53496cf..bc34dd815e5 100644 --- a/app/src/main/java/org/simple/clinic/security/pin/PinEntryEvent.kt +++ b/app/src/main/java/org/simple/clinic/security/pin/PinEntryEvent.kt @@ -18,6 +18,6 @@ data class PinAuthenticated(val data: Any?) : PinEntryEvent() { data class PinVerified(val result: PinVerificationMethod.VerificationResult) : PinEntryEvent() -object PinEntryDoneClicked : PinEntryEvent() +data object PinEntryDoneClicked : PinEntryEvent() data class DemoFacilitySaved(val data: Any?) : PinEntryEvent() diff --git a/app/src/main/java/org/simple/clinic/security/pin/PinEntryUi.kt b/app/src/main/java/org/simple/clinic/security/pin/PinEntryUi.kt index f9f7f1fd62d..eec07ea09ed 100644 --- a/app/src/main/java/org/simple/clinic/security/pin/PinEntryUi.kt +++ b/app/src/main/java/org/simple/clinic/security/pin/PinEntryUi.kt @@ -9,10 +9,10 @@ interface PinEntryUi { sealed class Mode : Parcelable { @Parcelize - object PinEntry : Mode() + data object PinEntry : Mode() @Parcelize - object Progress : Mode() + data object Progress : Mode() @Parcelize data class BruteForceLocked(val lockUntil: Instant) : Mode() diff --git a/app/src/main/java/org/simple/clinic/security/pin/verification/PinVerificationMethod.kt b/app/src/main/java/org/simple/clinic/security/pin/verification/PinVerificationMethod.kt index 3af2fc852e5..65580681fed 100644 --- a/app/src/main/java/org/simple/clinic/security/pin/verification/PinVerificationMethod.kt +++ b/app/src/main/java/org/simple/clinic/security/pin/verification/PinVerificationMethod.kt @@ -10,9 +10,9 @@ interface PinVerificationMethod { data class Incorrect(val data: Any? = null) : VerificationResult() - object NetworkError : VerificationResult() + data object NetworkError : VerificationResult() - object ServerError : VerificationResult() + data object ServerError : VerificationResult() data class OtherError(val cause: Throwable) : VerificationResult() } diff --git a/app/src/main/java/org/simple/clinic/selectcountry/ManifestFetchError.kt b/app/src/main/java/org/simple/clinic/selectcountry/ManifestFetchError.kt index 3989f20650a..e385c01e0b7 100644 --- a/app/src/main/java/org/simple/clinic/selectcountry/ManifestFetchError.kt +++ b/app/src/main/java/org/simple/clinic/selectcountry/ManifestFetchError.kt @@ -21,10 +21,10 @@ sealed class ManifestFetchError : Parcelable { } @Parcelize -object NetworkError : ManifestFetchError() +data object NetworkError : ManifestFetchError() @Parcelize -object ServerError : ManifestFetchError() +data object ServerError : ManifestFetchError() @Parcelize -object UnexpectedError : ManifestFetchError() +data object UnexpectedError : ManifestFetchError() diff --git a/app/src/main/java/org/simple/clinic/selectcountry/SelectCountryEffect.kt b/app/src/main/java/org/simple/clinic/selectcountry/SelectCountryEffect.kt index 7a96d700249..c4ef24c3147 100644 --- a/app/src/main/java/org/simple/clinic/selectcountry/SelectCountryEffect.kt +++ b/app/src/main/java/org/simple/clinic/selectcountry/SelectCountryEffect.kt @@ -4,10 +4,10 @@ import org.simple.clinic.appconfig.Country sealed class SelectCountryEffect -object FetchManifest : SelectCountryEffect() +data object FetchManifest : SelectCountryEffect() data class SaveCountryEffect(val country: Country) : SelectCountryEffect() sealed class SelectCountryViewEffect : SelectCountryEffect() -object GoToStateSelectionScreen : SelectCountryViewEffect() +data object GoToStateSelectionScreen : SelectCountryViewEffect() diff --git a/app/src/main/java/org/simple/clinic/selectcountry/SelectCountryEvent.kt b/app/src/main/java/org/simple/clinic/selectcountry/SelectCountryEvent.kt index 4575039c889..bdd8404426a 100644 --- a/app/src/main/java/org/simple/clinic/selectcountry/SelectCountryEvent.kt +++ b/app/src/main/java/org/simple/clinic/selectcountry/SelectCountryEvent.kt @@ -13,8 +13,8 @@ data class CountryChosen(val country: Country) : SelectCountryEvent() { override val analyticsName: String = "Select Country:Selected Country Changed:${country.isoCountryCode}" } -object CountrySaved : SelectCountryEvent() +data object CountrySaved : SelectCountryEvent() -object RetryClicked : SelectCountryEvent() { +data object RetryClicked : SelectCountryEvent() { override val analyticsName: String = "Select Country:Retry Clicked" } diff --git a/app/src/main/java/org/simple/clinic/selectstate/SelectStateEffect.kt b/app/src/main/java/org/simple/clinic/selectstate/SelectStateEffect.kt index 2e6005cb936..243422e77c6 100644 --- a/app/src/main/java/org/simple/clinic/selectstate/SelectStateEffect.kt +++ b/app/src/main/java/org/simple/clinic/selectstate/SelectStateEffect.kt @@ -4,12 +4,12 @@ import org.simple.clinic.appconfig.State sealed class SelectStateEffect -object LoadStates : SelectStateEffect() +data object LoadStates : SelectStateEffect() data class SaveSelectedState(val state: State) : SelectStateEffect() sealed class SelectStateViewEffect : SelectStateEffect() -object GoToRegistrationScreen : SelectStateViewEffect() +data object GoToRegistrationScreen : SelectStateViewEffect() -object ReplaceCurrentScreenWithRegistrationScreen : SelectStateViewEffect() +data object ReplaceCurrentScreenWithRegistrationScreen : SelectStateViewEffect() diff --git a/app/src/main/java/org/simple/clinic/selectstate/SelectStateEvent.kt b/app/src/main/java/org/simple/clinic/selectstate/SelectStateEvent.kt index ffba2198782..1da307d6ed1 100644 --- a/app/src/main/java/org/simple/clinic/selectstate/SelectStateEvent.kt +++ b/app/src/main/java/org/simple/clinic/selectstate/SelectStateEvent.kt @@ -5,13 +5,13 @@ import org.simple.clinic.widgets.UiEvent sealed class SelectStateEvent : UiEvent -object StateSaved : SelectStateEvent() +data object StateSaved : SelectStateEvent() data class StatesFetched(val states: List) : SelectStateEvent() data class FailedToFetchStates(val error: StatesFetchError) : SelectStateEvent() -object RetryButtonClicked : SelectStateEvent() { +data object RetryButtonClicked : SelectStateEvent() { override val analyticsName: String = "Select State:Retry Clicked" } diff --git a/app/src/main/java/org/simple/clinic/selectstate/StatesFetchError.kt b/app/src/main/java/org/simple/clinic/selectstate/StatesFetchError.kt index fd9d0947501..c807af6ed1b 100644 --- a/app/src/main/java/org/simple/clinic/selectstate/StatesFetchError.kt +++ b/app/src/main/java/org/simple/clinic/selectstate/StatesFetchError.kt @@ -17,11 +17,11 @@ sealed class StatesFetchError : Parcelable { } @Parcelize - object NetworkError : StatesFetchError() + data object NetworkError : StatesFetchError() @Parcelize - object ServerError : StatesFetchError() + data object ServerError : StatesFetchError() @Parcelize - object UnexpectedError : StatesFetchError() + data object UnexpectedError : StatesFetchError() } diff --git a/app/src/main/java/org/simple/clinic/settings/Language.kt b/app/src/main/java/org/simple/clinic/settings/Language.kt index f210a7664fe..806176686a2 100644 --- a/app/src/main/java/org/simple/clinic/settings/Language.kt +++ b/app/src/main/java/org/simple/clinic/settings/Language.kt @@ -21,4 +21,4 @@ data class ProvidedLanguage(val displayName: String, val languageCode: String) : } @Parcelize -object SystemDefaultLanguage : Language() +data object SystemDefaultLanguage : Language() diff --git a/app/src/main/java/org/simple/clinic/settings/SettingsEffect.kt b/app/src/main/java/org/simple/clinic/settings/SettingsEffect.kt index 06a0d0a7b24..adf52a757eb 100644 --- a/app/src/main/java/org/simple/clinic/settings/SettingsEffect.kt +++ b/app/src/main/java/org/simple/clinic/settings/SettingsEffect.kt @@ -2,24 +2,24 @@ package org.simple.clinic.settings sealed class SettingsEffect -object LoadUserDetailsEffect : SettingsEffect() +data object LoadUserDetailsEffect : SettingsEffect() -object LoadCurrentLanguageEffect : SettingsEffect() +data object LoadCurrentLanguageEffect : SettingsEffect() -object LoadAppVersionEffect : SettingsEffect() +data object LoadAppVersionEffect : SettingsEffect() -object CheckAppUpdateAvailable : SettingsEffect() +data object CheckAppUpdateAvailable : SettingsEffect() -object LogoutUser : SettingsEffect() +data object LogoutUser : SettingsEffect() -object LoadDatabaseEncryptionStatus : SettingsEffect() +data object LoadDatabaseEncryptionStatus : SettingsEffect() sealed class SettingsViewEffect : SettingsEffect() -object OpenLanguageSelectionScreenEffect : SettingsViewEffect() +data object OpenLanguageSelectionScreenEffect : SettingsViewEffect() -object ShowConfirmLogoutDialog : SettingsViewEffect() +data object ShowConfirmLogoutDialog : SettingsViewEffect() -object RestartApp : SettingsViewEffect() +data object RestartApp : SettingsViewEffect() -object GoBack : SettingsViewEffect() +data object GoBack : SettingsViewEffect() diff --git a/app/src/main/java/org/simple/clinic/settings/SettingsEvent.kt b/app/src/main/java/org/simple/clinic/settings/SettingsEvent.kt index 3542e402a29..72f33a8f69c 100644 --- a/app/src/main/java/org/simple/clinic/settings/SettingsEvent.kt +++ b/app/src/main/java/org/simple/clinic/settings/SettingsEvent.kt @@ -9,7 +9,7 @@ data class UserDetailsLoaded(val name: String, val phoneNumber: String) : Settin data class CurrentLanguageLoaded(val language: Language) : SettingsEvent() -object ChangeLanguage : SettingsEvent() { +data object ChangeLanguage : SettingsEvent() { override val analyticsName: String = "Settings:Change Language Clicked" } @@ -19,15 +19,15 @@ data class AppUpdateAvailabilityChecked(val isUpdateAvailable: Boolean) : Settin data class UserLogoutResult(val result: UserSession.LogoutResult) : SettingsEvent() -object LogoutButtonClicked : SettingsEvent() { +data object LogoutButtonClicked : SettingsEvent() { override val analyticsName: String = "Settings:Logout Button Clicked" } -object ConfirmLogoutButtonClicked : SettingsEvent() { +data object ConfirmLogoutButtonClicked : SettingsEvent() { override val analyticsName: String = "Settings:Confirm Logout Button Clicked" } -object BackClicked : SettingsEvent() { +data object BackClicked : SettingsEvent() { override val analyticsName: String = "Settings:Back Clicked" } diff --git a/app/src/main/java/org/simple/clinic/settings/changelanguage/ChangeLanguageEffect.kt b/app/src/main/java/org/simple/clinic/settings/changelanguage/ChangeLanguageEffect.kt index 9a6fb5fd48d..eec60a0c86e 100644 --- a/app/src/main/java/org/simple/clinic/settings/changelanguage/ChangeLanguageEffect.kt +++ b/app/src/main/java/org/simple/clinic/settings/changelanguage/ChangeLanguageEffect.kt @@ -4,14 +4,14 @@ import org.simple.clinic.settings.Language sealed class ChangeLanguageEffect -object LoadCurrentLanguageEffect : ChangeLanguageEffect() +data object LoadCurrentLanguageEffect : ChangeLanguageEffect() -object LoadSupportedLanguagesEffect : ChangeLanguageEffect() +data object LoadSupportedLanguagesEffect : ChangeLanguageEffect() data class UpdateCurrentLanguageEffect(val newLanguage: Language) : ChangeLanguageEffect() -object GoBack : ChangeLanguageEffect() +data object GoBack : ChangeLanguageEffect() -object RestartActivity : ChangeLanguageEffect() +data object RestartActivity : ChangeLanguageEffect() -object TriggerSync : ChangeLanguageEffect() +data object TriggerSync : ChangeLanguageEffect() diff --git a/app/src/main/java/org/simple/clinic/settings/changelanguage/ChangeLanguageEvent.kt b/app/src/main/java/org/simple/clinic/settings/changelanguage/ChangeLanguageEvent.kt index e7f5a10a6a1..71ced3244ff 100644 --- a/app/src/main/java/org/simple/clinic/settings/changelanguage/ChangeLanguageEvent.kt +++ b/app/src/main/java/org/simple/clinic/settings/changelanguage/ChangeLanguageEvent.kt @@ -19,9 +19,9 @@ data class SelectLanguageEvent(val newLanguage: Language) : ChangeLanguageEvent( } } -object CurrentLanguageChangedEvent : ChangeLanguageEvent() +data object CurrentLanguageChangedEvent : ChangeLanguageEvent() -object SaveCurrentLanguageEvent : ChangeLanguageEvent() { +data object SaveCurrentLanguageEvent : ChangeLanguageEvent() { override val analyticsName: String get() = "Change Language:Done Clicked" } diff --git a/app/src/main/java/org/simple/clinic/setup/SetupActivityEffect.kt b/app/src/main/java/org/simple/clinic/setup/SetupActivityEffect.kt index 9a479ede8fb..9937c58113e 100644 --- a/app/src/main/java/org/simple/clinic/setup/SetupActivityEffect.kt +++ b/app/src/main/java/org/simple/clinic/setup/SetupActivityEffect.kt @@ -6,31 +6,31 @@ import org.simple.clinic.setup.runcheck.Disallowed sealed class SetupActivityEffect -object FetchUserDetails : SetupActivityEffect() +data object FetchUserDetails : SetupActivityEffect() -object GoToMainActivity : SetupActivityEffect() +data object GoToMainActivity : SetupActivityEffect() -object ShowOnboardingScreen : SetupActivityEffect() +data object ShowOnboardingScreen : SetupActivityEffect() -object InitializeDatabase : SetupActivityEffect() +data object InitializeDatabase : SetupActivityEffect() -object ShowCountrySelectionScreen : SetupActivityEffect() +data object ShowCountrySelectionScreen : SetupActivityEffect() -object RunDatabaseMaintenance : SetupActivityEffect() +data object RunDatabaseMaintenance : SetupActivityEffect() -object FetchDatabaseMaintenanceLastRunAtTime : SetupActivityEffect() +data object FetchDatabaseMaintenanceLastRunAtTime : SetupActivityEffect() data class ShowNotAllowedToRunMessage(val reason: Disallowed.Reason) : SetupActivityEffect() -object CheckIfAppCanRun : SetupActivityEffect() +data object CheckIfAppCanRun : SetupActivityEffect() data class SaveCountryAndDeployment( val country: Country, val deployment: Deployment ): SetupActivityEffect() -object DeleteStoredCountryV1 : SetupActivityEffect() +data object DeleteStoredCountryV1 : SetupActivityEffect() -object ExecuteDatabaseEncryption : SetupActivityEffect() +data object ExecuteDatabaseEncryption : SetupActivityEffect() -object CheckMinimumMemory : SetupActivityEffect() +data object CheckMinimumMemory : SetupActivityEffect() diff --git a/app/src/main/java/org/simple/clinic/setup/SetupActivityEvent.kt b/app/src/main/java/org/simple/clinic/setup/SetupActivityEvent.kt index 00f8472ba58..fc80f48274a 100644 --- a/app/src/main/java/org/simple/clinic/setup/SetupActivityEvent.kt +++ b/app/src/main/java/org/simple/clinic/setup/SetupActivityEvent.kt @@ -17,18 +17,18 @@ data class UserDetailsFetched( val currentDeployment: Optional ) : SetupActivityEvent() -object DatabaseInitialized : SetupActivityEvent() +data object DatabaseInitialized : SetupActivityEvent() -object DatabaseMaintenanceCompleted : SetupActivityEvent() +data object DatabaseMaintenanceCompleted : SetupActivityEvent() data class DatabaseMaintenanceLastRunAtTimeLoaded(val runAt: Optional) : SetupActivityEvent() data class AppAllowedToRunCheckCompleted(val allowedToRun: AllowedToRun) : SetupActivityEvent() -object CountryAndDeploymentSaved: SetupActivityEvent() +data object CountryAndDeploymentSaved : SetupActivityEvent() -object StoredCountryV1Deleted: SetupActivityEvent() +data object StoredCountryV1Deleted : SetupActivityEvent() -object DatabaseEncryptionFinished : SetupActivityEvent() +data object DatabaseEncryptionFinished : SetupActivityEvent() data class MinimumMemoryChecked(val hasMinimumMemory: Boolean) : SetupActivityEvent() diff --git a/app/src/main/java/org/simple/clinic/setup/runcheck/AllowedToRun.kt b/app/src/main/java/org/simple/clinic/setup/runcheck/AllowedToRun.kt index 5a22337a079..8dbd91d4f3b 100644 --- a/app/src/main/java/org/simple/clinic/setup/runcheck/AllowedToRun.kt +++ b/app/src/main/java/org/simple/clinic/setup/runcheck/AllowedToRun.kt @@ -2,7 +2,7 @@ package org.simple.clinic.setup.runcheck sealed class AllowedToRun -object Allowed : AllowedToRun() +data object Allowed : AllowedToRun() data class Disallowed(val reason: Reason) : AllowedToRun() { diff --git a/app/src/main/java/org/simple/clinic/signature/SignatureEffect.kt b/app/src/main/java/org/simple/clinic/signature/SignatureEffect.kt index 2d77ca80fe7..de15c70cad4 100644 --- a/app/src/main/java/org/simple/clinic/signature/SignatureEffect.kt +++ b/app/src/main/java/org/simple/clinic/signature/SignatureEffect.kt @@ -4,12 +4,12 @@ import android.graphics.Bitmap sealed class SignatureEffect -object ClearSignature : SignatureEffect() +data object ClearSignature : SignatureEffect() data class AcceptSignature(val bitmap: Bitmap?) : SignatureEffect() -object CloseScreen : SignatureEffect() +data object CloseScreen : SignatureEffect() -object LoadSignatureBitmap : SignatureEffect() +data object LoadSignatureBitmap : SignatureEffect() data class SetSignatureBitmap(val bitmap: Bitmap) : SignatureEffect() diff --git a/app/src/main/java/org/simple/clinic/signature/SignatureEvent.kt b/app/src/main/java/org/simple/clinic/signature/SignatureEvent.kt index 685f1a78ec9..e4a2e474c63 100644 --- a/app/src/main/java/org/simple/clinic/signature/SignatureEvent.kt +++ b/app/src/main/java/org/simple/clinic/signature/SignatureEvent.kt @@ -5,7 +5,7 @@ import org.simple.clinic.widgets.UiEvent sealed class SignatureEvent : UiEvent -object UndoClicked : SignatureEvent() { +data object UndoClicked : SignatureEvent() { override val analyticsName: String = "Add Signature Dialog:Undo Clicked" } @@ -13,6 +13,6 @@ data class AcceptClicked(val bitmap: Bitmap?) : SignatureEvent() { override val analyticsName: String = "Add Signature Dialog:Accept Signature Clicked" } -object SignatureAccepted : SignatureEvent() +data object SignatureAccepted : SignatureEvent() data class SignatureBitmapLoaded(val bitmap: Bitmap?) : SignatureEvent() diff --git a/app/src/main/java/org/simple/clinic/summary/OpenIntention.kt b/app/src/main/java/org/simple/clinic/summary/OpenIntention.kt index 3b04112dc28..a509372e676 100644 --- a/app/src/main/java/org/simple/clinic/summary/OpenIntention.kt +++ b/app/src/main/java/org/simple/clinic/summary/OpenIntention.kt @@ -10,12 +10,12 @@ sealed class OpenIntention : Parcelable { abstract fun analyticsName(): String @Parcelize - object ViewExistingPatient : OpenIntention() { + data object ViewExistingPatient : OpenIntention() { override fun analyticsName() = "SEARCH" } @Parcelize - object ViewNewPatient : OpenIntention() { + data object ViewNewPatient : OpenIntention() { override fun analyticsName() = "NEW_PATIENT" } diff --git a/app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt b/app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt index d218132f97c..135c5126224 100644 --- a/app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/PatientSummaryEffect.kt @@ -11,7 +11,7 @@ sealed class PatientSummaryEffect data class LoadPatientSummaryProfile(val patientUuid: UUID) : PatientSummaryEffect() -object LoadCurrentUserAndFacility : PatientSummaryEffect() +data object LoadCurrentUserAndFacility : PatientSummaryEffect() data class CheckForInvalidPhone(val patientUuid: UUID) : PatientSummaryEffect() @@ -33,13 +33,13 @@ data class TriggerSync(val sheetOpenedFrom: AppointmentSheetOpenedFrom) : Patien data class FetchHasShownMissingPhoneReminder(val patientUuid: UUID) : PatientSummaryEffect() -object LoadMedicalOfficers : PatientSummaryEffect() +data object LoadMedicalOfficers : PatientSummaryEffect() data class LoadPatientRegistrationData(val patientUuid: UUID) : PatientSummaryEffect() data class LoadClinicalDecisionSupportInfo(val patientUuid: UUID) : PatientSummaryEffect() -object CheckIfCDSSPilotIsEnabled : PatientSummaryEffect() +data object CheckIfCDSSPilotIsEnabled : PatientSummaryEffect() data class LoadLatestScheduledAppointment(val patientUuid: UUID) : PatientSummaryEffect() @@ -62,9 +62,9 @@ data class HandleEditClick( val currentFacility: Facility ) : PatientSummaryViewEffect() -object GoBackToPreviousScreen : PatientSummaryViewEffect() +data object GoBackToPreviousScreen : PatientSummaryViewEffect() -object GoToHomeScreen : PatientSummaryViewEffect() +data object GoToHomeScreen : PatientSummaryViewEffect() data class ShowAddPhonePopup(val patientUuid: UUID) : PatientSummaryViewEffect() @@ -81,7 +81,7 @@ data class ShowScheduleAppointmentSheet( val currentFacility: Facility ) : PatientSummaryViewEffect() -object ShowDiagnosisError : PatientSummaryViewEffect() +data object ShowDiagnosisError : PatientSummaryViewEffect() data class OpenContactPatientScreen(val patientUuid: UUID) : PatientSummaryViewEffect() @@ -92,17 +92,17 @@ data class NavigateToTeleconsultRecordScreen( data class OpenContactDoctorSheet(val patientUuid: UUID) : PatientSummaryViewEffect() -object ShowAddMeasurementsWarningDialog : PatientSummaryViewEffect() +data object ShowAddMeasurementsWarningDialog : PatientSummaryViewEffect() -object ShowAddBloodPressureWarningDialog : PatientSummaryViewEffect() +data object ShowAddBloodPressureWarningDialog : PatientSummaryViewEffect() -object ShowAddBloodSugarWarningDialog : PatientSummaryViewEffect() +data object ShowAddBloodSugarWarningDialog : PatientSummaryViewEffect() -object OpenSelectFacilitySheet : PatientSummaryViewEffect() +data object OpenSelectFacilitySheet : PatientSummaryViewEffect() data class DispatchNewAssignedFacility(val facility: Facility) : PatientSummaryViewEffect() -object RefreshNextAppointment : PatientSummaryViewEffect() +data object RefreshNextAppointment : PatientSummaryViewEffect() data class ShowReassignPatientWarningSheet( val patientUuid: UUID, diff --git a/app/src/main/java/org/simple/clinic/summary/PatientSummaryEvent.kt b/app/src/main/java/org/simple/clinic/summary/PatientSummaryEvent.kt index fda2c598bb3..e4a3c2b435d 100644 --- a/app/src/main/java/org/simple/clinic/summary/PatientSummaryEvent.kt +++ b/app/src/main/java/org/simple/clinic/summary/PatientSummaryEvent.kt @@ -45,7 +45,7 @@ data class CurrentUserAndFacilityLoaded( val facility: Facility ) : PatientSummaryEvent() -object PatientSummaryEditClicked : PatientSummaryEvent() +data object PatientSummaryEditClicked : PatientSummaryEvent() data class ScheduledAppointment(val sheetOpenedFrom: AppointmentSheetOpenedFrom) : PatientSummaryEvent() { override val analyticsName = "Patient Summary:Schedule Appointment Sheet Closed" @@ -53,7 +53,7 @@ data class ScheduledAppointment(val sheetOpenedFrom: AppointmentSheetOpenedFrom) data class CompletedCheckForInvalidPhone(val isPhoneInvalid: Boolean) : PatientSummaryEvent() -object PatientSummaryBloodPressureSaved : PatientSummaryEvent() +data object PatientSummaryBloodPressureSaved : PatientSummaryEvent() data class DataForBackClickLoaded( val hasPatientMeasurementDataChangedSinceScreenCreated: Boolean, @@ -81,19 +81,19 @@ data class SyncTriggered(val sheetOpenedFrom: AppointmentSheetOpenedFrom) : Pati data class FetchedHasShownMissingPhoneReminder(val hasShownReminder: Boolean) : PatientSummaryEvent() -object ContactPatientClicked : PatientSummaryEvent() { +data object ContactPatientClicked : PatientSummaryEvent() { override val analyticsName: String = "Patient Summary:Phone Number Clicked" } -object ContactDoctorClicked : PatientSummaryEvent() { +data object ContactDoctorClicked : PatientSummaryEvent() { override val analyticsName: String = "Patient Summary:Contact Doctor Clicked" } -object LogTeleconsultClicked : PatientSummaryEvent() +data object LogTeleconsultClicked : PatientSummaryEvent() data class MedicalOfficersLoaded(val medicalOfficers: List) : PatientSummaryEvent() -object ChangeAssignedFacilityClicked : PatientSummaryEvent() { +data object ChangeAssignedFacilityClicked : PatientSummaryEvent() { override val analyticsName: String = "Assigned Facility:Change Facility" } @@ -107,11 +107,11 @@ data class PatientRegistrationDataLoaded( val countOfRecordedBloodSugars: Int ) : PatientSummaryEvent() -object NextAppointmentActionClicked : PatientSummaryEvent() { +data object NextAppointmentActionClicked : PatientSummaryEvent() { override val analyticsName: String = "Next Appointment Card:Action Button Clicked" } -object AssignedFacilityChanged : PatientSummaryEvent() +data object AssignedFacilityChanged : PatientSummaryEvent() data class ClinicalDecisionSupportInfoLoaded(val isNewestBpEntryHigh: Boolean, val hasPrescribedDrugsChangedToday: Boolean) : PatientSummaryEvent() diff --git a/app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEffect.kt b/app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEffect.kt index bda90f47d44..5dca5fe2cd2 100644 --- a/app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEffect.kt @@ -6,6 +6,6 @@ sealed class AddPhoneNumberEffect data class AddPhoneNumber(val patientUuid: UUID, val newNumber: String) : AddPhoneNumberEffect() -object CloseDialog : AddPhoneNumberEffect() +data object CloseDialog : AddPhoneNumberEffect() data class ValidatePhoneNumber(val newNumber: String) : AddPhoneNumberEffect() diff --git a/app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEvent.kt b/app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEvent.kt index e21e241479c..c622ed31d23 100644 --- a/app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEvent.kt +++ b/app/src/main/java/org/simple/clinic/summary/addphone/AddPhoneNumberEvent.kt @@ -5,7 +5,7 @@ import org.simple.clinic.widgets.UiEvent sealed class AddPhoneNumberEvent : UiEvent -object PhoneNumberAdded : AddPhoneNumberEvent() +data object PhoneNumberAdded : AddPhoneNumberEvent() data class PhoneNumberValidated( val newNumber: String, diff --git a/app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityEffect.kt b/app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityEffect.kt index ddb7f497b5e..0c52157a80d 100644 --- a/app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityEffect.kt @@ -11,4 +11,4 @@ data class ChangeAssignedFacility( val updatedAssignedFacilityId: UUID ) : AssignedFacilityEffect() -object NotifyAssignedFacilityChanged : AssignedFacilityEffect() +data object NotifyAssignedFacilityChanged : AssignedFacilityEffect() diff --git a/app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityEvent.kt b/app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityEvent.kt index ec572eafac2..4c01467ff1a 100644 --- a/app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityEvent.kt +++ b/app/src/main/java/org/simple/clinic/summary/assignedfacility/AssignedFacilityEvent.kt @@ -14,4 +14,4 @@ data class AssignedFacilitySelected(val facility: Facility) : AssignedFacilityEv override val analyticsName: String = "Assigned Facility:Facility Selected" } -object AssignedFacilityChanged : AssignedFacilityEvent() +data object AssignedFacilityChanged : AssignedFacilityEvent() diff --git a/app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffect.kt b/app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffect.kt index 175ca676e4f..9cd31d8a210 100644 --- a/app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEffect.kt @@ -22,4 +22,4 @@ data class OpenBloodPressureUpdateSheet(val measurement: BloodPressureMeasuremen data class ShowBloodPressureHistoryScreen(val patientUuid: UUID) : BloodPressureSummaryViewEffect() -object LoadCurrentFacility : BloodPressureSummaryViewEffect() +data object LoadCurrentFacility : BloodPressureSummaryViewEffect() diff --git a/app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEvent.kt b/app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEvent.kt index dfa9c625ed4..8d9222f4571 100644 --- a/app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEvent.kt +++ b/app/src/main/java/org/simple/clinic/summary/bloodpressures/BloodPressureSummaryViewEvent.kt @@ -12,7 +12,7 @@ data class BloodPressuresCountLoaded(val count: Int) : BloodPressureSummaryViewE data class CurrentFacilityLoaded(val facility: Facility) : BloodPressureSummaryViewEvent() -object AddNewBloodPressureClicked : BloodPressureSummaryViewEvent() { +data object AddNewBloodPressureClicked : BloodPressureSummaryViewEvent() { override val analyticsName = "Patient Summary:Add New BP Clicked" } @@ -20,6 +20,6 @@ data class BloodPressureClicked(val measurement: BloodPressureMeasurement) : Blo override val analyticsName = "Patient Summary:BP Clicked for editing" } -object SeeAllClicked : BloodPressureSummaryViewEvent() { +data object SeeAllClicked : BloodPressureSummaryViewEvent() { override val analyticsName = "Patient Summary:See All Clicked" } diff --git a/app/src/main/java/org/simple/clinic/summary/bloodsugar/BloodSugarSummaryViewEffect.kt b/app/src/main/java/org/simple/clinic/summary/bloodsugar/BloodSugarSummaryViewEffect.kt index 3c0148b6888..1f9481bc96e 100644 --- a/app/src/main/java/org/simple/clinic/summary/bloodsugar/BloodSugarSummaryViewEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/bloodsugar/BloodSugarSummaryViewEffect.kt @@ -5,7 +5,7 @@ import java.util.UUID sealed class BloodSugarSummaryViewEffect -object OpenBloodSugarTypeSelector : BloodSugarSummaryViewEffect() +data object OpenBloodSugarTypeSelector : BloodSugarSummaryViewEffect() data class FetchBloodSugarSummary(val patientUuid: UUID) : BloodSugarSummaryViewEffect() diff --git a/app/src/main/java/org/simple/clinic/summary/bloodsugar/BloodSugarSummaryViewEvent.kt b/app/src/main/java/org/simple/clinic/summary/bloodsugar/BloodSugarSummaryViewEvent.kt index b95b0ec0203..751145ff1f1 100644 --- a/app/src/main/java/org/simple/clinic/summary/bloodsugar/BloodSugarSummaryViewEvent.kt +++ b/app/src/main/java/org/simple/clinic/summary/bloodsugar/BloodSugarSummaryViewEvent.kt @@ -7,11 +7,11 @@ sealed class BloodSugarSummaryViewEvent : UiEvent data class BloodSugarSummaryFetched(val measurements: List) : BloodSugarSummaryViewEvent() -object NewBloodSugarClicked : BloodSugarSummaryViewEvent() +data object NewBloodSugarClicked : BloodSugarSummaryViewEvent() data class BloodSugarCountFetched(val count: Int) : BloodSugarSummaryViewEvent() -object SeeAllClicked : BloodSugarSummaryViewEvent() { +data object SeeAllClicked : BloodSugarSummaryViewEvent() { override val analyticsName: String = "Patient Summary:Blood Sugar See All Clicked" } diff --git a/app/src/main/java/org/simple/clinic/summary/linkId/LinkIdWithPatientEffect.kt b/app/src/main/java/org/simple/clinic/summary/linkId/LinkIdWithPatientEffect.kt index 84c5bc96d45..faf06c216af 100644 --- a/app/src/main/java/org/simple/clinic/summary/linkId/LinkIdWithPatientEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/linkId/LinkIdWithPatientEffect.kt @@ -14,6 +14,6 @@ data class GetPatientNameFromId(val patientUuid: UUID) : LinkIdWithPatientEffect sealed class LinkIdWithPatientViewEffect : LinkIdWithPatientEffect() -object CloseSheetWithOutIdLinked : LinkIdWithPatientViewEffect() +data object CloseSheetWithOutIdLinked : LinkIdWithPatientViewEffect() -object CloseSheetWithLinkedId : LinkIdWithPatientViewEffect() +data object CloseSheetWithLinkedId : LinkIdWithPatientViewEffect() diff --git a/app/src/main/java/org/simple/clinic/summary/linkId/LinkIdWithPatientEvent.kt b/app/src/main/java/org/simple/clinic/summary/linkId/LinkIdWithPatientEvent.kt index 31f3a6b9bf8..e75b92397d8 100644 --- a/app/src/main/java/org/simple/clinic/summary/linkId/LinkIdWithPatientEvent.kt +++ b/app/src/main/java/org/simple/clinic/summary/linkId/LinkIdWithPatientEvent.kt @@ -4,13 +4,13 @@ import org.simple.clinic.widgets.UiEvent sealed class LinkIdWithPatientEvent : UiEvent -object LinkIdWithPatientCancelClicked : LinkIdWithPatientEvent() { +data object LinkIdWithPatientCancelClicked : LinkIdWithPatientEvent() { override val analyticsName = "LinkIdWithPatient:Cancel Clicked" } -object IdentifierAddedToPatient : LinkIdWithPatientEvent() +data object IdentifierAddedToPatient : LinkIdWithPatientEvent() -object LinkIdWithPatientAddClicked : LinkIdWithPatientEvent() { +data object LinkIdWithPatientAddClicked : LinkIdWithPatientEvent() { override val analyticsName = "LinkIdWithPatient:Add Clicked" } diff --git a/app/src/main/java/org/simple/clinic/summary/medicalhistory/MedicalHistorySummaryEffect.kt b/app/src/main/java/org/simple/clinic/summary/medicalhistory/MedicalHistorySummaryEffect.kt index 0f5bc15480e..8311e8b4dc2 100644 --- a/app/src/main/java/org/simple/clinic/summary/medicalhistory/MedicalHistorySummaryEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/medicalhistory/MedicalHistorySummaryEffect.kt @@ -7,6 +7,6 @@ sealed class MedicalHistorySummaryEffect data class LoadMedicalHistory(val patientUUID: UUID) : MedicalHistorySummaryEffect() -object LoadCurrentFacility : MedicalHistorySummaryEffect() +data object LoadCurrentFacility : MedicalHistorySummaryEffect() data class SaveUpdatedMedicalHistory(val medicalHistory: MedicalHistory) : MedicalHistorySummaryEffect() diff --git a/app/src/main/java/org/simple/clinic/summary/nextappointment/NextAppointmentEvent.kt b/app/src/main/java/org/simple/clinic/summary/nextappointment/NextAppointmentEvent.kt index ef7100c2f28..0cc81057ca1 100644 --- a/app/src/main/java/org/simple/clinic/summary/nextappointment/NextAppointmentEvent.kt +++ b/app/src/main/java/org/simple/clinic/summary/nextappointment/NextAppointmentEvent.kt @@ -8,4 +8,4 @@ data class NextAppointmentPatientProfileLoaded( val nextAppointmentPatientProfile: NextAppointmentPatientProfile? ) : NextAppointmentEvent() -object RefreshAppointment : NextAppointmentEvent() +data object RefreshAppointment : NextAppointmentEvent() diff --git a/app/src/main/java/org/simple/clinic/summary/prescribeddrugs/DrugSummaryEffect.kt b/app/src/main/java/org/simple/clinic/summary/prescribeddrugs/DrugSummaryEffect.kt index 18bd56e802d..91500370909 100644 --- a/app/src/main/java/org/simple/clinic/summary/prescribeddrugs/DrugSummaryEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/prescribeddrugs/DrugSummaryEffect.kt @@ -7,7 +7,7 @@ sealed class DrugSummaryEffect data class LoadPrescribedDrugs(val patientUuid: UUID) : DrugSummaryEffect() -object LoadCurrentFacility : DrugSummaryEffect() +data object LoadCurrentFacility : DrugSummaryEffect() data class OpenUpdatePrescribedDrugScreen( val patientUuid: UUID, diff --git a/app/src/main/java/org/simple/clinic/summary/teleconsultation/contactdoctor/ContactDoctorEffect.kt b/app/src/main/java/org/simple/clinic/summary/teleconsultation/contactdoctor/ContactDoctorEffect.kt index 4dcb3bf639d..d6dd2085995 100644 --- a/app/src/main/java/org/simple/clinic/summary/teleconsultation/contactdoctor/ContactDoctorEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/teleconsultation/contactdoctor/ContactDoctorEffect.kt @@ -5,7 +5,7 @@ import java.util.UUID sealed class ContactDoctorEffect -object LoadMedicalOfficers : ContactDoctorEffect() +data object LoadMedicalOfficers : ContactDoctorEffect() data class CreateTeleconsultRequest( val patientUuid: UUID, diff --git a/app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusEffect.kt b/app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusEffect.kt index dd8f261e12f..b93e4d3204a 100644 --- a/app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusEffect.kt @@ -10,4 +10,4 @@ data class UpdateTeleconsultStatus( val teleconsultStatus: TeleconsultStatus ) : TeleconsultStatusEffect() -object CloseSheet : TeleconsultStatusEffect() +data object CloseSheet : TeleconsultStatusEffect() diff --git a/app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusEvent.kt b/app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusEvent.kt index cc98ab587ec..985447c0fab 100644 --- a/app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusEvent.kt +++ b/app/src/main/java/org/simple/clinic/summary/teleconsultation/status/TeleconsultStatusEvent.kt @@ -9,8 +9,8 @@ data class TeleconsultStatusChanged(val teleconsultStatus: TeleconsultStatus) : override val analyticsName: String = "Teleconsult Status Sheet:Status changed to $teleconsultStatus" } -object TeleconsultStatusUpdated : TeleconsultStatusEvent() +data object TeleconsultStatusUpdated : TeleconsultStatusEvent() -object DoneClicked : TeleconsultStatusEvent() { +data object DoneClicked : TeleconsultStatusEvent() { override val analyticsName: String = "Teleconsult Status Sheet:Done Clicked" } diff --git a/app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEffect.kt b/app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEffect.kt index 13862cd4a6b..0d80fdf76e0 100644 --- a/app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEffect.kt +++ b/app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEffect.kt @@ -10,11 +10,11 @@ data class LoadPhoneNumber(val patientUuid: PatientUuid) : UpdatePhoneNumberEffe data class ValidatePhoneNumber(val phoneNumber: String) : UpdatePhoneNumberEffect() -object ShowBlankPhoneNumberError : UpdatePhoneNumberEffect() +data object ShowBlankPhoneNumberError : UpdatePhoneNumberEffect() data class ShowPhoneNumberTooShortError(val minimumAllowedNumberLength: Int) : UpdatePhoneNumberEffect() -object CloseDialog : UpdatePhoneNumberEffect() +data object CloseDialog : UpdatePhoneNumberEffect() data class SaveNewPhoneNumber( val patientUuid: PatientUuid, diff --git a/app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEvent.kt b/app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEvent.kt index b9fd1e9f88a..d7965cdede4 100644 --- a/app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEvent.kt +++ b/app/src/main/java/org/simple/clinic/summary/updatephone/UpdatePhoneNumberEvent.kt @@ -12,14 +12,14 @@ data class PhoneNumberValidated( val result: PhoneNumberValidator.Result ) : UpdatePhoneNumberEvent() -object NewPhoneNumberSaved : UpdatePhoneNumberEvent() +data object NewPhoneNumberSaved : UpdatePhoneNumberEvent() data class UpdatePhoneNumberSaveClicked(val number: String) : UpdatePhoneNumberEvent() { override val analyticsName = "Patient Summary:Update Phone Number:Save Clicked" } -object ExistingPhoneNumberSaved : UpdatePhoneNumberEvent() +data object ExistingPhoneNumberSaved : UpdatePhoneNumberEvent() -object UpdatePhoneNumberCancelClicked : UpdatePhoneNumberEvent() { +data object UpdatePhoneNumberCancelClicked : UpdatePhoneNumberEvent() { override val analyticsName = "Patient Summary:Update Phone Number:Cancel Clicked" } diff --git a/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorEffect.kt b/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorEffect.kt index 48891676e40..999e113afc0 100644 --- a/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorEffect.kt +++ b/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorEffect.kt @@ -5,14 +5,14 @@ import java.time.Duration sealed class SyncIndicatorEffect -object FetchLastSyncedStatus : SyncIndicatorEffect() +data object FetchLastSyncedStatus : SyncIndicatorEffect() -object FetchDataForSyncIndicatorState : SyncIndicatorEffect() +data object FetchDataForSyncIndicatorState : SyncIndicatorEffect() data class StartSyncedStateTimer(val timerDuration: Duration) : SyncIndicatorEffect() -object InitiateDataSync : SyncIndicatorEffect() +data object InitiateDataSync : SyncIndicatorEffect() data class ShowDataSyncErrorDialog(val errorType: ResolvedError) : SyncIndicatorEffect() -object FetchPendingSyncRecordsState : SyncIndicatorEffect() +data object FetchPendingSyncRecordsState : SyncIndicatorEffect() diff --git a/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorEvent.kt b/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorEvent.kt index 9daa9fb511a..ace30f79b51 100644 --- a/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorEvent.kt +++ b/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorEvent.kt @@ -19,7 +19,7 @@ data class IncrementTimerTick(val minutes: Long) : SyncIndicatorEvent() data class DataSyncErrorReceived(val errorType: ResolvedError) : SyncIndicatorEvent() -object SyncIndicatorViewClicked : SyncIndicatorEvent() { +data object SyncIndicatorViewClicked : SyncIndicatorEvent() { override val analyticsName = "Sync Indicator: View Clicked" } diff --git a/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorState.kt b/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorState.kt index e78d5a6d6ce..24c49208a70 100644 --- a/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorState.kt +++ b/app/src/main/java/org/simple/clinic/sync/indicator/SyncIndicatorState.kt @@ -5,13 +5,13 @@ import kotlinx.parcelize.Parcelize import java.time.Duration sealed class SyncIndicatorState : Parcelable { - @Parcelize object ConnectToSync : SyncIndicatorState() + @Parcelize data object ConnectToSync : SyncIndicatorState() @Parcelize data class Synced(val durationSince: Duration) : SyncIndicatorState() { fun incrementDuration(duration: Duration): Synced { return copy(durationSince = durationSince.plus(duration)) } } - @Parcelize object SyncPending : SyncIndicatorState() - @Parcelize object Syncing : SyncIndicatorState() + @Parcelize data object SyncPending : SyncIndicatorState() + @Parcelize data object Syncing : SyncIndicatorState() } diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationEvent.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationEvent.kt index e36e64de1eb..678d1552cce 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationEvent.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationEvent.kt @@ -8,6 +8,6 @@ data class DurationChanged(val duration: String) : DrugDurationEvent() { override val analyticsName: String = "Drug Duration:Duration Changed" } -object DrugDurationSaveClicked : DrugDurationEvent() { +data object DrugDurationSaveClicked : DrugDurationEvent() { override val analyticsName: String = "Drug Duration Sheet:Save Clicked" } diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationValidationResult.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationValidationResult.kt index 5f91339ceb0..3266e4ea8aa 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationValidationResult.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/drugduration/DrugDurationValidationResult.kt @@ -6,10 +6,10 @@ import kotlinx.parcelize.Parcelize sealed class DrugDurationValidationResult : Parcelable @Parcelize -object Blank : DrugDurationValidationResult() +data object Blank : DrugDurationValidationResult() @Parcelize data class MaxDrugDuration(val maxDuration: Int) : DrugDurationValidationResult() @Parcelize -object Valid : DrugDurationValidationResult() +data object Valid : DrugDurationValidationResult() diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/medicinefrequency/MedicineFrequency.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/medicinefrequency/MedicineFrequency.kt index cba1974923b..fed0e7825f9 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/medicinefrequency/MedicineFrequency.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/medicinefrequency/MedicineFrequency.kt @@ -11,28 +11,28 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class MedicineFrequency : Parcelable { @Parcelize - object OD : MedicineFrequency() { + data object OD : MedicineFrequency() { override fun toString(): String { return "OD" } } @Parcelize - object BD : MedicineFrequency() { + data object BD : MedicineFrequency() { override fun toString(): String { return "BD" } } @Parcelize - object TDS : MedicineFrequency() { + data object TDS : MedicineFrequency() { override fun toString(): String { return "TDS" } } @Parcelize - object QDS : MedicineFrequency() { + data object QDS : MedicineFrequency() { override fun toString(): String { return "QDS" } diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/medicinefrequency/MedicineFrequencyEvent.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/medicinefrequency/MedicineFrequencyEvent.kt index 9044d7b88f1..a73359c73e6 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/medicinefrequency/MedicineFrequencyEvent.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/medicinefrequency/MedicineFrequencyEvent.kt @@ -8,6 +8,6 @@ data class MedicineFrequencyChanged(val medicineFrequency: MedicineFrequency) : override val analyticsName: String = "Medicine Frequency:Medicine Frequency Changed" } -object SaveMedicineFrequencyClicked : MedicineFrequencyEvent() { +data object SaveMedicineFrequencyClicked : MedicineFrequencyEvent() { override val analyticsName: String = "Save Medicine Frequency:Save Clicked" } diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEffect.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEffect.kt index e5445fbcd06..59f912ea3f0 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEffect.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEffect.kt @@ -6,9 +6,9 @@ sealed class TeleconsultPrescriptionEffect data class LoadPatientDetails(val patientUuid: UUID) : TeleconsultPrescriptionEffect() -object GoBack : TeleconsultPrescriptionEffect() +data object GoBack : TeleconsultPrescriptionEffect() -object ShowSignatureRequiredError : TeleconsultPrescriptionEffect() +data object ShowSignatureRequiredError : TeleconsultPrescriptionEffect() data class LoadDataForNextClick( val patientUuid: UUID, @@ -35,4 +35,4 @@ data class UpdateTeleconsultRecordMedicalRegistrationId( val medicalRegistrationId: String ) : TeleconsultPrescriptionEffect() -object ShowMedicinesRequiredError : TeleconsultPrescriptionEffect() +data object ShowMedicinesRequiredError : TeleconsultPrescriptionEffect() diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEvent.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEvent.kt index 22a1624f2eb..6af699e59c9 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEvent.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/TeleconsultPrescriptionEvent.kt @@ -7,7 +7,7 @@ sealed class TeleconsultPrescriptionEvent : UiEvent data class PatientDetailsLoaded(val patient: Patient) : TeleconsultPrescriptionEvent() -object BackClicked : TeleconsultPrescriptionEvent() { +data object BackClicked : TeleconsultPrescriptionEvent() { override val analyticsName: String = "Teleconsult Prescription:Back Clicked" } diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEffect.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEffect.kt index 2faaf0fcbfb..a66771c4cbe 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEffect.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEffect.kt @@ -4,16 +4,16 @@ import android.graphics.Bitmap sealed class TeleconsultDoctorInfoEffect -object LoadMedicalRegistrationId : TeleconsultDoctorInfoEffect() +data object LoadMedicalRegistrationId : TeleconsultDoctorInfoEffect() data class SetMedicalRegistrationId(val medicalRegistrationId: String) : TeleconsultDoctorInfoEffect() -object LoadSignatureBitmap : TeleconsultDoctorInfoEffect() +data object LoadSignatureBitmap : TeleconsultDoctorInfoEffect() data class SetSignatureBitmap(val bitmap: Bitmap) : TeleconsultDoctorInfoEffect() -object LoadCurrentUser : TeleconsultDoctorInfoEffect() +data object LoadCurrentUser : TeleconsultDoctorInfoEffect() -object ShowAddSignatureDialog : TeleconsultDoctorInfoEffect() +data object ShowAddSignatureDialog : TeleconsultDoctorInfoEffect() -object ShowAddSignatureButton : TeleconsultDoctorInfoEffect() +data object ShowAddSignatureButton : TeleconsultDoctorInfoEffect() diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEvent.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEvent.kt index 1d70861ee40..93d983b2cd8 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEvent.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/doctorinfo/TeleconsultDoctorInfoEvent.kt @@ -20,8 +20,8 @@ data class MedicalInstructionsChanged(val instructions: String) : TeleconsultDoc data class CurrentUserLoaded(val user: User) : TeleconsultDoctorInfoEvent() -object AddSignatureClicked : TeleconsultDoctorInfoEvent() { +data object AddSignatureClicked : TeleconsultDoctorInfoEvent() { override val analyticsName: String = "Teleconsult Doctor Info:Add Signature Clicked" } -object ActivityResumed : TeleconsultDoctorInfoEvent() +data object ActivityResumed : TeleconsultDoctorInfoEvent() diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/medicines/TeleconsultMedicinesEvent.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/medicines/TeleconsultMedicinesEvent.kt index 0c86895a6f5..87c9a0f31fd 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/medicines/TeleconsultMedicinesEvent.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/prescription/medicines/TeleconsultMedicinesEvent.kt @@ -10,7 +10,7 @@ sealed class TeleconsultMedicinesEvent : UiEvent data class PatientMedicinesLoaded(val medicines: List) : TeleconsultMedicinesEvent() -object EditMedicinesClicked : TeleconsultMedicinesEvent() { +data object EditMedicinesClicked : TeleconsultMedicinesEvent() { override val analyticsName: String = "Teleconsult Medicines:Edit Clicked" } diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEffect.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEffect.kt index a0c49500621..68dd04c5245 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEffect.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEffect.kt @@ -8,17 +8,17 @@ sealed class TeleconsultSharePrescriptionEffect data class LoadPatientMedicines(val patientUuid: UUID) : TeleconsultSharePrescriptionEffect() -object LoadSignature : TeleconsultSharePrescriptionEffect() +data object LoadSignature : TeleconsultSharePrescriptionEffect() data class SetSignature(val bitmap: Bitmap) : TeleconsultSharePrescriptionEffect() -object LoadMedicalRegistrationId : TeleconsultSharePrescriptionEffect() +data object LoadMedicalRegistrationId : TeleconsultSharePrescriptionEffect() data class SetMedicalRegistrationId(val medicalRegistrationId: String) : TeleconsultSharePrescriptionEffect() data class SaveBitmapInExternalStorage(val bitmap: Bitmap) : TeleconsultSharePrescriptionEffect() -object GoToHomeScreen : TeleconsultSharePrescriptionEffect() +data object GoToHomeScreen : TeleconsultSharePrescriptionEffect() data class LoadPatientProfile(val patientUuid: UUID) : TeleconsultSharePrescriptionEffect() @@ -28,6 +28,6 @@ data class RetrievePrescriptionImageUri(val fileName: String) : TeleconsultShare data class OpenSharingDialog(val imageUri: Uri) : TeleconsultSharePrescriptionEffect() -object GoBack : TeleconsultSharePrescriptionEffect() +data object GoBack : TeleconsultSharePrescriptionEffect() -object ShowImageSavedToast : TeleconsultSharePrescriptionEffect() +data object ShowImageSavedToast : TeleconsultSharePrescriptionEffect() diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEvent.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEvent.kt index 0d0c838e373..4907af4a1f8 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEvent.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/shareprescription/TeleconsultSharePrescriptionEvent.kt @@ -27,9 +27,9 @@ data class DownloadClicked( override val analyticsName: String = "Share Prescription Screen:Download Clicked" } -object PrescriptionImageSaved : TeleconsultSharePrescriptionEvent() +data object PrescriptionImageSaved : TeleconsultSharePrescriptionEvent() -object DoneClicked : TeleconsultSharePrescriptionEvent() { +data object DoneClicked : TeleconsultSharePrescriptionEvent() { override val analyticsName: String = "Share Prescription Screen:Done Clicked" } @@ -48,8 +48,8 @@ data class PrescriptionSavedForSharing(val fileName: String) : TeleconsultShareP data class SharePrescriptionUri(val imageUri: Uri) : TeleconsultSharePrescriptionEvent() -object BackClicked : TeleconsultSharePrescriptionEvent() { +data object BackClicked : TeleconsultSharePrescriptionEvent() { override val analyticsName: String = "Share Prescription Screen:Back Clicked" } -object ImageSavedMessageShown : TeleconsultSharePrescriptionEvent() +data object ImageSavedMessageShown : TeleconsultSharePrescriptionEvent() diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/success/TeleConsultSuccessEffect.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/success/TeleConsultSuccessEffect.kt index 64aadabeaa0..43cb91bbfe6 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/success/TeleConsultSuccessEffect.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/success/TeleConsultSuccessEffect.kt @@ -6,7 +6,7 @@ sealed class TeleConsultSuccessEffect { data class LoadPatientDetails(val patientUuid: UUID) : TeleConsultSuccessEffect() - object GoToHomeScreen : TeleConsultSuccessEffect() + data object GoToHomeScreen : TeleConsultSuccessEffect() data class GoToPrescriptionScreen( val patientUuid: UUID, diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/success/TeleConsultSuccessEvent.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/success/TeleConsultSuccessEvent.kt index 9fbbfc3b53b..5218f086428 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/success/TeleConsultSuccessEvent.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/success/TeleConsultSuccessEvent.kt @@ -7,10 +7,10 @@ sealed class TeleConsultSuccessEvent : UiEvent data class PatientDetailsLoaded(val patient: Patient) : TeleConsultSuccessEvent() -object NoPrescriptionClicked : TeleConsultSuccessEvent() { +data object NoPrescriptionClicked : TeleConsultSuccessEvent() { override val analyticsName: String = "Teleconsult Log:No Prescription Clicked" } -object YesPrescriptionClicked : TeleConsultSuccessEvent() { +data object YesPrescriptionClicked : TeleConsultSuccessEvent() { override val analyticsName: String = "Teleconsult Log:Yes Prescription Clicked" } diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/Answer.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/Answer.kt index c1cd423c103..3c20820b39e 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/Answer.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/Answer.kt @@ -10,10 +10,10 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class Answer : Parcelable { @Parcelize - object Yes : Answer() + data object Yes : Answer() @Parcelize - object No : Answer() + data object No : Answer() @Parcelize data class Unknown(val actualValue: String) : Answer() diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/TeleconsultStatus.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/TeleconsultStatus.kt index 4480fd5dd7c..f03d01fa8b5 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/TeleconsultStatus.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/TeleconsultStatus.kt @@ -10,17 +10,17 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class TeleconsultStatus : Parcelable { @Parcelize - object Yes : TeleconsultStatus() { + data object Yes : TeleconsultStatus() { override fun toString(): String = "Yes" } @Parcelize - object No : TeleconsultStatus() { + data object No : TeleconsultStatus() { override fun toString(): String = "No" } @Parcelize - object StillWaiting : TeleconsultStatus() { + data object StillWaiting : TeleconsultStatus() { override fun toString(): String = "waiting" } diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/TeleconsultationType.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/TeleconsultationType.kt index 848117b3d73..2b3fa5cf74c 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/TeleconsultationType.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/TeleconsultationType.kt @@ -10,21 +10,21 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class TeleconsultationType : Parcelable { @Parcelize - object Audio : TeleconsultationType() { + data object Audio : TeleconsultationType() { override fun toString(): String { return "Audio" } } @Parcelize - object Video : TeleconsultationType() { + data object Video : TeleconsultationType() { override fun toString(): String { return "Video" } } @Parcelize - object Message : TeleconsultationType() { + data object Message : TeleconsultationType() { override fun toString(): String { return "Message" } diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEffect.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEffect.kt index a3332fbd4e2..47059a6bb54 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEffect.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEffect.kt @@ -6,9 +6,9 @@ import java.util.UUID sealed class TeleconsultRecordEffect -object GoBack : TeleconsultRecordEffect() +data object GoBack : TeleconsultRecordEffect() -object NavigateToTeleconsultSuccess : TeleconsultRecordEffect() +data object NavigateToTeleconsultSuccess : TeleconsultRecordEffect() data class LoadTeleconsultRecord(val teleconsultRecordId: UUID) : TeleconsultRecordEffect() @@ -22,7 +22,7 @@ data class CreateTeleconsultRecord( data class LoadPatientDetails(val patientUuid: UUID) : TeleconsultRecordEffect() -object ShowTeleconsultNotRecordedWarning : TeleconsultRecordEffect() +data object ShowTeleconsultNotRecordedWarning : TeleconsultRecordEffect() data class ValidateTeleconsultRecord(val teleconsultRecordId: UUID) : TeleconsultRecordEffect() diff --git a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEvent.kt b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEvent.kt index 416be34240a..8cd34c6db14 100644 --- a/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEvent.kt +++ b/app/src/main/java/org/simple/clinic/teleconsultlog/teleconsultrecord/screen/TeleconsultRecordEvent.kt @@ -9,7 +9,7 @@ import java.util.UUID sealed class TeleconsultRecordEvent : UiEvent -object BackClicked : TeleconsultRecordEvent() { +data object BackClicked : TeleconsultRecordEvent() { override val analyticsName: String = "Teleconsult Record:Back Clicked" } @@ -35,4 +35,4 @@ data class TeleconsultRecordValidated( override val analyticsName: String = "Teleconsult Record:Validated" } -object PatientPrescriptionsCloned : TeleconsultRecordEvent() +data object PatientPrescriptionsCloned : TeleconsultRecordEvent() diff --git a/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerEffect.kt b/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerEffect.kt index 19e347e3d6a..5effdc039f4 100644 --- a/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerEffect.kt +++ b/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerEffect.kt @@ -5,9 +5,9 @@ import java.time.LocalDate sealed class TextInputDatePickerEffect { - object DismissSheet : TextInputDatePickerEffect() + data object DismissSheet : TextInputDatePickerEffect() - object HideDateErrorMessage : TextInputDatePickerEffect() + data object HideDateErrorMessage : TextInputDatePickerEffect() data class ShowDateValidationError(val dateValidation: Result) : TextInputDatePickerEffect() diff --git a/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerEvent.kt b/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerEvent.kt index 2a03a9bd9b8..ee2dd2bfc81 100644 --- a/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerEvent.kt +++ b/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerEvent.kt @@ -5,7 +5,7 @@ import java.time.LocalDate sealed class TextInputDatePickerEvent : UiEvent -object DismissSheetClicked : TextInputDatePickerEvent() { +data object DismissSheetClicked : TextInputDatePickerEvent() { override val analyticsName: String = "Text Input Date Picker:Dismiss sheet clicked" } @@ -15,7 +15,7 @@ data class MonthChanged(val month: String) : TextInputDatePickerEvent() data class YearChanged(val year: String) : TextInputDatePickerEvent() -object DoneClicked : TextInputDatePickerEvent() { +data object DoneClicked : TextInputDatePickerEvent() { override val analyticsName: String = "Text Input Date Picker:Done Clicked" } diff --git a/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerValidator.kt b/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerValidator.kt index d64e7d3f566..f07b26f6a30 100644 --- a/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerValidator.kt +++ b/app/src/main/java/org/simple/clinic/textInputdatepicker/TextInputDatePickerValidator.kt @@ -16,9 +16,9 @@ class TextInputDatePickerValidator @Inject constructor( sealed class Result { data class Valid(val parsedDate: LocalDate) : Result() sealed class NotValid : Result() { - object InvalidPattern : NotValid() - object DateIsInPast : NotValid() - object MaximumAllowedDateRange : NotValid() + data object InvalidPattern : NotValid() + data object DateIsInPast : NotValid() + data object MaximumAllowedDateRange : NotValid() } } diff --git a/app/src/main/java/org/simple/clinic/user/User.kt b/app/src/main/java/org/simple/clinic/user/User.kt index e6421f0877c..615c2c64918 100644 --- a/app/src/main/java/org/simple/clinic/user/User.kt +++ b/app/src/main/java/org/simple/clinic/user/User.kt @@ -150,14 +150,14 @@ data class User( sealed class CapabilityStatus : Parcelable { @Parcelize - object Yes : CapabilityStatus() { + data object Yes : CapabilityStatus() { override fun toString(): String { return "yes" } } @Parcelize - object No : CapabilityStatus() { + data object No : CapabilityStatus() { override fun toString(): String { return "no" } diff --git a/app/src/main/java/org/simple/clinic/user/UserSession.kt b/app/src/main/java/org/simple/clinic/user/UserSession.kt index 04b78a83064..e36517e0d29 100644 --- a/app/src/main/java/org/simple/clinic/user/UserSession.kt +++ b/app/src/main/java/org/simple/clinic/user/UserSession.kt @@ -220,7 +220,7 @@ class UserSession @Inject constructor( sealed class LogoutResult : Parcelable { @Parcelize - object Success : LogoutResult() + data object Success : LogoutResult() @Parcelize data class Failure(val cause: Throwable) : LogoutResult() diff --git a/app/src/main/java/org/simple/clinic/user/UserStatus.kt b/app/src/main/java/org/simple/clinic/user/UserStatus.kt index d7b2e828f9a..b07bd89f209 100644 --- a/app/src/main/java/org/simple/clinic/user/UserStatus.kt +++ b/app/src/main/java/org/simple/clinic/user/UserStatus.kt @@ -11,13 +11,13 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter sealed class UserStatus : Parcelable { @Parcelize - object WaitingForApproval : UserStatus() + data object WaitingForApproval : UserStatus() @Parcelize - object ApprovedForSyncing : UserStatus() + data object ApprovedForSyncing : UserStatus() @Parcelize - object DisapprovedForSyncing : UserStatus() + data object DisapprovedForSyncing : UserStatus() @Parcelize data class Unknown(val actualValue: String) : UserStatus() diff --git a/app/src/main/java/org/simple/clinic/user/finduser/FindUserResult.kt b/app/src/main/java/org/simple/clinic/user/finduser/FindUserResult.kt index 4014a8c9b61..103b5b12f52 100644 --- a/app/src/main/java/org/simple/clinic/user/finduser/FindUserResult.kt +++ b/app/src/main/java/org/simple/clinic/user/finduser/FindUserResult.kt @@ -7,9 +7,9 @@ sealed class FindUserResult { data class Found(val uuid: UUID, val status: UserStatus) : FindUserResult() - object NotFound : FindUserResult() + data object NotFound : FindUserResult() - object NetworkError : FindUserResult() + data object NetworkError : FindUserResult() - object UnexpectedError : FindUserResult() + data object UnexpectedError : FindUserResult() } diff --git a/app/src/main/java/org/simple/clinic/user/registeruser/RegistrationResult.kt b/app/src/main/java/org/simple/clinic/user/registeruser/RegistrationResult.kt index 4e900d7d8e3..e734dfde56a 100644 --- a/app/src/main/java/org/simple/clinic/user/registeruser/RegistrationResult.kt +++ b/app/src/main/java/org/simple/clinic/user/registeruser/RegistrationResult.kt @@ -2,9 +2,9 @@ package org.simple.clinic.user.registeruser sealed class RegistrationResult { - object Success : RegistrationResult() + data object Success : RegistrationResult() - object UnexpectedError : RegistrationResult() + data object UnexpectedError : RegistrationResult() - object NetworkError : RegistrationResult() + data object NetworkError : RegistrationResult() } diff --git a/app/src/main/java/org/simple/clinic/user/resetpin/ResetPinResult.kt b/app/src/main/java/org/simple/clinic/user/resetpin/ResetPinResult.kt index e414784c425..6c8b84983f4 100644 --- a/app/src/main/java/org/simple/clinic/user/resetpin/ResetPinResult.kt +++ b/app/src/main/java/org/simple/clinic/user/resetpin/ResetPinResult.kt @@ -1,8 +1,8 @@ package org.simple.clinic.user.resetpin sealed class ResetPinResult { - object Success : ResetPinResult() - object NetworkError : ResetPinResult() - object UserNotFound : ResetPinResult() + data object Success : ResetPinResult() + data object NetworkError : ResetPinResult() + data object UserNotFound : ResetPinResult() data class UnexpectedError(val cause: Throwable? = null) : ResetPinResult() } diff --git a/app/src/main/java/org/simple/clinic/util/RelativeTimestampGenerator.kt b/app/src/main/java/org/simple/clinic/util/RelativeTimestampGenerator.kt index bccc1706cc2..496309505d2 100644 --- a/app/src/main/java/org/simple/clinic/util/RelativeTimestampGenerator.kt +++ b/app/src/main/java/org/simple/clinic/util/RelativeTimestampGenerator.kt @@ -46,9 +46,9 @@ sealed class RelativeTimestamp { } } - object Today : RelativeTimestamp() + data object Today : RelativeTimestamp() - object Yesterday : RelativeTimestamp() + data object Yesterday : RelativeTimestamp() data class WithinSixMonths(val daysBetween: Int) : RelativeTimestamp() diff --git a/app/src/main/java/org/simple/clinic/widgets/ageanddateofbirth/UserInputAgeValidator.kt b/app/src/main/java/org/simple/clinic/widgets/ageanddateofbirth/UserInputAgeValidator.kt index e41cfde0ac6..0a168a25a38 100644 --- a/app/src/main/java/org/simple/clinic/widgets/ageanddateofbirth/UserInputAgeValidator.kt +++ b/app/src/main/java/org/simple/clinic/widgets/ageanddateofbirth/UserInputAgeValidator.kt @@ -16,10 +16,10 @@ class UserInputAgeValidator @Inject constructor( @Named("date_for_user_input") private val dateOfBirthFormat: DateTimeFormatter ) { sealed class Result { - object Valid : Result() + data object Valid : Result() sealed class Invalid : Result() { - object ExceedsMaxAgeLimit : Invalid() - object ExceedsMinAgeLimit : Invalid() + data object ExceedsMaxAgeLimit : Invalid() + data object ExceedsMinAgeLimit : Invalid() } } diff --git a/app/src/main/java/org/simple/clinic/widgets/ageanddateofbirth/UserInputDateValidator.kt b/app/src/main/java/org/simple/clinic/widgets/ageanddateofbirth/UserInputDateValidator.kt index e1e1551e4cd..bf7e1984d47 100644 --- a/app/src/main/java/org/simple/clinic/widgets/ageanddateofbirth/UserInputDateValidator.kt +++ b/app/src/main/java/org/simple/clinic/widgets/ageanddateofbirth/UserInputDateValidator.kt @@ -18,8 +18,8 @@ class UserInputDateValidator @Inject constructor( sealed class Result { data class Valid(val parsedDate: LocalDate) : Result() sealed class Invalid : Result() { - object InvalidPattern : Invalid() - object DateIsInFuture : Invalid() + data object InvalidPattern : Invalid() + data object DateIsInFuture : Invalid() } } diff --git a/app/src/test/java/org/simple/clinic/util/RequestPermissionsTest.kt b/app/src/test/java/org/simple/clinic/util/RequestPermissionsTest.kt index f7f7d62ea2c..f52803e42e5 100644 --- a/app/src/test/java/org/simple/clinic/util/RequestPermissionsTest.kt +++ b/app/src/test/java/org/simple/clinic/util/RequestPermissionsTest.kt @@ -151,7 +151,7 @@ class RequestPermissionsTest { sealed class Event { - object FirstEvent : Event() + data object FirstEvent : Event() data class SecondEvent( override var permission: Optional = Optional.empty(), @@ -159,7 +159,7 @@ class RequestPermissionsTest { override val permissionString: String = "permission_1" ) : Event(), RequiresPermission - object ThirdEvent : Event() + data object ThirdEvent : Event() data class FourthEvent( override var permission: Optional = Optional.empty(), diff --git a/app/src/test/java/org/simple/clinic/util/RuntimeNetworkStatusTest.kt b/app/src/test/java/org/simple/clinic/util/RuntimeNetworkStatusTest.kt index e348a6ffeba..10ac407394a 100644 --- a/app/src/test/java/org/simple/clinic/util/RuntimeNetworkStatusTest.kt +++ b/app/src/test/java/org/simple/clinic/util/RuntimeNetworkStatusTest.kt @@ -75,12 +75,12 @@ class RuntimeNetworkStatusTest { sealed class Event { - object FirstEvent : Event() + data object FirstEvent : Event() data class SecondEvent( override var networkStatus: Optional = Optional.empty() ) : Event(), RequiresNetwork - object ThirdEvent : Event() + data object ThirdEvent : Event() } } diff --git a/app/src/test/java/org/simple/clinic/util/SafeEnumTypeAdapterTest.kt b/app/src/test/java/org/simple/clinic/util/SafeEnumTypeAdapterTest.kt index 275e862b90d..2972ca2efb0 100644 --- a/app/src/test/java/org/simple/clinic/util/SafeEnumTypeAdapterTest.kt +++ b/app/src/test/java/org/simple/clinic/util/SafeEnumTypeAdapterTest.kt @@ -11,11 +11,11 @@ import org.simple.clinic.util.room.SafeEnumTypeAdapter class SafeEnumTypeAdapterTest { sealed class TestType { - object Value1 : TestType() { + data object Value1 : TestType() { override fun toString() = "TestType:Value1" } - object Value2 : TestType() { + data object Value2 : TestType() { override fun toString() = "TestType:Value2" } diff --git a/doc/arch/006-forward-compatibility-for-enums.md b/doc/arch/006-forward-compatibility-for-enums.md index a6257fd3e34..35e04641048 100644 --- a/doc/arch/006-forward-compatibility-for-enums.md +++ b/doc/arch/006-forward-compatibility-for-enums.md @@ -71,9 +71,9 @@ throws an error if an `enum class` is involved both in a Retrofit and a Room int ```kotlin sealed class AppointmentType { - object Manual : AppointmentType() // 1. Each subclass represents an enumerated value + data object Manual : AppointmentType() // 1. Each subclass represents an enumerated value - object Automatic : AppointmentType() + data object Automatic : AppointmentType() data class Unknown(val actual: String) : AppointmentType() // 2. Defined to deal with forward-compatibility diff --git a/doc/arch/011-screen-navigation-v2.md b/doc/arch/011-screen-navigation-v2.md index 0a7e2c65842..0135de52520 100644 --- a/doc/arch/011-screen-navigation-v2.md +++ b/doc/arch/011-screen-navigation-v2.md @@ -123,7 +123,7 @@ class FirstScreen : Fragment(R.layout.screen_navigation_first) { } @Parcelize - object Key : ScreenKey() { + data object Key : ScreenKey() { override fun instantiateFragment(): Fragment { return FirstScreen() diff --git a/doc/mobius/implementing-a-new-screen.md b/doc/mobius/implementing-a-new-screen.md index 11cebff16fc..625e43492df 100644 --- a/doc/mobius/implementing-a-new-screen.md +++ b/doc/mobius/implementing-a-new-screen.md @@ -76,9 +76,9 @@ data class SupportedLanguagesLoadedEvent(val languages: List) : Change data class SelectLanguageEvent(val newLanguage: Language) : ChangeLanguageEvent() -object CurrentLanguageChangedEvent : ChangeLanguageEvent() +data object CurrentLanguageChangedEvent : ChangeLanguageEvent() -object SaveCurrentLanguageEvent : ChangeLanguageEvent() +data object SaveCurrentLanguageEvent : ChangeLanguageEvent() ``` ##### `Effect` @@ -91,15 +91,15 @@ of this sealed class. These will be consumed by the `EffectHandler` component to ```kotlin sealed class ChangeLanguageEffect -object LoadCurrentLanguageEffect : ChangeLanguageEffect() +data object LoadCurrentLanguageEffect : ChangeLanguageEffect() -object LoadSupportedLanguagesEffect : ChangeLanguageEffect() +data object LoadSupportedLanguagesEffect : ChangeLanguageEffect() data class UpdateCurrentLanguageEffect(val newLanguage: Language) : ChangeLanguageEffect() -object GoBack : ChangeLanguageEffect() +data object GoBack : ChangeLanguageEffect() -object RestartActivity : ChangeLanguageEffect() +data object RestartActivity : ChangeLanguageEffect() ``` ##### `Update` diff --git a/mobius-migration/src/test/java/org/simple/mobius/migration/fix/Counter.kt b/mobius-migration/src/test/java/org/simple/mobius/migration/fix/Counter.kt index 16389575b5e..e6a4836f2d1 100644 --- a/mobius-migration/src/test/java/org/simple/mobius/migration/fix/Counter.kt +++ b/mobius-migration/src/test/java/org/simple/mobius/migration/fix/Counter.kt @@ -13,8 +13,8 @@ import kotlin.properties.Delegates typealias CounterModel = Int sealed class CounterEvent { - object Increment : CounterEvent() - object Decrement : CounterEvent() + data object Increment : CounterEvent() + data object Decrement : CounterEvent() } class CounterUpdate() : Update { @@ -34,7 +34,7 @@ fun createEffectHandler(view: VerifiableCounterView): ObservableTransformer {