diff --git a/agent_promts/roles/semantic_enrichment_agent.xml b/agent_promts/roles/semantic_enrichment_agent.xml
new file mode 100644
index 0000000..6591bf0
--- /dev/null
+++ b/agent_promts/roles/semantic_enrichment_agent.xml
@@ -0,0 +1,105 @@
+
+
+
+
+ Этот документ определяет операционный протокол для **исполнения роли 'Агента Семантического Обогащения'**. Главная задача — обогащение кодовой базы семантической информацией согласно `SEMANTIC_ENRICHMENT_PROTOCOL`.
+ 1.0
+
+
+
+
+
+
+
+ - ..agent_promts/interfaces/task_channel_interface.xml
+ - ..agent_promts/protocols/semantic_enrichment_protocol.xml
+
+
+
+
+ При исполнении этой роли, я действую как агент семантического обогащения. Моя задача - находить и размечать код, добавляя ему семантическую ценность в соответствии с протоколом.
+ Проактивно обогащать кодовую базу семантической разметкой для улучшения машиночитаемости и анализа.
+
+
+
+
+ Моя работа заключается в добавлении семантических комментариев и аннотаций, не изменяя логику существующего кода.
+
+
+ Все изменения должны быть доступны для просмотра, например, через Pull Request.
+
+
+
+
+ Загрузить и полностью проанализировать `agent_promts/protocols/semantic_enrichment_protocol.xml`, включая все вложенные `INCLUDE` файлы, для построения полного набора правил в памяти.
+
+
+
+ Задачи для этой роли определяют, какие части кодовой базы нужно обогатить.
+
+
+ full_project | directory | file_list
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+ CALL MyTaskChannel.UpdateTaskStatus(IssueID={WorkOrder.ID}, NewStatus='status::in-progress')
+
+
+
+ Извлечь `` из `WorkOrder`.
+ feature/{WorkOrder.ID}/semantic-enrichment
+ CALL MyTaskChannel.CreateBranch(BranchName={BranchName})
+ Определить `files_to_process` на основе `SCOPE` и `TARGET`.
+ Для каждого файла в `files_to_process` применить правила из `SEMANTIC_ENRICHMENT_PROTOCOL`.
+
+
+
+
+ Сделать коммит с сообщением: `feat(enrichment): apply semantic markup`.
+ CALL MyTaskChannel.CommitChanges(...)
+
+ CALL MyTaskChannel.AddComment(IssueID={WorkOrder.ID}, CommentBody='Enrichment complete. PR #{PrID} is ready for review.')
+
+
+ CALL MyTaskChannel.AddComment(IssueID={WorkOrder.ID}, CommentBody='Enrichment complete. No new semantic markup was added.')
+
+
+
+
+ CALL MyTaskChannel.UpdateTaskStatus(IssueID={WorkOrder.ID}, NewStatus='status::completed')
+
+
+
+ Отправить метрики через `MyMetricsSink`.
+
+
+
+
+
+
+`WorkOrder {WorkOrder.ID} completed.
+ - Files Processed: {EnrichmentMetrics.files_processed}
+ - Entities Enriched: {EnrichmentMetrics.entities_enriched}
+ - Relations Added: {EnrichmentMetrics.relations_added}
+ - Contracts Added: {EnrichmentMetrics.contracts_added}
+ - Logs Added: {EnrichmentMetrics.logs_added}`
+
+ CALL MyLogSink.Log(FileName="logs/enrichment_agent_log.txt", Content={LogMessage})
+
+
+
+]]>
\ No newline at end of file
diff --git a/agent_promts/roles/semantic_linter.xml b/agent_promts/roles/semantic_linter.xml
index b3565f0..110f287 100644
--- a/agent_promts/roles/semantic_linter.xml
+++ b/agent_promts/roles/semantic_linter.xml
@@ -11,13 +11,13 @@
- - ../interfaces/task_channel_interface.xml
- - ../protocols/semantic_enrichment_protocol.xml
+ - ..agent_promts/interfaces/task_channel_interface.xml
+ - ..agent_promts/protocols/semantic_enrichment_protocol.xml
- При исполнении этой роли, я, Gemini, действую как автоматизированный хранитель чистоты кода. Моя единственная задача — обеспечить, чтобы каждый файл в указанной области соответствовал `SEMANTIC_ENRICHMENT_PROTOCOL`.
+ При исполнении этой роли, я, действую как автоматизированный хранитель чистоты кода. Моя единственная задача — обеспечить, чтобы каждый файл в указанной области соответствовал `SEMANTIC_ENRICHMENT_PROTOCOL`.
Поддерживать 100% семантическую чистоту и машиночитаемость кодовой базы, делая все изменения отслеживаемыми через систему контроля версий.
@@ -30,18 +30,6 @@
-
-
-
-
-
-
- find . -name "*.kt"
- git diff --name-only {commit_range}
-
-
-
-
Задачи для этой роли должны содержать XML-блок, определяющий режим работы.
diff --git a/agent_promts/shared/metrics_catalog.xml b/agent_promts/shared/metrics_catalog.xml
index 8999952..9e33dd2 100644
--- a/agent_promts/shared/metrics_catalog.xml
+++ b/agent_promts/shared/metrics_catalog.xml
@@ -44,4 +44,12 @@
+
+ Количество обработанных файлов.
+ Количество обогащенных сущностей (добавлены якоря ENTITY).
+ Количество добавленных семантических связей (якоря RELATION).
+ Количество добавленных KDoc-контрактов.
+ Количество добавленных структурированных логов.
+
+
diff --git a/app/src/main/java/com/homebox/lens/MainActivity.kt b/app/src/main/java/com/homebox/lens/MainActivity.kt
index 0752d4c..e3519f7 100644
--- a/app/src/main/java/com/homebox/lens/MainActivity.kt
+++ b/app/src/main/java/com/homebox/lens/MainActivity.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens
// [FILE] MainActivity.kt
-// [SEMANTICS] ui, activity, entrypoint
+// [SEMANTICS] app, ui, activity, entrypoint
package com.homebox.lens
// [IMPORTS]
@@ -22,7 +22,7 @@ import timber.log.Timber
// [ENTITY: Activity('MainActivity')]
/**
- * @summary Главная и единственная Activity в приложении.
+ * @summary The main and only Activity in the application.
*/
@AndroidEntryPoint
class MainActivity : ComponentActivity() {
diff --git a/app/src/main/java/com/homebox/lens/MainApplication.kt b/app/src/main/java/com/homebox/lens/MainApplication.kt
index bdb7afb..57c6b21 100644
--- a/app/src/main/java/com/homebox/lens/MainApplication.kt
+++ b/app/src/main/java/com/homebox/lens/MainApplication.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens
// [FILE] MainApplication.kt
-// [SEMANTICS] application, hilt, timber
+// [SEMANTICS] app, hilt, timber, entrypoint
package com.homebox.lens
// [IMPORTS]
@@ -11,7 +11,7 @@ import timber.log.Timber
// [ENTITY: Application('MainApplication')]
/**
- * @summary Точка входа в приложение. Инициализирует Hilt и Timber.
+ * @summary The entry point of the application. Initializes Hilt and Timber.
*/
@HiltAndroidApp
class MainApplication : Application() {
diff --git a/app/src/main/java/com/homebox/lens/navigation/NavGraph.kt b/app/src/main/java/com/homebox/lens/navigation/NavGraph.kt
index 8d05b1d..512b732 100644
--- a/app/src/main/java/com/homebox/lens/navigation/NavGraph.kt
+++ b/app/src/main/java/com/homebox/lens/navigation/NavGraph.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.navigation
// [FILE] NavGraph.kt
-// [SEMANTICS] navigation, compose, nav_host
+// [SEMANTICS] app, ui, navigation
package com.homebox.lens.navigation
@@ -34,11 +34,11 @@ import com.homebox.lens.ui.screen.splash.SplashScreen
// [RELATION: Function('NavGraph')] -> [CREATES_INSTANCE_OF] -> [Class('NavigationActions')]
// [RELATION: Function('NavGraph')] -> [USES] -> [Screen('SplashScreen')]
/**
- * @summary Определяет граф навигации для всего приложения с использованием Jetpack Compose Navigation.
- * @param navController Контроллер навигации.
+ * @summary Defines the navigation graph for the entire application using Jetpack Compose Navigation.
+ * @param navController The navigation controller.
* @see Screen
- * @sideeffect Регистрирует все экраны и управляет состоянием навигации.
- * @invariant Стартовый экран - `Screen.Setup`.
+ * @sideeffect Registers all screens and manages the navigation state.
+ * @invariant The start screen is `Screen.Splash`.
*/
@Composable
fun NavGraph(
diff --git a/app/src/main/java/com/homebox/lens/navigation/NavigationActions.kt b/app/src/main/java/com/homebox/lens/navigation/NavigationActions.kt
index ff0ee98..566f74e 100644
--- a/app/src/main/java/com/homebox/lens/navigation/NavigationActions.kt
+++ b/app/src/main/java/com/homebox/lens/navigation/NavigationActions.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.navigation
// [FILE] NavigationActions.kt
-// [SEMANTICS] navigation, controller, actions
+// [SEMANTICS] app, ui, navigation, actions
package com.homebox.lens.navigation
// [IMPORTS]
@@ -11,16 +11,16 @@ import timber.log.Timber
// [ENTITY: Class('NavigationActions')]
// [RELATION: Class('NavigationActions')] -> [DEPENDS_ON] -> [Framework('NavHostController')]
/**
- * @summary Класс-обертка над NavHostController для предоставления типизированных навигационных действий.
- * @param navController Контроллер Jetpack Navigation.
- * @invariant Все навигационные действия должны использовать предоставленный navController.
+ * @summary Wrapper class over NavHostController to provide typed navigation actions.
+ * @param navController The Jetpack Navigation controller.
+ * @invariant All navigation actions must use the provided navController.
*/
class NavigationActions(private val navController: NavHostController) {
// [ENTITY: Function('navigateToDashboard')]
/**
- * @summary Навигация на главный экран.
- * @sideeffect Очищает back stack до главного экрана, чтобы избежать циклов.
+ * @summary Navigation to the main screen.
+ * @sideeffect Clears the back stack up to the main screen to avoid cycles.
*/
fun navigateToDashboard() {
Timber.i("[INFO][ACTION][navigate_to_dashboard] Navigating to Dashboard.")
diff --git a/app/src/main/java/com/homebox/lens/navigation/Screen.kt b/app/src/main/java/com/homebox/lens/navigation/Screen.kt
index eb34239..98b5642 100644
--- a/app/src/main/java/com/homebox/lens/navigation/Screen.kt
+++ b/app/src/main/java/com/homebox/lens/navigation/Screen.kt
@@ -1,13 +1,13 @@
// [PACKAGE] com.homebox.lens.navigation
// [FILE] Screen.kt
-// [SEMANTICS] navigation, routes, sealed_class
+// [SEMANTICS] app, ui, navigation, routes
package com.homebox.lens.navigation
// [ENTITY: SealedClass('Screen')]
/**
- * @summary Запечатанный класс для определения маршрутов навигации в приложении.
- * @description Обеспечивает типобезопасность при навигации.
- * @param route Строковый идентификатор маршрута.
+ * @summary Sealed class for defining navigation routes in the application.
+ * @description Provides type safety during navigation.
+ * @param route The string identifier of the route.
*/
sealed class Screen(val route: String) {
// [ENTITY: Object('Splash')]
@@ -26,11 +26,11 @@ sealed class Screen(val route: String) {
data object InventoryList : Screen("inventory_list_screen") {
// [ENTITY: Function('withFilter')]
/**
- * @summary Создает маршрут для экрана списка инвентаря с параметром фильтра.
- * @param key Ключ фильтра (например, "label" или "location").
- * @param value Значение фильтра (например, ID метки или местоположения).
- * @return Строку полного маршрута с query-параметром.
- * @throws IllegalArgumentException если ключ или значение пустые.
+ * @summary Creates a route for the inventory list screen with a filter parameter.
+ * @param key The filter key (e.g., "label" or "location").
+ * @param value The filter value (e.g., the ID of the label or location).
+ * @return A string of the full route with a query parameter.
+ * @throws IllegalArgumentException if the key or value is blank.
*/
fun withFilter(key: String, value: String): String {
require(key.isNotBlank()) { "Filter key cannot be blank." }
@@ -47,10 +47,10 @@ sealed class Screen(val route: String) {
data object ItemDetails : Screen("item_details_screen/{itemId}") {
// [ENTITY: Function('createRoute')]
/**
- * @summary Создает маршрут для экрана деталей элемента с указанным ID.
- * @param itemId ID элемента для отображения.
- * @return Строку полного маршрута.
- * @throws IllegalArgumentException если itemId пустой.
+ * @summary Creates a route for the item details screen with the specified ID.
+ * @param itemId The ID of the item to display.
+ * @return A string of the full route.
+ * @throws IllegalArgumentException if itemId is blank.
*/
fun createRoute(itemId: String): String {
require(itemId.isNotBlank()) { "itemId не может быть пустым." }
@@ -66,9 +66,9 @@ sealed class Screen(val route: String) {
data object ItemEdit : Screen("item_edit_screen?itemId={itemId}") {
// [ENTITY: Function('createRoute')]
/**
- * @summary Создает маршрут для экрана редактирования элемента с указанным ID.
- * @param itemId ID элемента для редактирования. Null, если создается новый элемент.
- * @return Строку полного маршрута.
+ * @summary Creates a route for the item edit screen with the specified ID.
+ * @param itemId The ID of the item to edit. Null if a new item is being created.
+ * @return A string of the full route.
*/
fun createRoute(itemId: String? = null): String {
return itemId?.let { "item_edit_screen?itemId=$it" } ?: "item_edit_screen"
@@ -85,9 +85,9 @@ sealed class Screen(val route: String) {
data object LabelEdit : Screen("label_edit_screen?labelId={labelId}") {
// [ENTITY: Function('createRoute')]
/**
- * @summary Создает маршрут для экрана редактирования метки с указанным ID.
- * @param labelId ID метки для редактирования. Null, если создается новая метка.
- * @return Строку полного маршрута.
+ * @summary Creates a route for the label edit screen with the specified ID.
+ * @param labelId The ID of the label to edit. Null if a new label is being created.
+ * @return A string of the full route.
*/
fun createRoute(labelId: String? = null): String {
return labelId?.let { "label_edit_screen?labelId=$it" } ?: "label_edit_screen"
@@ -104,10 +104,10 @@ sealed class Screen(val route: String) {
data object LocationEdit : Screen("location_edit_screen/{locationId}") {
// [ENTITY: Function('createRoute')]
/**
- * @summary Создает маршрут для экрана редактирования местоположения с указанным ID.
- * @param locationId ID местоположения для редактирования.
- * @return Строку полного маршрута.
- * @throws IllegalArgumentException если locationId пустой.
+ * @summary Creates a route for the location edit screen with the specified ID.
+ * @param locationId The ID of the location to edit.
+ * @return A string of the full route.
+ * @throws IllegalArgumentException if locationId is blank.
*/
fun createRoute(locationId: String): String {
require(locationId.isNotBlank()) { "locationId не может быть пустым." }
diff --git a/app/src/main/java/com/homebox/lens/ui/common/AppDrawer.kt b/app/src/main/java/com/homebox/lens/ui/common/AppDrawer.kt
index 1cc14fe..0ab2b2d 100644
--- a/app/src/main/java/com/homebox/lens/ui/common/AppDrawer.kt
+++ b/app/src/main/java/com/homebox/lens/ui/common/AppDrawer.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.common
// [FILE] AppDrawer.kt
-// [SEMANTICS] ui, common, navigation_drawer
+// [SEMANTICS] app, ui, common, navigation
package com.homebox.lens.ui.common
// [IMPORTS]
@@ -30,10 +30,10 @@ import com.homebox.lens.navigation.Screen
// [ENTITY: Function('AppDrawerContent')]
// [RELATION: Function('AppDrawerContent')] -> [DEPENDS_ON] -> [Class('NavigationActions')]
/**
- * @summary Контент для бокового навигационного меню (Drawer).
- * @param currentRoute Текущий маршрут для подсветки активного элемента.
- * @param navigationActions Объект с навигационными действиями.
- * @param onCloseDrawer Лямбда для закрытия бокового меню.
+ * @summary Content for the side navigation menu (Drawer).
+ * @param currentRoute The current route to highlight the active item.
+ * @param navigationActions The object with navigation actions.
+ * @param onCloseDrawer Lambda to close the side menu.
*/
@Composable
internal fun AppDrawerContent(
diff --git a/app/src/main/java/com/homebox/lens/ui/common/MainScaffold.kt b/app/src/main/java/com/homebox/lens/ui/common/MainScaffold.kt
index 0072a1f..6475455 100644
--- a/app/src/main/java/com/homebox/lens/ui/common/MainScaffold.kt
+++ b/app/src/main/java/com/homebox/lens/ui/common/MainScaffold.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.common
// [FILE] MainScaffold.kt
-// [SEMANTICS] ui, common, scaffold, navigation_drawer
+// [SEMANTICS] app, ui, common, scaffold
package com.homebox.lens.ui.common
@@ -21,14 +21,14 @@ import kotlinx.coroutines.launch
// [RELATION: Function('MainScaffold')] -> [DEPENDS_ON] -> [Class('NavigationActions')]
// [RELATION: Function('MainScaffold')] -> [CALLS] -> [Function('AppDrawerContent')]
/**
- * @summary Общая обертка для экранов, включающая Scaffold и Navigation Drawer.
- * @param topBarTitle Заголовок для TopAppBar.
- * @param currentRoute Текущий маршрут для подсветки активного элемента в Drawer.
- * @param navigationActions Объект с навигационными действиями.
- * @param topBarActions Composable-функция для отображения действий (иконок) в TopAppBar.
- * @param content Основное содержимое экрана, которое будет отображено внутри Scaffold.
- * @sideeffect Управляет состоянием (открыто/закрыто) бокового меню (ModalNavigationDrawer).
- * @invariant TopAppBar всегда отображается с иконкой меню.
+ * @summary A common wrapper for screens that includes a Scaffold and Navigation Drawer.
+ * @param topBarTitle The title for the TopAppBar.
+ * @param currentRoute The current route to highlight the active item in the Drawer.
+ * @param navigationActions The object with navigation actions.
+ * @param topBarActions A Composable function to display actions (icons) in the TopAppBar.
+ * @param content The main content of the screen to be displayed inside the Scaffold.
+ * @sideeffect Manages the state (open/closed) of the side menu (ModalNavigationDrawer).
+ * @invariant The TopAppBar is always displayed with a menu icon.
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
diff --git a/app/src/main/java/com/homebox/lens/ui/components/ColorPicker.kt b/app/src/main/java/com/homebox/lens/ui/components/ColorPicker.kt
index 3151ad5..1300707 100644
--- a/app/src/main/java/com/homebox/lens/ui/components/ColorPicker.kt
+++ b/app/src/main/java/com/homebox/lens/ui/components/ColorPicker.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.components
// [FILE] ColorPicker.kt
-// [SEMANTICS] ui, component, color_selection
+// [SEMANTICS] app, ui, component, color
package com.homebox.lens.ui.components
@@ -25,10 +25,10 @@ import com.homebox.lens.R
// [ENTITY: Function('ColorPicker')]
/**
- * @summary Компонент для выбора цвета.
- * @param selectedColor Текущий выбранный цвет в формате HEX строки (например, "#FFFFFF").
- * @param onColorSelected Лямбда-функция, вызываемая при выборе нового цвета.
- * @param modifier Модификатор для настройки внешнего вида.
+ * @summary A component for color selection.
+ * @param selectedColor The currently selected color in HEX string format (e.g., "#FFFFFF").
+ * @param onColorSelected A lambda function called when a new color is selected.
+ * @param modifier A modifier for customizing the appearance.
*/
@Composable
fun ColorPicker(
diff --git a/app/src/main/java/com/homebox/lens/ui/components/LoadingOverlay.kt b/app/src/main/java/com/homebox/lens/ui/components/LoadingOverlay.kt
index 6c6ff3b..46e071c 100644
--- a/app/src/main/java/com/homebox/lens/ui/components/LoadingOverlay.kt
+++ b/app/src/main/java/com/homebox/lens/ui/components/LoadingOverlay.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.components
// [FILE] LoadingOverlay.kt
-// [SEMANTICS] ui, component, loading
+// [SEMANTICS] app, ui, component, loading
package com.homebox.lens.ui.components
@@ -18,7 +18,7 @@ import androidx.compose.ui.graphics.Color
// [ENTITY: Function('LoadingOverlay')]
/**
- * @summary Полноэкранный оверлей с индикатором загрузки.
+ * @summary A full-screen overlay with a loading indicator.
*/
@Composable
fun LoadingOverlay() {
diff --git a/app/src/main/java/com/homebox/lens/ui/mapper/ItemMapper.kt b/app/src/main/java/com/homebox/lens/ui/mapper/ItemMapper.kt
index 01c0e98..6f7e262 100644
--- a/app/src/main/java/com/homebox/lens/ui/mapper/ItemMapper.kt
+++ b/app/src/main/java/com/homebox/lens/ui/mapper/ItemMapper.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.mapper
// [FILE] ItemMapper.kt
-// [SEMANTICS] ui, mapper, item
+// [SEMANTICS] app, ui, mapper, item
package com.homebox.lens.ui.mapper
import com.homebox.lens.domain.model.Item
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardScreen.kt
index e2775c8..390a371 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.dashboard
// [FILE] DashboardScreen.kt
-// [SEMANTICS] ui, screen, dashboard, compose, navigation
+// [SEMANTICS] app, ui, screen, dashboard
package com.homebox.lens.ui.screen.dashboard
// [IMPORTS]
@@ -37,11 +37,11 @@ import timber.log.Timber
// [RELATION: Function('DashboardScreen')] -> [DEPENDS_ON] -> [Class('NavigationActions')]
// [RELATION: Function('DashboardScreen')] -> [CALLS] -> [Function('MainScaffold')]
/**
- * @summary Главная Composable-функция для экрана "Панель управления".
- * @param viewModel ViewModel для этого экрана, предоставляется через Hilt.
- * @param currentRoute Текущий маршрут для подсветки активного элемента в Drawer.
- * @param navigationActions Объект с навигационными действиями.
- * @sideeffect Вызывает навигационные лямбды при взаимодействии с UI.
+ * @summary The main Composable function for the "Dashboard" screen.
+ * @param viewModel The ViewModel for this screen, provided by Hilt.
+ * @param currentRoute The current route to highlight the active item in the Drawer.
+ * @param navigationActions The object with navigation actions.
+ * @sideeffect Calls navigation lambdas upon UI interaction.
*/
@Composable
fun DashboardScreen(
@@ -82,11 +82,11 @@ fun DashboardScreen(
// [ENTITY: Function('DashboardContent')]
// [RELATION: Function('DashboardContent')] -> [CONSUMES_STATE] -> [SealedInterface('DashboardUiState')]
/**
- * @summary Отображает основной контент экрана в зависимости от uiState.
- * @param modifier Модификатор для стилизации.
- * @param uiState Текущее состояние UI экрана.
- * @param onLocationClick Лямбда-обработчик нажатия на местоположение.
- * @param onLabelClick Лямбда-обработчик нажатия на метку.
+ * @summary Displays the main content of the screen depending on the uiState.
+ * @param modifier A modifier for styling.
+ * @param uiState The current UI state of the screen.
+ * @param onLocationClick A lambda handler for clicking on a location.
+ * @param onLabelClick A lambda handler for clicking on a label.
*/
@Composable
private fun DashboardContent(
@@ -132,8 +132,8 @@ private fun DashboardContent(
// [ENTITY: Function('StatisticsSection')]
// [RELATION: Function('StatisticsSection')] -> [DEPENDS_ON] -> [DataClass('GroupStatistics')]
/**
- * @summary Секция для отображения общей статистики.
- * @param statistics Объект со статистическими данными.
+ * @summary Section for displaying general statistics.
+ * @param statistics The object with statistical data.
*/
@Composable
private fun StatisticsSection(statistics: GroupStatistics) {
@@ -164,9 +164,9 @@ private fun StatisticsSection(statistics: GroupStatistics) {
// [ENTITY: Function('StatisticCard')]
/**
- * @summary Карточка для отображения одного статистического показателя.
- * @param title Название показателя.
- * @param value Значение показателя.
+ * @summary Card for displaying a single statistical indicator.
+ * @param title The name of the indicator.
+ * @param value The value of the indicator.
*/
@Composable
private fun StatisticCard(title: String, value: String) {
@@ -180,8 +180,8 @@ private fun StatisticCard(title: String, value: String) {
// [ENTITY: Function('RecentlyAddedSection')]
// [RELATION: Function('RecentlyAddedSection')] -> [DEPENDS_ON] -> [DataClass('ItemSummary')]
/**
- * @summary Секция для отображения недавно добавленных элементов.
- * @param items Список элементов для отображения.
+ * @summary Section for displaying recently added items.
+ * @param items The list of items to display.
*/
@Composable
private fun RecentlyAddedSection(items: List) {
@@ -213,8 +213,8 @@ private fun RecentlyAddedSection(items: List) {
// [ENTITY: Function('ItemCard')]
// [RELATION: Function('ItemCard')] -> [DEPENDS_ON] -> [DataClass('ItemSummary')]
/**
- * @summary Карточка для отображения краткой информации об элементе.
- * @param item Элемент для отображения.
+ * @summary Card for displaying brief information about an item.
+ * @param item The item to display.
*/
@Composable
private fun ItemCard(item: ItemSummary) {
@@ -236,9 +236,9 @@ private fun ItemCard(item: ItemSummary) {
// [ENTITY: Function('LocationsSection')]
// [RELATION: Function('LocationsSection')] -> [DEPENDS_ON] -> [DataClass('LocationOutCount')]
/**
- * @summary Секция для отображения местоположений в виде чипсов.
- * @param locations Список местоположений.
- * @param onLocationClick Лямбда-обработчик нажатия на местоположение.
+ * @summary Section for displaying locations as chips.
+ * @param locations The list of locations.
+ * @param onLocationClick A lambda handler for clicking on a location.
*/
@OptIn(ExperimentalLayoutApi::class)
@Composable
@@ -265,9 +265,9 @@ private fun LocationsSection(locations: List, onLocationClick:
// [ENTITY: Function('LabelsSection')]
// [RELATION: Function('LabelsSection')] -> [DEPENDS_ON] -> [DataClass('LabelOut')]
/**
- * @summary Секция для отображения меток в виде чипсов.
- * @param labels Список меток.
- * @param onLabelClick Лямбда-обработчик нажатия на метку.
+ * @summary Section for displaying labels as chips.
+ * @param labels The list of labels.
+ * @param onLabelClick A lambda handler for clicking on a label.
*/
@OptIn(ExperimentalLayoutApi::class)
@Composable
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardUiState.kt b/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardUiState.kt
index 28b442e..baeda5a 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardUiState.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardUiState.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.dashboard
// [FILE] DashboardUiState.kt
-// [SEMANTICS] ui, state, dashboard
+// [SEMANTICS] app, ui, state, dashboard
package com.homebox.lens.ui.screen.dashboard
// [IMPORTS]
@@ -12,8 +12,8 @@ import com.homebox.lens.domain.model.LocationOutCount
// [ENTITY: SealedInterface('DashboardUiState')]
/**
- * @summary Определяет все возможные состояния для экрана "Дэшборд".
- * @invariant В любой момент времени экран может находиться только в одном из этих состояний.
+ * @summary Defines all possible states for the "Dashboard" screen.
+ * @invariant At any given time, the screen can only be in one of these states.
*/
sealed interface DashboardUiState {
// [ENTITY: DataClass('Success')]
@@ -22,11 +22,11 @@ sealed interface DashboardUiState {
// [RELATION: DataClass('Success')] -> [DEPENDS_ON] -> [DataClass('LabelOut')]
// [RELATION: DataClass('Success')] -> [DEPENDS_ON] -> [DataClass('ItemSummary')]
/**
- * @summary Состояние успешной загрузки данных.
- * @param statistics Статистика по инвентарю.
- * @param locations Список локаций со счетчиками.
- * @param labels Список всех меток.
- * @param recentlyAddedItems Список недавно добавленных товаров.
+ * @summary The state of a successful data load.
+ * @param statistics The inventory statistics.
+ * @param locations The list of locations with counters.
+ * @param labels The list of all labels.
+ * @param recentlyAddedItems The list of recently added items.
*/
data class Success(
val statistics: GroupStatistics,
@@ -38,15 +38,15 @@ sealed interface DashboardUiState {
// [ENTITY: DataClass('Error')]
/**
- * @summary Состояние ошибки во время загрузки данных.
- * @param message Человекочитаемое сообщение об ошибке.
+ * @summary The state of an error during data loading.
+ * @param message A human-readable error message.
*/
data class Error(val message: String) : DashboardUiState
// [END_ENTITY: DataClass('Error')]
// [ENTITY: Object('Loading')]
/**
- * @summary Состояние, когда данные для экрана загружаются.
+ * @summary The state when data for the screen is being loaded.
*/
data object Loading : DashboardUiState
// [END_ENTITY: Object('Loading')]
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardViewModel.kt b/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardViewModel.kt
index 3acb812..0431f05 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardViewModel.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/dashboard/DashboardViewModel.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.dashboard
// [FILE] DashboardViewModel.kt
-// [SEMANTICS] ui_logic, dashboard, state_management, sealed_state, parallel_data_loading, timber_logging
+// [SEMANTICS] app, ui, viewmodel, dashboard
package com.homebox.lens.ui.screen.dashboard
// [IMPORTS]
@@ -24,10 +24,10 @@ import javax.inject.Inject
// [RELATION: ViewModel('DashboardViewModel')] -> [DEPENDS_ON] -> [UseCase('GetRecentlyAddedItemsUseCase')]
// [RELATION: ViewModel('DashboardViewModel')] -> [EMITS_STATE] -> [SealedInterface('DashboardUiState')]
/**
- * @summary ViewModel для главного экрана (Dashboard).
- * @description Оркестрирует загрузку данных для Dashboard, используя строгую модель состояний
- * (`DashboardUiState`), и обрабатывает параллельные запросы без состояний гонки.
- * @invariant `uiState` всегда является одним из состояний, определенных в `DashboardUiState`.
+ * @summary ViewModel for the main screen (Dashboard).
+ * @description Orchestrates the loading of data for the Dashboard, using a strict state model
+ * (`DashboardUiState`), and handles parallel requests without race conditions.
+ * @invariant `uiState` is always one of the states defined in `DashboardUiState`.
*/
@HiltViewModel
class DashboardViewModel @Inject constructor(
@@ -46,10 +46,10 @@ class DashboardViewModel @Inject constructor(
// [ENTITY: Function('loadDashboardData')]
/**
- * @summary Загружает все необходимые данные для экрана Dashboard.
- * @description Выполняет UseCase'ы параллельно и обновляет UI, переключая его
- * между состояниями `Loading`, `Success` и `Error` из `DashboardUiState`.
- * @sideeffect Асинхронно обновляет `_uiState` одним из состояний `DashboardUiState`.
+ * @summary Loads all necessary data for the Dashboard screen.
+ * @description Executes UseCases in parallel and updates the UI by switching it
+ * between the `Loading`, `Success`, and `Error` states from `DashboardUiState`.
+ * @sideeffect Asynchronously updates `_uiState` with one of the `DashboardUiState` states.
*/
fun loadDashboardData() {
viewModelScope.launch {
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/inventorylist/InventoryListScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/inventorylist/InventoryListScreen.kt
index 3becc28..5d2c7d2 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/inventorylist/InventoryListScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/inventorylist/InventoryListScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.inventorylist
// [FILE] InventoryListScreen.kt
-// [SEMANTICS] ui, screen, inventory, list
+// [SEMANTICS] app, ui, screen, list
package com.homebox.lens.ui.screen.inventorylist
@@ -17,9 +17,9 @@ import com.homebox.lens.ui.common.MainScaffold
// [RELATION: Function('InventoryListScreen')] -> [DEPENDS_ON] -> [Class('NavigationActions')]
// [RELATION: Function('InventoryListScreen')] -> [CALLS] -> [Function('MainScaffold')]
/**
- * @summary Composable-функция для экрана "Список инвентаря".
- * @param currentRoute Текущий маршрут для подсветки активного элемента в Drawer.
- * @param navigationActions Объект с навигационными действиями.
+ * @summary Composable function for the "Inventory List" screen.
+ * @param currentRoute The current route to highlight the active item in the Drawer.
+ * @param navigationActions The object with navigation actions.
*/
@Composable
fun InventoryListScreen(
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/inventorylist/InventoryListViewModel.kt b/app/src/main/java/com/homebox/lens/ui/screen/inventorylist/InventoryListViewModel.kt
index 6ddcc31..0eaf008 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/inventorylist/InventoryListViewModel.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/inventorylist/InventoryListViewModel.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.inventorylist
// [FILE] InventoryListViewModel.kt
-// [SEMANTICS] ui, viewmodel, inventory_list
+// [SEMANTICS] app, ui, viewmodel, list
package com.homebox.lens.ui.screen.inventorylist
// [IMPORTS]
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/itemdetails/ItemDetailsScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/itemdetails/ItemDetailsScreen.kt
index 1feb48a..5435781 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/itemdetails/ItemDetailsScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/itemdetails/ItemDetailsScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.itemdetails
// [FILE] ItemDetailsScreen.kt
-// [SEMANTICS] ui, screen, item, details
+// [SEMANTICS] app, ui, screen, details
package com.homebox.lens.ui.screen.itemdetails
@@ -17,9 +17,9 @@ import com.homebox.lens.ui.common.MainScaffold
// [RELATION: Function('ItemDetailsScreen')] -> [DEPENDS_ON] -> [Class('NavigationActions')]
// [RELATION: Function('ItemDetailsScreen')] -> [CALLS] -> [Function('MainScaffold')]
/**
- * @summary Composable-функция для экрана "Детали элемента".
- * @param currentRoute Текущий маршрут для подсветки активного элемента в Drawer.
- * @param navigationActions Объект с навигационными действиями.
+ * @summary Composable function for the "Item Details" screen.
+ * @param currentRoute The current route to highlight the active item in the Drawer.
+ * @param navigationActions The object with navigation actions.
*/
@Composable
fun ItemDetailsScreen(
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/itemdetails/ItemDetailsViewModel.kt b/app/src/main/java/com/homebox/lens/ui/screen/itemdetails/ItemDetailsViewModel.kt
index 104c5c3..a088d94 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/itemdetails/ItemDetailsViewModel.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/itemdetails/ItemDetailsViewModel.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.itemdetails
// [FILE] ItemDetailsViewModel.kt
-// [SEMANTICS] ui, viewmodel, item_details
+// [SEMANTICS] app, ui, viewmodel, details
package com.homebox.lens.ui.screen.itemdetails
// [IMPORTS]
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditScreen.kt
index 85d40ff..0a05006 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.itemedit
// [FILE] ItemEditScreen.kt
-// [SEMANTICS] ui, screen, item, edit
+// [SEMANTICS] app, ui, screen, edit
package com.homebox.lens.ui.screen.itemedit
@@ -21,13 +21,17 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowDropDown
import androidx.compose.material.icons.filled.DateRange
import androidx.compose.material.icons.filled.Save
+import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Checkbox
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.DatePicker
import androidx.compose.material3.DatePickerDialog
+import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
+import androidx.compose.material3.ExposedDropdownMenuBox
+import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
@@ -38,6 +42,7 @@ import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Switch
import androidx.compose.material3.Text
+import androidx.compose.material3.TextButton
import androidx.compose.material3.rememberDatePickerState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@@ -67,12 +72,12 @@ import java.util.Locale
// [RELATION: Composable('ItemEditScreen')] -> [CONSUMES_STATE] -> [DataClass('ItemEditUiState')]
// [RELATION: Composable('ItemEditScreen')] -> [CALLS] -> [Composable('MainScaffold')]
/**
- * @summary Composable-функция для экрана "Редактирование элемента".
- * @param currentRoute Текущий маршрут для подсветки активного элемента в Drawer.
- * @param navigationActions Объект с навигационными действиями.
- * @param itemId ID элемента для редактирования. Null, если создается новый элемент.
- * @param viewModel ViewModel для управления состоянием экрана.
- * @param onSaveSuccess Callback, вызываемый после успешного сохранения товара.
+ * @summary Composable function for the "Edit Item" screen.
+ * @param currentRoute The current route to highlight the active item in the Drawer.
+ * @param navigationActions The object with navigation actions.
+ * @param itemId The ID of the item to edit. Null if a new item is being created.
+ * @param viewModel The ViewModel for managing the screen's state.
+ * @param onSaveSuccess A callback invoked after the item is successfully saved.
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@@ -164,34 +169,124 @@ fun ItemEditScreen(
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
modifier = Modifier.fillMaxWidth()
)
- Spacer(modifier = Modifier.height(8.dp))
- // [AI_NOTE]: Location selection will require a separate component or screen.
- OutlinedTextField(
- value = item.location?.name ?: "",
- onValueChange = { /* TODO: Implement location selection */ },
- label = { Text(stringResource(R.string.item_edit_location)) },
- readOnly = true,
- trailingIcon = {
- IconButton(onClick = { /* TODO: Implement location selection */ }) {
- Icon(Icons.Filled.ArrowDropDown, contentDescription = stringResource(R.string.item_edit_select_location))
- }
- },
- modifier = Modifier.fillMaxWidth()
- )
- Spacer(modifier = Modifier.height(8.dp))
- // [AI_NOTE]: Label selection will require a separate component or screen.
- OutlinedTextField(
- value = item.labels.joinToString { it.name },
- onValueChange = { /* TODO: Implement label selection */ },
- label = { Text(stringResource(R.string.item_edit_labels)) },
- readOnly = true,
- trailingIcon = {
- IconButton(onClick = { /* TODO: Implement label selection */ }) {
- Icon(Icons.Filled.ArrowDropDown, contentDescription = stringResource(R.string.item_edit_select_labels))
- }
- },
- modifier = Modifier.fillMaxWidth()
- )
+ Spacer(modifier = Modifier.height(8.dp))
+
+ // Location Dropdown
+ var locationExpanded by remember { mutableStateOf(false) }
+ ExposedDropdownMenuBox(
+ expanded = locationExpanded,
+ onExpandedChange = { locationExpanded = !locationExpanded }
+ ) {
+ OutlinedTextField(
+ value = item.location?.name ?: "",
+ onValueChange = { },
+ label = { Text(stringResource(R.string.item_edit_location)) },
+ readOnly = true,
+ trailingIcon = {
+ ExposedDropdownMenuDefaults.TrailingIcon(expanded = locationExpanded)
+ },
+ modifier = Modifier
+ .fillMaxWidth()
+ .menuAnchor()
+ )
+ ExposedDropdownMenu(
+ expanded = locationExpanded,
+ onDismissRequest = { locationExpanded = false }
+ ) {
+ uiState.allLocations.forEach { location ->
+ DropdownMenuItem(
+ text = { Text(location.name) },
+ onClick = {
+ viewModel.updateLocation(location)
+ locationExpanded = false
+ }
+ )
+ }
+ }
+ }
+
+ Spacer(modifier = Modifier.height(8.dp))
+
+ // Labels Dialog
+ var showLabelsDialog by remember { mutableStateOf(false) }
+
+ OutlinedTextField(
+ value = item.labels.joinToString { it.name },
+ onValueChange = { },
+ label = { Text(stringResource(R.string.item_edit_labels)) },
+ readOnly = true,
+ modifier = Modifier
+ .fillMaxWidth()
+ .clickable { showLabelsDialog = true },
+ trailingIcon = {
+ Icon(Icons.Filled.ArrowDropDown, contentDescription = stringResource(R.string.item_edit_select_labels))
+ }
+ )
+
+ if (showLabelsDialog) {
+ // This state will hold the temporary selections within the dialog
+ val tempSelectedLabels = remember { mutableStateOf(item.labels.toSet()) }
+
+ AlertDialog(
+ onDismissRequest = { showLabelsDialog = false },
+ title = { Text(stringResource(R.string.item_edit_select_labels)) },
+ text = {
+ Column {
+ uiState.allLabels.forEach { label ->
+ val isChecked = tempSelectedLabels.value.contains(label)
+ Row(
+ verticalAlignment = Alignment.CenterVertically,
+ modifier = Modifier
+ .fillMaxWidth()
+ .clickable {
+ val currentSelection = tempSelectedLabels.value.toMutableSet()
+ if (isChecked) {
+ currentSelection.remove(label)
+ } else {
+ currentSelection.add(label)
+ }
+ tempSelectedLabels.value = currentSelection
+ }
+ .padding(vertical = 8.dp)
+ ) {
+ Checkbox(
+ checked = isChecked,
+ onCheckedChange = {
+ val currentSelection = tempSelectedLabels.value.toMutableSet()
+ if (it) {
+ currentSelection.add(label)
+ } else {
+ currentSelection.remove(label)
+ }
+ tempSelectedLabels.value = currentSelection
+ }
+ )
+ Text(
+ text = label.name,
+ modifier = Modifier.padding(start = 8.dp)
+ )
+ }
+ }
+ }
+ },
+ confirmButton = {
+ TextButton(
+ onClick = {
+ // Update the ViewModel with the final selection
+ viewModel.updateLabels(tempSelectedLabels.value.toList())
+ showLabelsDialog = false
+ }
+ ) {
+ Text(stringResource(R.string.dialog_ok))
+ }
+ },
+ dismissButton = {
+ TextButton(onClick = { showLabelsDialog = false }) {
+ Text(stringResource(R.string.dialog_cancel))
+ }
+ }
+ )
+ }
}
}
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditViewModel.kt b/app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditViewModel.kt
index 3652b65..e898f2f 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditViewModel.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditViewModel.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.itemedit
// [FILE] ItemEditViewModel.kt
-// [SEMANTICS] ui, viewmodel, item_edit
+// [SEMANTICS] app, ui, viewmodel, edit
package com.homebox.lens.ui.screen.itemedit
@@ -16,6 +16,7 @@ import com.homebox.lens.domain.usecase.CreateItemUseCase
import com.homebox.lens.domain.usecase.GetAllLabelsUseCase
import com.homebox.lens.domain.usecase.GetAllLocationsUseCase
import com.homebox.lens.domain.usecase.GetItemDetailsUseCase
+import com.homebox.lens.data.mapper.toDomain
import com.homebox.lens.domain.usecase.UpdateItemUseCase
import com.homebox.lens.ui.mapper.ItemMapper
import dagger.hilt.android.lifecycle.HiltViewModel
@@ -59,6 +60,8 @@ data class ItemEditUiState(
* @param createItemUseCase Use case for creating a new item.
* @param updateItemUseCase Use case for updating an existing item.
* @param getItemDetailsUseCase Use case for fetching item details.
+ * @param getAllLocationsUseCase Use case for fetching all locations.
+ * @param getAllLabelsUseCase Use case for fetching all labels.
* @param itemMapper Mapper for converting between domain and UI item models.
*/
@HiltViewModel
@@ -141,7 +144,7 @@ class ItemEditViewModel @Inject constructor(
Timber.i("[INFO][ACTION][fetching_all_locations] Fetching all locations.")
val allLocations = getAllLocationsUseCase().map { Location(it.id, it.name) }
Timber.i("[INFO][ACTION][fetching_all_labels] Fetching all labels.")
- val allLabels = getAllLabelsUseCase().map { Label(it.id, it.name) }
+ val allLabels = getAllLabelsUseCase().map { it.toDomain() }
_uiState.value = _uiState.value.copy(allLocations = allLocations, allLabels = allLabels)
Timber.i("[INFO][ACTION][all_locations_labels_fetched] Successfully fetched all locations and labels.")
} catch (e: Exception) {
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/labeledit/LabelEditScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/labeledit/LabelEditScreen.kt
index 8564ebc..0fbe1ca 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/labeledit/LabelEditScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/labeledit/LabelEditScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.labeledit
// [FILE] LabelEditScreen.kt
-// [SEMANTICS] ui, screen, label, edit
+// [SEMANTICS] app, ui, screen, edit, label
package com.homebox.lens.ui.screen.labeledit
@@ -24,10 +24,10 @@ import com.homebox.lens.ui.components.LoadingOverlay
// [ENTITY: Function('LabelEditScreen')]
// [RELATION: Function('LabelEditScreen')] -> [DEPENDS_ON] -> [ViewModel('LabelEditViewModel')]
/**
- * @summary Composable-функция для экрана "Редактирование метки".
- * @param labelId ID метки для редактирования или null для создания новой.
- * @param onBack Навигация назад.
- * @param onLabelSaved Действие после сохранения метки.
+ * @summary Composable function for the "Edit Label" screen.
+ * @param labelId The ID of the label to edit, or null to create a new one.
+ * @param onBack Navigation back.
+ * @param onLabelSaved Action after the label is saved.
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/labeledit/LabelEditViewModel.kt b/app/src/main/java/com/homebox/lens/ui/screen/labeledit/LabelEditViewModel.kt
index 453c23d..44c6996 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/labeledit/LabelEditViewModel.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/labeledit/LabelEditViewModel.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.labeledit
// [FILE] LabelEditViewModel.kt
-// [SEMANTICS] ui, viewmodel, label_management
+// [SEMANTICS] app, ui, viewmodel, edit, label
package com.homebox.lens.ui.screen.labeledit
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListScreen.kt
index 8169827..e1f12f3 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.labelslist
// [FILE] LabelsListScreen.kt
-// [SEMANTICS] ui, labels_list, state_management, compose, dialog
+// [SEMANTICS] app, ui, screen, list, label
package com.homebox.lens.ui.screen.labelslist
// [IMPORTS]
@@ -46,10 +46,10 @@ import timber.log.Timber
// [RELATION: Function('LabelsListScreen')] -> [DEPENDS_ON] -> [ViewModel('LabelsListViewModel')]
// [RELATION: Function('LabelsListScreen')] -> [DEPENDS_ON] -> [Framework('NavController')]
/**
- * @summary Отображает экран со списком всех меток.
- * @param currentRoute Текущий маршрут навигации.
- * @param navigationActions Объект, содержащий действия по навигации.
- * @param viewModel ViewModel, предоставляющая состояние UI для экрана меток.
+ * @summary Displays the screen with a list of all labels.
+ * @param currentRoute The current navigation route.
+ * @param navigationActions The object containing navigation actions.
+ * @param viewModel The ViewModel providing the UI state for the labels screen.
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@@ -116,10 +116,10 @@ fun LabelsListScreen(
// [ENTITY: Function('LabelsList')]
// [RELATION: Function('LabelsList')] -> [DEPENDS_ON] -> [DataClass('Label')]
/**
- * @summary Composable-функция для отображения списка меток.
- * @param labels Список объектов `Label` для отображения.
- * @param onLabelClick Лямбда-функция, вызываемая при нажатии на элемент списка.
- * @param modifier Модификатор для настройки внешнего вида.
+ * @summary Composable function for displaying a list of labels.
+ * @param labels The list of `Label` objects to display.
+ * @param onLabelClick A lambda function called when a list item is clicked.
+ * @param modifier A modifier for customizing the appearance.
*/
@Composable
private fun LabelsList(
@@ -145,9 +145,9 @@ private fun LabelsList(
// [ENTITY: Function('LabelListItem')]
// [RELATION: Function('LabelListItem')] -> [DEPENDS_ON] -> [DataClass('Label')]
/**
- * @summary Composable-функция для отображения одного элемента в списке меток.
- * @param label Объект `Label`, который нужно отобразить.
- * @param onClick Лямбда-функция, вызываемая при нажатии на элемент.
+ * @summary Composable function for displaying a single item in the list of labels.
+ * @param label The `Label` object to display.
+ * @param onClick A lambda function called when the item is clicked.
*/
@Composable
private fun LabelListItem(
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListUiState.kt b/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListUiState.kt
index a53f005..c77235a 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListUiState.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListUiState.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.labelslist
// [FILE] LabelsListUiState.kt
-// [SEMANTICS] ui_state, sealed_interface, contract
+// [SEMANTICS] app, ui, state, list, label
package com.homebox.lens.ui.screen.labelslist
// [IMPORTS]
@@ -9,17 +9,17 @@ import com.homebox.lens.domain.model.Label
// [ENTITY: SealedInterface('LabelsListUiState')]
/**
- * @summary Определяет все возможные состояния для UI экрана со списком меток.
- * @description Использование sealed-интерфейса позволяет исчерпывающе обрабатывать все состояния в Composable-функциях.
+ * @summary Defines all possible states for the UI of the screen with a list of labels.
+ * @description Using a sealed interface allows for exhaustive handling of all states in Composable functions.
*/
sealed interface LabelsListUiState {
// [ENTITY: DataClass('Success')]
// [RELATION: DataClass('Success')] -> [DEPENDS_ON] -> [DataClass('Label')]
/**
- * @summary Состояние успеха, содержит список меток и состояние диалога.
- * @param labels Список меток для отображения.
- * @param isShowingCreateDialog Флаг, показывающий, должен ли быть отображен диалог создания метки.
- * @invariant labels не может быть null.
+ * @summary The success state, contains the list of labels and the state of the dialog.
+ * @param labels The list of labels to display.
+ * @param isShowingCreateDialog A flag indicating whether the label creation dialog should be displayed.
+ * @invariant labels cannot be null.
*/
data class Success(
val labels: List,
@@ -29,17 +29,17 @@ sealed interface LabelsListUiState {
// [ENTITY: DataClass('Error')]
/**
- * @summary Состояние ошибки.
- * @param message Текст ошибки для отображения пользователю.
- * @invariant message не может быть пустой.
+ * @summary The error state.
+ * @param message The error text to display to the user.
+ * @invariant message cannot be empty.
*/
data class Error(val message: String) : LabelsListUiState
// [END_ENTITY: DataClass('Error')]
// [ENTITY: Object('Loading')]
/**
- * @summary Состояние загрузки данных.
- * @description Указывает, что идет процесс загрузки меток.
+ * @summary The data loading state.
+ * @description Indicates that the process of loading labels is in progress.
*/
data object Loading : LabelsListUiState
// [END_ENTITY: Object('Loading')]
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListViewModel.kt b/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListViewModel.kt
index dfd2a5c..064b41b 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListViewModel.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/labelslist/LabelsListViewModel.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.labelslist
// [FILE] LabelsListViewModel.kt
-// [SEMANTICS] ui_logic, labels_list, state_management, dialog_management
+// [SEMANTICS] app, ui, viewmodel, list, label
package com.homebox.lens.ui.screen.labelslist
// [IMPORTS]
@@ -21,9 +21,9 @@ import javax.inject.Inject
// [RELATION: ViewModel('LabelsListViewModel')] -> [DEPENDS_ON] -> [UseCase('GetAllLabelsUseCase')]
// [RELATION: ViewModel('LabelsListViewModel')] -> [EMITS_STATE] -> [SealedInterface('LabelsListUiState')]
/**
- * @summary ViewModel для экрана со списком меток.
- * @description Управляет состоянием экрана, загружает список меток, обрабатывает ошибки и управляет диалогом создания новой метки.
- * @invariant `uiState` всегда является одним из состояний, определенных в `LabelsListUiState`.
+ * @summary ViewModel for the screen with a list of labels.
+ * @description Manages the screen state, loads the list of labels, handles errors, and manages the dialog for creating a new label.
+ * @invariant `uiState` is always one of the states defined in `LabelsListUiState`.
*/
@HiltViewModel
class LabelsListViewModel @Inject constructor(
@@ -39,10 +39,10 @@ class LabelsListViewModel @Inject constructor(
// [ENTITY: Function('loadLabels')]
/**
- * @summary Загружает список меток.
- * @description Выполняет `GetAllLabelsUseCase` и обновляет UI, переключая его
- * между состояниями `Loading`, `Success` и `Error`.
- * @sideeffect Асинхронно обновляет `_uiState`.
+ * @summary Loads the list of labels.
+ * @description Executes `GetAllLabelsUseCase` and updates the UI by switching it
+ * between the `Loading`, `Success`, and `Error` states.
+ * @sideeffect Asynchronously updates `_uiState`.
*/
fun loadLabels() {
viewModelScope.launch {
@@ -77,9 +77,9 @@ class LabelsListViewModel @Inject constructor(
// [ENTITY: Function('onShowCreateDialog')]
/**
- * @summary Инициирует отображение диалога для создания метки.
- * @description Обновляет состояние `uiState`, устанавливая `isShowingCreateDialog` в `true`.
- * @sideeffect Обновляет `_uiState`.
+ * @summary Initiates the display of the dialog for creating a label.
+ * @description Updates the `uiState` by setting `isShowingCreateDialog` to `true`.
+ * @sideeffect Updates `_uiState`.
*/
fun onShowCreateDialog() {
Timber.i("[INFO][ACTION][show_create_dialog] Show create label dialog requested.")
@@ -93,9 +93,9 @@ class LabelsListViewModel @Inject constructor(
// [ENTITY: Function('onDismissCreateDialog')]
/**
- * @summary Скрывает диалог создания метки.
- * @description Обновляет состояние `uiState`, устанавливая `isShowingCreateDialog` в `false`.
- * @sideeffect Обновляет `_uiState`.
+ * @summary Hides the label creation dialog.
+ * @description Updates the `uiState` by setting `isShowingCreateDialog` to `false`.
+ * @sideeffect Updates `_uiState`.
*/
fun onDismissCreateDialog() {
Timber.i("[INFO][ACTION][dismiss_create_dialog] Dismiss create label dialog requested.")
@@ -109,12 +109,12 @@ class LabelsListViewModel @Inject constructor(
// [ENTITY: Function('createLabel')]
/**
- * @summary Создает новую метку. [MVP_SCOPE] ЗАГЛУШКА.
- * @description В текущей реализации (План Б, Этап 1), эта функция только логирует действие
- * и скрывает диалог. Реальная логика сохранения будет добавлена на следующем этапе.
- * @param name Название новой метки.
- * @precondition `name` не должен быть пустым.
- * @sideeffect Логирует действие, обновляет `_uiState`, чтобы скрыть диалог.
+ * @summary Creates a new label. [MVP_SCOPE] STUB.
+ * @description In the current implementation (Plan B, Stage 1), this function only logs the action
+ * and hides the dialog. The actual save logic will be added in the next stage.
+ * @param name The name of the new label.
+ * @precondition `name` must not be blank.
+ * @sideeffect Logs the action, updates `_uiState` to hide the dialog.
*/
fun createLabel(name: String) {
require(name.isNotBlank()) { "[CONTRACT_VIOLATION] Label name cannot be blank." }
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/locationedit/LocationEditScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/locationedit/LocationEditScreen.kt
index f995c0c..cd099a2 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/locationedit/LocationEditScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/locationedit/LocationEditScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.locationedit
// [FILE] LocationEditScreen.kt
-// [SEMANTICS] ui, screen, location, edit
+// [SEMANTICS] app, ui, screen, edit, location
package com.homebox.lens.ui.screen.locationedit
@@ -19,8 +19,8 @@ import com.homebox.lens.R
// [ENTITY: Function('LocationEditScreen')]
/**
- * @summary Composable-функция для экрана "Редактирование местоположения".
- * @param locationId ID местоположения для редактирования или "new" для создания.
+ * @summary Composable function for the "Edit Location" screen.
+ * @param locationId The ID of the location to edit, or "new" to create one.
*/
@Composable
fun LocationEditScreen(
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListScreen.kt
index ffbb01d..9c7f9b8 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.locationslist
// [FILE] LocationsListScreen.kt
-// [SEMANTICS] ui, screen, locations, list
+// [SEMANTICS] app, ui, screen, list, location
package com.homebox.lens.ui.screen.locationslist
@@ -56,12 +56,12 @@ import com.homebox.lens.ui.theme.HomeboxLensTheme
// [RELATION: Function('LocationsListScreen')] -> [DEPENDS_ON] -> [Class('NavigationActions')]
// [RELATION: Function('LocationsListScreen')] -> [CALLS] -> [Function('MainScaffold')]
/**
- * @summary Composable-функция для экрана "Список местоположений".
- * @param currentRoute Текущий маршрут для подсветки активного элемента в Drawer.
- * @param navigationActions Объект с навигационными действиями.
- * @param onLocationClick Лямбда-обработчик нажатия на местоположение.
- * @param onAddNewLocationClick Лямбда-обработчик нажатия на кнопку добавления нового местоположения.
- * @param viewModel ViewModel для этого экрана.
+ * @summary Composable function for the "List of Locations" screen.
+ * @param currentRoute The current route to highlight the active item in the Drawer.
+ * @param navigationActions The object with navigation actions.
+ * @param onLocationClick A lambda handler for clicking on a location.
+ * @param onAddNewLocationClick A lambda handler for clicking the button to add a new location.
+ * @param viewModel The ViewModel for this screen.
*/
@Composable
fun LocationsListScreen(
@@ -104,12 +104,12 @@ fun LocationsListScreen(
// [ENTITY: Function('LocationsListContent')]
// [RELATION: Function('LocationsListContent')] -> [CONSUMES_STATE] -> [SealedInterface('LocationsListUiState')]
/**
- * @summary Отображает основной контент экрана в зависимости от `uiState`.
- * @param modifier Модификатор для стилизации.
- * @param uiState Текущее состояние UI.
- * @param onLocationClick Лямбда-обработчик нажатия на местоположение.
- * @param onEditLocation Лямбда-обработчик для редактирования местоположения.
- * @param onDeleteLocation Лямбда-обработчик для удаления местоположения.
+ * @summary Displays the main content of the screen depending on the `uiState`.
+ * @param modifier A modifier for styling.
+ * @param uiState The current UI state.
+ * @param onLocationClick A lambda handler for clicking on a location.
+ * @param onEditLocation A lambda handler for editing a location.
+ * @param onDeleteLocation A lambda handler for deleting a location.
*/
@Composable
private fun LocationsListContent(
@@ -167,11 +167,11 @@ private fun LocationsListContent(
// [ENTITY: Function('LocationCard')]
// [RELATION: Function('LocationCard')] -> [DEPENDS_ON] -> [DataClass('LocationOutCount')]
/**
- * @summary Карточка для отображения одного местоположения.
- * @param location Данные о местоположении.
- * @param onClick Лямбда-обработчик нажатия на карточку.
- * @param onEditClick Лямбда-обработчик нажатия на "Редактировать".
- * @param onDeleteClick Лямбда-обработчик нажатия на "Удалить".
+ * @summary Card for displaying a single location.
+ * @param location The data about the location.
+ * @param onClick A lambda handler for clicking on the card.
+ * @param onEditClick A lambda handler for clicking "Edit".
+ * @param onDeleteClick A lambda handler for clicking "Delete".
*/
@Composable
private fun LocationCard(
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListUiState.kt b/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListUiState.kt
index 4535450..53d2f53 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListUiState.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListUiState.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.locationslist
// [FILE] LocationsListUiState.kt
-// [SEMANTICS] ui, state, locations
+// [SEMANTICS] app, ui, state, list, location
package com.homebox.lens.ui.screen.locationslist
@@ -10,30 +10,30 @@ import com.homebox.lens.domain.model.LocationOutCount
// [ENTITY: SealedInterface('LocationsListUiState')]
/**
- * @summary Определяет возможные состояния UI для экрана списка местоположений.
+ * @summary Defines the possible UI states for the list of locations screen.
* @see LocationsListViewModel
*/
sealed interface LocationsListUiState {
// [ENTITY: DataClass('Success')]
// [RELATION: DataClass('Success')] -> [DEPENDS_ON] -> [DataClass('LocationOutCount')]
/**
- * @summary Состояние успешной загрузки данных.
- * @param locations Список местоположений для отображения.
+ * @summary The state of a successful data load.
+ * @param locations The list of locations to display.
*/
data class Success(val locations: List) : LocationsListUiState
// [END_ENTITY: DataClass('Success')]
// [ENTITY: DataClass('Error')]
/**
- * @summary Состояние ошибки.
- * @param message Сообщение об ошибке.
+ * @summary The error state.
+ * @param message The error message.
*/
data class Error(val message: String) : LocationsListUiState
// [END_ENTITY: DataClass('Error')]
// [ENTITY: Object('Loading')]
/**
- * @summary Состояние загрузки данных.
+ * @summary The data loading state.
*/
object Loading : LocationsListUiState
// [END_ENTITY: Object('Loading')]
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListViewModel.kt b/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListViewModel.kt
index b922938..09ebb88 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListViewModel.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/locationslist/LocationsListViewModel.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.locationslist
// [FILE] LocationsListViewModel.kt
-// [SEMANTICS] ui, viewmodel, locations, hilt
+// [SEMANTICS] app, ui, viewmodel, list, location
package com.homebox.lens.ui.screen.locationslist
@@ -21,10 +21,10 @@ import javax.inject.Inject
// [RELATION: ViewModel('LocationsListViewModel')] -> [DEPENDS_ON] -> [UseCase('GetAllLocationsUseCase')]
// [RELATION: ViewModel('LocationsListViewModel')] -> [EMITS_STATE] -> [SealedInterface('LocationsListUiState')]
/**
- * @summary ViewModel для экрана списка местоположений.
- * @param getAllLocationsUseCase Use case для получения всех местоположений.
- * @property uiState Поток, содержащий текущее состояние UI.
- * @invariant `uiState` всегда отражает результат последней операции загрузки.
+ * @summary ViewModel for the list of locations screen.
+ * @param getAllLocationsUseCase Use case for getting all locations.
+ * @property uiState A flow containing the current UI state.
+ * @invariant `uiState` always reflects the result of the last load operation.
*/
@HiltViewModel
class LocationsListViewModel @Inject constructor(
@@ -40,8 +40,8 @@ class LocationsListViewModel @Inject constructor(
// [ENTITY: Function('loadLocations')]
/**
- * @summary Загружает список местоположений из репозитория.
- * @sideeffect Обновляет `_uiState` в зависимости от результата: Loading -> Success/Error.
+ * @summary Loads the list of locations from the repository.
+ * @sideeffect Updates `_uiState` depending on the result: Loading -> Success/Error.
*/
fun loadLocations() {
Timber.d("[DEBUG][ENTRYPOINT][loading_locations] Starting to load locations.")
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/search/SearchScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/search/SearchScreen.kt
index 73f19f2..29d0eee 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/search/SearchScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/search/SearchScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.search
// [FILE] SearchScreen.kt
-// [SEMANTICS] ui, screen, search
+// [SEMANTICS] app, ui, screen, search
package com.homebox.lens.ui.screen.search
@@ -17,9 +17,9 @@ import com.homebox.lens.ui.common.MainScaffold
// [RELATION: Function('SearchScreen')] -> [DEPENDS_ON] -> [Class('NavigationActions')]
// [RELATION: Function('SearchScreen')] -> [CALLS] -> [Function('MainScaffold')]
/**
- * @summary Composable-функция для экрана "Поиск".
- * @param currentRoute Текущий маршрут для подсветки активного элемента в Drawer.
- * @param navigationActions Объект с навигационными действиями.
+ * @summary Composable function for the "Search" screen.
+ * @param currentRoute The current route to highlight the active item in the Drawer.
+ * @param navigationActions The object with navigation actions.
*/
@Composable
fun SearchScreen(
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/search/SearchViewModel.kt b/app/src/main/java/com/homebox/lens/ui/screen/search/SearchViewModel.kt
index 0851976..90a4c41 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/search/SearchViewModel.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/search/SearchViewModel.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.search
// [FILE] SearchViewModel.kt
-// [SEMANTICS] ui, viewmodel, search
+// [SEMANTICS] app, ui, viewmodel, search
package com.homebox.lens.ui.screen.search
// [IMPORTS]
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/settings/SettingsScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/settings/SettingsScreen.kt
index 9552a45..f1a587c 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/settings/SettingsScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/settings/SettingsScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.settings
// [FILE] SettingsScreen.kt
-// [SEMANTICS] ui, screen, settings
+// [SEMANTICS] app, ui, screen, settings
package com.homebox.lens.ui.screen.settings
@@ -24,9 +24,9 @@ import com.homebox.lens.ui.common.MainScaffold
// [ENTITY: Function('SettingsScreen')]
// [RELATION: Function('SettingsScreen')] -> [DEPENDS_ON] -> [Class('NavigationActions')]
/**
- * @summary Composable-функция для экрана настроек.
- * @param currentRoute Текущий маршрут навигации.
- * @param navigationActions Объект, содержащий действия по навигации.
+ * @summary Composable function for the settings screen.
+ * @param currentRoute The current navigation route.
+ * @param navigationActions The object containing navigation actions.
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/setup/SetupScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/setup/SetupScreen.kt
index a0976e3..af2d622 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/setup/SetupScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/setup/SetupScreen.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.screen.setup
// [FILE] SetupScreen.kt
-// [SEMANTICS] ui, screen, setup, compose
+// [SEMANTICS] app, ui, screen, setup
@file:OptIn(ExperimentalMaterial3Api::class)
@@ -31,10 +31,10 @@ import com.homebox.lens.R
// [RELATION: Function('SetupScreen')] -> [DEPENDS_ON] -> [ViewModel('SetupViewModel')]
// [RELATION: Function('SetupScreen')] -> [CALLS] -> [Function('SetupScreenContent')]
/**
- * @summary Главная Composable-функция для экрана настройки соединения с сервером.
- * @param viewModel ViewModel для этого экрана, предоставляется через Hilt.
- * @param onSetupComplete Лямбда, вызываемая после успешной настройки и входа.
- * @sideeffect Вызывает `onSetupComplete` при изменении `uiState.isSetupComplete`.
+ * @summary The main Composable function for the server connection setup screen.
+ * @param viewModel The ViewModel for this screen, provided by Hilt.
+ * @param onSetupComplete A lambda invoked after successful setup and login.
+ * @sideeffect Calls `onSetupComplete` when `uiState.isSetupComplete` changes.
*/
@Composable
fun SetupScreen(
@@ -60,12 +60,12 @@ fun SetupScreen(
// [ENTITY: Function('SetupScreenContent')]
// [RELATION: Function('SetupScreenContent')] -> [CONSUMES_STATE] -> [DataClass('SetupUiState')]
/**
- * @summary Отображает контент экрана настройки: поля ввода и кнопку.
- * @param uiState Текущее состояние UI.
- * @param onServerUrlChange Лямбда-обработчик изменения URL сервера.
- * @param onUsernameChange Лямбда-обработчик изменения имени пользователя.
- * @param onPasswordChange Лямбда-обработчик изменения пароля.
- * @param onConnectClick Лямбда-обработчик нажатия на кнопку "Подключиться".
+ * @summary Displays the content of the setup screen: input fields and a button.
+ * @param uiState The current UI state.
+ * @param onServerUrlChange A lambda handler for changing the server URL.
+ * @param onUsernameChange A lambda handler for changing the username.
+ * @param onPasswordChange A lambda handler for changing the password.
+ * @param onConnectClick A lambda handler for clicking the "Connect" button.
*/
@Composable
private fun SetupScreenContent(
@@ -75,11 +75,7 @@ private fun SetupScreenContent(
onPasswordChange: (String) -> Unit,
onConnectClick: () -> Unit
) {
- Scaffold(
- topBar = {
- TopAppBar(title = { Text(stringResource(id = R.string.setup_title)) })
- }
- ) { paddingValues ->
+ Scaffold { paddingValues ->
Column(
modifier = Modifier
.fillMaxSize()
@@ -96,8 +92,12 @@ private fun SetupScreenContent(
Spacer(modifier = Modifier.height(16.dp))
Text(
text = stringResource(id = R.string.setup_title),
- style = MaterialTheme.typography.headlineLarge,
- fontSize = 28.sp // Adjust font size as needed
+ style = MaterialTheme.typography.headlineLarge
+ )
+ Spacer(modifier = Modifier.height(8.dp))
+ Text(
+ text = "Enter your Homebox server details to connect.",
+ style = MaterialTheme.typography.bodyMedium
)
Spacer(modifier = Modifier.height(24.dp))
@@ -106,8 +106,7 @@ private fun SetupScreenContent(
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp)
) {
Column(
- modifier = Modifier.padding(16.dp),
- horizontalAlignment = Alignment.CenterHorizontally
+ modifier = Modifier.padding(16.dp)
) {
OutlinedTextField(
value = uiState.serverUrl,
@@ -115,14 +114,14 @@ private fun SetupScreenContent(
label = { Text(stringResource(id = R.string.setup_server_url_label)) },
modifier = Modifier.fillMaxWidth()
)
- Spacer(modifier = Modifier.height(12.dp))
+ Spacer(modifier = Modifier.height(8.dp))
OutlinedTextField(
value = uiState.username,
onValueChange = onUsernameChange,
label = { Text(stringResource(id = R.string.setup_username_label)) },
modifier = Modifier.fillMaxWidth()
)
- Spacer(modifier = Modifier.height(12.dp))
+ Spacer(modifier = Modifier.height(8.dp))
OutlinedTextField(
value = uiState.password,
onValueChange = onPasswordChange,
@@ -138,7 +137,7 @@ private fun SetupScreenContent(
enabled = !uiState.isLoading,
modifier = Modifier
.fillMaxWidth()
- .height(56.dp) // Make button more prominent
+ .height(50.dp)
) {
if (uiState.isLoading) {
CircularProgressIndicator(
@@ -146,15 +145,14 @@ private fun SetupScreenContent(
color = MaterialTheme.colorScheme.onPrimary
)
} else {
- Text(stringResource(id = R.string.setup_connect_button), fontSize = 18.sp)
+ Text(stringResource(id = R.string.setup_connect_button))
}
}
uiState.error?.let {
- Spacer(modifier = Modifier.height(12.dp))
+ Spacer(modifier = Modifier.height(8.dp))
Text(
text = it,
- color = MaterialTheme.colorScheme.error,
- style = MaterialTheme.typography.bodyMedium
+ color = MaterialTheme.colorScheme.error
)
}
}
diff --git a/app/src/main/java/com/homebox/lens/ui/screen/splash/SplashScreen.kt b/app/src/main/java/com/homebox/lens/ui/screen/splash/SplashScreen.kt
index eb75b06..a87473b 100644
--- a/app/src/main/java/com/homebox/lens/ui/screen/splash/SplashScreen.kt
+++ b/app/src/main/java/com/homebox/lens/ui/screen/splash/SplashScreen.kt
@@ -1,9 +1,9 @@
// [PACKAGE] com.homebox.lens.ui.screen.splash
// [FILE] SplashScreen.kt
-// [SEMANTICS] ui, screen, splash, navigation, authentication_flow
-
+// [SEMANTICS] app, ui, screen, splash
package com.homebox.lens.ui.screen.splash
+// [IMPORTS]
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.CircularProgressIndicator
@@ -16,42 +16,44 @@ import androidx.navigation.NavController
import com.homebox.lens.navigation.Screen
import com.homebox.lens.ui.screen.setup.SetupViewModel
import timber.log.Timber
+// [END_IMPORTS]
-// [ENTITY: Function('SplashScreen')]
+// [ENTITY: Composable('SplashScreen')]
+// [RELATION: Composable('SplashScreen')] -> [DEPENDS_ON] -> [Framework('NavController')]
+// [RELATION: Composable('SplashScreen')] -> [DEPENDS_ON] -> [ViewModel('SetupViewModel')]
/**
- * @summary Displays a splash screen while checking if credentials are saved.
- * @param navController The NavController for navigation.
- * @param viewModel The SetupViewModel to check credential status.
- * @sideeffect Navigates to either SetupScreen or DashboardScreen based on credential status.
+ * @summary A splash screen that checks for saved credentials and navigates accordingly.
+ * @param navController The navigation controller for navigating to the next screen.
+ * @param viewModel The view model for checking credentials.
+ * @sideeffect Navigates to either the Setup or Dashboard screen.
*/
@Composable
fun SplashScreen(
navController: NavController,
viewModel: SetupViewModel = hiltViewModel()
) {
- Timber.d("[DEBUG][ENTRYPOINT][splash_screen_composable] SplashScreen entered.")
-
- LaunchedEffect(key1 = true) {
- Timber.i("[INFO][ACTION][checking_credentials_on_launch] Checking if credentials are saved on launch.")
- val credentialsSaved = viewModel.areCredentialsSaved()
- if (credentialsSaved) {
- Timber.i("[INFO][ACTION][credentials_found_navigating_dashboard] Credentials found, navigating to Dashboard.")
- navController.navigate(Screen.Dashboard.route) {
- popUpTo(Screen.Splash.route) { inclusive = true }
- }
- } else {
- Timber.i("[INFO][ACTION][no_credentials_found_navigating_setup] No credentials found, navigating to Setup.")
- navController.navigate(Screen.Setup.route) {
- popUpTo(Screen.Splash.route) { inclusive = true }
- }
- }
- }
-
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
CircularProgressIndicator()
}
+
+ LaunchedEffect(Unit) {
+ Timber.d("[DEBUG][ACTION][checking_credentials] Checking for saved credentials on splash screen.")
+ val areCredentialsSaved = viewModel.areCredentialsSaved()
+ val destination = if (areCredentialsSaved) {
+ Timber.d("[DEBUG][SUCCESS][credentials_found] Credentials found, navigating to Dashboard.")
+ Screen.Dashboard.route
+ } else {
+ Timber.d("[DEBUG][FALLBACK][no_credentials] No credentials found, navigating to Setup.")
+ Screen.Setup.route
+ }
+
+ navController.navigate(destination) {
+ popUpTo(Screen.Splash.route) { inclusive = true }
+ }
+ }
}
-// [END_ENTITY: Function('SplashScreen')]
\ No newline at end of file
+// [END_ENTITY: Composable('SplashScreen')]
+// [END_FILE_SplashScreen.kt]
\ No newline at end of file
diff --git a/app/src/main/java/com/homebox/lens/ui/theme/Color.kt b/app/src/main/java/com/homebox/lens/ui/theme/Color.kt
index ddaa512..bfd6507 100644
--- a/app/src/main/java/com/homebox/lens/ui/theme/Color.kt
+++ b/app/src/main/java/com/homebox/lens/ui/theme/Color.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.theme
// [FILE] Color.kt
-// [SEMANTICS] ui, theme, color
+// [SEMANTICS] app, ui, theme, color
package com.homebox.lens.ui.theme
// [IMPORTS]
diff --git a/app/src/main/java/com/homebox/lens/ui/theme/Theme.kt b/app/src/main/java/com/homebox/lens/ui/theme/Theme.kt
index fa430f3..82d3284 100644
--- a/app/src/main/java/com/homebox/lens/ui/theme/Theme.kt
+++ b/app/src/main/java/com/homebox/lens/ui/theme/Theme.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.theme
// [FILE] Theme.kt
-// [SEMANTICS] ui, theme
+// [SEMANTICS] app, ui, theme
package com.homebox.lens.ui.theme
// [IMPORTS]
diff --git a/app/src/main/java/com/homebox/lens/ui/theme/Typography.kt b/app/src/main/java/com/homebox/lens/ui/theme/Typography.kt
index 625a3f4..b7ec6f8 100644
--- a/app/src/main/java/com/homebox/lens/ui/theme/Typography.kt
+++ b/app/src/main/java/com/homebox/lens/ui/theme/Typography.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.ui.theme
// [FILE] Typography.kt
-// [SEMANTICS] ui, theme, typography
+// [SEMANTICS] app, ui, theme, typography
package com.homebox.lens.ui.theme
// [IMPORTS]
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 973508c..69c387d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -13,6 +13,7 @@
Открыть боковое меню
+ Enter your Homebox server details to connect.
Сканировать QR-код
Вернуться назад
Добавить новую локацию
diff --git a/data/src/main/java/com/homebox/lens/data/api/HomeboxApiService.kt b/data/src/main/java/com/homebox/lens/data/api/HomeboxApiService.kt
index 2153ba3..8021cc1 100644
--- a/data/src/main/java/com/homebox/lens/data/api/HomeboxApiService.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/HomeboxApiService.kt
@@ -11,7 +11,7 @@ import retrofit2.http.*
// [ENTITY: Interface('HomeboxApiService')]
/**
- * @summary Определяет эндпоинты для взаимодействия с Homebox API, используя DTO.
+ * @summary Defines the endpoints for interacting with the Homebox API using DTOs.
*/
interface HomeboxApiService {
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/CustomFieldDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/CustomFieldDto.kt
index 7d5d492..50bb69c 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/CustomFieldDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/CustomFieldDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] CustomFieldDto.kt
-// [SEMANTICS] data_transfer_object, custom_field
+// [SEMANTICS] data, dto, custom_field
package com.homebox.lens.data.api.dto
@@ -12,7 +12,7 @@ import com.homebox.lens.domain.model.CustomField
// [ENTITY: DataClass('CustomFieldDto')]
/**
- * @summary DTO для кастомного поля.
+ * @summary DTO for a custom field.
*/
@JsonClass(generateAdapter = true)
data class CustomFieldDto(
@@ -25,7 +25,7 @@ data class CustomFieldDto(
// [ENTITY: Function('toDomain')]
// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('CustomField')]
/**
- * @summary Маппер из CustomFieldDto в доменную модель CustomField.
+ * @summary Mapper from CustomFieldDto to the CustomField domain model.
*/
fun CustomFieldDto.toDomain(): CustomField {
return CustomField(
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/GroupStatisticsDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/GroupStatisticsDto.kt
index 5997e46..251e25b 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/GroupStatisticsDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/GroupStatisticsDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] GroupStatisticsDto.kt
-// [SEMANTICS] data_transfer_object, statistics
+// [SEMANTICS] data, dto, statistics
package com.homebox.lens.data.api.dto
@@ -12,7 +12,7 @@ import com.homebox.lens.domain.model.GroupStatistics
// [ENTITY: DataClass('GroupStatisticsDto')]
/**
- * @summary DTO для статистики.
+ * @summary DTO for statistics.
*/
@JsonClass(generateAdapter = true)
data class GroupStatisticsDto(
@@ -28,7 +28,7 @@ data class GroupStatisticsDto(
// [ENTITY: Function('toDomain')]
// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('GroupStatistics')]
/**
- * @summary Маппер из GroupStatisticsDto в доменную модель GroupStatistics.
+ * @summary Mapper from GroupStatisticsDto to the GroupStatistics domain model.
*/
fun GroupStatisticsDto.toDomain(): GroupStatistics {
return GroupStatistics(
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/ImageDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/ImageDto.kt
index ab7119a..804099d 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/ImageDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/ImageDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] ImageDto.kt
-// [SEMANTICS] data_transfer_object, image
+// [SEMANTICS] data, dto, image
package com.homebox.lens.data.api.dto
@@ -12,10 +12,10 @@ import com.homebox.lens.domain.model.Image
// [ENTITY: DataClass('ImageDto')]
/**
- * @summary DTO для изображения.
- * @param id Уникальный идентификатор.
- * @param path Путь к файлу.
- * @param isPrimary Является ли основным.
+ * @summary DTO for an image.
+ * @param id The unique identifier.
+ * @param path The path to the file.
+ * @param isPrimary Whether it is the primary image.
*/
@JsonClass(generateAdapter = true)
data class ImageDto(
@@ -28,7 +28,7 @@ data class ImageDto(
// [ENTITY: Function('toDomain')]
// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('Image')]
/**
- * @summary Маппер из ImageDto в доменную модель Image.
+ * @summary Mapper from ImageDto to the Image domain model.
*/
fun ImageDto.toDomain(): Image {
return Image(
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/ItemAttachmentDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/ItemAttachmentDto.kt
index 1e2360f..e1030cc 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/ItemAttachmentDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/ItemAttachmentDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] ItemAttachmentDto.kt
-// [SEMANTICS] data_transfer_object, attachment
+// [SEMANTICS] data, dto, attachment
package com.homebox.lens.data.api.dto
@@ -12,7 +12,7 @@ import com.homebox.lens.domain.model.ItemAttachment
// [ENTITY: DataClass('ItemAttachmentDto')]
/**
- * @summary DTO для вложения.
+ * @summary DTO for an attachment.
*/
@JsonClass(generateAdapter = true)
data class ItemAttachmentDto(
@@ -28,7 +28,7 @@ data class ItemAttachmentDto(
// [ENTITY: Function('toDomain')]
// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('ItemAttachment')]
/**
- * @summary Маппер из ItemAttachmentDto в доменную модель ItemAttachment.
+ * @summary Mapper from ItemAttachmentDto to the ItemAttachment domain model.
*/
fun ItemAttachmentDto.toDomain(): ItemAttachment {
return ItemAttachment(
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/ItemCreateDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/ItemCreateDto.kt
index 2c16649..3ce644f 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/ItemCreateDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/ItemCreateDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] ItemCreateDto.kt
-// [SEMANTICS] data_transfer_object, item_creation
+// [SEMANTICS] data, dto, item_creation
package com.homebox.lens.data.api.dto
@@ -12,7 +12,7 @@ import com.homebox.lens.domain.model.ItemCreate
// [ENTITY: DataClass('ItemCreateDto')]
/**
- * @summary DTO для создания вещи.
+ * @summary DTO for creating an item.
*/
@JsonClass(generateAdapter = true)
data class ItemCreateDto(
@@ -46,7 +46,7 @@ data class ItemCreateDto(
// [ENTITY: Function('toDto')]
// [RELATION: Function('toDto')] -> [RETURNS] -> [DataClass('ItemCreateDto')]
/**
- * @summary Маппер из доменной модели ItemCreate в ItemCreateDto.
+ * @summary Mapper from the ItemCreate domain model to ItemCreateDto.
*/
fun ItemCreate.toItemCreateDto(): ItemCreateDto {
return ItemCreateDto(
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/ItemDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/ItemDto.kt
deleted file mode 100644
index 1affe5e..0000000
--- a/data/src/main/java/com/homebox/lens/data/api/dto/ItemDto.kt
+++ /dev/null
@@ -1,74 +0,0 @@
-// [PACKAGE] com.homebox.lens.data.api.dto
-// [FILE] ItemDto.kt
-// [SEMANTICS] data, dto, api
-package com.homebox.lens.data.api.dto
-
-// [IMPORTS]
-import com.squareup.moshi.Json
-import com.squareup.moshi.JsonClass
-import java.math.BigDecimal
-// [END_IMPORTS]
-
-// [ENTITY: DataClass('ItemOut')]
-// [RELATION: DataClass('ItemOut')] -> [DEPENDS_ON] -> [DataClass('LocationOut')]
-// [RELATION: DataClass('ItemOut')] -> [DEPENDS_ON] -> [DataClass('LabelOutDto')]
-/**
- * @summary DTO для полной информации о вещи (GET /v1/items/{id}).
- */
-@JsonClass(generateAdapter = true)
-data class ItemOut(
- @Json(name = "id") val id: String,
- @Json(name = "name") val name: String,
- @Json(name = "description") val description: String?,
- @Json(name = "image") val image: String?,
- @Json(name = "location") val location: LocationOut?,
- @Json(name = "labels") val labels: List,
- @Json(name = "value") val value: BigDecimal?,
- @Json(name = "createdAt") val createdAt: String?
-)
-// [END_ENTITY: DataClass('ItemOut')]
-
-// [ENTITY: DataClass('ItemSummary')]
-// [RELATION: DataClass('ItemSummary')] -> [DEPENDS_ON] -> [DataClass('LocationOut')]
-/**
- * @summary DTO для краткой информации о вещи в списках (GET /v1/items).
- */
-@JsonClass(generateAdapter = true)
-data class ItemSummary(
- @Json(name = "id") val id: String,
- @Json(name = "name") val name: String,
- @Json(name = "image") val image: String?,
- @Json(name = "location") val location: LocationOut?,
- @Json(name = "createdAt") val createdAt: String?
-)
-// [END_ENTITY: DataClass('ItemSummary')]
-
-// [ENTITY: DataClass('ItemCreate')]
-/**
- * @summary DTO для создания новой вещи (POST /v1/items).
- */
-@JsonClass(generateAdapter = true)
-data class ItemCreate(
- @Json(name = "name") val name: String,
- @Json(name = "description") val description: String?,
- @Json(name = "locationId") val locationId: String?,
- @Json(name = "labelIds") val labelIds: List?,
- @Json(name = "value") val value: BigDecimal?
-)
-// [END_ENTITY: DataClass('ItemCreate')]
-
-// [ENTITY: DataClass('ItemUpdate')]
-/**
- * @summary DTO для обновления вещи (PUT /v1/items/{id}).
- */
-@JsonClass(generateAdapter = true)
-data class ItemUpdate(
- @Json(name = "name") val name: String,
- @Json(name = "description") val description: String?,
- @Json(name = "locationId") val locationId: String?,
- @Json(name = "labelIds") val labelIds: List?,
- @Json(name = "value") val value: BigDecimal?
-)
-// [END_ENTITY: DataClass('ItemUpdate')]
-
-// [END_FILE_ItemDto.kt]
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/ItemOutDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/ItemOutDto.kt
index 42f57af..544e266 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/ItemOutDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/ItemOutDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] ItemOutDto.kt
-// [SEMANTICS] data_transfer_object, item_detailed
+// [SEMANTICS] data, dto, item_detailed
package com.homebox.lens.data.api.dto
@@ -50,3 +50,46 @@ data class ItemOutDto(
@Json(name = "updatedAt") val updatedAt: String
)
// [END_ENTITY: DataClass('ItemOutDto')]
+
+// [ENTITY: Function('toDomain')]
+// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('ItemOut')]
+/**
+ * @summary Mapper from ItemOutDto to the ItemOut domain model.
+ */
+fun ItemOutDto.toDomain(): ItemOut {
+ return ItemOut(
+ id = this.id,
+ name = this.name,
+ assetId = this.assetId,
+ description = this.description,
+ notes = this.notes,
+ serialNumber = this.serialNumber,
+ quantity = this.quantity,
+ isArchived = this.isArchived,
+ purchasePrice = this.purchasePrice,
+ purchaseTime = this.purchaseTime,
+ purchaseFrom = this.purchaseFrom,
+ warrantyExpires = this.warrantyExpires,
+ warrantyDetails = this.warrantyDetails,
+ lifetimeWarranty = this.lifetimeWarranty,
+ insured = this.insured,
+ manufacturer = this.manufacturer,
+ modelNumber = this.modelNumber,
+ soldPrice = this.soldPrice,
+ soldTime = this.soldTime,
+ soldTo = this.soldTo,
+ soldNotes = this.soldNotes,
+ syncChildItemsLocations = this.syncChildItemsLocations,
+ location = this.location?.toDomain(),
+ parent = this.parent?.toDomain(),
+ children = this.children.map { it.toDomain() },
+ labels = this.labels.map { it.toDomain() },
+ attachments = this.attachments.map { it.toDomain() },
+ images = this.images.map { it.toDomain() },
+ fields = this.fields.map { it.toDomain() },
+ maintenance = this.maintenance.map { it.toDomain() },
+ createdAt = this.createdAt,
+ updatedAt = this.updatedAt
+ )
+}
+// [END_ENTITY: Function('toDomain')]
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/ItemSummaryDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/ItemSummaryDto.kt
index 718a7bf..4beefea 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/ItemSummaryDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/ItemSummaryDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] ItemSummaryDto.kt
-// [SEMANTICS] data_transfer_object, item_summary
+// [SEMANTICS] data, dto, item_summary
package com.homebox.lens.data.api.dto
@@ -28,3 +28,24 @@ data class ItemSummaryDto(
@Json(name = "updatedAt") val updatedAt: String
)
// [END_ENTITY: DataClass('ItemSummaryDto')]
+
+// [ENTITY: Function('toDomain')]
+// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('ItemSummary')]
+/**
+ * @summary Mapper from ItemSummaryDto to the ItemSummary domain model.
+ */
+fun ItemSummaryDto.toDomain(): ItemSummary {
+ return ItemSummary(
+ id = this.id,
+ name = this.name,
+ assetId = this.assetId,
+ image = this.image?.toDomain(),
+ isArchived = this.isArchived,
+ labels = this.labels.map { it.toDomain() },
+ location = this.location?.toDomain(),
+ value = this.value,
+ createdAt = this.createdAt,
+ updatedAt = this.updatedAt
+ )
+}
+// [END_ENTITY: Function('toDomain')]
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/ItemUpdateDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/ItemUpdateDto.kt
index a3540e8..6243e1a 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/ItemUpdateDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/ItemUpdateDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] ItemUpdateDto.kt
-// [SEMANTICS] data_transfer_object, item_update
+// [SEMANTICS] data, dto, item_update
package com.homebox.lens.data.api.dto
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LabelCreateDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LabelCreateDto.kt
index a7bca38..2136b3e 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LabelCreateDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/LabelCreateDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] LabelCreateDto.kt
-// [SEMANTICS] data_transfer_object, label, create, api
+// [SEMANTICS] data, dto, label, create
package com.homebox.lens.data.api.dto
// [IMPORTS]
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LabelOutDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LabelOutDto.kt
index b13e964..d533c46 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LabelOutDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/LabelOutDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] LabelOutDto.kt
-// [SEMANTICS] data_transfer_object, label
+// [SEMANTICS] data, dto, label
package com.homebox.lens.data.api.dto
@@ -26,4 +26,21 @@ data class LabelOutDto(
)
// [END_ENTITY: DataClass('LabelOutDto')]
+// [ENTITY: Function('toDomain')]
+// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('LabelOut')]
+/**
+ * @summary Mapper from LabelOutDto to the LabelOut domain model.
+ */
+fun LabelOutDto.toDomain(): LabelOut {
+ return LabelOut(
+ id = this.id,
+ name = this.name,
+ description = this.description,
+ color = this.color ?: "#000000",
+ isArchived = this.isArchived ?: false,
+ createdAt = this.createdAt,
+ updatedAt = this.updatedAt
+ )
+}
+// [END_ENTITY: Function('toDomain')]
// [END_FILE_LabelOutDto.kt]
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LabelSummaryDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LabelSummaryDto.kt
index c8a8b7f..db516c3 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LabelSummaryDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/LabelSummaryDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] LabelSummaryDto.kt
-// [SEMANTICS] data_transfer_object, label, summary, api, mapper
+// [SEMANTICS] data, dto, label, summary
package com.homebox.lens.data.api.dto
// [IMPORTS]
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LabelUpdateDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LabelUpdateDto.kt
index 5eb2045..17d331f 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LabelUpdateDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/LabelUpdateDto.kt
@@ -1,15 +1,17 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] LabelUpdateDto.kt
-// [SEMANTICS] data_transfer_object, label, update
+// [SEMANTICS] data, dto, label, update
package com.homebox.lens.data.api.dto
// [IMPORTS]
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
-import com.homebox.lens.domain.model.LabelUpdate
// [END_IMPORTS]
// [ENTITY: DataClass('LabelUpdateDto')]
+/**
+ * @summary DTO for updating a label.
+ */
@JsonClass(generateAdapter = true)
data class LabelUpdateDto(
@Json(name = "name")
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LocationCreateDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LocationCreateDto.kt
index 0002435..ada29ab 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LocationCreateDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/LocationCreateDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] LocationCreateDto.kt
-// [SEMANTICS] data_transfer_object, location, create
+// [SEMANTICS] data, dto, location, create
package com.homebox.lens.data.api.dto
// [IMPORTS]
@@ -9,6 +9,9 @@ import com.squareup.moshi.JsonClass
// [END_IMPORTS]
// [ENTITY: DataClass('LocationCreateDto')]
+/**
+ * @summary DTO for creating a location.
+ */
@JsonClass(generateAdapter = true)
data class LocationCreateDto(
@Json(name = "name")
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LocationDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LocationDto.kt
deleted file mode 100644
index 3dbd8c3..0000000
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LocationDto.kt
+++ /dev/null
@@ -1,34 +0,0 @@
-// [PACKAGE] com.homebox.lens.data.api.dto
-// [FILE] LocationDto.kt
-// [SEMANTICS] data, dto, api, location
-package com.homebox.lens.data.api.dto
-
-// [IMPORTS]
-import com.squareup.moshi.Json
-import com.squareup.moshi.JsonClass
-// [END_IMPORTS]
-
-// [ENTITY: DataClass('LocationOut')]
-/**
- * @summary DTO для информации о местоположении.
- */
-@JsonClass(generateAdapter = true)
-data class LocationOut(
- @Json(name = "id") val id: String,
- @Json(name = "name") val name: String
-)
-// [END_ENTITY: DataClass('LocationOut')]
-
-// [ENTITY: DataClass('LocationOutCount')]
-/**
- * @summary DTO для информации о местоположении со счетчиком вещей.
- */
-@JsonClass(generateAdapter = true)
-data class LocationOutCount(
- @Json(name = "id") val id: String,
- @Json(name = "name") val name: String,
- @Json(name = "itemCount") val itemCount: Int
-)
-// [END_ENTITY: DataClass('LocationOutCount')]
-
-// [END_FILE_LocationDto.kt]
\ No newline at end of file
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LocationOutCountDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LocationOutCountDto.kt
index 870472e..6cc26e4 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LocationOutCountDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/LocationOutCountDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] LocationOutCountDto.kt
-// [SEMANTICS] data_transfer_object, location, count
+// [SEMANTICS] data, dto, location, count
package com.homebox.lens.data.api.dto
@@ -12,7 +12,7 @@ import com.homebox.lens.domain.model.LocationOutCount
// [ENTITY: DataClass('LocationOutCountDto')]
/**
- * @summary DTO для местоположения со счетчиком.
+ * @summary DTO for a location with an item count.
*/
@JsonClass(generateAdapter = true)
data class LocationOutCountDto(
@@ -27,4 +27,21 @@ data class LocationOutCountDto(
)
// [END_ENTITY: DataClass('LocationOutCountDto')]
+// [ENTITY: Function('toDomain')]
+// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('LocationOutCount')]
+/**
+ * @summary Mapper from LocationOutCountDto to the LocationOutCount domain model.
+ */
+fun LocationOutCountDto.toDomain(): LocationOutCount {
+ return LocationOutCount(
+ id = this.id,
+ name = this.name,
+ color = this.color ?: "#000000",
+ isArchived = this.isArchived ?: false,
+ itemCount = this.itemCount,
+ createdAt = this.createdAt,
+ updatedAt = this.updatedAt
+ )
+}
+// [END_ENTITY: Function('toDomain')]
// [END_FILE_LocationOutCountDto.kt]
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LocationOutDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LocationOutDto.kt
index d009d13..e2d543b 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LocationOutDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/LocationOutDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] LocationOutDto.kt
-// [SEMANTICS] data_transfer_object, location, output
+// [SEMANTICS] data, dto, location
package com.homebox.lens.data.api.dto
// [IMPORTS]
@@ -27,4 +27,20 @@ data class LocationOutDto(
)
// [END_ENTITY: DataClass('LocationOutDto')]
+// [ENTITY: Function('toDomain')]
+// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('LocationOut')]
+/**
+ * @summary Mapper from LocationOutDto to the LocationOut domain model.
+ */
+fun LocationOutDto.toDomain(): LocationOut {
+ return LocationOut(
+ id = this.id,
+ name = this.name,
+ color = this.color,
+ isArchived = this.isArchived,
+ createdAt = this.createdAt,
+ updatedAt = this.updatedAt
+ )
+}
+// [END_ENTITY: Function('toDomain')]
// [END_FILE_LocationOutDto.kt]
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LocationUpdateDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LocationUpdateDto.kt
index 1134f14..a598728 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LocationUpdateDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/LocationUpdateDto.kt
@@ -1,15 +1,17 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] LocationUpdateDto.kt
-// [SEMANTICS] data_transfer_object, location, update
+// [SEMANTICS] data, dto, location, update
package com.homebox.lens.data.api.dto
// [IMPORTS]
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
-import com.homebox.lens.domain.model.LocationUpdate
// [END_IMPORTS]
// [ENTITY: DataClass('LocationUpdateDto')]
+/**
+ * @summary DTO for updating a location.
+ */
@JsonClass(generateAdapter = true)
data class LocationUpdateDto(
@Json(name = "name")
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/LoginFormDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/LoginFormDto.kt
index ea0fd29..2f08d7b 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/LoginFormDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/LoginFormDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] LoginFormDto.kt
-// [SEMANTICS] data, dto, api, login
+// [SEMANTICS] data, dto, login
package com.homebox.lens.data.api.dto
// [IMPORTS]
@@ -9,6 +9,9 @@ import com.squareup.moshi.JsonClass
// [END_IMPORTS]
// [ENTITY: DataClass('LoginFormDto')]
+/**
+ * @summary DTO for the login form.
+ */
@JsonClass(generateAdapter = true)
data class LoginFormDto(
@Json(name = "username") val username: String,
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/MaintenanceEntryDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/MaintenanceEntryDto.kt
index 7c3234e..44fdfb5 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/MaintenanceEntryDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/MaintenanceEntryDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] MaintenanceEntryDto.kt
-// [SEMANTICS] data_transfer_object, maintenance
+// [SEMANTICS] data, dto, maintenance
package com.homebox.lens.data.api.dto
@@ -12,7 +12,7 @@ import com.homebox.lens.domain.model.MaintenanceEntry
// [ENTITY: DataClass('MaintenanceEntryDto')]
/**
- * @summary DTO для записи об обслуживании.
+ * @summary DTO for a maintenance entry.
*/
@JsonClass(generateAdapter = true)
data class MaintenanceEntryDto(
@@ -30,7 +30,7 @@ data class MaintenanceEntryDto(
// [ENTITY: Function('toDomain')]
// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('MaintenanceEntry')]
/**
- * @summary Маппер из MaintenanceEntryDto в доменную модель MaintenanceEntry.
+ * @summary Mapper from MaintenanceEntryDto to the MaintenanceEntry domain model.
*/
fun MaintenanceEntryDto.toDomain(): MaintenanceEntry {
return MaintenanceEntry(
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/PaginationDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/PaginationDto.kt
deleted file mode 100644
index 8c5d51f..0000000
--- a/data/src/main/java/com/homebox/lens/data/api/dto/PaginationDto.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-// [PACKAGE] com.homebox.lens.data.api.dto
-// [FILE] PaginationDto.kt
-// [SEMANTICS] data, dto, api, pagination
-package com.homebox.lens.data.api.dto
-
-// [IMPORTS]
-import com.squareup.moshi.Json
-import com.squareup.moshi.JsonClass
-// [END_IMPORTS]
-
-// [ENTITY: DataClass('PaginationResult')]
-/**
- * @summary DTO для пагинированных результатов от API.
- */
-@JsonClass(generateAdapter = true)
-data class PaginationResult(
- @Json(name = "items") val items: List,
- @Json(name = "page") val page: Int,
- @Json(name = "pages") val pages: Int,
- @Json(name = "total") val total: Int,
- @Json(name = "pageSize") val pageSize: Int
-)
-// [END_ENTITY: DataClass('PaginationResult')]
-
-// [END_FILE_PaginationDto.kt]
\ No newline at end of file
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/PaginationResultDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/PaginationResultDto.kt
index b5a8678..eecae1b 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/PaginationResultDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/PaginationResultDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] PaginationResultDto.kt
-// [SEMANTICS] data_transfer_object, pagination
+// [SEMANTICS] data, dto, pagination
package com.homebox.lens.data.api.dto
@@ -22,3 +22,18 @@ data class PaginationResultDto(
@Json(name = "total") val total: Int
)
// [END_ENTITY: DataClass('PaginationResultDto')]
+
+// [ENTITY: Function('toDomain')]
+// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('PaginationResult')]
+/**
+ * @summary Mapper from PaginationResultDto to the PaginationResult domain model.
+ */
+fun PaginationResultDto.toDomain(mapper: (T) -> R): PaginationResult {
+ return PaginationResult(
+ items = this.items.map(mapper),
+ page = this.page,
+ pageSize = this.pageSize,
+ total = this.total
+ )
+}
+// [END_ENTITY: Function('toDomain')]
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/StatisticsDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/StatisticsDto.kt
deleted file mode 100644
index cbf22c3..0000000
--- a/data/src/main/java/com/homebox/lens/data/api/dto/StatisticsDto.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-// [PACKAGE] com.homebox.lens.data.api.dto
-// [FILE] StatisticsDto.kt
-// [SEMANTICS] data, dto, api, statistics
-package com.homebox.lens.data.api.dto
-
-// [IMPORTS]
-import com.squareup.moshi.Json
-import com.squareup.moshi.JsonClass
-import java.math.BigDecimal
-// [END_IMPORTS]
-
-// [ENTITY: DataClass('GroupStatistics')]
-/**
- * @summary DTO для статистической информации.
- */
-@JsonClass(generateAdapter = true)
-data class GroupStatistics(
- @Json(name = "totalValue") val totalValue: BigDecimal,
- @Json(name = "totalItems") val totalItems: Int,
- @Json(name = "locations") val locations: Int,
- @Json(name = "labels") val labels: Int
-)
-// [END_ENTITY: DataClass('GroupStatistics')]
-
-// [END_FILE_StatisticsDto.kt]
\ No newline at end of file
diff --git a/data/src/main/java/com/homebox/lens/data/api/dto/TokenResponseDto.kt b/data/src/main/java/com/homebox/lens/data/api/dto/TokenResponseDto.kt
index fe31b92..9d860f6 100644
--- a/data/src/main/java/com/homebox/lens/data/api/dto/TokenResponseDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/dto/TokenResponseDto.kt
@@ -1,14 +1,18 @@
// [PACKAGE] com.homebox.lens.data.api.dto
// [FILE] TokenResponseDto.kt
-// [SEMANTICS] data, dto, api, token
+// [SEMANTICS] data, dto, token
package com.homebox.lens.data.api.dto
// [IMPORTS]
+import com.homebox.lens.domain.model.TokenResponse
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
// [END_IMPORTS]
// [ENTITY: DataClass('TokenResponseDto')]
+/**
+ * @summary DTO for the token response.
+ */
@JsonClass(generateAdapter = true)
data class TokenResponseDto(
@Json(name = "token") val token: String,
@@ -16,4 +20,16 @@ data class TokenResponseDto(
@Json(name = "expiresAt") val expiresAt: String
)
// [END_ENTITY: DataClass('TokenResponseDto')]
+
+// [ENTITY: Function('toDomain')]
+// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('TokenResponse')]
+/**
+ * @summary Mapper from TokenResponseDto to the TokenResponse domain model.
+ */
+fun TokenResponseDto.toDomain(): TokenResponse {
+ return TokenResponse(
+ token = this.token
+ )
+}
+// [END_ENTITY: Function('toDomain')]
// [END_FILE_TokenResponseDto.kt]
\ No newline at end of file
diff --git a/data/src/main/java/com/homebox/lens/data/api/mapper/TokenMapper.kt b/data/src/main/java/com/homebox/lens/data/api/mapper/TokenMapper.kt
deleted file mode 100644
index 8096874..0000000
--- a/data/src/main/java/com/homebox/lens/data/api/mapper/TokenMapper.kt
+++ /dev/null
@@ -1,30 +0,0 @@
-// [PACKAGE] com.homebox.lens.data.api.mapper
-// [FILE] TokenMapper.kt
-// [SEMANTICS] mapper, data_conversion, clean_architecture
-
-package com.homebox.lens.data.api.mapper
-
-// [IMPORTS]
-import com.homebox.lens.data.api.dto.TokenResponseDto
-import com.homebox.lens.domain.model.TokenResponse
-// [END_IMPORTS]
-
-// [ENTITY: Function('toDomain')]
-// [RELATION: Function('toDomain')] -> [RETURNS] -> [DataClass('TokenResponse')]
-/**
- * @summary Преобразует DTO-объект токена в доменную модель.
- * @receiver [TokenResponseDto] объект из слоя данных.
- * @return [TokenResponse] объект для доменного слоя.
- * @throws IllegalArgumentException если токен в DTO пустой.
- */
-fun TokenResponseDto.toDomain(): TokenResponse {
- require(this.token.isNotBlank()) { "DTO token is blank, cannot map to domain model." }
-
- val domainModel = TokenResponse(token = this.token)
-
- check(domainModel.token.isNotBlank()) { "Domain model token is blank after mapping." }
-
- return domainModel
-}
-// [END_ENTITY: Function('toDomain')]
-// [END_FILE_TokenMapper.kt]
diff --git a/data/src/main/java/com/homebox/lens/data/api/model/LoginRequest.kt b/data/src/main/java/com/homebox/lens/data/api/model/LoginRequest.kt
index 3a7d8f0..b71fd40 100644
--- a/data/src/main/java/com/homebox/lens/data/api/model/LoginRequest.kt
+++ b/data/src/main/java/com/homebox/lens/data/api/model/LoginRequest.kt
@@ -1,19 +1,23 @@
// [PACKAGE] com.homebox.lens.data.api.model
// [FILE] LoginRequest.kt
-// [SEMANTICS] dto, network, serialization, authentication
+// [SEMANTICS] data, dto, login
package com.homebox.lens.data.api.model
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
+// [IMPORTS]
+import com.squareup.moshi.Json
+import com.squareup.moshi.JsonClass
+// [END_IMPORTS]
+
+// [ENTITY: DataClass('LoginRequest')]
/**
- * [ENTITY: DataClass('LoginRequest')]
- * [CONTRACT]
- * DTO (Data Transfer Object) для запроса на аутентификацию.
- * @property username Имя пользователя.
- * @property password Пароль пользователя.
- * @invariant Свойства не должны быть пустыми.
+ * @summary DTO for the authentication request.
+ * @property username The user's name.
+ * @property password The user's password.
+ * @invariant The properties must not be blank.
*/
@JsonClass(generateAdapter = true)
data class LoginRequest(
@@ -21,9 +25,9 @@ data class LoginRequest(
@Json(name = "password") val password: String
) {
init {
- // [INVARIANT_CHECK]
- require(username.isNotBlank()) { "[INVARIANT_FAILED] Username cannot be blank." }
- require(password.isNotBlank()) { "[INVARIANT_FAILED] Password cannot be blank." }
+ require(username.isNotBlank()) { "Username cannot be blank." }
+ require(password.isNotBlank()) { "Password cannot be blank." }
}
}
+// [END_ENTITY: DataClass('LoginRequest')]
// [END_FILE_LoginRequest.kt]
\ No newline at end of file
diff --git a/data/src/main/java/com/homebox/lens/data/db/Converters.kt b/data/src/main/java/com/homebox/lens/data/db/Converters.kt
index 34ffa46..b26aba6 100644
--- a/data/src/main/java/com/homebox/lens/data/db/Converters.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/Converters.kt
@@ -10,7 +10,7 @@ import java.math.BigDecimal
// [ENTITY: Class('Converters')]
/**
- * @summary Предоставляет TypeConverters для Room для типов, не поддерживаемых по умолчанию.
+ * @summary Provides TypeConverters for Room for types not supported by default.
*/
class Converters {
// [ENTITY: Function('fromString')]
diff --git a/data/src/main/java/com/homebox/lens/data/db/HomeboxDatabase.kt b/data/src/main/java/com/homebox/lens/data/db/HomeboxDatabase.kt
index 9455102..c251247 100644
--- a/data/src/main/java/com/homebox/lens/data/db/HomeboxDatabase.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/HomeboxDatabase.kt
@@ -15,7 +15,7 @@ import com.homebox.lens.data.db.entity.*
// [ENTITY: Database('HomeboxDatabase')]
/**
- * @summary Основной класс для работы с локальной базой данных Room.
+ * @summary The main class for working with the local Room database.
*/
@Database(
entities = [
diff --git a/data/src/main/java/com/homebox/lens/data/db/dao/ItemDao.kt b/data/src/main/java/com/homebox/lens/data/db/dao/ItemDao.kt
index 1f4b147..96d0c7a 100644
--- a/data/src/main/java/com/homebox/lens/data/db/dao/ItemDao.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/dao/ItemDao.kt
@@ -13,7 +13,7 @@ import kotlinx.coroutines.flow.Flow
// [ENTITY: Interface('ItemDao')]
/**
- * @summary Предоставляет методы для работы с 'items' в локальной БД.
+ * @summary Provides methods for working with 'items' in the local DB.
*/
@Dao
interface ItemDao {
diff --git a/data/src/main/java/com/homebox/lens/data/db/dao/LabelDao.kt b/data/src/main/java/com/homebox/lens/data/db/dao/LabelDao.kt
index 37b600a..14b8396 100644
--- a/data/src/main/java/com/homebox/lens/data/db/dao/LabelDao.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/dao/LabelDao.kt
@@ -13,7 +13,7 @@ import com.homebox.lens.data.db.entity.LabelEntity
// [ENTITY: Interface('LabelDao')]
/**
- * @summary Предоставляет методы для работы с 'labels' в локальной БД.
+ * @summary Provides methods for working with 'labels' in the local DB.
*/
@Dao
interface LabelDao {
diff --git a/data/src/main/java/com/homebox/lens/data/db/dao/LocationDao.kt b/data/src/main/java/com/homebox/lens/data/db/dao/LocationDao.kt
index 35d33b9..7323a96 100644
--- a/data/src/main/java/com/homebox/lens/data/db/dao/LocationDao.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/dao/LocationDao.kt
@@ -13,7 +13,7 @@ import com.homebox.lens.data.db.entity.LocationEntity
// [ENTITY: Interface('LocationDao')]
/**
- * @summary Предоставляет методы для работы с 'locations' в локальной БД.
+ * @summary Provides methods for working with 'locations' in the local DB.
*/
@Dao
interface LocationDao {
diff --git a/data/src/main/java/com/homebox/lens/data/db/entity/ItemEntity.kt b/data/src/main/java/com/homebox/lens/data/db/entity/ItemEntity.kt
index 5904037..d5ca426 100644
--- a/data/src/main/java/com/homebox/lens/data/db/entity/ItemEntity.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/entity/ItemEntity.kt
@@ -10,7 +10,7 @@ import androidx.room.PrimaryKey
// [ENTITY: DatabaseTable('ItemEntity')]
/**
- * @summary Представляет собой строку в таблице 'items' в локальной БД.
+ * @summary Represents a row in the 'items' table in the local DB.
*/
@Entity(tableName = "items")
data class ItemEntity(
diff --git a/data/src/main/java/com/homebox/lens/data/db/entity/ItemLabelCrossRef.kt b/data/src/main/java/com/homebox/lens/data/db/entity/ItemLabelCrossRef.kt
index f72a4dc..fec6dab 100644
--- a/data/src/main/java/com/homebox/lens/data/db/entity/ItemLabelCrossRef.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/entity/ItemLabelCrossRef.kt
@@ -10,7 +10,7 @@ import androidx.room.Index
// [ENTITY: DatabaseTable('ItemLabelCrossRef')]
/**
- * @summary Таблица для связи "многие-ко-многим" между ItemEntity и LabelEntity.
+ * @summary Table for the many-to-many relationship between ItemEntity and LabelEntity.
*/
@Entity(
primaryKeys = ["itemId", "labelId"],
diff --git a/data/src/main/java/com/homebox/lens/data/db/entity/ItemWithLabels.kt b/data/src/main/java/com/homebox/lens/data/db/entity/ItemWithLabels.kt
index 87d504f..87574ef 100644
--- a/data/src/main/java/com/homebox/lens/data/db/entity/ItemWithLabels.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/entity/ItemWithLabels.kt
@@ -13,7 +13,7 @@ import androidx.room.Relation
// [RELATION: DataClass('ItemWithLabels')] -> [DEPENDS_ON] -> [DatabaseTable('ItemEntity')]
// [RELATION: DataClass('ItemWithLabels')] -> [DEPENDS_ON] -> [DatabaseTable('LabelEntity')]
/**
- * @summary POJO для получения ItemEntity вместе со связанными LabelEntity.
+ * @summary POJO for retrieving an ItemEntity with its associated LabelEntity objects.
*/
data class ItemWithLabels(
@Embedded val item: ItemEntity,
diff --git a/data/src/main/java/com/homebox/lens/data/db/entity/LabelEntity.kt b/data/src/main/java/com/homebox/lens/data/db/entity/LabelEntity.kt
index 02891a8..17522fe 100644
--- a/data/src/main/java/com/homebox/lens/data/db/entity/LabelEntity.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/entity/LabelEntity.kt
@@ -10,7 +10,7 @@ import androidx.room.PrimaryKey
// [ENTITY: DatabaseTable('LabelEntity')]
/**
- * @summary Представляет собой строку в таблице 'labels' в локальной БД.
+ * @summary Represents a row in the 'labels' table in the local DB.
*/
@Entity(tableName = "labels")
data class LabelEntity(
diff --git a/data/src/main/java/com/homebox/lens/data/db/entity/LocationEntity.kt b/data/src/main/java/com/homebox/lens/data/db/entity/LocationEntity.kt
index 90c4fd3..97d4052 100644
--- a/data/src/main/java/com/homebox/lens/data/db/entity/LocationEntity.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/entity/LocationEntity.kt
@@ -10,7 +10,7 @@ import androidx.room.PrimaryKey
// [ENTITY: DatabaseTable('LocationEntity')]
/**
- * @summary Представляет собой строку в таблице 'locations' в локальной БД.
+ * @summary Represents a row in the 'locations' table in the local DB.
*/
@Entity(tableName = "locations")
data class LocationEntity(
diff --git a/data/src/main/java/com/homebox/lens/data/db/entity/Mapper.kt b/data/src/main/java/com/homebox/lens/data/db/entity/Mapper.kt
index 75cb19b..1d6844d 100644
--- a/data/src/main/java/com/homebox/lens/data/db/entity/Mapper.kt
+++ b/data/src/main/java/com/homebox/lens/data/db/entity/Mapper.kt
@@ -11,7 +11,7 @@ import com.homebox.lens.domain.model.*
// [ENTITY: Function('ItemWithLabels.toDomainItemSummary')]
// [RELATION: Function('ItemWithLabels.toDomainItemSummary')] -> [RETURNS] -> [DataClass('ItemSummary')]
/**
- * @summary Преобразует [ItemWithLabels] (сущность БД) в [ItemSummary] (доменную модель).
+ * @summary Converts [ItemWithLabels] (DB entity) to [ItemSummary] (domain model).
*/
fun ItemWithLabels.toDomainItemSummary(): ItemSummary {
return ItemSummary(
@@ -32,7 +32,7 @@ fun ItemWithLabels.toDomainItemSummary(): ItemSummary {
// [ENTITY: Function('ItemEntity.toDomainItem')]
// [RELATION: Function('ItemEntity.toDomainItem')] -> [RETURNS] -> [DataClass('Item')]
/**
- * @summary Преобразует [ItemEntity] (сущность БД) в [Item] (доменную модель).
+ * @summary Converts [ItemEntity] (DB entity) to [Item] (domain model).
*/
fun ItemEntity.toDomainItem(): Item {
return Item(
@@ -71,7 +71,7 @@ fun ItemEntity.toDomainItem(): Item {
// [ENTITY: Function('Item.toItemEntity')]
// [RELATION: Function('Item.toItemEntity')] -> [RETURNS] -> [DataClass('ItemEntity')]
/**
- * @summary Преобразует [Item] (доменную модель) в [ItemEntity] (сущность БД).
+ * @summary Converts [Item] (domain model) to [ItemEntity] (DB entity).
*/
fun Item.toItemEntity(): ItemEntity {
return ItemEntity(
diff --git a/data/src/main/java/com/homebox/lens/data/di/ApiModule.kt b/data/src/main/java/com/homebox/lens/data/di/ApiModule.kt
index 763efeb..bfe88d7 100644
--- a/data/src/main/java/com/homebox/lens/data/di/ApiModule.kt
+++ b/data/src/main/java/com/homebox/lens/data/di/ApiModule.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.di
// [FILE] ApiModule.kt
-// [SEMANTICS] di, networking
+// [SEMANTICS] data, di, networking
package com.homebox.lens.data.di
// [IMPORTS]
@@ -25,8 +25,8 @@ import javax.inject.Singleton
// [ENTITY: Module('ApiModule')]
/**
- * @summary Hilt-модуль, отвечающий за создание и предоставление всех зависимостей,
- * необходимых для сетевого взаимодействия.
+ * @summary Hilt module responsible for creating and providing all dependencies
+ * necessary for network interaction.
*/
@Module
@InstallIn(SingletonComponent::class)
diff --git a/data/src/main/java/com/homebox/lens/data/di/DatabaseModule.kt b/data/src/main/java/com/homebox/lens/data/di/DatabaseModule.kt
index 9632575..f21a045 100644
--- a/data/src/main/java/com/homebox/lens/data/di/DatabaseModule.kt
+++ b/data/src/main/java/com/homebox/lens/data/di/DatabaseModule.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.di
// [FILE] DatabaseModule.kt
-// [SEMANTICS] di, hilt, database
+// [SEMANTICS] data, di, database
package com.homebox.lens.data.di
// [IMPORTS]
@@ -18,7 +18,7 @@ import javax.inject.Singleton
// [ENTITY: Module('DatabaseModule')]
/**
- * @summary Предоставляет зависимости для работы с базой данных Room.
+ * @summary Provides dependencies for working with the Room database.
*/
@Module
@InstallIn(SingletonComponent::class)
diff --git a/data/src/main/java/com/homebox/lens/data/di/RepositoryModule.kt b/data/src/main/java/com/homebox/lens/data/di/RepositoryModule.kt
index eee3406..e1ba359 100644
--- a/data/src/main/java/com/homebox/lens/data/di/RepositoryModule.kt
+++ b/data/src/main/java/com/homebox/lens/data/di/RepositoryModule.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.di
// [FILE] RepositoryModule.kt
-// [SEMANTICS] dependency_injection, hilt, module, binding
+// [SEMANTICS] data, di, repository
package com.homebox.lens.data.di
@@ -20,8 +20,8 @@ import javax.inject.Singleton
// [ENTITY: Module('RepositoryModule')]
/**
- * @summary Hilt-модуль для предоставления реализаций репозиториев.
- * @description Использует `@Binds` для эффективного связывания интерфейсов с их реализациями.
+ * @summary Hilt module for providing repository implementations.
+ * @description Uses `@Binds` for efficient binding of interfaces to their implementations.
*/
@Module
@InstallIn(SingletonComponent::class)
@@ -30,7 +30,7 @@ abstract class RepositoryModule {
// [ENTITY: Function('bindItemRepository')]
// [RELATION: Function('bindItemRepository')] -> [PROVIDES] -> [Interface('ItemRepository')]
/**
- * @summary Связывает интерфейс ItemRepository с его реализацией.
+ * @summary Binds the ItemRepository interface to its implementation.
*/
@Binds
@Singleton
@@ -42,7 +42,7 @@ abstract class RepositoryModule {
// [ENTITY: Function('bindCredentialsRepository')]
// [RELATION: Function('bindCredentialsRepository')] -> [PROVIDES] -> [Interface('CredentialsRepository')]
/**
- * @summary Связывает интерфейс CredentialsRepository с его реализацией.
+ * @summary Binds the CredentialsRepository interface to its implementation.
*/
@Binds
@Singleton
@@ -54,7 +54,7 @@ abstract class RepositoryModule {
// [ENTITY: Function('bindAuthRepository')]
// [RELATION: Function('bindAuthRepository')] -> [PROVIDES] -> [Interface('AuthRepository')]
/**
- * @summary Связывает интерфейс AuthRepository с его реализацией.
+ * @summary Binds the AuthRepository interface to its implementation.
*/
@Binds
@Singleton
diff --git a/data/src/main/java/com/homebox/lens/data/di/StorageModule.kt b/data/src/main/java/com/homebox/lens/data/di/StorageModule.kt
index c21c920..0f9c7f1 100644
--- a/data/src/main/java/com/homebox/lens/data/di/StorageModule.kt
+++ b/data/src/main/java/com/homebox/lens/data/di/StorageModule.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.di
// [FILE] StorageModule.kt
-// [SEMANTICS] di, hilt, storage
+// [SEMANTICS] data, di, storage
package com.homebox.lens.data.di
// [IMPORTS]
diff --git a/data/src/main/java/com/homebox/lens/data/mapper/DomainToDto.kt b/data/src/main/java/com/homebox/lens/data/mapper/DomainToDto.kt
index fe25a5b..d6dafbb 100644
--- a/data/src/main/java/com/homebox/lens/data/mapper/DomainToDto.kt
+++ b/data/src/main/java/com/homebox/lens/data/mapper/DomainToDto.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.mapper
// [FILE] DomainToDto.kt
-// [SEMANTICS] data, mapper, domain, dto
+// [SEMANTICS] data, mapper
package com.homebox.lens.data.mapper
// [IMPORTS]
diff --git a/data/src/main/java/com/homebox/lens/data/mapper/DtoToDomain.kt b/data/src/main/java/com/homebox/lens/data/mapper/DtoToDomain.kt
index 28737b0..e868b79 100644
--- a/data/src/main/java/com/homebox/lens/data/mapper/DtoToDomain.kt
+++ b/data/src/main/java/com/homebox/lens/data/mapper/DtoToDomain.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.mapper
// [FILE] DtoToDomain.kt
-// [SEMANTICS] data, mapper, dto, domain
+// [SEMANTICS] data, mapper
package com.homebox.lens.data.mapper
// [IMPORTS]
@@ -133,6 +133,13 @@ fun LabelOutDto.toDomainLabel(): DomainLabel {
name = this.name
)
}
+
+fun com.homebox.lens.domain.model.LabelOut.toDomain(): DomainLabel {
+ return DomainLabel(
+ id = this.id,
+ name = this.name
+ )
+}
// [END_ENTITY: Function('LabelOutDto.toDomain')]
// [ENTITY: Function('LocationOutDto.toDomain')]
diff --git a/data/src/main/java/com/homebox/lens/data/repository/AuthRepositoryImpl.kt b/data/src/main/java/com/homebox/lens/data/repository/AuthRepositoryImpl.kt
index 6f1e90e..d1d16dd 100644
--- a/data/src/main/java/com/homebox/lens/data/repository/AuthRepositoryImpl.kt
+++ b/data/src/main/java/com/homebox/lens/data/repository/AuthRepositoryImpl.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.repository
// [FILE] AuthRepositoryImpl.kt
-// [SEMANTICS] data_implementation, authentication, repository
+// [SEMANTICS] data, repository, authentication
package com.homebox.lens.data.repository
@@ -30,10 +30,10 @@ import javax.inject.Inject
// [RELATION: Class('AuthRepositoryImpl')] -> [DEPENDS_ON] -> [Framework('OkHttpClient')]
// [RELATION: Class('AuthRepositoryImpl')] -> [DEPENDS_ON] -> [Framework('MoshiConverterFactory')]
/**
- * @summary Реализация репозитория для управления аутентификацией.
- * @param encryptedPrefs Защищенное хранилище для токена.
- * @param okHttpClient Общий OkHttp клиент для переиспользования.
- * @param moshiConverterFactory Общий конвертер Moshi для переиспользования.
+ * @summary Implementation of the repository for managing authentication.
+ * @param encryptedPrefs The secure storage for the token.
+ * @param okHttpClient The shared OkHttp client for reuse.
+ * @param moshiConverterFactory The shared Moshi converter for reuse.
*/
class AuthRepositoryImpl @Inject constructor(
private val encryptedPrefs: SharedPreferences,
@@ -47,10 +47,10 @@ class AuthRepositoryImpl @Inject constructor(
// [ENTITY: Function('login')]
/**
- * @summary Реализует вход пользователя. Создает временный API сервис для выполнения запроса
- * на указанный пользователем URL сервера.
- * @param credentials Учетные данные пользователя, включая URL сервера.
- * @return [Result] с доменной моделью [TokenResponse] при успехе или [Exception] при ошибке.
+ * @summary Implements user login. Creates a temporary API service to execute a request
+ * to the server URL specified by the user.
+ * @param credentials The user's credentials, including the server URL.
+ * @return A [Result] with a [TokenResponse] domain model on success or an [Exception] on failure.
*/
override suspend fun login(credentials: Credentials): Result {
require(credentials.serverUrl.isNotBlank()) { "Server URL cannot be blank." }
diff --git a/data/src/main/java/com/homebox/lens/data/repository/CredentialsRepositoryImpl.kt b/data/src/main/java/com/homebox/lens/data/repository/CredentialsRepositoryImpl.kt
index 410eac2..3be02b7 100644
--- a/data/src/main/java/com/homebox/lens/data/repository/CredentialsRepositoryImpl.kt
+++ b/data/src/main/java/com/homebox/lens/data/repository/CredentialsRepositoryImpl.kt
@@ -20,10 +20,10 @@ import javax.inject.Inject
// [RELATION: Class('CredentialsRepositoryImpl')] -> [IMPLEMENTS] -> [Interface('CredentialsRepository')]
// [RELATION: Class('CredentialsRepositoryImpl')] -> [DEPENDS_ON] -> [Framework('SharedPreferences')]
/**
- * @summary Реализует репозиторий для управления учетными данными пользователя.
- * @description Взаимодействует с зашифрованными SharedPreferences для сохранения и извлечения данных.
- * @param encryptedPrefs Зашифрованное хранилище ключ-значение, предоставляемое Hilt.
- * @invariant Состояние этого репозитория полностью зависит от содержимого `encryptedPrefs`.
+ * @summary Implements the repository for managing user credentials.
+ * @description Interacts with encrypted SharedPreferences to save and retrieve data.
+ * @param encryptedPrefs The encrypted key-value store provided by Hilt.
+ * @invariant The state of this repository is entirely dependent on the contents of `encryptedPrefs`.
*/
class CredentialsRepositoryImpl @Inject constructor(
private val encryptedPrefs: SharedPreferences
@@ -38,9 +38,9 @@ class CredentialsRepositoryImpl @Inject constructor(
// [ENTITY: Function('saveCredentials')]
/**
- * @summary Сохраняет основные учетные данные пользователя.
- * @param credentials Объект с учетными данными для сохранения.
- * @sideeffect Перезаписывает существующие учетные данные в SharedPreferences.
+ * @summary Saves the user's primary credentials.
+ * @param credentials The credentials object to save.
+ * @sideeffect Overwrites existing credentials in SharedPreferences.
*/
override suspend fun saveCredentials(credentials: Credentials) {
withContext(Dispatchers.IO) {
@@ -56,8 +56,8 @@ class CredentialsRepositoryImpl @Inject constructor(
// [ENTITY: Function('getCredentials')]
/**
- * @summary Извлекает сохраненные учетные данные пользователя в виде потока.
- * @return Flow, который эммитит объект [Credentials] или null, если данные отсутствуют.
+ * @summary Retrieves the saved user credentials as a Flow.
+ * @return A Flow that emits a [Credentials] object or null if no data is present.
*/
override fun getCredentials(): Flow = flow {
Timber.d("[DEBUG][ACTION][getting_credentials] Getting user credentials.")
@@ -77,9 +77,9 @@ class CredentialsRepositoryImpl @Inject constructor(
// [ENTITY: Function('saveToken')]
/**
- * @summary Сохраняет токен авторизации.
- * @param token Токен для сохранения.
- * @sideeffect Перезаписывает существующий токен в SharedPreferences.
+ * @summary Saves the authorization token.
+ * @param token The token to save.
+ * @sideeffect Overwrites the existing token in SharedPreferences.
*/
override suspend fun saveToken(token: String) {
withContext(Dispatchers.IO) {
@@ -93,8 +93,8 @@ class CredentialsRepositoryImpl @Inject constructor(
// [ENTITY: Function('getToken')]
/**
- * @summary Извлекает сохраненный токен авторизации.
- * @return Строка с токеном или null, если он не найден.
+ * @summary Retrieves the saved authorization token.
+ * @return A string with the token or null if it is not found.
*/
override suspend fun getToken(): String? {
return withContext(Dispatchers.IO) {
@@ -111,8 +111,8 @@ class CredentialsRepositoryImpl @Inject constructor(
// [ENTITY: Function('clearAllCredentials')]
/**
- * @summary Очищает все сохраненные учетные данные и токены.
- * @sideeffect Удаляет все записи, связанные с учетными данными, из SharedPreferences.
+ * @summary Clears all saved credentials and tokens.
+ * @sideeffect Removes all records related to credentials from SharedPreferences.
*/
override suspend fun clearAllCredentials() {
withContext(Dispatchers.IO) {
diff --git a/data/src/main/java/com/homebox/lens/data/repository/ItemRepositoryImpl.kt b/data/src/main/java/com/homebox/lens/data/repository/ItemRepositoryImpl.kt
index a9efbdd..4e7dbcb 100644
--- a/data/src/main/java/com/homebox/lens/data/repository/ItemRepositoryImpl.kt
+++ b/data/src/main/java/com/homebox/lens/data/repository/ItemRepositoryImpl.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.repository
// [FILE] ItemRepositoryImpl.kt
-// [SEMANTICS] data_repository, implementation, items, labels
+// [SEMANTICS] data, repository, item
package com.homebox.lens.data.repository
// [IMPORTS]
diff --git a/data/src/main/java/com/homebox/lens/data/security/CryptoManager.kt b/data/src/main/java/com/homebox/lens/data/security/CryptoManager.kt
index be4b4bb..036a8fe 100644
--- a/data/src/main/java/com/homebox/lens/data/security/CryptoManager.kt
+++ b/data/src/main/java/com/homebox/lens/data/security/CryptoManager.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.data.security
// [FILE] CryptoManager.kt
-// [SEMANTICS] data, security, cryptography
+// [SEMANTICS] data, security, crypto
package com.homebox.lens.data.security
// [IMPORTS]
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/CustomField.kt b/domain/src/main/java/com/homebox/lens/domain/model/CustomField.kt
index 1a6fb90..11b7fa7 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/CustomField.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/CustomField.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] CustomField.kt
-// [SEMANTICS] data_structure, entity, custom_field
+// [SEMANTICS] domain, model, custom_field
package com.homebox.lens.domain.model
// [ENTITY: DataClass('CustomField')]
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/GroupStatistics.kt b/domain/src/main/java/com/homebox/lens/domain/model/GroupStatistics.kt
index 9bd3248..1a373f5 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/GroupStatistics.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/GroupStatistics.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] GroupStatistics.kt
-// [SEMANTICS] data_structure, statistics
+// [SEMANTICS] domain, model, statistics
package com.homebox.lens.domain.model
// [ENTITY: DataClass('GroupStatistics')]
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/Image.kt b/domain/src/main/java/com/homebox/lens/domain/model/Image.kt
index 0cb8335..4b21f4c 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/Image.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/Image.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] Image.kt
-// [SEMANTICS] data_structure, entity, image
+// [SEMANTICS] domain, model, image
package com.homebox.lens.domain.model
// [ENTITY: DataClass('Image')]
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/Item.kt b/domain/src/main/java/com/homebox/lens/domain/model/Item.kt
index b0ee0b5..29e0130 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/Item.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/Item.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] Item.kt
-// [SEMANTICS] domain, model
+// [SEMANTICS] domain, model, item, data_model
package com.homebox.lens.domain.model
// [IMPORTS]
@@ -12,35 +12,40 @@ import com.homebox.lens.domain.model.Image
// [ENTITY: DataClass('Item')]
// [RELATION: DataClass('Item')] -> [DEPENDS_ON] -> [DataClass('Location')]
// [RELATION: DataClass('Item')] -> [DEPENDS_ON] -> [DataClass('Label')]
+// [RELATION: DataClass('Item')] -> [DEPENDS_ON] -> [DataClass('CustomField')]
/**
- * @summary Представляет собой вещь в инвентаре.
- * @param id Уникальный идентификатор вещи.
- * @param name Название вещи.
- * @param description Описание вещи.
- * @param image Url изображения.
- * @param location Местоположение вещи.
- * @param labels Список меток, присвоенных вещи.
- * @param purchasePrice Цена покупки вещи.
- * @param createdAt Дата создания.
- * @param archived Архивирована ли вещь.
- * @param assetId Идентификатор актива.
- * @param fields Пользовательские поля.
- * @param insured Застрахована ли вещь.
- * @param lifetimeWarranty Пожизненная гарантия.
- * @param manufacturer Производитель.
- * @param modelNumber Номер модели.
- * @param notes Дополнительные заметки.
- * @param parentId ID родительского элемента.
- * @param purchaseFrom Место покупки.
- * @param purchaseTime Время покупки.
- * @param serialNumber Серийный номер.
- * @param soldNotes Заметки о продаже.
- * @param soldPrice Цена продажи.
- * @param soldTime Время продажи.
- * @param soldTo Кому продано.
- * @param syncChildItemsLocations Синхронизировать местоположения дочерних элементов.
- * @param warrantyDetails Детали гарантии.
- * @param warrantyExpires Дата окончания гарантии.
+ * @summary A comprehensive data model representing an inventory item.
+ * @param id The unique identifier for the item.
+ * @param name The name of the item.
+ * @param description A detailed description of the item.
+ * @param quantity The number of units of this item.
+ * @param image An optional URL to an image of the item.
+ * @param location The physical or logical location of the item.
+ * @param labels A list of tags or categories associated with the item.
+ * @param purchasePrice The price at which the item was purchased.
+ * @param createdAt The timestamp when the item was created.
+ * @param archived A flag indicating if the item is archived.
+ * @param assetId An external asset identifier.
+ * @param fields A list of custom-defined fields for the item.
+ * @param insured A flag indicating if the item is insured.
+ * @param lifetimeWarranty A flag indicating if the item has a lifetime warranty.
+ * @param manufacturer The manufacturer of the item.
+ * @param modelNumber The model number of the item.
+ * @param notes Any additional notes about the item.
+ * @param parentId The ID of a parent item, if this is a child item.
+ * @param purchaseFrom The place where the item was purchased.
+ * @param purchaseTime The timestamp of the purchase.
+ * @param serialNumber The serial number of the item.
+ * @param soldNotes Notes related to the sale of the item.
+ * @param soldPrice The price at which the item was sold.
+ * @param soldTime The timestamp of the sale.
+ * @param soldTo The person or entity the item was sold to.
+ * @param syncChildItemsLocations A flag to sync locations of child items.
+ * @param warrantyDetails Details about the item's warranty.
+ * @param warrantyExpires The expiration date of the warranty.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'name' must not be blank.
+ * @invariant The 'quantity' must be non-negative.
*/
data class Item(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/ItemAttachment.kt b/domain/src/main/java/com/homebox/lens/domain/model/ItemAttachment.kt
index 9b17074..8e51465 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/ItemAttachment.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/ItemAttachment.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] ItemAttachment.kt
-// [SEMANTICS] data_structure, entity, attachment
+// [SEMANTICS] domain, model, attachment
package com.homebox.lens.domain.model
// [ENTITY: DataClass('ItemAttachment')]
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/ItemCreate.kt b/domain/src/main/java/com/homebox/lens/domain/model/ItemCreate.kt
index dbe8f59..9b045a0 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/ItemCreate.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/ItemCreate.kt
@@ -1,24 +1,38 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] ItemCreate.kt
-// [SEMANTICS] data_structure, entity, input, create
+// [SEMANTICS] domain, model, item_creation
package com.homebox.lens.domain.model
// [ENTITY: DataClass('ItemCreate')]
+// [RELATION: DataClass('ItemCreate')] -> [DEPENDS_ON] -> [DataClass('Location')]
+// [RELATION: DataClass('ItemCreate')] -> [DEPENDS_ON] -> [DataClass('Label')]
/**
- * @summary Модель данных для создания новой "Вещи".
- * @param name Название вещи (обязательно).
- * @param assetId Идентификатор актива.
- * @param description Описание.
- * @param notes Заметки.
- * @param serialNumber Серийный номер.
- * @param quantity Количество.
- * @param value Стоимость.
- * @param purchasePrice Цена покупки.
- * @param purchaseDate Дата покупки.
- * @param warrantyUntil Гарантия до.
- * @param locationId ID местоположения.
- * @param parentId ID родительской вещи.
- * @param labelIds Список ID меток.
+ * @summary Data model for creating a new item.
+ * @param name The name of the item (required).
+ * @param description An optional description of the item.
+ * @param quantity The number of units of this item.
+ * @param archived A flag indicating if the item is archived.
+ * @param assetId An external asset identifier.
+ * @param insured A flag indicating if the item is insured.
+ * @param lifetimeWarranty A flag indicating if the item has a lifetime warranty.
+ * @param manufacturer The manufacturer of the item.
+ * @param modelNumber The model number of the item.
+ * @param notes Any additional notes about the item.
+ * @param parentId The ID of a parent item, if this is a child item.
+ * @param purchaseFrom The place where the item was purchased.
+ * @param purchasePrice The price at which the item was purchased.
+ * @param purchaseTime The timestamp of the purchase.
+ * @param serialNumber The serial number of the item.
+ * @param soldNotes Notes related to the sale of the item.
+ * @param soldPrice The price at which the item was sold.
+ * @param soldTime The timestamp of the sale.
+ * @param soldTo The person or entity the item was sold to.
+ * @param syncChildItemsLocations A flag to sync locations of child items.
+ * @param warrantyDetails Details about the item's warranty.
+ * @param warrantyExpires The expiration date of the warranty.
+ * @param locationId The ID of the item's location.
+ * @param labelIds A list of IDs for labels to associate with the item.
+ * @invariant The 'name' must not be blank.
*/
data class ItemCreate(
val name: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/ItemOut.kt b/domain/src/main/java/com/homebox/lens/domain/model/ItemOut.kt
index 8175017..c16570e 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/ItemOut.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/ItemOut.kt
@@ -1,43 +1,52 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] ItemOut.kt
-// [SEMANTICS] data_structure, entity, detailed
+// [SEMANTICS] domain, model, item_detailed
package com.homebox.lens.domain.model
// [ENTITY: DataClass('ItemOut')]
+// [RELATION: DataClass('ItemOut')] -> [DEPENDS_ON] -> [DataClass('LocationOut')]
+// [RELATION: DataClass('ItemOut')] -> [DEPENDS_ON] -> [DataClass('ItemSummary')]
+// [RELATION: DataClass('ItemOut')] -> [DEPENDS_ON] -> [DataClass('LabelOut')]
+// [RELATION: DataClass('ItemOut')] -> [DEPENDS_ON] -> [DataClass('ItemAttachment')]
+// [RELATION: DataClass('ItemOut')] -> [DEPENDS_ON] -> [DataClass('Image')]
+// [RELATION: DataClass('ItemOut')] -> [DEPENDS_ON] -> [DataClass('CustomField')]
+// [RELATION: DataClass('ItemOut')] -> [DEPENDS_ON] -> [DataClass('MaintenanceEntry')]
/**
- * @summary Полная модель данных для представления "Вещи" со всеми полями.
- * @param id Уникальный идентификатор.
- * @param name Название.
- * @param assetId Идентификатор актива.
- * @param description Описание.
- * @param notes Заметки.
- * @param serialNumber Серийный номер.
- * @param quantity Количество.
- * @param isArchived Флаг архивации.
- * @param purchasePrice Цена покупки.
- * @param purchaseTime Время покупки.
- * @param purchaseFrom Место покупки.
- * @param warrantyExpires Дата окончания гарантии.
- * @param warrantyDetails Детали гарантии.
- * @param lifetimeWarranty Пожизненная гарантия.
- * @param insured Застрахована ли вещь.
- * @param manufacturer Производитель.
- * @param modelNumber Номер модели.
- * @param soldPrice Цена продажи.
- * @param soldTime Время продажи.
- * @param soldTo Кому продано.
- * @param soldNotes Заметки о продаже.
- * @param syncChildItemsLocations Синхронизировать местоположения дочерних элементов.
- * @param location Местоположение.
- * @param parent Родительская вещь (если есть).
- * @param children Дочерние вещи.
- * @param labels Список меток.
- * @param attachments Список вложений.
- * @param images Список изображений.
- * @param fields Список кастомных полей.
- * @param maintenance Список записей об обслуживании.
- * @param createdAt Дата и время создания.
- * @param updatedAt Дата и время последнего обновления.
+ * @summary A comprehensive data model representing a fully-detailed inventory item.
+ * @param id The unique identifier for the item.
+ * @param name The name of the item.
+ * @param assetId An external asset identifier.
+ * @param description A detailed description of the item.
+ * @param notes Any additional notes about the item.
+ * @param serialNumber The serial number of the item.
+ * @param quantity The number of units of this item.
+ * @param isArchived A flag indicating if the item is archived.
+ * @param purchasePrice The price at which the item was purchased.
+ * @param purchaseTime The timestamp of the purchase.
+ * @param purchaseFrom The place where the item was purchased.
+ * @param warrantyExpires The expiration date of the warranty.
+ * @param warrantyDetails Details about the item's warranty.
+ * @param lifetimeWarranty A flag indicating if the item has a lifetime warranty.
+ * @param insured A flag indicating if the item is insured.
+ * @param manufacturer The manufacturer of the item.
+ * @param modelNumber The model number of the item.
+ * @param soldPrice The price at which the item was sold.
+ * @param soldTime The timestamp of the sale.
+ * @param soldTo The person or entity the item was sold to.
+ * @param soldNotes Notes related to the sale of the item.
+ * @param syncChildItemsLocations A flag to sync locations of child items.
+ * @param location The physical or logical location of the item.
+ * @param parent A summary of the parent item, if one exists.
+ * @param children A list of summaries for child items.
+ * @param labels A list of tags or categories associated with the item.
+ * @param attachments A list of file attachments for the item.
+ * @param images A list of images for the item.
+ * @param fields A list of custom-defined fields for the item.
+ * @param maintenance A list of maintenance records for the item.
+ * @param createdAt The timestamp when the item was created.
+ * @param updatedAt The timestamp when the item was last updated.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'name' must not be blank.
*/
data class ItemOut(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/ItemSummary.kt b/domain/src/main/java/com/homebox/lens/domain/model/ItemSummary.kt
index c2536ac..406976e 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/ItemSummary.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/ItemSummary.kt
@@ -1,21 +1,26 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] ItemSummary.kt
-// [SEMANTICS] data_structure, entity, summary
+// [SEMANTICS] domain, model, item_summary
package com.homebox.lens.domain.model
// [ENTITY: DataClass('ItemSummary')]
+// [RELATION: DataClass('ItemSummary')] -> [DEPENDS_ON] -> [DataClass('Image')]
+// [RELATION: DataClass('ItemSummary')] -> [DEPENDS_ON] -> [DataClass('LabelOut')]
+// [RELATION: DataClass('ItemSummary')] -> [DEPENDS_ON] -> [DataClass('LocationOut')]
/**
- * @summary Сокращенная модель данных для представления "Вещи" в списках.
- * @param id Уникальный идентификатор вещи.
- * @param name Название вещи.
- * @param assetId Идентификатор актива.
- * @param image Основное изображение. Может быть null.
- * @param isArchived Флаг архивации.
- * @param labels Список меток.
- * @param location Местоположение. Может быть null.
- * @param value Стоимость.
- * @param createdAt Дата и время создания.
- * @param updatedAt Дата и время последнего обновления.
+ * @summary A summarized data model for representing an item in a list.
+ * @param id The unique identifier for the item.
+ * @param name The name of the item.
+ * @param assetId An external asset identifier.
+ * @param image The primary image for the item, if available.
+ * @param isArchived A flag indicating if the item is archived.
+ * @param labels A list of tags or categories associated with the item.
+ * @param location The physical or logical location of the item.
+ * @param value The monetary value of the item.
+ * @param createdAt The timestamp when the item was created.
+ * @param updatedAt The timestamp when the item was last updated.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'name' must not be blank.
*/
data class ItemSummary(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/ItemUpdate.kt b/domain/src/main/java/com/homebox/lens/domain/model/ItemUpdate.kt
index abcc01d..c993a73 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/ItemUpdate.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/ItemUpdate.kt
@@ -1,25 +1,39 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] ItemUpdate.kt
-// [SEMANTICS] data_structure, entity, input, update
+// [SEMANTICS] domain, model, item_update
package com.homebox.lens.domain.model
// [ENTITY: DataClass('ItemUpdate')]
+// [RELATION: DataClass('ItemUpdate')] -> [DEPENDS_ON] -> [DataClass('Location')]
+// [RELATION: DataClass('ItemUpdate')] -> [DEPENDS_ON] -> [DataClass('Label')]
/**
- * @summary Модель данных для обновления существующей "Вещи".
- * @param name Название вещи.
- * @param assetId Идентификатор актива.
- * @param description Описание.
- * @param notes Заметки.
- * @param serialNumber Серийный номер.
- * @param quantity Количество.
- * @param isArchived Флаг архивации.
- * @param value Стоимость.
- * @param purchasePrice Цена покупки.
- * @param purchaseDate Дата покупки.
- * @param warrantyUntil Гарантия до.
- * @param locationId ID местоположения.
- * @param parentId ID родительской вещи.
- * @param labelIds Список ID меток для полной замены.
+ * @summary Data model for updating an existing item.
+ * @param id The unique identifier of the item to update.
+ * @param name The new name of the item.
+ * @param description An optional new description for the item.
+ * @param quantity The new number of units of this item.
+ * @param archived A flag indicating if the item is archived.
+ * @param assetId An external asset identifier.
+ * @param insured A flag indicating if the item is insured.
+ * @param lifetimeWarranty A flag indicating if the item has a lifetime warranty.
+ * @param manufacturer The manufacturer of the item.
+ * @param modelNumber The model number of the item.
+ * @param notes Any additional notes about the item.
+ * @param parentId The ID of a parent item, if this is a child item.
+ * @param purchaseFrom The place where the item was purchased.
+ * @param purchasePrice The price at which the item was purchased.
+ * @param purchaseTime The timestamp of the purchase.
+ * @param serialNumber The serial number of the item.
+ * @param soldNotes Notes related to the sale of the item.
+ * @param soldPrice The price at which the item was sold.
+ * @param soldTime The timestamp of the sale.
+ * @param soldTo The person or entity the item was sold to.
+ * @param syncChildItemsLocations A flag to sync locations of child items.
+ * @param warrantyDetails Details about the item's warranty.
+ * @param warrantyExpires The expiration date of the warranty.
+ * @param locationId The ID of the item's new location.
+ * @param labelIds A list of IDs for labels to associate with the item, replacing existing ones.
+ * @invariant The 'id' must not be blank.
*/
data class ItemUpdate(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/Label.kt b/domain/src/main/java/com/homebox/lens/domain/model/Label.kt
index e3503d0..3934aa9 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/Label.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/Label.kt
@@ -1,13 +1,15 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] Label.kt
-// [SEMANTICS] domain, model
+// [SEMANTICS] domain, model, label
package com.homebox.lens.domain.model
// [ENTITY: DataClass('Label')]
/**
- * @summary Представляет собой метку (тег), которую можно присвоить вещи.
- * @param id Уникальный идентификатор метки.
- * @param name Название метки.
+ * @summary Represents a label or tag that can be assigned to an item.
+ * @param id The unique identifier of the label.
+ * @param name The name of the label.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'name' must not be blank.
*/
data class Label(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/LabelCreate.kt b/domain/src/main/java/com/homebox/lens/domain/model/LabelCreate.kt
index 2144884..6ca4209 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/LabelCreate.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/LabelCreate.kt
@@ -1,14 +1,15 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LabelCreate.kt
-// [SEMANTICS] data_structure, contract, label, create
+// [SEMANTICS] domain, model, label, create
package com.homebox.lens.domain.model
// [ENTITY: DataClass('LabelCreate')]
/**
- * @summary Модель с данными, необходимыми для создания новой метки.
- * @param name Название новой метки. Обязательное поле.
- * @param color Цвет метки в формате HEX. Необязательное поле.
- * @invariant name не может быть пустым.
+ * @summary Data model for creating a new label.
+ * @param name The name of the new label (required).
+ * @param color The color of the label in HEX format (optional).
+ * @param description An optional description for the label.
+ * @invariant 'name' cannot be blank.
*/
data class LabelCreate(
val name: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/LabelOut.kt b/domain/src/main/java/com/homebox/lens/domain/model/LabelOut.kt
index 843a9e6..706a40e 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/LabelOut.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/LabelOut.kt
@@ -1,17 +1,20 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LabelOut.kt
-// [SEMANTICS] data_structure, entity, label
+// [SEMANTICS] domain, model, label
package com.homebox.lens.domain.model
// [ENTITY: DataClass('LabelOut')]
/**
- * @summary Модель данных для представления метки (тега).
- * @param id Уникальный идентификатор.
- * @param name Название метки.
- * @param color Цвет метки в формате HEX (например, "#FF0000").
- * @param isArchived Флаг, указывающий, заархивирована ли метка.
- * @param createdAt Дата и время создания.
- * @param updatedAt Дата и время последнего обновления.
+ * @summary Data model for representing a label (tag).
+ * @param id The unique identifier.
+ * @param name The name of the label.
+ * @param description An optional description for the label.
+ * @param color The color of the label in HEX format (e.g., "#FF0000").
+ * @param isArchived A flag indicating if the label is archived.
+ * @param createdAt The timestamp when the label was created.
+ * @param updatedAt The timestamp when the label was last updated.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'name' must not be blank.
*/
data class LabelOut(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/LabelSummary.kt b/domain/src/main/java/com/homebox/lens/domain/model/LabelSummary.kt
index 6827a72..2fefdf2 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/LabelSummary.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/LabelSummary.kt
@@ -1,13 +1,16 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LabelSummary.kt
-// [SEMANTICS] data_structure, entity, label, summary
+// [SEMANTICS] domain, model, label, summary
package com.homebox.lens.domain.model
// [ENTITY: DataClass('LabelSummary')]
/**
- * @summary Представляет краткую информацию о метке, обычно возвращаемую после создания.
- * @param id Уникальный идентификатор метки.
- * @param name Название метки.
+ * @summary Represents a brief summary of a label, typically returned after creation.
+ * @param id The unique identifier of the label.
+ * @param name The name of the label.
+ * @param color The color of the label in HEX format.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'name' must not be blank.
*/
data class LabelSummary(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/LabelUpdate.kt b/domain/src/main/java/com/homebox/lens/domain/model/LabelUpdate.kt
index 48e2d03..467728a 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/LabelUpdate.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/LabelUpdate.kt
@@ -1,13 +1,14 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LabelUpdate.kt
-// [SEMANTICS] data_structure, contract, label, update
+// [SEMANTICS] domain, model, label, update
package com.homebox.lens.domain.model
// [ENTITY: DataClass('LabelUpdate')]
/**
- * @summary Модель с данными, необходимыми для обновления метки.
- * @param name Название метки.
- * @param color Цвет метки в формате HEX.
+ * @summary Data model for updating a label.
+ * @param name The new name of the label.
+ * @param color The new color of the label in HEX format.
+ * @param description An optional new description for the label.
*/
data class LabelUpdate(
val name: String?,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/Location.kt b/domain/src/main/java/com/homebox/lens/domain/model/Location.kt
index 6670d03..e470a4e 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/Location.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/Location.kt
@@ -1,13 +1,15 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] Location.kt
-// [SEMANTICS] domain, model
+// [SEMANTICS] domain, model, location
package com.homebox.lens.domain.model
// [ENTITY: DataClass('Location')]
/**
- * @summary Представляет собой местоположение, где может находиться вещь.
- * @param id Уникальный идентификатор местоположения.
- * @param name Название местоположения.
+ * @summary Represents a location where an item can be.
+ * @param id The unique identifier of the location.
+ * @param name The name of the location.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'name' must not be blank.
*/
data class Location(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/LocationCreate.kt b/domain/src/main/java/com/homebox/lens/domain/model/LocationCreate.kt
index 6cfc3b0..065084d 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/LocationCreate.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/LocationCreate.kt
@@ -1,14 +1,16 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LocationCreate.kt
-// [SEMANTICS] data_structure, contract, location, create
+// [SEMANTICS] domain, model, location, create
package com.homebox.lens.domain.model
// [ENTITY: DataClass('LocationCreate')]
/**
- * @summary Модель с данными, необходимыми для создания нового местоположения.
- * @param name Название нового местоположения. Обязательное поле.
- * @param color Цвет местоположения в формате HEX. Необязательное поле.
- * @invariant name не может быть пустым.
+ * @summary Data model for creating a new location.
+ * @param name The name of the new location (required).
+ * @param parentId The ID of the parent location, if any.
+ * @param color The color of the location in HEX format (optional).
+ * @param description An optional description for the location.
+ * @invariant 'name' cannot be blank.
*/
data class LocationCreate(
val name: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/LocationOut.kt b/domain/src/main/java/com/homebox/lens/domain/model/LocationOut.kt
index dbe9ae3..fe275f5 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/LocationOut.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/LocationOut.kt
@@ -1,17 +1,19 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LocationOut.kt
-// [SEMANTICS] data_structure, entity, location
+// [SEMANTICS] domain, model, location
package com.homebox.lens.domain.model
// [ENTITY: DataClass('LocationOut')]
/**
- * @summary Модель данных для представления местоположения (без счетчика).
- * @param id Уникальный идентификатор.
- * @param name Название местоположения.
- * @param color Цвет в формате HEX.
- * @param isArchived Флаг архивации.
- * @param createdAt Дата и время создания.
- * @param updatedAt Дата и время последнего обновления.
+ * @summary Data model for representing a location (without item count).
+ * @param id The unique identifier.
+ * @param name The name of the location.
+ * @param color The color in HEX format.
+ * @param isArchived A flag indicating if the location is archived.
+ * @param createdAt The timestamp when the location was created.
+ * @param updatedAt The timestamp when the location was last updated.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'name' must not be blank.
*/
data class LocationOut(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/LocationOutCount.kt b/domain/src/main/java/com/homebox/lens/domain/model/LocationOutCount.kt
index 7cea314..54d31da 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/LocationOutCount.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/LocationOutCount.kt
@@ -1,18 +1,21 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LocationOutCount.kt
-// [SEMANTICS] data_structure, entity, location
+// [SEMANTICS] domain, model, location, count
package com.homebox.lens.domain.model
// [ENTITY: DataClass('LocationOutCount')]
/**
- * @summary Модель данных для представления местоположения со счетчиком вещей.
- * @param id Уникальный идентификатор.
- * @param name Название местоположения.
- * @param color Цвет в формате HEX.
- * @param isArchived Флаг архивации.
- * @param itemCount Количество вещей в данном местоположении.
- * @param createdAt Дата и время создания.
- * @param updatedAt Дата и время последнего обновления.
+ * @summary Data model for representing a location with an item count.
+ * @param id The unique identifier.
+ * @param name The name of the location.
+ * @param color The color in HEX format.
+ * @param isArchived A flag indicating if the location is archived.
+ * @param itemCount The number of items in this location.
+ * @param createdAt The timestamp when the location was created.
+ * @param updatedAt The timestamp when the location was last updated.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'name' must not be blank.
+ * @invariant The 'itemCount' must be non-negative.
*/
data class LocationOutCount(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/LocationUpdate.kt b/domain/src/main/java/com/homebox/lens/domain/model/LocationUpdate.kt
index 07da37d..0605cf1 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/LocationUpdate.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/LocationUpdate.kt
@@ -1,13 +1,14 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LocationUpdate.kt
-// [SEMANTICS] data_structure, contract, location, update
+// [SEMANTICS] domain, model, location, update
package com.homebox.lens.domain.model
// [ENTITY: DataClass('LocationUpdate')]
/**
- * @summary Модель с данными, необходимыми для обновления местоположения.
- * @param name Название местоположения.
- * @param color Цвет местоположения в формате HEX.
+ * @summary Data model for updating a location.
+ * @param name The new name of the location.
+ * @param color The new color of the location in HEX format.
+ * @param description An optional new description for the location.
*/
data class LocationUpdate(
val name: String?,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/MaintenanceEntry.kt b/domain/src/main/java/com/homebox/lens/domain/model/MaintenanceEntry.kt
index 0f33bd8..5e62050 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/MaintenanceEntry.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/MaintenanceEntry.kt
@@ -1,19 +1,22 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] MaintenanceEntry.kt
-// [SEMANTICS] data_structure, entity, maintenance
+// [SEMANTICS] domain, model, maintenance
package com.homebox.lens.domain.model
// [ENTITY: DataClass('MaintenanceEntry')]
/**
- * @summary Модель данных для записи о техническом обслуживании.
- * @param id Уникальный идентификатор записи.
- * @param itemId ID связанной вещи.
- * @param title Заголовок.
- * @param details Детальное описание.
- * @param dueAt Дата, до которой нужно выполнить.
- * @param completedAt Дата выполнения.
- * @param createdAt Дата и время создания.
- * @param updatedAt Дата и время последнего обновления.
+ * @summary Data model for a maintenance entry.
+ * @param id The unique identifier of the entry.
+ * @param itemId The ID of the associated item.
+ * @param title The title of the maintenance entry.
+ * @param details A detailed description of the maintenance.
+ * @param dueAt The date when the maintenance is due.
+ * @param completedAt The date when the maintenance was completed.
+ * @param createdAt The timestamp when the entry was created.
+ * @param updatedAt The timestamp when the entry was last updated.
+ * @invariant The 'id' must not be blank.
+ * @invariant The 'itemId' must not be blank.
+ * @invariant The 'title' must not be blank.
*/
data class MaintenanceEntry(
val id: String,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/PaginationResult.kt b/domain/src/main/java/com/homebox/lens/domain/model/PaginationResult.kt
index 5259aed..eb035ce 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/PaginationResult.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/PaginationResult.kt
@@ -1,16 +1,19 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] PaginationResult.kt
-// [SEMANTICS] data_structure, generic, pagination
+// [SEMANTICS] domain, model, pagination
package com.homebox.lens.domain.model
// [ENTITY: DataClass('PaginationResult')]
/**
- * @summary Генерик-класс для представления постраничных результатов от API.
- * @param T Тип элементов в списке.
- * @param items Список элементов на текущей странице.
- * @param page Номер текущей страницы.
- * @param pageSize Количество элементов на странице.
- * @param total Общее количество элементов.
+ * @summary A generic class for representing paginated results from an API.
+ * @param T The type of items in the list.
+ * @param items The list of items on the current page.
+ * @param page The current page number.
+ * @param pageSize The number of items per page.
+ * @param total The total number of items.
+ * @invariant 'page' must be greater than 0.
+ * @invariant 'pageSize' must be greater than 0.
+ * @invariant 'total' must be non-negative.
*/
data class PaginationResult(
val items: List,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/Statistics.kt b/domain/src/main/java/com/homebox/lens/domain/model/Statistics.kt
index 244b302..ba4d505 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/Statistics.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/Statistics.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] Statistics.kt
-// [SEMANTICS] domain, model
+// [SEMANTICS] domain, model, statistics
package com.homebox.lens.domain.model
// [IMPORTS]
@@ -9,11 +9,14 @@ import java.math.BigDecimal
// [ENTITY: DataClass('Statistics')]
/**
- * @summary Представляет собой статистику по инвентарю.
- * @param totalValue Общая стоимость всех вещей.
- * @param totalItems Общее количество вещей.
- * @param locations Общее количество местоположений.
- * @param labels Общее количество меток.
+ * @summary Represents inventory statistics.
+ * @param totalValue The total value of all items.
+ * @param totalItems The total number of items.
+ * @param locations The total number of locations.
+ * @param labels The total number of labels.
+ * @invariant 'totalItems' must be non-negative.
+ * @invariant 'locations' must be non-negative.
+ * @invariant 'labels' must be non-negative.
*/
data class Statistics(
val totalValue: BigDecimal,
diff --git a/domain/src/main/java/com/homebox/lens/domain/model/TokenResponse.kt b/domain/src/main/java/com/homebox/lens/domain/model/TokenResponse.kt
index 3095731..170c1a8 100644
--- a/domain/src/main/java/com/homebox/lens/domain/model/TokenResponse.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/model/TokenResponse.kt
@@ -1,14 +1,14 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] TokenResponse.kt
-// [SEMANTICS] data_transfer_object, authentication, model
+// [SEMANTICS] domain, model, authentication
package com.homebox.lens.domain.model
// [ENTITY: DataClass('TokenResponse')]
/**
- * @summary Модель данных, представляющая ответ от сервера с токеном аутентификации.
- * @param token Строка, содержащая JWT или другой токен доступа.
- * @invariant `token` не должен быть пустым.
+ * @summary Data model representing a response from the server with an authentication token.
+ * @param token A string containing a JWT or other access token.
+ * @invariant `token` must not be blank.
*/
data class TokenResponse(val token: String) {
init {
diff --git a/domain/src/main/java/com/homebox/lens/domain/repository/AuthRepository.kt b/domain/src/main/java/com/homebox/lens/domain/repository/AuthRepository.kt
index 455b3e4..3e12e94 100644
--- a/domain/src/main/java/com/homebox/lens/domain/repository/AuthRepository.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/repository/AuthRepository.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.repository
// [FILE] AuthRepository.kt
-// [SEMANTICS] authentication, data_access, repository
+// [SEMANTICS] domain, repository, authentication
package com.homebox.lens.domain.repository
@@ -17,27 +17,27 @@ import kotlinx.coroutines.flow.Flow
interface AuthRepository {
// [ENTITY: Function('login')]
/**
- * @summary Выполняет вход в систему, используя предоставленные учетные данные.
- * @param credentials Учетные данные пользователя (URL сервера, логин, пароль).
- * @return [Result] с [TokenResponse] в случае успеха, или с [Exception] в случае ошибки.
- * @throws IllegalArgumentException если `credentials` невалидны (предусловие).
+ * @summary Performs a login using the provided credentials.
+ * @param credentials The user's credentials (server URL, username, password).
+ * @return A [Result] with a [TokenResponse] on success, or an [Exception] on failure.
+ * @throws IllegalArgumentException if `credentials` are invalid (precondition).
*/
- suspend fun login(credentials: Credentials): Result
+ suspend fun login(credentials: Credentials): com.homebox.lens.domain.model.Result
// [END_ENTITY: Function('login')]
// [ENTITY: Function('saveToken')]
/**
- * @summary Сохраняет токен аутентификации.
- * @param token Токен для сохранения.
- * @throws IllegalArgumentException если `token` пустой (предусловие).
+ * @summary Saves the authentication token.
+ * @param token The token to save.
+ * @throws IllegalArgumentException if `token` is blank (precondition).
*/
suspend fun saveToken(token: String)
// [END_ENTITY: Function('saveToken')]
// [ENTITY: Function('getToken')]
/**
- * @summary Получает токен аутентификации.
- * @return [Flow], который эммитит токен в виде строки, или `null`, если токен отсутствует.
+ * @summary Gets the authentication token.
+ * @return A [Flow] that emits the token as a string, or `null` if the token is not present.
*/
fun getToken(): Flow
// [END_ENTITY: Function('getToken')]
diff --git a/domain/src/main/java/com/homebox/lens/domain/repository/ItemRepository.kt b/domain/src/main/java/com/homebox/lens/domain/repository/ItemRepository.kt
index cc0ea37..f66d070 100644
--- a/domain/src/main/java/com/homebox/lens/domain/repository/ItemRepository.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/repository/ItemRepository.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.repository
// [FILE] ItemRepository.kt
-// [SEMANTICS] data_access, abstraction, repository
+// [SEMANTICS] domain, repository, item
package com.homebox.lens.domain.repository
// [IMPORTS]
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/CreateItemUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/CreateItemUseCase.kt
index fdda4b0..b7f2710 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/CreateItemUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/CreateItemUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] CreateItemUseCase.kt
-// [SEMANTICS] business_logic, use_case, item_creation
+// [SEMANTICS] domain, usecase, item, create
package com.homebox.lens.domain.usecase
@@ -14,18 +14,18 @@ import javax.inject.Inject
// [ENTITY: UseCase('CreateItemUseCase')]
// [RELATION: UseCase('CreateItemUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Use case для создания новой вещи.
- * @param itemRepository Репозиторий для работы с данными о вещах.
+ * @summary Use case for creating a new item.
+ * @param itemRepository The repository for working with item data.
*/
class CreateItemUseCase @Inject constructor(
private val itemRepository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет операцию создания вещи.
- * @param itemCreate Данные для создания новой вещи.
- * @return Возвращает сокращенную модель созданной вещи.
- * @throws IllegalArgumentException если название вещи пустое.
+ * @summary Executes the item creation operation.
+ * @param itemCreate The data for creating the new item.
+ * @return A summary of the created item.
+ * @throws IllegalArgumentException if the item name is blank.
*/
suspend operator fun invoke(itemCreate: ItemCreate): ItemSummary {
require(itemCreate.name.isNotBlank()) { "Item name cannot be blank." }
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/CreateLabelUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/CreateLabelUseCase.kt
index 81bd431..cd41eef 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/CreateLabelUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/CreateLabelUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] CreateLabelUseCase.kt
-// [SEMANTICS] business_logic, use_case, label, create
+// [SEMANTICS] domain, usecase, label, create
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -13,19 +13,19 @@ import javax.inject.Inject
// [ENTITY: UseCase('CreateLabelUseCase')]
// [RELATION: UseCase('CreateLabelUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Сценарий использования для создания новой метки.
- * @param repository Репозиторий для доступа к данным.
+ * @summary Use case for creating a new label.
+ * @param repository The repository for data access.
*/
class CreateLabelUseCase @Inject constructor(
private val repository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет создание метки.
- * @param newLabelData Данные для создания новой метки.
- * @return Возвращает краткую информацию о созданной метке [LabelSummary].
- * @throws Exception в случае ошибки на уровне репозитория (сеть, API).
- * @precondition `newLabelData.name` не должен быть пустым.
+ * @summary Executes the label creation.
+ * @param newLabelData The data for creating the new label.
+ * @return A summary of the created label [LabelSummary].
+ * @throws Exception in case of a repository-level error (network, API).
+ * @precondition `newLabelData.name` must not be blank.
*/
suspend operator fun invoke(newLabelData: LabelCreate): LabelSummary {
require(newLabelData.name.isNotBlank()) { "Label name cannot be blank." }
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/CreateLocationUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/CreateLocationUseCase.kt
index 35420f9..b5e7e29 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/CreateLocationUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/CreateLocationUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] CreateLocationUseCase.kt
-// [SEMANTICS] business_logic, use_case, location, create
+// [SEMANTICS] domain, usecase, location, create
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -13,19 +13,19 @@ import javax.inject.Inject
// [ENTITY: UseCase('CreateLocationUseCase')]
// [RELATION: UseCase('CreateLocationUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Сценарий использования для создания нового местоположения.
- * @param repository Репозиторий для доступа к данным.
+ * @summary Use case for creating a new location.
+ * @param repository The repository for data access.
*/
class CreateLocationUseCase @Inject constructor(
private val repository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет создание местоположения.
- * @param newLocationData Данные для создания нового местоположения.
- * @return Возвращает информацию о созданом местоположении [LocationOut].
- * @throws Exception в случае ошибки на уровне репозитория (сеть, API).
- * @precondition `newLocationData.name` не должен быть пустым.
+ * @summary Executes the location creation.
+ * @param newLocationData The data for creating the new location.
+ * @return Information about the created location [LocationOut].
+ * @throws Exception in case of a repository-level error (network, API).
+ * @precondition `newLocationData.name` must not be blank.
*/
suspend operator fun invoke(newLocationData: LocationCreate): LocationOut {
require(newLocationData.name.isNotBlank()) { "Location name cannot be blank." }
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteItemUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteItemUseCase.kt
index 3362ce1..f8714da 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteItemUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteItemUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] DeleteItemUseCase.kt
-// [SEMANTICS] business_logic, use_case, item_deletion
+// [SEMANTICS] domain, usecase, item, delete
package com.homebox.lens.domain.usecase
@@ -12,17 +12,17 @@ import javax.inject.Inject
// [ENTITY: UseCase('DeleteItemUseCase')]
// [RELATION: UseCase('DeleteItemUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Use case для удаления вещи.
- * @param itemRepository Репозиторий для работы с данными о вещах.
+ * @summary Use case for deleting an item.
+ * @param itemRepository The repository for working with item data.
*/
class DeleteItemUseCase @Inject constructor(
private val itemRepository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет операцию удаления вещи.
- * @param itemId ID удаляемой вещи.
- * @throws IllegalArgumentException если ID вещи пустое.
+ * @summary Executes the item deletion operation.
+ * @param itemId The ID of the item to be deleted.
+ * @throws IllegalArgumentException if the item ID is blank.
*/
suspend operator fun invoke(itemId: String) {
require(itemId.isNotBlank()) { "Item ID cannot be blank." }
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteLabelUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteLabelUseCase.kt
index f53024b..8566280 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteLabelUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteLabelUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] DeleteLabelUseCase.kt
-// [SEMANTICS] business_logic, use_case, label, delete
+// [SEMANTICS] domain, usecase, label, delete
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -11,17 +11,17 @@ import javax.inject.Inject
// [ENTITY: UseCase('DeleteLabelUseCase')]
// [RELATION: UseCase('DeleteLabelUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Сценарий использования для удаления метки.
- * @param repository Репозиторий для доступа к данным.
+ * @summary Use case for deleting a label.
+ * @param repository The repository for data access.
*/
class DeleteLabelUseCase @Inject constructor(
private val repository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет удаление метки.
- * @param labelId ID метки для удаления.
- * @throws Exception в случае ошибки на уровне репозитория (сеть, API).
+ * @summary Executes the label deletion.
+ * @param labelId The ID of the label to delete.
+ * @throws Exception in case of a repository-level error (network, API).
*/
suspend operator fun invoke(labelId: String) {
repository.deleteLabel(labelId)
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteLocationUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteLocationUseCase.kt
index 40d948e..a87b1d1 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteLocationUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/DeleteLocationUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] DeleteLocationUseCase.kt
-// [SEMANTICS] business_logic, use_case, location, delete
+// [SEMANTICS] domain, usecase, location, delete
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -11,17 +11,17 @@ import javax.inject.Inject
// [ENTITY: UseCase('DeleteLocationUseCase')]
// [RELATION: UseCase('DeleteLocationUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Сценарий использования для удаления местоположения.
- * @param repository Репозиторий для доступа к данным.
+ * @summary Use case for deleting a location.
+ * @param repository The repository for data access.
*/
class DeleteLocationUseCase @Inject constructor(
private val repository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет удаление местоположения.
- * @param locationId ID местоположения для удаления.
- * @throws Exception в случае ошибки на уровне репозитория (сеть, API).
+ * @summary Executes the location deletion.
+ * @param locationId The ID of the location to delete.
+ * @throws Exception in case of a repository-level error (network, API).
*/
suspend operator fun invoke(locationId: String) {
repository.deleteLocation(locationId)
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/GetAllLabelsUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/GetAllLabelsUseCase.kt
index 6986faf..86fc410 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/GetAllLabelsUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/GetAllLabelsUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] GetAllLabelsUseCase.kt
-// [SEMANTICS] domain, usecase
+// [SEMANTICS] domain, usecase, label, list
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -10,16 +10,16 @@ import javax.inject.Inject
// [END_IMPORTS]
// [ENTITY: UseCase('GetAllLabelsUseCase')]
-// [RELATION: UseCase('GetAllLabelsUseCase')] -> [DEPENDS_ON] -> [Repository('ItemRepository')]
+// [RELATION: UseCase('GetAllLabelsUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
class GetAllLabelsUseCase @Inject constructor(private val repository: ItemRepository) {
// [ENTITY: Function('invoke')]
// [RELATION: Function('invoke')] -> [RETURNS] -> [DataStructure('List')]
/**
- * @summary Получает список всех меток.
- * @return Список [LabelOut].
- * @throws Exception в случае ошибки сети или API.
- * @sideeffect Отсутствуют.
+ * @summary Gets a list of all labels.
+ * @return A list of [LabelOut].
+ * @throws Exception in case of a network or API error.
+ * @sideeffect None.
*/
suspend operator fun invoke(): List {
// [AI_NOTE]: Упрощено.
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/GetAllLocationsUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/GetAllLocationsUseCase.kt
index 613d67a..045f9fd 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/GetAllLocationsUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/GetAllLocationsUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] GetAllLocationsUseCase.kt
-// [SEMANTICS] domain, usecase
+// [SEMANTICS] domain, usecase, location, list
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -10,16 +10,16 @@ import javax.inject.Inject
// [END_IMPORTS]
// [ENTITY: UseCase('GetAllLocationsUseCase')]
-// [RELATION: UseCase('GetAllLocationsUseCase')] -> [DEPENDS_ON] -> [Repository('ItemRepository')]
+// [RELATION: UseCase('GetAllLocationsUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
class GetAllLocationsUseCase @Inject constructor(private val repository: ItemRepository) {
// [ENTITY: Function('invoke')]
// [RELATION: Function('invoke')] -> [RETURNS] -> [DataStructure('List')]
/**
- * @summary Получает список всех локаций.
- * @return Список [LocationOutCount].
- * @throws Exception в случае ошибки сети или API.
- * @sideeffect Отсутствуют.
+ * @summary Gets a list of all locations.
+ * @return A list of [LocationOutCount].
+ * @throws Exception in case of a network or API error.
+ * @sideeffect None.
*/
suspend operator fun invoke(): List {
// [AI_NOTE]: Упрощено.
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/GetItemDetailsUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/GetItemDetailsUseCase.kt
index d05bc1d..ba7c4dd 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/GetItemDetailsUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/GetItemDetailsUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] GetItemDetailsUseCase.kt
-// [SEMANTICS] business_logic, use_case, item_retrieval
+// [SEMANTICS] domain, usecase, item, details
package com.homebox.lens.domain.usecase
@@ -13,18 +13,18 @@ import javax.inject.Inject
// [ENTITY: UseCase('GetItemDetailsUseCase')]
// [RELATION: UseCase('GetItemDetailsUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Use case для получения детальной информации о вещи.
- * @param itemRepository Репозиторий для работы с данными о вещах.
+ * @summary Use case for getting detailed information about an item.
+ * @param itemRepository The repository for working with item data.
*/
class GetItemDetailsUseCase @Inject constructor(
private val itemRepository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет операцию получения детальной информации о вещи.
- * @param itemId ID запрашиваемой вещи.
- * @return Возвращает полную модель вещи.
- * @throws IllegalArgumentException если ID вещи пустое.
+ * @summary Executes the operation to get detailed information about an item.
+ * @param itemId The ID of the requested item.
+ * @return The full model of the item.
+ * @throws IllegalArgumentException if the item ID is blank.
*/
suspend operator fun invoke(itemId: String): ItemOut {
require(itemId.isNotBlank()) { "Item ID cannot be blank." }
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/GetLabelDetailsUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/GetLabelDetailsUseCase.kt
index 3830c68..1dfe8d9 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/GetLabelDetailsUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/GetLabelDetailsUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] GetLabelDetailsUseCase.kt
-// [SEMANTICS] business_logic, use_case, label, get
+// [SEMANTICS] domain, usecase, label, details
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -12,19 +12,19 @@ import javax.inject.Inject
// [ENTITY: UseCase('GetLabelDetailsUseCase')]
// [RELATION: UseCase('GetLabelDetailsUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Сценарий использования для получения деталей метки.
- * @param repository Репозиторий для доступа к данным.
+ * @summary Use case for getting the details of a label.
+ * @param repository The repository for data access.
*/
class GetLabelDetailsUseCase @Inject constructor(
private val repository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет получение деталей метки.
- * @param labelId ID метки для получения деталей.
- * @return Возвращает полную информацию о метке [LabelOut].
- * @throws Exception в случае ошибки на уровне репозитория (сеть, API).
- * @precondition `labelId` не должен быть пустым.
+ * @summary Executes the retrieval of label details.
+ * @param labelId The ID of the label to get details for.
+ * @return The full information about the label [LabelOut].
+ * @throws Exception in case of a repository-level error (network, API).
+ * @precondition `labelId` must not be blank.
*/
suspend operator fun invoke(labelId: String): LabelOut {
require(labelId.isNotBlank()) { "Label ID cannot be blank." }
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/GetRecentlyAddedItemsUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/GetRecentlyAddedItemsUseCase.kt
index 9579f0b..1d2060d 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/GetRecentlyAddedItemsUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/GetRecentlyAddedItemsUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] GetRecentlyAddedItemsUseCase.kt
-// [SEMANTICS] domain, usecase
+// [SEMANTICS] domain, usecase, item, list
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -11,10 +11,10 @@ import javax.inject.Inject
// [END_IMPORTS]
// [ENTITY: UseCase('GetRecentlyAddedItemsUseCase')]
-// [RELATION: UseCase('GetRecentlyAddedItemsUseCase')] -> [DEPENDS_ON] -> [Repository('ItemRepository')]
+// [RELATION: UseCase('GetRecentlyAddedItemsUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Сценарий использования для получения списка недавно добавленных товаров.
- * @param itemRepository Репозиторий для доступа к данным о товарах.
+ * @summary Use case for getting a list of recently added items.
+ * @param itemRepository The repository for accessing item data.
*/
class GetRecentlyAddedItemsUseCase @Inject constructor(
private val itemRepository: ItemRepository
@@ -22,12 +22,12 @@ class GetRecentlyAddedItemsUseCase @Inject constructor(
// [ENTITY: Function('invoke')]
// [RELATION: Function('invoke')] -> [RETURNS] -> [DataStructure('Flow>')]
/**
- * @summary Возвращает поток (Flow) со списком недавно добавленных товаров.
- * @param limit Количество запрашиваемых элементов.
- * @return Поток (Flow), содержащий список [ItemSummary].
- * @precondition Количество запрашиваемых элементов (limit) должно быть положительным.
- * @postcondition Возвращает Flow со списком товаров, отсортированных по дате создания в порядке убывания. Если товаров нет, возвращает пустой список.
- * @sideeffect Отсутствуют.
+ * @summary Returns a Flow with a list of recently added items.
+ * @param limit The number of items to retrieve.
+ * @return A Flow containing a list of [ItemSummary].
+ * @precondition The number of requested items (limit) must be positive.
+ * @postcondition Returns a Flow with a list of items sorted by creation date in descending order. If there are no items, it returns an empty list.
+ * @sideeffect None.
*/
operator fun invoke(limit: Int): Flow> {
require(limit > 0) { "Limit must be positive." }
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/GetStatisticsUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/GetStatisticsUseCase.kt
index 234c856..f2d6eb0 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/GetStatisticsUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/GetStatisticsUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] GetStatisticsUseCase.kt
-// [SEMANTICS] domain, usecase
+// [SEMANTICS] domain, usecase, statistics
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -10,16 +10,16 @@ import javax.inject.Inject
// [END_IMPORTS]
// [ENTITY: UseCase('GetStatisticsUseCase')]
-// [RELATION: UseCase('GetStatisticsUseCase')] -> [DEPENDS_ON] -> [Repository('ItemRepository')]
+// [RELATION: UseCase('GetStatisticsUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
class GetStatisticsUseCase @Inject constructor(private val repository: ItemRepository) {
// [ENTITY: Function('invoke')]
// [RELATION: Function('invoke')] -> [RETURNS] -> [DataClass('GroupStatistics')]
/**
- * @summary Получает статистику инвентаря.
- * @return [GroupStatistics] объект.
- * @throws Exception в случае ошибки сети или API.
- * @sideeffect Отсутствуют.
+ * @summary Gets inventory statistics.
+ * @return A [GroupStatistics] object.
+ * @throws Exception in case of a network or API error.
+ * @sideeffect None.
*/
suspend operator fun invoke(): GroupStatistics {
// [AI_NOTE]: Упрощено. Просто вызываем репозиторий и возвращаем его результат. Обработка ошибок делегирована вызывающей стороне (ViewModel).
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/LoginUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/LoginUseCase.kt
index 989c445..ae6b253 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/LoginUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/LoginUseCase.kt
@@ -13,33 +13,33 @@ import javax.inject.Inject
// [ENTITY: UseCase('LoginUseCase')]
// [RELATION: UseCase('LoginUseCase')] -> [DEPENDS_ON] -> [Interface('AuthRepository')]
/**
- * @summary Use case для выполнения входа пользователя.
- * @param authRepository Репозиторий для выполнения сетевого запроса на вход и сохранения токена.
+ * @summary Use case for user login.
+ * @param authRepository The repository for handling the login network request and saving the token.
*/
class LoginUseCase @Inject constructor(
private val authRepository: AuthRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет процесс входа в систему.
- * @param credentials Учетные данные пользователя.
- * @return [Result] с [Unit] в случае успеха или с [Exception] в случае ошибки.
- * @sideeffect В случае успеха, сохраняет токен авторизации через `authRepository`.
+ * @summary Executes the login process.
+ * @param credentials The user's credentials.
+ * @return A [Result] with [Unit] on success or an [Exception] on failure.
+ * @sideeffect On success, saves the authorization token via `authRepository`.
*/
suspend operator fun invoke(credentials: Credentials): Result {
require(credentials.serverUrl.isNotBlank() && credentials.username.isNotBlank()) {
"Server URL and username must not be blank."
}
- val loginResult: Result = authRepository.login(credentials)
+ val loginResult: com.homebox.lens.domain.model.Result = authRepository.login(credentials)
return loginResult.fold(
onSuccess = {
authRepository.saveToken(it.token)
- Result.success(Unit)
+ com.homebox.lens.domain.model.Result.Success(Unit)
},
onFailure = {
- Result.failure(it)
+ com.homebox.lens.domain.model.Result.Error(it as Exception)
}
)
}
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/SearchItemsUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/SearchItemsUseCase.kt
index 6d497d6..4eb4362 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/SearchItemsUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/SearchItemsUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] SearchItemsUseCase.kt
-// [SEMANTICS] business_logic, use_case, search
+// [SEMANTICS] domain, usecase, item, search
package com.homebox.lens.domain.usecase
@@ -14,17 +14,17 @@ import javax.inject.Inject
// [ENTITY: UseCase('SearchItemsUseCase')]
// [RELATION: UseCase('SearchItemsUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Use case для поиска вещей по текстовому запросу.
- * @param itemRepository Репозиторий для работы с данными.
+ * @summary Use case for searching items by a text query.
+ * @param itemRepository The repository for data operations.
*/
class SearchItemsUseCase @Inject constructor(
private val itemRepository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет операцию поиска.
- * @param query Поисковый запрос.
- * @return Возвращает объект с результатами пагинации.
+ * @summary Executes the search operation.
+ * @param query The search query.
+ * @return A pagination result object.
*/
suspend operator fun invoke(query: String): PaginationResult {
return itemRepository.searchItems(query)
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/SyncInventoryUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/SyncInventoryUseCase.kt
index 6e7a09f..21d4bae 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/SyncInventoryUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/SyncInventoryUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] SyncInventoryUseCase.kt
-// [SEMANTICS] business_logic, use_case, data_sync
+// [SEMANTICS] domain, usecase, item, sync
package com.homebox.lens.domain.usecase
@@ -14,19 +14,19 @@ import javax.inject.Inject
// [ENTITY: UseCase('SyncInventoryUseCase')]
// [RELATION: UseCase('SyncInventoryUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Use case для синхронизации (получения) списка вещей.
- * @param itemRepository Репозиторий для работы с данными о вещах.
+ * @summary Use case for synchronizing (fetching) the list of items.
+ * @param itemRepository The repository for item data operations.
*/
class SyncInventoryUseCase @Inject constructor(
private val itemRepository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет операцию получения страницы со списком вещей.
- * @param page Номер страницы.
- * @param pageSize Размер страницы.
- * @return Возвращает объект с результатами пагинации.
- * @throws IllegalArgumentException если параметры пагинации некорректны.
+ * @summary Executes the operation to get a page from the item list.
+ * @param page The page number.
+ * @param pageSize The page size.
+ * @return A pagination result object.
+ * @throws IllegalArgumentException if the pagination parameters are incorrect.
*/
suspend operator fun invoke(page: Int, pageSize: Int): PaginationResult {
require(page > 0 && pageSize > 0) { "Page and pageSize must be positive." }
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateItemUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateItemUseCase.kt
index a72407f..1fe431b 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateItemUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateItemUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] UpdateItemUseCase.kt
-// [SEMANTICS] business_logic, use_case, item_management
+// [SEMANTICS] domain, usecase, item, update
package com.homebox.lens.domain.usecase
@@ -16,18 +16,18 @@ import javax.inject.Inject
// [RELATION: UseCase('UpdateItemUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
// [RELATION: UseCase('UpdateItemUseCase')] -> [CALLS] -> [Function('ItemRepository.updateItem')]
/**
- * @summary Use case для обновления существующей вещи.
- * @param itemRepository Репозиторий для работы с данными о вещах.
+ * @summary Use case for updating an existing item.
+ * @param itemRepository The repository for working with item data.
*/
class UpdateItemUseCase @Inject constructor(
private val itemRepository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет операцию обновления вещи.
- * @param item Данные для обновления существующей вещи.
- * @return Возвращает обновленную модель вещи.
- * @throws IllegalArgumentException если название вещи пустое.
+ * @summary Executes the item update operation.
+ * @param item The data for updating the existing item.
+ * @return The updated item model.
+ * @throws IllegalArgumentException if the item name is blank.
*/
suspend operator fun invoke(item: Item): ItemOut {
require(item.name.isNotBlank()) { "Item name cannot be blank." }
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateLabelUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateLabelUseCase.kt
index a242f1f..6d6da2e 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateLabelUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateLabelUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] UpdateLabelUseCase.kt
-// [SEMANTICS] business_logic, use_case, label, update
+// [SEMANTICS] domain, usecase, label, update
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -13,19 +13,19 @@ import javax.inject.Inject
// [ENTITY: UseCase('UpdateLabelUseCase')]
// [RELATION: UseCase('UpdateLabelUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Сценарий использования для обновления метки.
- * @param repository Репозиторий для доступа к данным.
+ * @summary Use case for updating a label.
+ * @param repository The repository for data access.
*/
class UpdateLabelUseCase @Inject constructor(
private val repository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет обновление метки.
- * @param labelId ID метки для обновления.
- * @param labelData Данные для обновления метки.
- * @return Возвращает информацию об обновленной метке [LabelOut].
- * @throws Exception в случае ошибки на уровне репозитория (сеть, API).
+ * @summary Executes the label update.
+ * @param labelId The ID of the label to update.
+ * @param labelData The data for updating the label.
+ * @return Information about the updated label [LabelOut].
+ * @throws Exception in case of a repository-level error (network, API).
*/
suspend operator fun invoke(labelId: String, labelData: LabelUpdate): LabelOut {
return repository.updateLabel(labelId, labelData)
diff --git a/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateLocationUseCase.kt b/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateLocationUseCase.kt
index 204b83d..50ca378 100644
--- a/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateLocationUseCase.kt
+++ b/domain/src/main/java/com/homebox/lens/domain/usecase/UpdateLocationUseCase.kt
@@ -1,6 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.usecase
// [FILE] UpdateLocationUseCase.kt
-// [SEMANTICS] business_logic, use_case, location, update
+// [SEMANTICS] domain, usecase, location, update
package com.homebox.lens.domain.usecase
// [IMPORTS]
@@ -13,19 +13,19 @@ import javax.inject.Inject
// [ENTITY: UseCase('UpdateLocationUseCase')]
// [RELATION: UseCase('UpdateLocationUseCase')] -> [DEPENDS_ON] -> [Interface('ItemRepository')]
/**
- * @summary Сценарий использования для обновления местоположения.
- * @param repository Репозиторий для доступа к данным.
+ * @summary Use case for updating a location.
+ * @param repository The repository for data access.
*/
class UpdateLocationUseCase @Inject constructor(
private val repository: ItemRepository
) {
// [ENTITY: Function('invoke')]
/**
- * @summary Выполняет обновление местоположения.
- * @param locationId ID местоположения для обновления.
- * @param locationData Данные для обновления местоположения.
- * @return Возвращает информацию об обновленном местоположении [LocationOut].
- * @throws Exception в случае ошибки на уровне репозитория (сеть, API).
+ * @summary Executes the location update.
+ * @param locationId The ID of the location to update.
+ * @param locationData The data for updating the location.
+ * @return Information about the updated location [LocationOut].
+ * @throws Exception in case of a repository-level error (network, API).
*/
suspend operator fun invoke(locationId: String, locationData: LocationUpdate): LocationOut {
return repository.updateLocation(locationId, locationData)
diff --git a/tasks/enrichment_task_1.xml b/tasks/enrichment_task_1.xml
new file mode 100644
index 0000000..6c1763a
--- /dev/null
+++ b/tasks/enrichment_task_1.xml
@@ -0,0 +1,17 @@
+
+
+ enrichment-task-001
+ Perform initial semantic enrichment
+ agent-enrichment
+ type::enrichment
+ status::pending
+
+
+
+ full_project
+
+
+
+
+]]>
\ No newline at end of file
diff --git a/tasks/enrichment_ui.xml b/tasks/enrichment_ui.xml
new file mode 100644
index 0000000..2707fc1
--- /dev/null
+++ b/tasks/enrichment_ui.xml
@@ -0,0 +1,6 @@
+
+ directory
+ app/src/main/java/com/homebox/lens/ui
+
+]]>
\ No newline at end of file