From f6a623db9a61949a240c3153126e92adb2b31f83 Mon Sep 17 00:00:00 2001 From: Puvikaran Santhirasegaram <74664443+Puvikaran2001@users.noreply.github.com> Date: Tue, 7 May 2024 14:30:14 +0200 Subject: [PATCH 1/6] Change folder structure --- .../{ => datasources}/api/ApiClient.kt | 4 ++-- .../{ => datasources}/api/ApiService.kt | 20 ++++++++--------- .../api/protocol/Accounts.kt | 2 +- .../{ => datasources}/api/protocol/Devices.kt | 2 +- .../{ => datasources}/api/protocol/Events.kt | 2 +- .../{ => datasources}/api/protocol/Tasks.kt | 2 +- .../api/protocol/Timespan.kt | 2 +- .../typeadapters/LocalDateTimeTypeAdapter.kt | 2 +- .../{ => gui}/components/Buttons.kt | 2 +- .../components/ConfirmAlertDialog.kt | 2 +- .../{ => gui}/components/DateRangePicker.kt | 4 ++-- .../{ => gui}/components/Dateformat.kt | 2 +- .../{ => gui}/components/Heading.kt | 2 +- .../{ => gui}/components/Loading.kt | 4 ++-- .../components/StandardDropDownMenu.kt | 4 ++-- .../{ => gui}/components/TextFields.kt | 2 +- .../{ => gui}/components/TimePicker.kt | 4 ++-- .../{ => gui}/pages/AccountPage.kt | 8 +++---- .../{ => gui}/pages/CreateDevicePage.kt | 10 ++++----- .../{ => gui}/pages/CreateTaskPage.kt | 22 +++++++++---------- .../{ => gui}/pages/HomePage.kt | 17 +++++++------- .../{ => gui}/pages/LoginPage.kt | 12 +++++----- .../{ => gui}/pages/Page.kt | 2 +- .../{ => gui}/pages/SignUpPage.kt | 12 +++++----- .../{ => gui}/pages/TaskOverviewPage.kt | 18 +++++++-------- .../{ui => gui}/theme/Color.kt | 2 +- .../{ui => gui}/theme/Theme.kt | 2 +- .../{ui => gui}/theme/Type.kt | 2 +- .../model/DeviceOverview.kt | 2 +- .../schedulingfrontend/model/DeviceTask.kt | 2 +- .../schedulingfrontend/model/TaskEvent.kt | 4 ++-- .../repositories/account/AccountRepository.kt | 4 ++-- .../repositories/device/IDeviceRepository.kt | 2 +- .../repositories/event/IEventRepository.kt | 2 +- .../java/testdata/DummyEventRepository.kt | 2 +- .../main/java/testdata/DummyTaskRepository.kt | 4 ++-- .../app/src/main/java/testdata/TestData.kt | 8 +++---- .../schedulingfrontend/TaskFormTest.kt | 2 +- 38 files changed, 100 insertions(+), 101 deletions(-) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => datasources}/api/ApiClient.kt (93%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => datasources}/api/ApiService.kt (68%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => datasources}/api/protocol/Accounts.kt (76%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => datasources}/api/protocol/Devices.kt (82%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => datasources}/api/protocol/Events.kt (77%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => datasources}/api/protocol/Tasks.kt (84%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => datasources}/api/protocol/Timespan.kt (63%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => datasources}/api/typeadapters/LocalDateTimeTypeAdapter.kt (95%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/components/Buttons.kt (94%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/components/ConfirmAlertDialog.kt (96%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/components/DateRangePicker.kt (97%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/components/Dateformat.kt (88%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/components/Heading.kt (96%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/components/Loading.kt (94%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/components/StandardDropDownMenu.kt (96%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/components/TextFields.kt (97%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/components/TimePicker.kt (97%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/pages/AccountPage.kt (94%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/pages/CreateDevicePage.kt (93%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/pages/CreateTaskPage.kt (92%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/pages/HomePage.kt (95%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/pages/LoginPage.kt (91%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/pages/Page.kt (96%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/pages/SignUpPage.kt (91%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ => gui}/pages/TaskOverviewPage.kt (95%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ui => gui}/theme/Color.kt (98%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ui => gui}/theme/Theme.kt (99%) rename frontend/app/src/main/java/dk/scheduling/schedulingfrontend/{ui => gui}/theme/Type.kt (95%) diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/ApiClient.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/ApiClient.kt similarity index 93% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/ApiClient.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/ApiClient.kt index e1dd0265..fe875173 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/ApiClient.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/ApiClient.kt @@ -1,8 +1,8 @@ -package dk.scheduling.schedulingfrontend.api +package dk.scheduling.schedulingfrontend.datasources.api import com.google.gson.Gson import com.google.gson.GsonBuilder -import dk.scheduling.schedulingfrontend.api.typeadapters.LocalDateTimeTypeAdapter +import dk.scheduling.schedulingfrontend.datasources.api.typeadapters.LocalDateTimeTypeAdapter import okhttp3.OkHttpClient import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/ApiService.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/ApiService.kt similarity index 68% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/ApiService.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/ApiService.kt index 57606320..176dbf62 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/ApiService.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/ApiService.kt @@ -1,13 +1,13 @@ -package dk.scheduling.schedulingfrontend.api -import dk.scheduling.schedulingfrontend.api.protocol.CreateDeviceRequest -import dk.scheduling.schedulingfrontend.api.protocol.CreateDeviceResponse -import dk.scheduling.schedulingfrontend.api.protocol.CreateTaskRequest -import dk.scheduling.schedulingfrontend.api.protocol.GetDevicesResponse -import dk.scheduling.schedulingfrontend.api.protocol.GetEventsResponse -import dk.scheduling.schedulingfrontend.api.protocol.GetTasksResponse -import dk.scheduling.schedulingfrontend.api.protocol.RegisterOrLoginRequest -import dk.scheduling.schedulingfrontend.api.protocol.RegisterOrLoginResponse -import dk.scheduling.schedulingfrontend.api.protocol.Task +package dk.scheduling.schedulingfrontend.datasources.api +import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateDeviceRequest +import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateDeviceResponse +import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateTaskRequest +import dk.scheduling.schedulingfrontend.datasources.api.protocol.GetDevicesResponse +import dk.scheduling.schedulingfrontend.datasources.api.protocol.GetEventsResponse +import dk.scheduling.schedulingfrontend.datasources.api.protocol.GetTasksResponse +import dk.scheduling.schedulingfrontend.datasources.api.protocol.RegisterOrLoginRequest +import dk.scheduling.schedulingfrontend.datasources.api.protocol.RegisterOrLoginResponse +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Task import retrofit2.Response import retrofit2.http.Body import retrofit2.http.DELETE diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Accounts.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Accounts.kt similarity index 76% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Accounts.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Accounts.kt index 7738670b..cc788acc 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Accounts.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Accounts.kt @@ -1,6 +1,6 @@ @file:Suppress("PropertyName") -package dk.scheduling.schedulingfrontend.api.protocol +package dk.scheduling.schedulingfrontend.datasources.api.protocol import java.util.UUID diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Devices.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Devices.kt similarity index 82% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Devices.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Devices.kt index 6bf397bf..2a2e7641 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Devices.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Devices.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.api.protocol +package dk.scheduling.schedulingfrontend.datasources.api.protocol data class Device( val id: Long, diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Events.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Events.kt similarity index 77% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Events.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Events.kt index e9f69c57..8aa43a94 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Events.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Events.kt @@ -1,6 +1,6 @@ @file:Suppress("PropertyName") -package dk.scheduling.schedulingfrontend.api.protocol +package dk.scheduling.schedulingfrontend.datasources.api.protocol import java.time.LocalDateTime diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Tasks.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Tasks.kt similarity index 84% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Tasks.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Tasks.kt index 932c5293..832f9a2a 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Tasks.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Tasks.kt @@ -1,6 +1,6 @@ @file:Suppress("PropertyName") -package dk.scheduling.schedulingfrontend.api.protocol +package dk.scheduling.schedulingfrontend.datasources.api.protocol data class Task( val id: Long, diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Timespan.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Timespan.kt similarity index 63% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Timespan.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Timespan.kt index 9d89081b..0191dea7 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/protocol/Timespan.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/protocol/Timespan.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.api.protocol +package dk.scheduling.schedulingfrontend.datasources.api.protocol import java.time.LocalDateTime diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/typeadapters/LocalDateTimeTypeAdapter.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/typeadapters/LocalDateTimeTypeAdapter.kt similarity index 95% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/typeadapters/LocalDateTimeTypeAdapter.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/typeadapters/LocalDateTimeTypeAdapter.kt index ed8214c5..fd8fc93d 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/api/typeadapters/LocalDateTimeTypeAdapter.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/datasources/api/typeadapters/LocalDateTimeTypeAdapter.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.api.typeadapters +package dk.scheduling.schedulingfrontend.datasources.api.typeadapters import com.google.gson.JsonDeserializationContext import com.google.gson.JsonDeserializer diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Buttons.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Buttons.kt similarity index 94% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Buttons.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Buttons.kt index d8a14a40..8e407f60 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Buttons.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Buttons.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.components +package dk.scheduling.schedulingfrontend.gui.components import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/ConfirmAlertDialog.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/ConfirmAlertDialog.kt similarity index 96% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/ConfirmAlertDialog.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/ConfirmAlertDialog.kt index b8b90372..c7998f81 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/ConfirmAlertDialog.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/ConfirmAlertDialog.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.components +package dk.scheduling.schedulingfrontend.gui.components import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.material3.AlertDialog diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/DateRangePicker.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/DateRangePicker.kt similarity index 97% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/DateRangePicker.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/DateRangePicker.kt index 57e00772..6a33b860 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/DateRangePicker.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/DateRangePicker.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.components +package dk.scheduling.schedulingfrontend.gui.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -27,8 +27,8 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.window.DialogProperties +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme import dk.scheduling.schedulingfrontend.model.Status -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme import java.time.Instant import java.time.LocalDateTime import java.time.LocalTime diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Dateformat.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Dateformat.kt similarity index 88% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Dateformat.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Dateformat.kt index 812ba40c..20dd3d53 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Dateformat.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Dateformat.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.components +package dk.scheduling.schedulingfrontend.gui.components import java.time.format.DateTimeFormatter import java.util.Locale diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Heading.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Heading.kt similarity index 96% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Heading.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Heading.kt index 5ab7366e..54f6924f 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Heading.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Heading.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.components +package dk.scheduling.schedulingfrontend.gui.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Loading.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Loading.kt similarity index 94% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Loading.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Loading.kt index 9b05a26e..952eb777 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/Loading.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/Loading.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.components +package dk.scheduling.schedulingfrontend.gui.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -16,7 +16,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme import kotlinx.coroutines.delay @Composable diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/StandardDropDownMenu.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/StandardDropDownMenu.kt similarity index 96% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/StandardDropDownMenu.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/StandardDropDownMenu.kt index 208a4636..4f693af9 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/StandardDropDownMenu.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/StandardDropDownMenu.kt @@ -1,6 +1,6 @@ @file:OptIn(ExperimentalMaterial3Api::class) -package dk.scheduling.schedulingfrontend.components +package dk.scheduling.schedulingfrontend.gui.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -22,7 +22,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme @Composable fun StandardDropDownMenu( diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/TextFields.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/TextFields.kt similarity index 97% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/TextFields.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/TextFields.kt index 187a5201..aa729990 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/TextFields.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/TextFields.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.components +package dk.scheduling.schedulingfrontend.gui.components import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.text.KeyboardOptions diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/TimePicker.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/TimePicker.kt similarity index 97% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/TimePicker.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/TimePicker.kt index 2d6be670..3b841585 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/components/TimePicker.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/components/TimePicker.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.components +package dk.scheduling.schedulingfrontend.gui.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -29,7 +29,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.window.DialogProperties -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme @OptIn(ExperimentalMaterial3Api::class) @Composable diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/AccountPage.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/AccountPage.kt similarity index 94% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/AccountPage.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/AccountPage.kt index af72fe90..d08299fd 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/AccountPage.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/AccountPage.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.pages +package dk.scheduling.schedulingfrontend.gui.pages import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -21,10 +21,10 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.TextUnitType import androidx.compose.ui.unit.dp -import dk.scheduling.schedulingfrontend.components.FilledButton -import dk.scheduling.schedulingfrontend.components.OutlinedButton +import dk.scheduling.schedulingfrontend.gui.components.FilledButton +import dk.scheduling.schedulingfrontend.gui.components.OutlinedButton +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme import dk.scheduling.schedulingfrontend.repositories.account.IAccountRepository -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme import kotlinx.coroutines.launch import testdata.DummyAccountRepository diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/CreateDevicePage.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/CreateDevicePage.kt similarity index 93% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/CreateDevicePage.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/CreateDevicePage.kt index b42ad66b..ecdb1d4f 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/CreateDevicePage.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/CreateDevicePage.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.pages +package dk.scheduling.schedulingfrontend.gui.pages import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -23,10 +23,10 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.em -import dk.scheduling.schedulingfrontend.api.protocol.Device -import dk.scheduling.schedulingfrontend.components.FilledButton -import dk.scheduling.schedulingfrontend.components.OutlinedButton -import dk.scheduling.schedulingfrontend.components.StandardTextField +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device +import dk.scheduling.schedulingfrontend.gui.components.FilledButton +import dk.scheduling.schedulingfrontend.gui.components.OutlinedButton +import dk.scheduling.schedulingfrontend.gui.components.StandardTextField import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository import kotlinx.coroutines.launch import testdata.DummyDeviceRepository diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/CreateTaskPage.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/CreateTaskPage.kt similarity index 92% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/CreateTaskPage.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/CreateTaskPage.kt index 41a76d11..746089fd 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/CreateTaskPage.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/CreateTaskPage.kt @@ -2,7 +2,7 @@ ExperimentalMaterial3Api::class, ) -package dk.scheduling.schedulingfrontend.pages +package dk.scheduling.schedulingfrontend.gui.pages import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.layout.Arrangement @@ -32,20 +32,20 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import dk.scheduling.schedulingfrontend.api.protocol.Device -import dk.scheduling.schedulingfrontend.api.protocol.Timespan -import dk.scheduling.schedulingfrontend.components.DateRange -import dk.scheduling.schedulingfrontend.components.FilledButton -import dk.scheduling.schedulingfrontend.components.Loading -import dk.scheduling.schedulingfrontend.components.StandardDateRangePicker -import dk.scheduling.schedulingfrontend.components.StandardDropDownMenu -import dk.scheduling.schedulingfrontend.components.StandardTimePickerDialog -import dk.scheduling.schedulingfrontend.components.Title +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Timespan +import dk.scheduling.schedulingfrontend.gui.components.DateRange +import dk.scheduling.schedulingfrontend.gui.components.FilledButton +import dk.scheduling.schedulingfrontend.gui.components.Loading +import dk.scheduling.schedulingfrontend.gui.components.StandardDateRangePicker +import dk.scheduling.schedulingfrontend.gui.components.StandardDropDownMenu +import dk.scheduling.schedulingfrontend.gui.components.StandardTimePickerDialog +import dk.scheduling.schedulingfrontend.gui.components.Title +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme import dk.scheduling.schedulingfrontend.model.Duration import dk.scheduling.schedulingfrontend.model.TaskForm import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository import dk.scheduling.schedulingfrontend.repositories.task.ITaskRepository -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme import kotlinx.coroutines.launch import testdata.DummyDeviceRepository import testdata.DummyTaskRepository diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/HomePage.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/HomePage.kt similarity index 95% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/HomePage.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/HomePage.kt index a49d6520..06469f57 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/HomePage.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/HomePage.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.pages +package dk.scheduling.schedulingfrontend.gui.pages import androidx.compose.animation.animateContentSize import androidx.compose.animation.core.animateFloatAsState @@ -44,20 +44,19 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import dk.scheduling.schedulingfrontend.api.protocol.Device -import dk.scheduling.schedulingfrontend.components.ConfirmAlertDialog -import dk.scheduling.schedulingfrontend.components.DATE_FORMATTER -import dk.scheduling.schedulingfrontend.components.Loading +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device +import dk.scheduling.schedulingfrontend.gui.components.ConfirmAlertDialog +import dk.scheduling.schedulingfrontend.gui.components.DATE_FORMATTER +import dk.scheduling.schedulingfrontend.gui.components.Loading +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme +import dk.scheduling.schedulingfrontend.gui.theme.scheduled +import dk.scheduling.schedulingfrontend.gui.theme.success import dk.scheduling.schedulingfrontend.model.DeviceOverview import dk.scheduling.schedulingfrontend.model.DeviceState import dk.scheduling.schedulingfrontend.model.getDeviceState import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository import dk.scheduling.schedulingfrontend.repositories.overviews.IOverviewsRepository import dk.scheduling.schedulingfrontend.repositories.overviews.OverviewRepository -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme -import dk.scheduling.schedulingfrontend.ui.theme.scheduled -import dk.scheduling.schedulingfrontend.ui.theme.success -import kotlinx.coroutines.launch import testdata.DummyDeviceRepository import testdata.DummyEventRepository import testdata.DummyTaskRepository diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/LoginPage.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/LoginPage.kt similarity index 91% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/LoginPage.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/LoginPage.kt index 0c5c2160..6d203b89 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/LoginPage.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/LoginPage.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.pages +package dk.scheduling.schedulingfrontend.gui.pages import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -20,12 +20,12 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import dk.scheduling.schedulingfrontend.components.FilledButton -import dk.scheduling.schedulingfrontend.components.PasswordTextField -import dk.scheduling.schedulingfrontend.components.StandardTextField -import dk.scheduling.schedulingfrontend.components.Title +import dk.scheduling.schedulingfrontend.gui.components.FilledButton +import dk.scheduling.schedulingfrontend.gui.components.PasswordTextField +import dk.scheduling.schedulingfrontend.gui.components.StandardTextField +import dk.scheduling.schedulingfrontend.gui.components.Title +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme import dk.scheduling.schedulingfrontend.repositories.account.IAccountRepository -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme import kotlinx.coroutines.launch import testdata.DummyAccountRepository diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/Page.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/Page.kt similarity index 96% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/Page.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/Page.kt index 83bb22b3..d1ccd5d0 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/Page.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/Page.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.pages +package dk.scheduling.schedulingfrontend.gui.pages import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.Login diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/SignUpPage.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/SignUpPage.kt similarity index 91% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/SignUpPage.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/SignUpPage.kt index ee58542f..d1229b0c 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/SignUpPage.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/SignUpPage.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.pages +package dk.scheduling.schedulingfrontend.gui.pages import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -20,12 +20,12 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import dk.scheduling.schedulingfrontend.components.FilledButton -import dk.scheduling.schedulingfrontend.components.PasswordTextField -import dk.scheduling.schedulingfrontend.components.StandardTextField -import dk.scheduling.schedulingfrontend.components.Title +import dk.scheduling.schedulingfrontend.gui.components.FilledButton +import dk.scheduling.schedulingfrontend.gui.components.PasswordTextField +import dk.scheduling.schedulingfrontend.gui.components.StandardTextField +import dk.scheduling.schedulingfrontend.gui.components.Title +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme import dk.scheduling.schedulingfrontend.repositories.account.IAccountRepository -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme import kotlinx.coroutines.launch import testdata.DummyAccountRepository diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/TaskOverviewPage.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/TaskOverviewPage.kt similarity index 95% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/TaskOverviewPage.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/TaskOverviewPage.kt index 18cd19ab..4a0e0eb0 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/TaskOverviewPage.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/TaskOverviewPage.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.pages +package dk.scheduling.schedulingfrontend.gui.pages import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement @@ -44,19 +44,19 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.TextUnitType import androidx.compose.ui.unit.dp -import dk.scheduling.schedulingfrontend.api.protocol.Event -import dk.scheduling.schedulingfrontend.api.protocol.Timespan -import dk.scheduling.schedulingfrontend.components.ConfirmAlertDialog -import dk.scheduling.schedulingfrontend.components.DATE_AND_TIME_FORMAT -import dk.scheduling.schedulingfrontend.components.DATE_FORMAT -import dk.scheduling.schedulingfrontend.components.Loading -import dk.scheduling.schedulingfrontend.components.TIME_FORMAT +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Event +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Timespan +import dk.scheduling.schedulingfrontend.gui.components.ConfirmAlertDialog +import dk.scheduling.schedulingfrontend.gui.components.DATE_AND_TIME_FORMAT +import dk.scheduling.schedulingfrontend.gui.components.DATE_FORMAT +import dk.scheduling.schedulingfrontend.gui.components.Loading +import dk.scheduling.schedulingfrontend.gui.components.TIME_FORMAT +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme import dk.scheduling.schedulingfrontend.model.DeviceTask import dk.scheduling.schedulingfrontend.model.TaskEvent import dk.scheduling.schedulingfrontend.repositories.overviews.IOverviewsRepository import dk.scheduling.schedulingfrontend.repositories.overviews.OverviewRepository import dk.scheduling.schedulingfrontend.repositories.task.ITaskRepository -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme import kotlinx.coroutines.launch import testdata.DummyDeviceRepository import testdata.DummyEventRepository diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/ui/theme/Color.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/theme/Color.kt similarity index 98% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/ui/theme/Color.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/theme/Color.kt index d2e95c36..2c7cf70a 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/ui/theme/Color.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/theme/Color.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.ui.theme +package dk.scheduling.schedulingfrontend.gui.theme import androidx.compose.ui.graphics.Color val md_theme_light_primary = Color(0xFF6750A4) diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/ui/theme/Theme.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/theme/Theme.kt similarity index 99% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/ui/theme/Theme.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/theme/Theme.kt index f9c3842d..fbf4ab69 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/ui/theme/Theme.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/theme/Theme.kt @@ -1,5 +1,5 @@ -package dk.scheduling.schedulingfrontend.ui.theme +package dk.scheduling.schedulingfrontend.gui.theme import android.app.Activity import android.os.Build diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/ui/theme/Type.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/theme/Type.kt similarity index 95% rename from frontend/app/src/main/java/dk/scheduling/schedulingfrontend/ui/theme/Type.kt rename to frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/theme/Type.kt index c168832e..d58cd40b 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/ui/theme/Type.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/theme/Type.kt @@ -1,4 +1,4 @@ -package dk.scheduling.schedulingfrontend.ui.theme +package dk.scheduling.schedulingfrontend.gui.theme import androidx.compose.material3.Typography import androidx.compose.ui.text.TextStyle diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceOverview.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceOverview.kt index 90468334..3b6c964c 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceOverview.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceOverview.kt @@ -1,6 +1,6 @@ package dk.scheduling.schedulingfrontend.model -import dk.scheduling.schedulingfrontend.api.protocol.Device +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device data class DeviceOverview( var device: Device, diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceTask.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceTask.kt index c6c62468..dca7e2dd 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceTask.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceTask.kt @@ -1,6 +1,6 @@ package dk.scheduling.schedulingfrontend.model -import dk.scheduling.schedulingfrontend.api.protocol.Device +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device data class DeviceTask( val device: Device, diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/TaskEvent.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/TaskEvent.kt index acd7fa93..f69aa013 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/TaskEvent.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/TaskEvent.kt @@ -1,7 +1,7 @@ package dk.scheduling.schedulingfrontend.model -import dk.scheduling.schedulingfrontend.api.protocol.Event -import dk.scheduling.schedulingfrontend.api.protocol.Task +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Event +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Task data class TaskEvent( val task: Task, diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/account/AccountRepository.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/account/AccountRepository.kt index a9f8ff7e..a2f7eeb8 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/account/AccountRepository.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/account/AccountRepository.kt @@ -1,8 +1,8 @@ package dk.scheduling.schedulingfrontend.repositories.account -import dk.scheduling.schedulingfrontend.api.ApiService -import dk.scheduling.schedulingfrontend.api.protocol.RegisterOrLoginRequest import dk.scheduling.schedulingfrontend.datasources.AccountDataSource +import dk.scheduling.schedulingfrontend.datasources.api.ApiService +import dk.scheduling.schedulingfrontend.datasources.api.protocol.RegisterOrLoginRequest import java.util.UUID class AccountRepository( diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/device/IDeviceRepository.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/device/IDeviceRepository.kt index 349a5f80..f2822d63 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/device/IDeviceRepository.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/device/IDeviceRepository.kt @@ -1,6 +1,6 @@ package dk.scheduling.schedulingfrontend.repositories.device -import dk.scheduling.schedulingfrontend.api.protocol.Device +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device interface IDeviceRepository { suspend fun getAllDevices(): List diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/event/IEventRepository.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/event/IEventRepository.kt index 7ca7c91a..5985f7c7 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/event/IEventRepository.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/event/IEventRepository.kt @@ -1,6 +1,6 @@ package dk.scheduling.schedulingfrontend.repositories.event -import dk.scheduling.schedulingfrontend.api.protocol.Event +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Event interface IEventRepository { suspend fun getAllEvents(): List diff --git a/frontend/app/src/main/java/testdata/DummyEventRepository.kt b/frontend/app/src/main/java/testdata/DummyEventRepository.kt index 030cb522..8b0d664f 100644 --- a/frontend/app/src/main/java/testdata/DummyEventRepository.kt +++ b/frontend/app/src/main/java/testdata/DummyEventRepository.kt @@ -1,6 +1,6 @@ package testdata -import dk.scheduling.schedulingfrontend.api.protocol.Event +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Event import dk.scheduling.schedulingfrontend.repositories.event.IEventRepository import kotlinx.coroutines.delay import java.time.LocalDateTime diff --git a/frontend/app/src/main/java/testdata/DummyTaskRepository.kt b/frontend/app/src/main/java/testdata/DummyTaskRepository.kt index 9f8b00ac..dc17ca91 100644 --- a/frontend/app/src/main/java/testdata/DummyTaskRepository.kt +++ b/frontend/app/src/main/java/testdata/DummyTaskRepository.kt @@ -1,7 +1,7 @@ package testdata -import dk.scheduling.schedulingfrontend.api.protocol.Task -import dk.scheduling.schedulingfrontend.api.protocol.Timespan +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Task +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Timespan import dk.scheduling.schedulingfrontend.repositories.task.ITaskRepository import kotlinx.coroutines.delay diff --git a/frontend/app/src/main/java/testdata/TestData.kt b/frontend/app/src/main/java/testdata/TestData.kt index fa07c471..adbea899 100644 --- a/frontend/app/src/main/java/testdata/TestData.kt +++ b/frontend/app/src/main/java/testdata/TestData.kt @@ -1,9 +1,9 @@ package testdata -import dk.scheduling.schedulingfrontend.api.protocol.Device -import dk.scheduling.schedulingfrontend.api.protocol.Event -import dk.scheduling.schedulingfrontend.api.protocol.Task -import dk.scheduling.schedulingfrontend.api.protocol.Timespan +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Event +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Task +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Timespan import java.time.LocalDateTime fun devicesTestData(): List { diff --git a/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/TaskFormTest.kt b/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/TaskFormTest.kt index 26000d5d..506eb1f1 100644 --- a/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/TaskFormTest.kt +++ b/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/TaskFormTest.kt @@ -2,7 +2,7 @@ package dk.scheduling.schedulingfrontend import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.TimePickerState -import dk.scheduling.schedulingfrontend.components.DateRange +import dk.scheduling.schedulingfrontend.gui.components.DateRange import dk.scheduling.schedulingfrontend.model.Duration import dk.scheduling.schedulingfrontend.model.TaskForm import org.junit.Test From b4c5ced81ef1a954136c61734910b37875243c3f Mon Sep 17 00:00:00 2001 From: Puvikaran Santhirasegaram <74664443+Puvikaran2001@users.noreply.github.com> Date: Tue, 7 May 2024 14:30:43 +0200 Subject: [PATCH 2/6] Fix Folder structure --- .../schedulingfrontend/MainActivity.kt | 37 +++++++++++++------ .../schedulingfrontend/MainLayout.kt | 2 +- .../schedulingfrontend/model/DeviceState.kt | 2 +- .../schedulingfrontend/model/TaskForm.kt | 2 +- .../repositories/device/DeviceRepository.kt | 6 +-- .../repositories/event/EventRepository.kt | 4 +- .../repositories/task/ITaskRepository.kt | 4 +- .../repositories/task/TaskRepository.kt | 8 ++-- .../java/testdata/DummyDeviceRepository.kt | 2 +- .../schedulingfrontend/ApiServiceTest.kt | 16 ++++---- .../schedulingfrontend/DateRangeTest.kt | 2 +- 11 files changed, 50 insertions(+), 35 deletions(-) diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainActivity.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainActivity.kt index b51f6361..683769d4 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainActivity.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainActivity.kt @@ -19,15 +19,22 @@ import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController -import dk.scheduling.schedulingfrontend.pages.AccountPage -import dk.scheduling.schedulingfrontend.pages.CreateDevicePage -import dk.scheduling.schedulingfrontend.pages.CreateTaskPage -import dk.scheduling.schedulingfrontend.pages.HomePage -import dk.scheduling.schedulingfrontend.pages.LoginPage -import dk.scheduling.schedulingfrontend.pages.Page -import dk.scheduling.schedulingfrontend.pages.SignUpPage -import dk.scheduling.schedulingfrontend.pages.TaskOverviewPage -import dk.scheduling.schedulingfrontend.ui.theme.SchedulingFrontendTheme +import dk.scheduling.schedulingfrontend.datasources.AccountDataSource +import dk.scheduling.schedulingfrontend.datasources.api.getApiClient +import dk.scheduling.schedulingfrontend.gui.pages.AccountPage +import dk.scheduling.schedulingfrontend.gui.pages.CreateDevicePage +import dk.scheduling.schedulingfrontend.gui.pages.CreateTaskPage +import dk.scheduling.schedulingfrontend.gui.pages.HomePage +import dk.scheduling.schedulingfrontend.gui.pages.LoginPage +import dk.scheduling.schedulingfrontend.gui.pages.Page +import dk.scheduling.schedulingfrontend.gui.pages.SignUpPage +import dk.scheduling.schedulingfrontend.gui.pages.TaskOverviewPage +import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme +import dk.scheduling.schedulingfrontend.repositories.account.AccountRepository +import dk.scheduling.schedulingfrontend.repositories.device.DeviceRepository +import dk.scheduling.schedulingfrontend.repositories.event.EventRepository +import dk.scheduling.schedulingfrontend.repositories.overviews.OverviewRepository +import dk.scheduling.schedulingfrontend.repositories.task.TaskRepository import kotlinx.coroutines.runBlocking class MainActivity : ComponentActivity() { @@ -96,7 +103,11 @@ class MainActivity : ComponentActivity() { CreateDevicePage( deviceRepository = App.appModule.deviceRepo, navigateOnValidCreation = { appState.navHostController.navigate(Page.DeviceOverview.route) }, - navigateOnCancelCreation = { appState.navHostController.navigate(Page.DeviceOverview.route) }, + navigateOnCancelCreation = { + appState.navHostController.navigate( + Page.DeviceOverview.route, + ) + }, ) } composable( @@ -107,7 +118,11 @@ class MainActivity : ComponentActivity() { deviceRepository = App.appModule.deviceRepo, taskRepository = App.appModule.taskRepo, navigateOnValidCreation = { appState.navHostController.navigate(Page.TaskOverview.route) }, - navigateOnCancelCreation = { appState.navHostController.navigate(Page.TaskOverview.route) }, + navigateOnCancelCreation = { + appState.navHostController.navigate( + Page.TaskOverview.route, + ) + }, ) } composable(Page.Account.route) { diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainLayout.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainLayout.kt index 56027d9b..82699b87 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainLayout.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainLayout.kt @@ -11,7 +11,7 @@ import androidx.navigation.NavController import androidx.navigation.NavDestination.Companion.hierarchy import androidx.navigation.NavGraph.Companion.findStartDestination import androidx.navigation.compose.currentBackStackEntryAsState -import dk.scheduling.schedulingfrontend.pages.Page +import dk.scheduling.schedulingfrontend.gui.pages.Page @Composable fun BottomNavigationBar( diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceState.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceState.kt index 7699e712..409abdb0 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceState.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/DeviceState.kt @@ -1,6 +1,6 @@ package dk.scheduling.schedulingfrontend.model -import dk.scheduling.schedulingfrontend.api.protocol.Event +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Event import java.time.LocalDateTime import java.time.temporal.ChronoUnit diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/TaskForm.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/TaskForm.kt index fb8e68ec..89dfe68b 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/TaskForm.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/model/TaskForm.kt @@ -2,7 +2,7 @@ package dk.scheduling.schedulingfrontend.model import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.TimePickerState -import dk.scheduling.schedulingfrontend.components.DateRange +import dk.scheduling.schedulingfrontend.gui.components.DateRange import java.time.LocalDateTime import java.time.temporal.ChronoUnit diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/device/DeviceRepository.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/device/DeviceRepository.kt index 7e7163f2..a063d2b7 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/device/DeviceRepository.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/device/DeviceRepository.kt @@ -1,8 +1,8 @@ package dk.scheduling.schedulingfrontend.repositories.device -import dk.scheduling.schedulingfrontend.api.ApiService -import dk.scheduling.schedulingfrontend.api.protocol.CreateDeviceRequest -import dk.scheduling.schedulingfrontend.api.protocol.Device +import dk.scheduling.schedulingfrontend.datasources.api.ApiService +import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateDeviceRequest +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device import dk.scheduling.schedulingfrontend.exceptions.CreationFailedException import dk.scheduling.schedulingfrontend.exceptions.DeletionFailedException import dk.scheduling.schedulingfrontend.exceptions.NoBodyWasProvidedException diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/event/EventRepository.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/event/EventRepository.kt index a019a77a..8f6f2bee 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/event/EventRepository.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/event/EventRepository.kt @@ -2,9 +2,9 @@ package dk.scheduling.schedulingfrontend.repositories.event import android.content.Context import androidx.work.WorkManager -import dk.scheduling.schedulingfrontend.api.ApiService -import dk.scheduling.schedulingfrontend.api.protocol.Event import dk.scheduling.schedulingfrontend.background.EventAlarmSetterWorker +import dk.scheduling.schedulingfrontend.datasources.api.ApiService +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Event import dk.scheduling.schedulingfrontend.exceptions.NoBodyWasProvidedException import dk.scheduling.schedulingfrontend.exceptions.UnauthorizedException import dk.scheduling.schedulingfrontend.exceptions.UnsuccessfulRequestException diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/task/ITaskRepository.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/task/ITaskRepository.kt index 4c94e47a..ec2dcd5c 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/task/ITaskRepository.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/task/ITaskRepository.kt @@ -1,7 +1,7 @@ package dk.scheduling.schedulingfrontend.repositories.task -import dk.scheduling.schedulingfrontend.api.protocol.Task -import dk.scheduling.schedulingfrontend.api.protocol.Timespan +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Task +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Timespan interface ITaskRepository { suspend fun getAllTasks(): List diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/task/TaskRepository.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/task/TaskRepository.kt index ae49ab26..b2ddebd5 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/task/TaskRepository.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/repositories/task/TaskRepository.kt @@ -1,9 +1,9 @@ package dk.scheduling.schedulingfrontend.repositories.task -import dk.scheduling.schedulingfrontend.api.ApiService -import dk.scheduling.schedulingfrontend.api.protocol.CreateTaskRequest -import dk.scheduling.schedulingfrontend.api.protocol.Task -import dk.scheduling.schedulingfrontend.api.protocol.Timespan +import dk.scheduling.schedulingfrontend.datasources.api.ApiService +import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateTaskRequest +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Task +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Timespan import dk.scheduling.schedulingfrontend.exceptions.CreationFailedException import dk.scheduling.schedulingfrontend.exceptions.DeletionFailedException import dk.scheduling.schedulingfrontend.exceptions.NoBodyWasProvidedException diff --git a/frontend/app/src/main/java/testdata/DummyDeviceRepository.kt b/frontend/app/src/main/java/testdata/DummyDeviceRepository.kt index 5de2f7f7..9c47fa84 100644 --- a/frontend/app/src/main/java/testdata/DummyDeviceRepository.kt +++ b/frontend/app/src/main/java/testdata/DummyDeviceRepository.kt @@ -1,6 +1,6 @@ package testdata -import dk.scheduling.schedulingfrontend.api.protocol.Device +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository import kotlinx.coroutines.delay diff --git a/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/ApiServiceTest.kt b/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/ApiServiceTest.kt index 919478b5..a1cd1db6 100644 --- a/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/ApiServiceTest.kt +++ b/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/ApiServiceTest.kt @@ -1,13 +1,13 @@ package dk.scheduling.schedulingfrontend -import dk.scheduling.schedulingfrontend.api.ApiService -import dk.scheduling.schedulingfrontend.api.getApiClient -import dk.scheduling.schedulingfrontend.api.protocol.CreateDeviceRequest -import dk.scheduling.schedulingfrontend.api.protocol.CreateTaskRequest -import dk.scheduling.schedulingfrontend.api.protocol.Device -import dk.scheduling.schedulingfrontend.api.protocol.RegisterOrLoginRequest -import dk.scheduling.schedulingfrontend.api.protocol.Task -import dk.scheduling.schedulingfrontend.api.protocol.Timespan +import dk.scheduling.schedulingfrontend.datasources.api.ApiService +import dk.scheduling.schedulingfrontend.datasources.api.getApiClient +import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateDeviceRequest +import dk.scheduling.schedulingfrontend.datasources.api.protocol.CreateTaskRequest +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Device +import dk.scheduling.schedulingfrontend.datasources.api.protocol.RegisterOrLoginRequest +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Task +import dk.scheduling.schedulingfrontend.datasources.api.protocol.Timespan import kotlinx.coroutines.runBlocking import org.junit.Assert.assertEquals import org.junit.Before diff --git a/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/DateRangeTest.kt b/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/DateRangeTest.kt index 671561cf..81f8b313 100644 --- a/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/DateRangeTest.kt +++ b/frontend/app/src/test/java/dk/scheduling/schedulingfrontend/DateRangeTest.kt @@ -1,6 +1,6 @@ package dk.scheduling.schedulingfrontend -import dk.scheduling.schedulingfrontend.components.DateRange +import dk.scheduling.schedulingfrontend.gui.components.DateRange import org.junit.Test class DateRangeTest { From 460ba5f44163ce7a5c505e342baf19bbe9f1a412 Mon Sep 17 00:00:00 2001 From: Puvikaran Santhirasegaram <74664443+Puvikaran2001@users.noreply.github.com> Date: Fri, 10 May 2024 12:00:05 +0200 Subject: [PATCH 3/6] Fix imports --- .../java/dk/scheduling/schedulingfrontend/MainActivity.kt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainActivity.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainActivity.kt index 683769d4..8d4e431d 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainActivity.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/MainActivity.kt @@ -19,8 +19,6 @@ import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController -import dk.scheduling.schedulingfrontend.datasources.AccountDataSource -import dk.scheduling.schedulingfrontend.datasources.api.getApiClient import dk.scheduling.schedulingfrontend.gui.pages.AccountPage import dk.scheduling.schedulingfrontend.gui.pages.CreateDevicePage import dk.scheduling.schedulingfrontend.gui.pages.CreateTaskPage @@ -30,11 +28,6 @@ import dk.scheduling.schedulingfrontend.gui.pages.Page import dk.scheduling.schedulingfrontend.gui.pages.SignUpPage import dk.scheduling.schedulingfrontend.gui.pages.TaskOverviewPage import dk.scheduling.schedulingfrontend.gui.theme.SchedulingFrontendTheme -import dk.scheduling.schedulingfrontend.repositories.account.AccountRepository -import dk.scheduling.schedulingfrontend.repositories.device.DeviceRepository -import dk.scheduling.schedulingfrontend.repositories.event.EventRepository -import dk.scheduling.schedulingfrontend.repositories.overviews.OverviewRepository -import dk.scheduling.schedulingfrontend.repositories.task.TaskRepository import kotlinx.coroutines.runBlocking class MainActivity : ComponentActivity() { From 54e53665f1bd0ad4aafd1937a079c558bd3d1fba Mon Sep 17 00:00:00 2001 From: Puvikaran Santhirasegaram <74664443+Puvikaran2001@users.noreply.github.com> Date: Fri, 10 May 2024 12:05:15 +0200 Subject: [PATCH 4/6] Refactor --- .../schedulingfrontend/module/AppModule.kt | 48 +------------------ .../schedulingfrontend/module/IAppModule.kt | 19 ++++++++ .../module/TestMockAppModule.kt | 47 ++++++++++++++++++ 3 files changed, 68 insertions(+), 46 deletions(-) create mode 100644 frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/IAppModule.kt create mode 100644 frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/TestMockAppModule.kt diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/AppModule.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/AppModule.kt index bd80a741..d6ef7584 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/AppModule.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/AppModule.kt @@ -3,9 +3,9 @@ package dk.scheduling.schedulingfrontend.module import android.content.Context import androidx.core.content.ContextCompat.getString import dk.scheduling.schedulingfrontend.R -import dk.scheduling.schedulingfrontend.api.ApiService -import dk.scheduling.schedulingfrontend.api.getApiClient import dk.scheduling.schedulingfrontend.datasources.AccountDataSource +import dk.scheduling.schedulingfrontend.datasources.api.ApiService +import dk.scheduling.schedulingfrontend.datasources.api.getApiClient import dk.scheduling.schedulingfrontend.repositories.account.AccountRepository import dk.scheduling.schedulingfrontend.repositories.account.IAccountRepository import dk.scheduling.schedulingfrontend.repositories.device.DeviceRepository @@ -15,20 +15,6 @@ import dk.scheduling.schedulingfrontend.repositories.event.IEventRepository import dk.scheduling.schedulingfrontend.repositories.overviews.OverviewRepository import dk.scheduling.schedulingfrontend.repositories.task.ITaskRepository import dk.scheduling.schedulingfrontend.repositories.task.TaskRepository -import testdata.DummyAccountRepository -import testdata.DummyDeviceRepository -import testdata.DummyEventRepository -import testdata.DummyTaskRepository - -interface IAppModule { - val apiService: ApiService - val accountDataStorage: AccountDataSource - val accountRepo: IAccountRepository - val deviceRepo: IDeviceRepository - val taskRepo: ITaskRepository - val eventRepo: IEventRepository - val overviewRepo: OverviewRepository -} class AppModule( private val context: Context, @@ -59,33 +45,3 @@ class AppModule( ) } } - -class TestMockAppModule( - private val context: Context, -) : IAppModule { - override val apiService: ApiService by lazy { - getApiClient(baseUrl = getString(context, R.string.base_url)) - } - override val accountDataStorage: AccountDataSource by lazy { - AccountDataSource(context) - } - override val accountRepo: IAccountRepository by lazy { - DummyAccountRepository() - } - override val deviceRepo: IDeviceRepository by lazy { - DummyDeviceRepository(0) - } - override val taskRepo: ITaskRepository by lazy { - DummyTaskRepository(0) - } - override val eventRepo: IEventRepository by lazy { - DummyEventRepository(0) - } - override val overviewRepo: OverviewRepository by lazy { - OverviewRepository( - deviceRepository = deviceRepo, - taskRepository = taskRepo, - eventRepository = eventRepo, - ) - } -} diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/IAppModule.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/IAppModule.kt new file mode 100644 index 00000000..8fb8c6be --- /dev/null +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/IAppModule.kt @@ -0,0 +1,19 @@ +package dk.scheduling.schedulingfrontend.module + +import dk.scheduling.schedulingfrontend.datasources.AccountDataSource +import dk.scheduling.schedulingfrontend.datasources.api.ApiService +import dk.scheduling.schedulingfrontend.repositories.account.IAccountRepository +import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository +import dk.scheduling.schedulingfrontend.repositories.event.IEventRepository +import dk.scheduling.schedulingfrontend.repositories.overviews.OverviewRepository +import dk.scheduling.schedulingfrontend.repositories.task.ITaskRepository + +interface IAppModule { + val apiService: ApiService + val accountDataStorage: AccountDataSource + val accountRepo: IAccountRepository + val deviceRepo: IDeviceRepository + val taskRepo: ITaskRepository + val eventRepo: IEventRepository + val overviewRepo: OverviewRepository +} diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/TestMockAppModule.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/TestMockAppModule.kt new file mode 100644 index 00000000..771c28ba --- /dev/null +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/module/TestMockAppModule.kt @@ -0,0 +1,47 @@ +package dk.scheduling.schedulingfrontend.module + +import android.content.Context +import androidx.core.content.ContextCompat +import dk.scheduling.schedulingfrontend.R +import dk.scheduling.schedulingfrontend.datasources.AccountDataSource +import dk.scheduling.schedulingfrontend.datasources.api.ApiService +import dk.scheduling.schedulingfrontend.datasources.api.getApiClient +import dk.scheduling.schedulingfrontend.repositories.account.IAccountRepository +import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository +import dk.scheduling.schedulingfrontend.repositories.event.IEventRepository +import dk.scheduling.schedulingfrontend.repositories.overviews.OverviewRepository +import dk.scheduling.schedulingfrontend.repositories.task.ITaskRepository +import testdata.DummyAccountRepository +import testdata.DummyDeviceRepository +import testdata.DummyEventRepository +import testdata.DummyTaskRepository + +class TestMockAppModule( + private val context: Context, +) : IAppModule { + override val apiService: ApiService by lazy { + getApiClient(baseUrl = ContextCompat.getString(context, R.string.base_url)) + } + override val accountDataStorage: AccountDataSource by lazy { + AccountDataSource(context) + } + override val accountRepo: IAccountRepository by lazy { + DummyAccountRepository() + } + override val deviceRepo: IDeviceRepository by lazy { + DummyDeviceRepository(0) + } + override val taskRepo: ITaskRepository by lazy { + DummyTaskRepository(0) + } + override val eventRepo: IEventRepository by lazy { + DummyEventRepository(0) + } + override val overviewRepo: OverviewRepository by lazy { + OverviewRepository( + deviceRepository = deviceRepo, + taskRepository = taskRepo, + eventRepository = eventRepo, + ) + } +} From bcdc42d3ff615ee4b3a53bd26f9cd1a03e91fab5 Mon Sep 17 00:00:00 2001 From: Puvikaran Santhirasegaram <74664443+Puvikaran2001@users.noreply.github.com> Date: Fri, 10 May 2024 12:29:09 +0200 Subject: [PATCH 5/6] Fix problem after rebase --- .../schedulingfrontend/eventnotification/EventAlarmReceiver.kt | 2 +- .../java/dk/scheduling/schedulingfrontend/gui/pages/HomePage.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/eventnotification/EventAlarmReceiver.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/eventnotification/EventAlarmReceiver.kt index ec9cc7d7..39a7a574 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/eventnotification/EventAlarmReceiver.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/eventnotification/EventAlarmReceiver.kt @@ -7,8 +7,8 @@ import androidx.core.app.NotificationCompat import androidx.core.content.ContextCompat.getString import dk.scheduling.schedulingfrontend.App import dk.scheduling.schedulingfrontend.R -import dk.scheduling.schedulingfrontend.components.DATE_AND_TIME_FORMAT import dk.scheduling.schedulingfrontend.database.EventAlarm +import dk.scheduling.schedulingfrontend.gui.components.DATE_AND_TIME_FORMAT import java.time.Duration import java.time.LocalDateTime import java.time.temporal.ChronoUnit diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/HomePage.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/HomePage.kt index 06469f57..666c65bc 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/HomePage.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/gui/pages/HomePage.kt @@ -57,6 +57,7 @@ import dk.scheduling.schedulingfrontend.model.getDeviceState import dk.scheduling.schedulingfrontend.repositories.device.IDeviceRepository import dk.scheduling.schedulingfrontend.repositories.overviews.IOverviewsRepository import dk.scheduling.schedulingfrontend.repositories.overviews.OverviewRepository +import kotlinx.coroutines.launch import testdata.DummyDeviceRepository import testdata.DummyEventRepository import testdata.DummyTaskRepository From d54401240d6bd1da9dedea00d0aac0cd7483f383 Mon Sep 17 00:00:00 2001 From: Puvikaran Santhirasegaram <74664443+Puvikaran2001@users.noreply.github.com> Date: Fri, 10 May 2024 12:48:43 +0200 Subject: [PATCH 6/6] wrong version before --- frontend/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/build.gradle.kts b/frontend/build.gradle.kts index e3a84bdd..81594e38 100644 --- a/frontend/build.gradle.kts +++ b/frontend/build.gradle.kts @@ -1,5 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "8.4.0" apply false + id("com.android.application") version "8.3.2" apply false id("org.jetbrains.kotlin.android") version "1.9.23" apply false }