Коммит 70c3dcdb создал по автору Radch-enko's avatar Radch-enko
Просмотр файлов

Refactor: modularize slot feature and relocate related logic

- Extracted `Slot` functionality into a new `slot` module with dedicated DI setup and updated dependencies.
- Moved `GetSlotsByRoomUseCase` and `SlotUiMapper` into the `slot` module for better modular structure.
- Updated all references of `Slot` components and mappers for consistent integration across modules.
- Consolidated and re-organized slot-related UI strings into the `core/ui` module for reuse.
- Adjusted Gradle files and dependency configurations to support the new `slot` module.
владелец 29c75771
......@@ -48,6 +48,7 @@ kotlin {
implementation(project(":clients:tablet:feature:settings"))
implementation(project(":clients:tablet:feature:bookingEditor"))
implementation(project(":clients:tablet:feature:fastBooking"))
implementation(project(":clients:tablet:feature:slot"))
implementation(project(":clients:tablet:core:data"))
implementation(project(":clients:tablet:core:domain"))
......
......@@ -4,6 +4,7 @@ import band.effective.office.tablet.core.data.di.dataModule
import band.effective.office.tablet.core.domain.di.domainModule
import band.effective.office.tablet.feature.bookingEditor.di.bookingEditorModule
import band.effective.office.tablet.feature.main.di.mainScreenModule
import band.effective.office.tablet.feature.slot.di.slotDiModule
import org.koin.core.context.startKoin
class KoinInitializer {
......@@ -16,6 +17,7 @@ class KoinInitializer {
domainModule,
mainScreenModule,
bookingEditorModule,
slotDiModule,
)
}
}
......
......@@ -26,4 +26,10 @@
<string name="date_booking">%1$s, %2$s — %3$s</string>
<string name="on_main">На главную</string>
<string name="success_text">Вы заняли %1$s</string>
<string name="cancel">Отмена</string>
<string name="loading_slot_for_time">Загрузка слота на время: %1$s - %2$s</string>
<string name="empty_slot">Свободно %1$s мин</string>
<string name="event_slot">Занято %1$s</string>
<string name="multislot">%1$s брони</string>
<string name="loading_slot">Слот загружается</string>
</resources>
\ Нет новой строки в конце файла
......@@ -7,6 +7,7 @@ kotlin {
commonMain.dependencies {
implementation(project(":clients:tablet:feature:bookingEditor"))
implementation(project(":clients:tablet:feature:fastBooking"))
implementation(project(":clients:tablet:feature:slot"))
}
}
}
......
......@@ -37,12 +37,6 @@
<string name="data_not_upd">Данные брони могут быть неактуальны</string>
<string name="fastbooking_button">%1$s мин</string>
<string name="fastbooking_title">Занять любую переговорку на:</string>
<string name="empty_slot">Свободно %1$s мин</string>
<string name="event_slot">Занято %1$s</string>
<string name="multislot">%1$s брони</string>
<string name="cancel">Отмена</string>
<string name="loading_slot">Слот загружается</string>
<string name="loading_slot_for_time">Загрузка слота на время: %1$s - %2$s</string>
<string name="free_select_room">Освободить переговорку?</string>
<string name="try_again">Попробовать ещё раз</string>
<string name="free_select_room_button">Освободить</string>
......
......@@ -20,9 +20,9 @@ import band.effective.office.tablet.core.domain.model.RoomInfo
import band.effective.office.tablet.core.ui.common.Disconnect
import band.effective.office.tablet.core.ui.date.DateTimeView
import band.effective.office.tablet.feature.main.components.RoomInfoComponent
import band.effective.office.tablet.feature.main.presentation.slot.SlotComponent
import band.effective.office.tablet.feature.main.presentation.slot.SlotIntent
import band.effective.office.tablet.feature.main.presentation.slot.components.SlotView
import band.effective.office.tablet.feature.slot.presentation.SlotComponent
import band.effective.office.tablet.feature.slot.presentation.SlotIntent
import band.effective.office.tablet.feature.slot.presentation.components.SlotView
import kotlin.time.ExperimentalTime
import kotlinx.datetime.LocalDateTime
......
package band.effective.office.tablet.feature.main.di
import band.effective.office.tablet.core.domain.useCase.DeleteBookingUseCase
import band.effective.office.tablet.feature.main.domain.FreeUpRoomUseCase
import band.effective.office.tablet.feature.main.domain.GetRoomIndexUseCase
import band.effective.office.tablet.feature.main.domain.GetSlotsByRoomUseCase
import band.effective.office.tablet.feature.main.domain.GetTimeToNextEventUseCase
import band.effective.office.tablet.feature.main.presentation.mapper.SlotUiMapper
import org.koin.dsl.module
val mainScreenModule = module {
single { GetRoomIndexUseCase(get()) }
single { GetTimeToNextEventUseCase() }
single { GetSlotsByRoomUseCase(get()) }
single { FreeUpRoomUseCase(get()) }
single { SlotUiMapper() }
}
\ Нет новой строки в конце файла
......@@ -20,8 +20,8 @@ import band.effective.office.tablet.feature.main.domain.GetRoomIndexUseCase
import band.effective.office.tablet.feature.main.domain.GetTimeToNextEventUseCase
import band.effective.office.tablet.feature.main.presentation.freeuproom.FreeSelectRoomComponent
import band.effective.office.tablet.feature.main.presentation.main.navigation.ModalWindowsConfig
import band.effective.office.tablet.feature.main.presentation.slot.SlotComponent
import band.effective.office.tablet.feature.main.presentation.slot.SlotIntent
import band.effective.office.tablet.feature.slot.presentation.SlotComponent
import band.effective.office.tablet.feature.slot.presentation.SlotIntent
import band.effective.office.tablet.feature.bookingEditor.presentation.BookingEditorComponent
import band.effective.office.tablet.feature.fastBooking.presentation.FastBookingComponent
import com.arkivanov.decompose.ComponentContext
......
......@@ -8,7 +8,7 @@ import androidx.compose.ui.Modifier
import band.effective.office.tablet.core.domain.model.RoomInfo
import band.effective.office.tablet.feature.main.components.uiComponent.FastBookingRightSide
import band.effective.office.tablet.feature.main.components.uiComponent.RoomInfoLeftPanel
import band.effective.office.tablet.feature.main.presentation.slot.SlotComponent
import band.effective.office.tablet.feature.slot.presentation.SlotComponent
import kotlin.time.ExperimentalTime
import kotlinx.datetime.LocalDateTime
......
plugins {
id("band.effective.office.client.kmp.feature")
}
compose.resources {
publicResClass = false
packageOfResClass = "band.effective.office.tablet.feature.slot"
generateResClass = auto
}
\ Нет новой строки в конце файла
package band.effective.office.tablet.feature.slot.di
import band.effective.office.tablet.feature.slot.domain.usecase.GetSlotsByRoomUseCase
import band.effective.office.tablet.feature.slot.presentation.mapper.SlotUiMapper
import org.koin.dsl.module
val slotDiModule = module {
single { SlotUiMapper() }
single { GetSlotsByRoomUseCase(get()) }
}
\ Нет новой строки в конце файла
package band.effective.office.tablet.feature.main.domain
package band.effective.office.tablet.feature.slot.domain.usecase
import band.effective.office.tablet.core.domain.OfficeTime
import band.effective.office.tablet.core.domain.model.RoomInfo
......
package band.effective.office.tablet.feature.main.presentation.slot
package band.effective.office.tablet.feature.slot.presentation
import band.effective.office.tablet.core.domain.OfficeTime
import band.effective.office.tablet.core.domain.model.EventInfo
......@@ -11,9 +11,8 @@ import band.effective.office.tablet.core.domain.util.BootstrapperTimer
import band.effective.office.tablet.core.domain.util.asInstant
import band.effective.office.tablet.core.domain.util.asLocalDateTime
import band.effective.office.tablet.core.domain.util.currentInstant
import band.effective.office.tablet.core.domain.util.currentLocalDateTime
import band.effective.office.tablet.feature.main.domain.GetSlotsByRoomUseCase
import band.effective.office.tablet.feature.main.presentation.mapper.SlotUiMapper
import band.effective.office.tablet.feature.slot.domain.usecase.GetSlotsByRoomUseCase
import band.effective.office.tablet.feature.slot.presentation.mapper.SlotUiMapper
import com.arkivanov.decompose.ComponentContext
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.minutes
......
package band.effective.office.tablet.feature.main.presentation.slot
package band.effective.office.tablet.feature.slot.presentation
import band.effective.office.tablet.core.domain.model.Slot
import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalDateTime
sealed interface SlotIntent {
data class ClickOnSlot(val slot: SlotUi) : SlotIntent
......
package band.effective.office.tablet.feature.main.presentation.slot
package band.effective.office.tablet.feature.slot.presentation
import band.effective.office.tablet.core.domain.model.Slot
......
package band.effective.office.tablet.feature.main.presentation.slot.components
package band.effective.office.tablet.feature.slot.presentation.components
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.animateFloatAsState
......
package band.effective.office.tablet.feature.main.presentation.slot.components
package band.effective.office.tablet.feature.slot.presentation.components
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
......@@ -12,7 +12,7 @@ import androidx.compose.ui.graphics.Color
import band.effective.office.tablet.core.domain.util.toFormattedString
import band.effective.office.tablet.core.ui.theme.h5
import band.effective.office.tablet.core.ui.theme.h7
import band.effective.office.tablet.feature.main.presentation.slot.SlotUi
import band.effective.office.tablet.feature.slot.presentation.SlotUi
@Composable
fun CommonSlotView(
......
package band.effective.office.tablet.feature.main.presentation.slot.components
package band.effective.office.tablet.feature.slot.presentation.components
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
......@@ -18,10 +18,10 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import band.effective.office.tablet.core.ui.Res
import band.effective.office.tablet.core.ui.cancel
import band.effective.office.tablet.core.ui.theme.h7
import band.effective.office.tablet.feature.main.Res
import band.effective.office.tablet.feature.main.cancel
import band.effective.office.tablet.feature.main.presentation.slot.SlotUi
import band.effective.office.tablet.feature.slot.presentation.SlotUi
import org.jetbrains.compose.resources.stringResource
@Composable
......
package band.effective.office.tablet.feature.main.presentation.slot.components
package band.effective.office.tablet.feature.slot.presentation.components
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
......@@ -10,11 +10,11 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import band.effective.office.tablet.core.domain.util.toFormattedString
import band.effective.office.tablet.core.ui.Res
import band.effective.office.tablet.core.ui.loading_slot_for_time
import band.effective.office.tablet.core.ui.theme.h5
import band.effective.office.tablet.core.ui.theme.h7
import band.effective.office.tablet.feature.main.Res
import band.effective.office.tablet.feature.main.loading_slot_for_time
import band.effective.office.tablet.feature.main.presentation.slot.SlotUi
import band.effective.office.tablet.feature.slot.presentation.SlotUi
import org.jetbrains.compose.resources.stringResource
@Composable
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать