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

Refactor: modularize booking editor and domain logic

- Moved `CreateBookingUseCase` and `UpdateBookingUseCase` to the `core/domain` module for better cross-module reusability.
- Extracted `BookingEditor` logic into a new `bookingEditor` module with di setup and updated dependencies.
- Replaced `UpdateEventComponent` with `BookingEditorComponent` across the main module to streamline event management.
- Consolidated shared UI components into the `core/ui` module to avoid duplication.
- Updated Gradle files and DI modules for consistent dependency management.
- Improved naming and organization of string resources for booking-related views.
владелец 040a3209
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="create_view_title">Занять %1$s</string>
<string name="booking_view_title">Измененить бронь</string>
<string name="booking_time_button">Занять c %1$s до %2$s</string>
<string name="update_button">Изменить</string>
<string name="delete_button">Удалить бронь</string>
</resources>
\ No newline at end of file
package band.effective.office.tablet.feature.bookingEditor.di
import band.effective.office.tablet.feature.bookingEditor.presentation.mapper.EventInfoMapper
import band.effective.office.tablet.feature.bookingEditor.presentation.mapper.UpdateEventComponentStateToEventInfoMapper
import org.koin.dsl.module
val bookingEditorModule = module {
single { EventInfoMapper() }
single { UpdateEventComponentStateToEventInfoMapper() }
}
\ No newline at end of file
package band.effective.office.tablet.feature.main.presentation.updateEvent package band.effective.office.tablet.feature.bookingEditor.presentation
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
...@@ -20,34 +20,33 @@ import androidx.compose.ui.unit.dp ...@@ -20,34 +20,33 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import band.effective.office.tablet.core.domain.model.Organizer import band.effective.office.tablet.core.domain.model.Organizer
import band.effective.office.tablet.core.domain.util.asInstant
import band.effective.office.tablet.core.domain.util.timeFormatter import band.effective.office.tablet.core.domain.util.timeFormatter
import band.effective.office.tablet.core.ui.button.SuccessButton import band.effective.office.tablet.core.ui.button.SuccessButton
import band.effective.office.tablet.core.ui.common.AlertButton
import band.effective.office.tablet.core.ui.common.CrossButtonView import band.effective.office.tablet.core.ui.common.CrossButtonView
import band.effective.office.tablet.core.ui.common.EventDurationView
import band.effective.office.tablet.core.ui.common.EventOrganizerView
import band.effective.office.tablet.core.ui.common.FailureSelectRoomView
import band.effective.office.tablet.core.ui.common.Loader import band.effective.office.tablet.core.ui.common.Loader
import band.effective.office.tablet.core.ui.common.SuccessSelectRoomView
import band.effective.office.tablet.core.ui.date.DateTimeView import band.effective.office.tablet.core.ui.date.DateTimeView
import band.effective.office.tablet.core.ui.theme.h3 import band.effective.office.tablet.core.ui.theme.h3
import band.effective.office.tablet.core.ui.theme.h6 import band.effective.office.tablet.core.ui.theme.h6
import band.effective.office.tablet.feature.main.Res import band.effective.office.tablet.feature.bookingEditor.Res
import band.effective.office.tablet.feature.main.booking_time_button import band.effective.office.tablet.feature.bookingEditor.booking_time_button
import band.effective.office.tablet.feature.main.booking_view_title import band.effective.office.tablet.feature.bookingEditor.booking_view_title
import band.effective.office.tablet.feature.main.create_view_title import band.effective.office.tablet.feature.bookingEditor.create_view_title
import band.effective.office.tablet.feature.main.delete_button import band.effective.office.tablet.feature.bookingEditor.delete_button
import band.effective.office.tablet.feature.main.presentation.common.AlertButton import band.effective.office.tablet.feature.bookingEditor.presentation.datetimepicker.DateTimePickerModalView
import band.effective.office.tablet.feature.main.presentation.common.EventDurationView import band.effective.office.tablet.feature.bookingEditor.update_button
import band.effective.office.tablet.feature.main.presentation.common.EventOrganizerView
import band.effective.office.tablet.feature.main.presentation.common.FailureSelectRoomView
import band.effective.office.tablet.feature.main.presentation.common.SuccessSelectRoomView
import band.effective.office.tablet.feature.main.presentation.datetimepicker.DateTimePickerModalView
import band.effective.office.tablet.feature.main.update_button
import com.arkivanov.decompose.extensions.compose.stack.Children import com.arkivanov.decompose.extensions.compose.stack.Children
import kotlinx.datetime.LocalDateTime import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.format import kotlinx.datetime.format
import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.resources.stringResource
@Composable @Composable
fun UpdateEventView( fun BookingEditor(
component: UpdateEventComponent component: BookingEditorComponent
) { ) {
val state by component.state.collectAsState() val state by component.state.collectAsState()
...@@ -60,21 +59,22 @@ fun UpdateEventView( ...@@ -60,21 +59,22 @@ fun UpdateEventView(
Dialog( Dialog(
onDismissRequest = { component.sendIntent(Intent.OnClose) }, onDismissRequest = { component.sendIntent(Intent.OnClose) },
properties = DialogProperties( properties = DialogProperties(
usePlatformDefaultWidth = it.instance != UpdateEventComponent.ModalConfig.FailureModal usePlatformDefaultWidth = it.instance != BookingEditorComponent.ModalConfig.FailureModal
) )
) { ) {
when (it.instance) { when (it.instance) {
UpdateEventComponent.ModalConfig.FailureModal -> FailureSelectRoomView( BookingEditorComponent.ModalConfig.FailureModal -> FailureSelectRoomView(
onDismissRequest = { component.sendIntent(Intent.OnClose) }) onDismissRequest = { component.sendIntent(Intent.OnClose) })
UpdateEventComponent.ModalConfig.SuccessModal -> SuccessSelectRoomView( BookingEditorComponent.ModalConfig.SuccessModal -> SuccessSelectRoomView(
roomName = component.room, roomName = component.room,
organizerName = state.selectOrganizer.fullName, organizerName = state.selectOrganizer.fullName,
eventInfo = state.event, startTime = state.event.startTime,
finishTime = state.event.finishTime,
close = { component.sendIntent(Intent.OnClose) } close = { component.sendIntent(Intent.OnClose) }
) )
UpdateEventComponent.ModalConfig.UpdateModal -> UpdateEventView( BookingEditorComponent.ModalConfig.UpdateModal -> BookingEditor(
onDismissRequest = { component.sendIntent(Intent.OnClose) }, onDismissRequest = { component.sendIntent(Intent.OnClose) },
incrementData = { component.sendIntent(Intent.OnUpdateDate(1)) }, incrementData = { component.sendIntent(Intent.OnUpdateDate(1)) },
decrementData = { component.sendIntent(Intent.OnUpdateDate(-1)) }, decrementData = { component.sendIntent(Intent.OnUpdateDate(-1)) },
...@@ -111,7 +111,7 @@ fun UpdateEventView( ...@@ -111,7 +111,7 @@ fun UpdateEventView(
@Composable @Composable
fun UpdateEventView( private fun BookingEditor(
onDismissRequest: () -> Unit, onDismissRequest: () -> Unit,
incrementData: () -> Unit, incrementData: () -> Unit,
decrementData: () -> Unit, decrementData: () -> Unit,
...@@ -173,11 +173,10 @@ fun UpdateEventView( ...@@ -173,11 +173,10 @@ fun UpdateEventView(
Spacer(modifier = Modifier.height(15.dp)) Spacer(modifier = Modifier.height(15.dp))
EventOrganizerView( EventOrganizerView(
modifier = Modifier.fillMaxWidth().height(100.dp), modifier = Modifier.fillMaxWidth().height(100.dp),
selectOrganizers = organizers, selectOrganizers = organizers.map { it.fullName },
expanded = expended, expanded = expended,
selectedItem = selectOrganizer,
onExpandedChange = onExpandedChange, onExpandedChange = onExpandedChange,
onSelectItem = onSelectOrganizer, onSelectItem = { org -> onSelectOrganizer(organizers.find { it.fullName == org }!!) },
onInput = onInput, onInput = onInput,
isInputError = isInputError, isInputError = isInputError,
onDoneInput = onDoneInput, onDoneInput = onDoneInput,
......
package band.effective.office.tablet.feature.main.presentation.updateEvent package band.effective.office.tablet.feature.bookingEditor.presentation
import band.effective.office.tablet.core.domain.model.EventInfo import band.effective.office.tablet.core.domain.model.EventInfo
import band.effective.office.tablet.core.domain.model.Organizer import band.effective.office.tablet.core.domain.model.Organizer
import band.effective.office.tablet.core.domain.model.Slot import band.effective.office.tablet.core.domain.model.Slot
import band.effective.office.tablet.core.domain.unbox import band.effective.office.tablet.core.domain.unbox
import band.effective.office.tablet.core.domain.useCase.CheckBookingUseCase import band.effective.office.tablet.core.domain.useCase.CheckBookingUseCase
import band.effective.office.tablet.core.domain.useCase.CreateBookingUseCase
import band.effective.office.tablet.core.domain.useCase.OrganizersInfoUseCase import band.effective.office.tablet.core.domain.useCase.OrganizersInfoUseCase
import band.effective.office.tablet.core.domain.useCase.UpdateBookingUseCase
import band.effective.office.tablet.core.domain.util.asInstant 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.asLocalDateTime
import band.effective.office.tablet.core.domain.util.currentLocalDateTime import band.effective.office.tablet.core.domain.util.currentLocalDateTime
import band.effective.office.tablet.core.domain.util.defaultTimeZone import band.effective.office.tablet.core.domain.util.defaultTimeZone
import band.effective.office.tablet.core.ui.common.ModalWindow import band.effective.office.tablet.core.ui.common.ModalWindow
import band.effective.office.tablet.core.ui.utils.componentCoroutineScope import band.effective.office.tablet.core.ui.utils.componentCoroutineScope
import band.effective.office.tablet.feature.main.domain.CreateBookingUseCase import band.effective.office.tablet.feature.bookingEditor.presentation.datetimepicker.DateTimePickerComponent
import band.effective.office.tablet.feature.main.domain.UpdateBookingUseCase import band.effective.office.tablet.feature.bookingEditor.presentation.mapper.EventInfoMapper
import band.effective.office.tablet.feature.main.domain.mapper.EventInfoMapper import band.effective.office.tablet.feature.bookingEditor.presentation.mapper.UpdateEventComponentStateToEventInfoMapper
import band.effective.office.tablet.feature.main.domain.mapper.UpdateEventComponentStateToEventInfoMapper
import band.effective.office.tablet.feature.main.presentation.datetimepicker.DateTimePickerComponent
import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.ComponentContext
import com.arkivanov.decompose.router.stack.StackNavigation import com.arkivanov.decompose.router.stack.StackNavigation
import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.childStack
...@@ -35,7 +35,7 @@ import kotlinx.serialization.Serializable ...@@ -35,7 +35,7 @@ import kotlinx.serialization.Serializable
import org.koin.core.component.KoinComponent import org.koin.core.component.KoinComponent
import org.koin.core.component.inject import org.koin.core.component.inject
class UpdateEventComponent( class BookingEditorComponent(
componentContext: ComponentContext, componentContext: ComponentContext,
event: EventInfo, event: EventInfo,
val room: String, val room: String,
...@@ -77,7 +77,6 @@ class UpdateEventComponent( ...@@ -77,7 +77,6 @@ class UpdateEventComponent(
childFactory = { config, _ -> config }, childFactory = { config, _ -> config },
) )
init { init {
loadOrganizers() loadOrganizers()
} }
......
package band.effective.office.tablet.feature.main.presentation.updateEvent package band.effective.office.tablet.feature.bookingEditor.presentation
import band.effective.office.tablet.core.domain.model.Organizer import band.effective.office.tablet.core.domain.model.Organizer
import kotlinx.datetime.LocalDateTime import kotlinx.datetime.LocalDateTime
......
package band.effective.office.tablet.feature.main.presentation.updateEvent package band.effective.office.tablet.feature.bookingEditor.presentation
import band.effective.office.tablet.core.domain.model.EventInfo import band.effective.office.tablet.core.domain.model.EventInfo
import band.effective.office.tablet.core.domain.model.Organizer import band.effective.office.tablet.core.domain.model.Organizer
......
package band.effective.office.tablet.feature.main.presentation.datetimepicker package band.effective.office.tablet.feature.bookingEditor.presentation.datetimepicker
import band.effective.office.tablet.core.domain.model.EventInfo import band.effective.office.tablet.core.domain.model.EventInfo
import band.effective.office.tablet.core.domain.useCase.CheckBookingUseCase import band.effective.office.tablet.core.domain.useCase.CheckBookingUseCase
...@@ -8,6 +8,8 @@ import band.effective.office.tablet.core.domain.util.currentLocalDateTime ...@@ -8,6 +8,8 @@ import band.effective.office.tablet.core.domain.util.currentLocalDateTime
import band.effective.office.tablet.core.ui.common.ModalWindow import band.effective.office.tablet.core.ui.common.ModalWindow
import band.effective.office.tablet.core.ui.utils.componentCoroutineScope import band.effective.office.tablet.core.ui.utils.componentCoroutineScope
import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.ComponentContext
import kotlin.time.Duration
import kotlin.time.Duration.Companion.minutes
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.asStateFlow
...@@ -18,7 +20,6 @@ import kotlinx.datetime.LocalDateTime ...@@ -18,7 +20,6 @@ import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.LocalTime import kotlinx.datetime.LocalTime
import org.koin.core.component.KoinComponent import org.koin.core.component.KoinComponent
import org.koin.core.component.inject import org.koin.core.component.inject
import kotlin.time.Duration.Companion.minutes
class DateTimePickerComponent( class DateTimePickerComponent(
private val componentContext: ComponentContext, private val componentContext: ComponentContext,
...@@ -81,8 +82,8 @@ class DateTimePickerComponent( ...@@ -81,8 +82,8 @@ class DateTimePickerComponent(
val currentDate = state.value.currentDate val currentDate = state.value.currentDate
val newDate = LocalDateTime( val newDate = LocalDateTime(
year = currentDate.year, year = currentDate.year,
monthNumber = currentDate.monthNumber, month = currentDate.month.ordinal,
dayOfMonth = currentDate.dayOfMonth, day = currentDate.day,
hour = hour, hour = hour,
minute = minute, minute = minute,
second = 0, second = 0,
...@@ -124,7 +125,7 @@ class DateTimePickerComponent( ...@@ -124,7 +125,7 @@ class DateTimePickerComponent(
data class OnChangeTime(val time: LocalTime) : Intent data class OnChangeTime(val time: LocalTime) : Intent
} }
private fun LocalDateTime.plus(duration: kotlin.time.Duration): LocalDateTime { private fun LocalDateTime.plus(duration: Duration): LocalDateTime {
val instant = this.asInstant val instant = this.asInstant
val newInstant = instant.plus(duration) val newInstant = instant.plus(duration)
return newInstant.asLocalDateTime return newInstant.asLocalDateTime
......
package band.effective.office.tablet.feature.main.presentation.datetimepicker package band.effective.office.tablet.feature.bookingEditor.presentation.datetimepicker
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
...@@ -28,10 +28,9 @@ import band.effective.office.tablet.core.domain.util.toFormattedString ...@@ -28,10 +28,9 @@ import band.effective.office.tablet.core.domain.util.toFormattedString
import band.effective.office.tablet.core.ui.common.CrossButtonView import band.effective.office.tablet.core.ui.common.CrossButtonView
import band.effective.office.tablet.core.ui.theme.LocalCustomColorsPalette import band.effective.office.tablet.core.ui.theme.LocalCustomColorsPalette
import band.effective.office.tablet.core.ui.theme.header8 import band.effective.office.tablet.core.ui.theme.header8
import band.effective.office.tablet.feature.main.Res import band.effective.office.tablet.core.ui.time_booked
import band.effective.office.tablet.feature.main.presentation.datetimepicker.components.DatePickerView import band.effective.office.tablet.feature.bookingEditor.presentation.datetimepicker.components.DatePickerView
import band.effective.office.tablet.feature.main.presentation.datetimepicker.components.TimePickerView import band.effective.office.tablet.feature.bookingEditor.presentation.datetimepicker.components.TimePickerView
import band.effective.office.tablet.feature.main.time_booked
import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalDateTime import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.LocalTime import kotlinx.datetime.LocalTime
...@@ -116,7 +115,7 @@ fun DateTimePickerModalView( ...@@ -116,7 +115,7 @@ fun DateTimePickerModalView(
Text( Text(
text = when (enableDateButton) { text = when (enableDateButton) {
true -> "${currentDate.day} ${currentDate.month.name} ${currentDate.toFormattedString("HH:mm")}" true -> "${currentDate.day} ${currentDate.month.name} ${currentDate.toFormattedString("HH:mm")}"
false -> stringResource(Res.string.time_booked) false -> stringResource(band.effective.office.tablet.core.ui.Res.string.time_booked)
}, },
style = header8, style = header8,
color = LocalCustomColorsPalette.current.primaryTextAndIcon, color = LocalCustomColorsPalette.current.primaryTextAndIcon,
......
package band.effective.office.tablet.feature.main.presentation.datetimepicker.components package band.effective.office.tablet.feature.bookingEditor.presentation.datetimepicker.components
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.material3.DatePickerDefaults import androidx.compose.material3.DatePickerDefaults
......
package band.effective.office.tablet.feature.main.presentation.datetimepicker.components package band.effective.office.tablet.feature.bookingEditor.presentation.datetimepicker.components
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.TimePickerLayoutType import androidx.compose.material3.TimePickerLayoutType
......
package band.effective.office.tablet.feature.main.domain.mapper package band.effective.office.tablet.feature.bookingEditor.presentation.mapper
import band.effective.office.tablet.core.domain.model.EventInfo import band.effective.office.tablet.core.domain.model.EventInfo
import band.effective.office.tablet.core.domain.model.Slot import band.effective.office.tablet.core.domain.model.Slot
import band.effective.office.tablet.core.domain.util.asInstant import band.effective.office.tablet.core.domain.util.asInstant
import band.effective.office.tablet.feature.main.presentation.updateEvent.State import band.effective.office.tablet.feature.bookingEditor.presentation.State
class EventInfoMapper { class EventInfoMapper {
......
package band.effective.office.tablet.feature.main.domain.mapper package band.effective.office.tablet.feature.bookingEditor.presentation.mapper
import band.effective.office.tablet.core.domain.model.EventInfo import band.effective.office.tablet.core.domain.model.EventInfo
import band.effective.office.tablet.core.domain.util.asInstant 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.asLocalDateTime
import band.effective.office.tablet.feature.main.presentation.updateEvent.State import band.effective.office.tablet.feature.bookingEditor.presentation.State
import kotlin.time.Duration.Companion.minutes import kotlin.time.Duration.Companion.minutes
class UpdateEventComponentStateToEventInfoMapper { class UpdateEventComponentStateToEventInfoMapper {
......
...@@ -2,6 +2,14 @@ plugins { ...@@ -2,6 +2,14 @@ plugins {
id("band.effective.office.client.kmp.feature") id("band.effective.office.client.kmp.feature")
} }
kotlin {
sourceSets {
commonMain.dependencies {
implementation(project(":clients:tablet:feature:bookingEditor"))
}
}
}
compose.resources { compose.resources {
publicResClass = false publicResClass = false
packageOfResClass = "band.effective.office.tablet.feature.main" packageOfResClass = "band.effective.office.tablet.feature.main"
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
<string name="free_select_room">Освободить переговорку?</string> <string name="free_select_room">Освободить переговорку?</string>
<string name="try_again">Попробовать ещё раз</string> <string name="try_again">Попробовать ещё раз</string>
<string name="free_select_room_button">Освободить</string> <string name="free_select_room_button">Освободить</string>
<string name="booking_time_button">Занять c %1$s до %2$s</string>
<string name="booking_time">с %1$s до %2$s</string> <string name="booking_time">с %1$s до %2$s</string>
<string name="title_booking_dialog">Занять %2$s?</string> <string name="title_booking_dialog">Занять %2$s?</string>
<string name="whenEvent">Когда</string> <string name="whenEvent">Когда</string>
...@@ -54,18 +53,6 @@ ...@@ -54,18 +53,6 @@
<string name="organizer">Организатор</string> <string name="organizer">Организатор</string>
<string name="minutes">%1$s мин</string> <string name="minutes">%1$s мин</string>
<string name="hours_minutes">%1$sч %2$sмин</string> <string name="hours_minutes">%1$sч %2$sмин</string>
<string name="date_booking">%1$s, %2$s — %3$s</string>
<string name="success_text">Вы заняли %1$s</string>
<string name="on_main">На главную</string>
<string name="failure_text">Вас кто-то опередил</string>
<string name="select_other_room">Попробуйте занять другую переговорку, либо выберите другое время брони</string>
<string name="booking_view_title">Измененить бронь</string>
<string name="create_view_title">Занять %1$s</string> <string name="create_view_title">Занять %1$s</string>
<string name="update_button">Изменить</string>
<string name="delete_button">Удалить бронь</string>
<string name="time_booked">Это время уже занято</string> <string name="time_booked">Это время уже занято</string>
<string name="booked_until">Забронирована до %1$s</string>
<string name="cancel_book">Отменить бронь</string>
<string name="find_quiet_place">Через %1$s мин освободится %2$s. Пока что попробуйте найти тихое место в офисе</string>
<string name="no_free">Свободных нет</string>
</resources> </resources>
\ No newline at end of file
package band.effective.office.tablet.feature.main.di package band.effective.office.tablet.feature.main.di
import band.effective.office.tablet.feature.main.domain.CreateBookingUseCase
import band.effective.office.tablet.feature.main.domain.DeleteBookingUseCase import band.effective.office.tablet.feature.main.domain.DeleteBookingUseCase
import band.effective.office.tablet.feature.main.domain.FreeUpRoomUseCase 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.GetRoomIndexUseCase
import band.effective.office.tablet.feature.main.domain.GetSlotsByRoomUseCase 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.domain.GetTimeToNextEventUseCase
import band.effective.office.tablet.feature.main.domain.UpdateBookingUseCase
import band.effective.office.tablet.feature.main.domain.mapper.EventInfoMapper
import band.effective.office.tablet.feature.main.domain.mapper.UpdateEventComponentStateToEventInfoMapper
import band.effective.office.tablet.feature.main.presentation.mapper.SlotUiMapper import band.effective.office.tablet.feature.main.presentation.mapper.SlotUiMapper
import org.koin.dsl.module import org.koin.dsl.module
...@@ -17,11 +13,6 @@ val mainScreenModule = module { ...@@ -17,11 +13,6 @@ val mainScreenModule = module {
single { GetTimeToNextEventUseCase() } single { GetTimeToNextEventUseCase() }
single { GetSlotsByRoomUseCase(get()) } single { GetSlotsByRoomUseCase(get()) }
single { FreeUpRoomUseCase(get()) } single { FreeUpRoomUseCase(get()) }
single { CreateBookingUseCase(get()) }
single { DeleteBookingUseCase(get()) } single { DeleteBookingUseCase(get()) }
single { UpdateBookingUseCase(get()) }
single { SlotUiMapper() } single { SlotUiMapper() }
single { EventInfoMapper() }
single { UpdateEventComponentStateToEventInfoMapper() }
} }
\ No newline at end of file
...@@ -12,7 +12,7 @@ import band.effective.office.tablet.core.domain.util.currentInstant ...@@ -12,7 +12,7 @@ import band.effective.office.tablet.core.domain.util.currentInstant
import band.effective.office.tablet.core.domain.util.currentLocalDateTime import band.effective.office.tablet.core.domain.util.currentLocalDateTime
import band.effective.office.tablet.core.ui.common.ModalWindow import band.effective.office.tablet.core.ui.common.ModalWindow
import band.effective.office.tablet.core.ui.utils.componentCoroutineScope import band.effective.office.tablet.core.ui.utils.componentCoroutineScope
import band.effective.office.tablet.feature.main.domain.CreateBookingUseCase import band.effective.office.tablet.core.domain.useCase.CreateBookingUseCase
import band.effective.office.tablet.feature.main.domain.DeleteBookingUseCase import band.effective.office.tablet.feature.main.domain.DeleteBookingUseCase
import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.ComponentContext
import com.arkivanov.decompose.router.stack.StackNavigation import com.arkivanov.decompose.router.stack.StackNavigation
......
...@@ -29,8 +29,8 @@ import band.effective.office.tablet.core.ui.common.Loader ...@@ -29,8 +29,8 @@ import band.effective.office.tablet.core.ui.common.Loader
import band.effective.office.tablet.core.ui.date.timeFormatter import band.effective.office.tablet.core.ui.date.timeFormatter
import band.effective.office.tablet.core.ui.theme.LocalCustomColorsPalette import band.effective.office.tablet.core.ui.theme.LocalCustomColorsPalette
import band.effective.office.tablet.core.ui.theme.h2 import band.effective.office.tablet.core.ui.theme.h2
import band.effective.office.tablet.feature.main.presentation.common.FailureFastSelectRoomView import band.effective.office.tablet.core.ui.common.FailureFastSelectRoomView
import band.effective.office.tablet.feature.main.presentation.common.SuccessFastSelectRoomView import band.effective.office.tablet.core.ui.common.SuccessFastSelectRoomView
import com.arkivanov.decompose.extensions.compose.stack.Children import com.arkivanov.decompose.extensions.compose.stack.Children
@Composable @Composable
...@@ -73,7 +73,7 @@ fun FastEventView(component: FastEventComponent) { ...@@ -73,7 +73,7 @@ fun FastEventView(component: FastEventComponent) {
is FastEventComponent.ModalConfig.SuccessModal -> SuccessFastSelectRoomView( is FastEventComponent.ModalConfig.SuccessModal -> SuccessFastSelectRoomView(
roomName = modalInstance.room, roomName = modalInstance.room,
eventInfo = modalInstance.eventInfo, finishTime = modalInstance.eventInfo.finishTime,
close = { component.sendIntent(Intent.OnCloseWindowRequest) }, close = { component.sendIntent(Intent.OnCloseWindowRequest) },
onFreeRoomRequest = { component.sendIntent(Intent.OnFreeSelectRequest(it)) }, onFreeRoomRequest = { component.sendIntent(Intent.OnFreeSelectRequest(it)) },
isLoading = state.isLoad isLoading = state.isLoad
......
...@@ -23,7 +23,7 @@ import band.effective.office.tablet.feature.main.presentation.freeuproom.FreeSel ...@@ -23,7 +23,7 @@ import band.effective.office.tablet.feature.main.presentation.freeuproom.FreeSel
import band.effective.office.tablet.feature.main.presentation.main.navigation.ModalWindowsConfig 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.SlotComponent
import band.effective.office.tablet.feature.main.presentation.slot.SlotIntent import band.effective.office.tablet.feature.main.presentation.slot.SlotIntent
import band.effective.office.tablet.feature.main.presentation.updateEvent.UpdateEventComponent import band.effective.office.tablet.feature.bookingEditor.presentation.BookingEditorComponent
import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.ComponentContext
import com.arkivanov.decompose.router.slot.SlotNavigation import com.arkivanov.decompose.router.slot.SlotNavigation
import com.arkivanov.decompose.router.slot.activate import com.arkivanov.decompose.router.slot.activate
...@@ -205,7 +205,7 @@ class MainComponent( ...@@ -205,7 +205,7 @@ class MainComponent(
onCloseRequest = navigation::dismiss, onCloseRequest = navigation::dismiss,
) )
is ModalWindowsConfig.UpdateEvent -> UpdateEventComponent( is ModalWindowsConfig.UpdateEvent -> BookingEditorComponent(
componentContext = componentContext, componentContext = componentContext,
event = modalWindows.event, event = modalWindows.event,
room = state.value.run { roomList[indexSelectRoom].name }, room = state.value.run { roomList[indexSelectRoom].name },
......
...@@ -18,8 +18,8 @@ import band.effective.office.tablet.feature.main.presentation.fastevent.FastEven ...@@ -18,8 +18,8 @@ import band.effective.office.tablet.feature.main.presentation.fastevent.FastEven
import band.effective.office.tablet.feature.main.presentation.fastevent.FastEventView import band.effective.office.tablet.feature.main.presentation.fastevent.FastEventView
import band.effective.office.tablet.feature.main.presentation.freeuproom.FreeSelectRoomComponent import band.effective.office.tablet.feature.main.presentation.freeuproom.FreeSelectRoomComponent
import band.effective.office.tablet.feature.main.presentation.freeuproom.FreeSelectRoomView import band.effective.office.tablet.feature.main.presentation.freeuproom.FreeSelectRoomView
import band.effective.office.tablet.feature.main.presentation.updateEvent.UpdateEventComponent import band.effective.office.tablet.feature.bookingEditor.presentation.BookingEditorComponent
import band.effective.office.tablet.feature.main.presentation.updateEvent.UpdateEventView import band.effective.office.tablet.feature.bookingEditor.presentation.BookingEditor
import com.arkivanov.decompose.extensions.compose.subscribeAsState import com.arkivanov.decompose.extensions.compose.subscribeAsState
import kotlin.time.ExperimentalTime import kotlin.time.ExperimentalTime
...@@ -72,7 +72,7 @@ fun MainScreen(component: MainComponent) { ...@@ -72,7 +72,7 @@ fun MainScreen(component: MainComponent) {
) { ) {
when (val activeComponent = activeWindowSlot.child?.instance) { when (val activeComponent = activeWindowSlot.child?.instance) {
is FreeSelectRoomComponent -> FreeSelectRoomView(freeSelectRoomComponent = activeComponent) is FreeSelectRoomComponent -> FreeSelectRoomView(freeSelectRoomComponent = activeComponent)
is UpdateEventComponent -> UpdateEventView(component = activeComponent) is BookingEditorComponent -> BookingEditor(component = activeComponent)
is FastEventComponent -> FastEventView(component = activeComponent) is FastEventComponent -> FastEventView(component = activeComponent)
} }
} }
......
...@@ -46,4 +46,5 @@ include( ...@@ -46,4 +46,5 @@ include(
"clients:tablet:core:data", "clients:tablet:core:data",
"clients:tablet:feature:main", "clients:tablet:feature:main",
"clients:tablet:feature:settings", "clients:tablet:feature:settings",
"clients:tablet:feature:bookingEditor",
) )
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать