Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Teacher]Create Out Feature #186

Merged
merged 53 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
0929fb5
feat: Create Outing Module
wnsgur1 Sep 16, 2024
6a327ab
feat: Outing Screen
wnsgur1 Sep 16, 2024
229a129
feat: Create Outing Navigation
wnsgur1 Sep 16, 2024
00183ad
chore: ReName
wnsgur1 Sep 16, 2024
9fc8206
feat: Create Out ViewModel
wnsgur1 Sep 16, 2024
c102737
feat: Create Pending Box
wnsgur1 Sep 16, 2024
79d514d
feat: Create Member List
wnsgur1 Sep 16, 2024
af2ca87
feat: Create Member Filter
wnsgur1 Sep 16, 2024
40d81c0
feat: Create Remaining Time
wnsgur1 Sep 16, 2024
47cd566
chore: Edit Remaining Time
wnsgur1 Sep 16, 2024
e26cdac
chore: Get All OutSleeping
wnsgur1 Sep 16, 2024
c382d5f
feat: Create Loading
wnsgur1 Sep 16, 2024
89d8a43
chore: Edit Loading
wnsgur1 Sep 16, 2024
520de23
feat: Create Approve Module
wnsgur1 Sep 16, 2024
1183291
feat: Create Navigation
wnsgur1 Sep 16, 2024
9d929f9
feat: Create Screen
wnsgur1 Sep 16, 2024
6620580
feat: Create View Model
wnsgur1 Sep 16, 2024
c4148d9
remove: Pending Cnt
wnsgur1 Sep 16, 2024
8dbd8b0
feat: Get Pending Member
wnsgur1 Sep 16, 2024
fff7ab2
feat: Create Bottom Sheet
wnsgur1 Sep 16, 2024
96aa9b6
feat: Create Allow Reject
wnsgur1 Sep 16, 2024
8696fb6
feat: Link Navigation
wnsgur1 Sep 16, 2024
0b9396e
chore: Edit Spacer
wnsgur1 Sep 16, 2024
70595cf
style: Apply Spotless Format
wnsgur1 Sep 17, 2024
6f8efd0
feat: Edit Bottom Sheet Shape
wnsgur1 Sep 17, 2024
3a78bed
style: Apply Spotless Format
wnsgur1 Sep 17, 2024
0e0cb3e
Merge branch 'develop' into feature/t/184-create-out-feature
wnsgur1 Sep 17, 2024
6c55c66
style: Apply Spotless Format
wnsgur1 Sep 17, 2024
b6fd682
fix: Conflict
wnsgur1 Sep 17, 2024
da1707a
style: Apply Spotless Format
wnsgur1 Sep 17, 2024
0ca6cee
feat: Navigate Block
wnsgur1 Sep 17, 2024
3a7739f
remove: Overlap Implementation
wnsgur1 Sep 17, 2024
4b3d656
feat: Edit Member Filter
wnsgur1 Sep 17, 2024
7a9caa6
feat: Add Bottom Padding
wnsgur1 Sep 17, 2024
37d2f13
chore: ReName Package
wnsgur1 Sep 17, 2024
1f6a31a
fix: Etc
wnsgur1 Sep 17, 2024
675c7fe
chore: Edit Package Name
wnsgur1 Sep 17, 2024
f702047
style: Apply Spotless Format
wnsgur1 Sep 17, 2024
5cb86d5
feat: Function Integration
wnsgur1 Sep 17, 2024
1820325
style: Apply Spotless Format
wnsgur1 Sep 17, 2024
e86b696
chore: Edit Package
wnsgur1 Sep 17, 2024
1ff52aa
remove: Function
wnsgur1 Sep 17, 2024
93266df
feat: List Padding
wnsgur1 Sep 17, 2024
5dd633f
chore: Edit Navigate
wnsgur1 Sep 17, 2024
3643d8d
chore: Edit Time Filter
wnsgur1 Sep 17, 2024
0a47af6
style: Apply Spotless Format
wnsgur1 Sep 17, 2024
574645d
feat: Create Navigate Size Padding
wnsgur1 Sep 19, 2024
d040491
chore: Edit Time Text Color
wnsgur1 Sep 19, 2024
9e93341
chore: Edit Bottom Padding
wnsgur1 Sep 19, 2024
ec6e81f
style: Apply Spotless Format
wnsgur1 Sep 19, 2024
c1ed804
Merge branch 'develop' into feature/t/184-create-out-feature
wnsgur1 Sep 19, 2024
0cddc05
fix: Conflict
wnsgur1 Sep 19, 2024
c9cfe32
style: Apply Spotless Format
wnsgur1 Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ interface OutingRepository {

fun getSleepovers(date: LocalDate): Flow<Result<ImmutableList<Outing>>>

fun getAllSleepovers(date: LocalDate): Flow<Result<ImmutableList<Outing>>>

fun askSleepover(reason: String, startAt: LocalDate, endAt: LocalDate): Flow<Result<Unit>>

fun deleteOuting(id: Long): Flow<Result<Unit>>

fun deleteSleepover(id: Long): Flow<Result<Unit>>

fun allowSleepover(id: Long): Flow<Result<Unit>>

fun allowGoing(id: Long): Flow<Result<Unit>>

fun rejectSleepover(id: Long): Flow<Result<Unit>>

fun rejectGoing(id: Long): Flow<Result<Unit>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ internal class OutingRepositoryImpl(
}.asResult().flowOn(dispatcher)
}

override fun getAllSleepovers(date: LocalDate): Flow<Result<ImmutableList<Outing>>> {
return flow {
emit(network.getAllSleepovers(date).map { it.toModel() }.toImmutableList())
}.asResult().flowOn(dispatcher)
}

override fun askSleepover(reason: String, startAt: LocalDate, endAt: LocalDate): Flow<Result<Unit>> {
return flow {
emit(network.askSleepover(reason, startAt, endAt))
Expand All @@ -70,4 +76,26 @@ internal class OutingRepositoryImpl(
emit(network.deleteSleepover(id))
}.asResult().flowOn(dispatcher)
}

override fun allowSleepover(id: Long): Flow<Result<Unit>> {
return flow {
emit(network.allowSleepover(id))
}.asResult().flowOn(dispatcher)
}
override fun allowGoing(id: Long): Flow<Result<Unit>> {
return flow {
emit(network.allowGoing(id))
}.asResult().flowOn(dispatcher)
}

override fun rejectSleepover(id: Long): Flow<Result<Unit>> {
return flow {
emit(network.rejectSleepover(id))
}.asResult().flowOn(dispatcher)
}
override fun rejectGoing(id: Long): Flow<Result<Unit>> {
return flow {
emit(network.rejectGoing(id))
}.asResult().flowOn(dispatcher)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.b1nd.dodam.network.outing.di.outingDataSourceModule
import com.b1nd.dodam.network.point.di.pointDataSourceModule
import com.b1nd.dodam.network.schedule.di.scheduleDatasourceModule
import com.b1nd.dodam.nightstudy.di.nightStudyViewModelModule
import com.b1nd.dodam.outing.di.outingViewModelModule
import com.b1nd.dodam.register.di.registerDataSourceModule
import com.b1nd.dodam.register.di.registerRepositoryModule
import com.b1nd.dodam.register.di.registerViewModelModule
Expand Down Expand Up @@ -90,6 +91,7 @@ class DodamApplication : Application() {
registerViewModelModule,
settingViewModelModule,
nightStudyViewModelModule,
outingViewModelModule,
) + mainViewModelModules,
)
}
Expand Down
2 changes: 2 additions & 0 deletions dodam-teacher-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ kotlin {
implementation(projects.network.nightStudy)
implementation(projects.featureTeacher.home)
implementation(projects.feature.meal)
implementation(projects.featureTeacher.outing)
implementation(projects.featureTeacher.approveOuting)
implementation(projects.featureTeacher.point)

implementation(projects.data.login)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import coil3.memory.MemoryCache
import coil3.network.ktor.KtorNetworkFetcherFactory
import coil3.request.crossfade
import coil3.util.DebugLogger
import com.b1nd.dodam.approve.approveOutingScreen
import com.b1nd.dodam.approve.navigateToApproveOuting
import com.b1nd.dodam.designsystem.DodamTheme
import com.b1nd.dodam.designsystem.component.DodamNavigationBar
import com.b1nd.dodam.designsystem.component.DodamNavigationBarItem
Expand All @@ -54,6 +56,9 @@ import com.b1nd.dodam.nightstudy.navigation.nightStudyScreen
import com.b1nd.dodam.onboarding.navigation.ONBOARDING_ROUTE
import com.b1nd.dodam.onboarding.navigation.navigateToOnboarding
import com.b1nd.dodam.onboarding.navigation.onboardingScreen
import com.b1nd.dodam.outing.navigation.OUTING_ROUTE
import com.b1nd.dodam.outing.navigation.navigateToOuting
import com.b1nd.dodam.outing.navigation.outingScreen
import com.b1nd.dodam.point.navigation.pointScreen
import com.b1nd.dodam.register.navigation.authScreen
import com.b1nd.dodam.register.navigation.infoScreen
Expand Down Expand Up @@ -165,7 +170,17 @@ fun DodamTeacherApp(viewModel: DodamTeacherAppViewModel = koinViewModel()) {
},
)
},
navigateToOuting = {},
navigateToOuting = {
navHostController.navigateToOuting(
navOptions = navOptions {
popUpTo(navHostController.graph.findStartDestination().route.toString()) {
saveState = true
}
launchSingleTop = true
restoreState = true
},
)
},
navigateToNightStudy = {
navHostController.navigateToNightStudy(
navOptions = navOptions {
Expand All @@ -185,6 +200,13 @@ fun DodamTeacherApp(viewModel: DodamTeacherAppViewModel = koinViewModel()) {
showSnackbar = showSnackbar,
popBackStack = navHostController::popBackStack,
)
mealScreen()
outingScreen(
navHostController::navigateToApproveOuting,
)
approveOutingScreen(
onBackClick = navHostController::popBackStack,
)
}

// Bottom Navigation
Expand Down Expand Up @@ -220,7 +242,7 @@ fun DodamTeacherApp(viewModel: DodamTeacherAppViewModel = koinViewModel()) {
private fun DodamTeacherBottomNavigation(modifier: Modifier = Modifier, backStackEntry: NavBackStackEntry?, onClick: (destination: String) -> Unit) {
val route = backStackEntry?.destination?.route

if (route != null && route in listOf(HOME_ROUTE, MEAL_ROUTE, NIGHT_STUDY_ROUTE)) {
if (route != null && route in listOf(HOME_ROUTE, MEAL_ROUTE, NIGHT_STUDY_ROUTE, OUTING_ROUTE)) {
DodamNavigationBar(
modifier = modifier,
items = persistentListOf(
Expand All @@ -241,9 +263,11 @@ private fun DodamTeacherBottomNavigation(modifier: Modifier = Modifier, backStac
enable = route != MEAL_ROUTE,
),
DodamNavigationBarItem(
selected = route == "",
selected = route == OUTING_ROUTE,
icon = DodamIcons.DoorOpen,
onClick = {},
onClick = {
onClick(OUTING_ROUTE)
},
wnsgur1 marked this conversation as resolved.
Show resolved Hide resolved
),
DodamNavigationBarItem(
selected = route == NIGHT_STUDY_ROUTE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.b1nd.dodam.teacher

import com.b1nd.dodam.approve.approveOutingViewModelModule
import com.b1nd.dodam.common.network.di.coroutineScopeModule
import com.b1nd.dodam.common.network.di.dispatchersModule
import com.b1nd.dodam.data.banner.di.bannerRepositoryModule
Expand All @@ -24,6 +25,7 @@ import com.b1nd.dodam.network.outing.di.outingDataSourceModule
import com.b1nd.dodam.network.point.di.pointDataSourceModule
import com.b1nd.dodam.network.schedule.di.scheduleDatasourceModule
import com.b1nd.dodam.nightstudy.di.nightStudyViewModelModule
import com.b1nd.dodam.outing.di.outingViewModelModule
import com.b1nd.dodam.point.di.pointViewModelModule
import com.b1nd.dodam.register.di.registerDataSourceModule
import com.b1nd.dodam.register.di.registerRepositoryModule
Expand Down Expand Up @@ -64,6 +66,8 @@ fun initKoin(block: KoinApplication.() -> Unit = {}) {
pointViewModelModule,
pointRepositoryModule,
pointDataSourceModule,
outingViewModelModule,
approveOutingViewModelModule,
)
block()
}
Expand Down
1 change: 1 addition & 0 deletions feature-teacher/approve_outing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
64 changes: 64 additions & 0 deletions feature-teacher/approve_outing/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import com.b1nd.dodam.dsl.androidLibrary
import com.b1nd.dodam.dsl.setIOS
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.dodam.multiplatform.feature)
alias(libs.plugins.dodam.multiplatform.koin)
alias(libs.plugins.dodam.multiplatform.kotlin.serialization)
}


kotlin{
androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
setIOS(
name = "ApproveOuting",
bundleId = "com.b1nd.dodam.approve_outing"
)

sourceSets{
commonMain.dependencies {
implementation(projects.common)
api(projects.network.core)
implementation(libs.dodam.design.system.cmm)
implementation(projects.ui)
implementation(projects.network.outing)
implementation(projects.data.outing)
}
androidMain.dependencies {
implementation(libs.koin.android)
}
wnsgur1 marked this conversation as resolved.
Show resolved Hide resolved
}
}


androidLibrary {
namespace = "com.b1nd.dodam.approve_outing"
compileSdk = libs.versions.compileSdk.get().toInt()

buildFeatures {
compose = true
}

defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

composeCompiler {
enableStrongSkippingMode = true

reportsDestination = layout.buildDirectory.dir("compose_compiler")
stabilityConfigurationFile = rootProject.layout.projectDirectory.file("stability_config.conf")
}
}


Loading
Loading