This commit is contained in:
2025-08-14 15:34:05 +03:00
parent ecf614e4c2
commit 7816bb3464
27 changed files with 1795 additions and 335 deletions

View File

@@ -1,4 +1,18 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LabelCreate.kt
// [SEMANTICS] data_structure, contract, label, create
package com.homebox.lens.domain.model
class LabelCreate {
}
// [CORE-LOGIC]
/**
[CONTRACT]
[ENTITY: DataClass('LabelCreate')]
@summary Модель с данными, необходимыми для создания новой метки.
@property name Название новой метки. Обязательное поле.
@property color Цвет метки в формате HEX. Необязательное поле.
@invariant name не может быть пустым.
*/
data class LabelCreate(
val name: String,
val color: String?
)
// [END_FILE_LabelCreate.kt]

View File

@@ -0,0 +1,19 @@
// [PACKAGE] com.homebox.lens.domain.model
// [FILE] LabelSummary.kt
// [SEMANTICS] data_structure, entity, label, summary
package com.homebox.lens.domain.model
// [CORE-LOGIC]
/**
* [CONTRACT]
* [ENTITY: DataClass('LabelSummary')]
* @summary Представляет краткую информацию о метке, обычно возвращаемую после создания.
* @property id Уникальный идентификатор метки.
* @property name Название метки.
* @coherence_note Эта модель соответствует схеме `repo.LabelSummary` из спецификации API.
*/
data class LabelSummary(
val id: String,
val name: String
)
// [END_FILE_LabelSummary.kt]

View File

@@ -1,7 +1,6 @@
// [PACKAGE] com.homebox.lens.domain.repository
// [FILE] ItemRepository.kt
// [SEMANTICS] data_access, abstraction, repository
package com.homebox.lens.domain.repository
// [IMPORTS]
@@ -9,22 +8,24 @@ import com.homebox.lens.domain.model.*
// [CORE-LOGIC]
/**
* [CONTRACT]
* Абстракция репозитория для работы с "Вещами".
* Определяет контракт, которому должен следовать слой данных.
* [COHERENCE_NOTE] Метод `login` был удален, так как он относится к аутентификации и перенесен в `AuthRepository`.
*/
[CONTRACT]
Абстракция репозитория для работы с "Вещами".
Определяет контракт, которому должен следовать слой данных.
*/
interface ItemRepository {
// [DELETED] suspend fun login(credentials: Credentials): Result<Unit>
suspend fun createItem(newItemData: ItemCreate): ItemSummary
suspend fun getItemDetails(itemId: String): ItemOut
suspend fun updateItem(itemId: String, item: ItemUpdate): ItemOut
suspend fun deleteItem(itemId: String)
suspend fun syncInventory(page: Int, pageSize: Int): PaginationResult<ItemSummary>
suspend fun getStatistics(): GroupStatistics
suspend fun getAllLocations(): List<LocationOutCount>
suspend fun getAllLabels(): List<LabelOut>
suspend fun searchItems(query: String): PaginationResult<ItemSummary>
fun getRecentlyAddedItems(limit: Int): kotlinx.coroutines.flow.Flow<List<ItemSummary>>
suspend fun createItem(newItemData: ItemCreate): ItemSummary
suspend fun getItemDetails(itemId: String): ItemOut
suspend fun updateItem(itemId: String, item: ItemUpdate): ItemOut
suspend fun deleteItem(itemId: String)
suspend fun syncInventory(page: Int, pageSize: Int): PaginationResult<ItemSummary>
suspend fun getStatistics(): GroupStatistics
suspend fun getAllLocations(): List<LocationOutCount>
suspend fun getAllLabels(): List<LabelOut>
suspend fun createLabel(newLabelData: LabelCreate): LabelSummary
suspend fun searchItems(query: String): PaginationResult<ItemSummary>
fun getRecentlyAddedItems(limit: Int): kotlinx.coroutines.flow.Flow<List<ItemSummary>>
}
// [END_FILE_ItemRepository.kt]