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

Merge Feature/40 feature ride to destination #54

Merged
merged 73 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
643c097
remove example client test
TSampley Sep 23, 2024
34c09ee
remove module info
TSampley Sep 23, 2024
9483a2c
Create :feature:ride test koin extensions
TSampley Sep 23, 2024
c0bd4a7
Add setupKoin docs
TSampley Sep 23, 2024
1affa51
remove unsupported unit tests
TSampley Sep 23, 2024
0022a99
Move passenger test to :feature:ride module
TSampley Sep 23, 2024
4555104
Specify annotation targets
TSampley Sep 23, 2024
aa412d2
Add annotation defaults
TSampley Sep 23, 2024
4b5ba88
Create expiration date entity
TSampley Sep 23, 2024
009ced6
Use constants to express range expectations
TSampley Sep 23, 2024
6c7b1e6
Add ExpirationDateTest
TSampley Sep 23, 2024
aa26d78
Add payment selection to ride ui test
TSampley Sep 23, 2024
470e120
Add PaymentMethod
TSampley Sep 23, 2024
0bd8f2c
Add PaymentSelectionView
TSampley Sep 23, 2024
edd4394
Move PassengerDashboardView
TSampley Sep 23, 2024
640018e
Add payment repository
TSampley Sep 23, 2024
c71cc22
Add payment events
TSampley Sep 23, 2024
31ca654
Add payment method state to destination search ui state
TSampley Sep 23, 2024
07d50ed
Bind payment method event callbacks to view model
TSampley Sep 23, 2024
d6111e4
Use state class as content key
TSampley Sep 23, 2024
1950f9e
Move RideViewModel
TSampley Sep 23, 2024
c50a871
Move files from dot-separated package directory
TSampley Sep 23, 2024
2afa8c9
Move remaining files from root to package directory
TSampley Sep 23, 2024
04dace6
Create local payment store
TSampley Sep 23, 2024
3d742f8
Expand actions of payment repository
TSampley Sep 23, 2024
aab60f7
update onSelectPayment to use Result
TSampley Sep 23, 2024
896380b
Add payment data types to ride module
TSampley Sep 23, 2024
55c3562
Change payment method id to uuid-v4
TSampley Sep 23, 2024
18a40f8
Fix invalid expiration date year
TSampley Sep 23, 2024
3cc63d4
Fix missing home route
TSampley Sep 23, 2024
4f09cb4
Fix wrong content description
TSampley Sep 23, 2024
ee1aaf9
Update content description expectations for consistency
TSampley Sep 23, 2024
f0a497b
Fix button expectation
TSampley Sep 23, 2024
910605e
Fix test expectations
TSampley Sep 23, 2024
2377793
Add arrived rider state
TSampley Sep 23, 2024
1c9b33f
Rename RideRequestRepository to reflect generalized purpose
TSampley Sep 23, 2024
ba7ad67
Reorganize test setup
TSampley Sep 23, 2024
9cfc405
Add current trip observable
TSampley Sep 23, 2024
ad46d08
rename service/cache
TSampley Sep 23, 2024
69c0d12
Move test data to test setup
TSampley Sep 23, 2024
b3b7972
Make test payment store accessible with test type
TSampley Sep 23, 2024
1ae5ffe
rename TestPaymentStore
TSampley Sep 23, 2024
000c110
implement fake request ride
TSampley Sep 23, 2024
117f370
Move passenger profile to test setup
TSampley Sep 23, 2024
1f4b413
Add testing event functions
TSampley Sep 23, 2024
f39259b
Finish test script
TSampley Sep 23, 2024
4e6f310
implement test repository functions
TSampley Sep 23, 2024
050f273
Rename RideViewModel.kt as Trip-
TSampley Sep 23, 2024
8fddf73
Watch for accepted trip events
TSampley Sep 23, 2024
ecc1edb
Emit trip events
TSampley Sep 23, 2024
c2346c5
Move MessageInput to :core:ui
TSampley Sep 23, 2024
49cfd78
Review Drive.status forms
TSampley Sep 23, 2024
56c27ac
reformat actions/expectations for clarity
TSampley Sep 23, 2024
55f012a
Add hailing message expectation
TSampley Sep 23, 2024
cf0d56c
Emit event in coroutine scope to ensure emission
TSampley Sep 23, 2024
f6c62e3
Add driver profile content description and message input
TSampley Sep 23, 2024
1a899e7
Send trip request on detail confirmation
TSampley Sep 23, 2024
d3d7562
replace arbitrary delay with smart wait
TSampley Sep 23, 2024
7116d59
Add user readable name to Accommodation
TSampley Sep 23, 2024
426cc36
replace BriefProfileUiState with DriverProfile
TSampley Sep 23, 2024
31d4860
Fix wrong text
TSampley Sep 23, 2024
652491d
Add missing elements from active ride view
TSampley Sep 23, 2024
e7017ce
Add smart wait for button
TSampley Sep 23, 2024
1b25efb
Include profile and ride in each trip event
TSampley Sep 23, 2024
27b7dcb
cover remaining trip events
TSampley Sep 23, 2024
9de9669
Fill completed ride view
TSampley Sep 24, 2024
e3bdfd2
wrap event emissions in coroutines
TSampley Sep 24, 2024
595b6be
add driver profile semantics; remove erroneous text
TSampley Sep 24, 2024
8cb4136
Add cancel/rate view model events and bindings
TSampley Sep 24, 2024
5339eb4
Add smart wait
TSampley Sep 24, 2024
44db348
Fix arrival message
TSampley Sep 24, 2024
b37164c
Add missing done button
TSampley Sep 24, 2024
c3420cc
replace irrelevant waitForIdle with smart wait
TSampley Sep 24, 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
1 change: 0 additions & 1 deletion .github/workflows/main-release-flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
- name: "Build: Assemble and Test entire project"
run: |
./gradlew :app-android:buildRelease
./gradlew testReleaseUnitTest

# - run: ./gradlew generate coverage report, upload test/coverage reports

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ package org.pointyware.xyz.core.common
/**
* Expresses a constraint on the length of a string.
*/
annotation class StringLength(val min: Int, val max: Int)
@Target(AnnotationTarget.PROPERTY)
annotation class StringLength(val min: Int = 0, val max: Int = Int.MAX_VALUE)

/**
* Expresses a constraint on the range of an integer.
*/
annotation class IntRange(val min: Int, val max: Int)
@Target(AnnotationTarget.PROPERTY)
annotation class IntRange(val min: Int = Int.MIN_VALUE, val max: Int = Int.MAX_VALUE)

/**
* Expresses a regular expression constraint on a string.
*/
annotation class Regex(val pattern: String)
@Target(AnnotationTarget.PROPERTY)
annotation class Regex(val pattern: String = "^.*$")
6 changes: 3 additions & 3 deletions core/entities/src/commonMain/kotlin/ride/Accommodation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlinx.serialization.Serializable
* Describes a driver accommodation that can be provided to a rider with a [Disability].
*/
@Serializable
sealed class Accommodation {
data object WheelchairAccess : Accommodation()
data object AnimalFriendly : Accommodation()
sealed class Accommodation(val name: String) { // TODO: replace with resource ID for i18n
data object WheelchairAccess : Accommodation("Wheelchair Access")
data object AnimalFriendly : Accommodation("Animal Friendly")
}
18 changes: 13 additions & 5 deletions core/entities/src/commonMain/kotlin/ride/Ride.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sealed interface Ride {
/**
* The current status of the ride as it progresses through the system.
*/
val status: Status
val status: Status // TODO: remove; redundant

/**
* The time the ride was posted to the system by the rider.
Expand Down Expand Up @@ -110,6 +110,14 @@ sealed interface Ride {
val timeToStart: Instant
): Status, RouteProgress.Unrealized

/**
* The ride has been accepted by a driver for future completion.
* Possible transitions are [Active], [Ended]
*/
data class AcceptedImmediate(
val timeAccepted: Instant
): Status, RouteProgress.Unrealized

/**
* The ride is in progress.
* Possible transitions are [Ended]
Expand Down Expand Up @@ -242,7 +250,7 @@ data class PendingRide(
): Ride {

override val status: Ride.Status
get() = Ride.Status.Immediate
get() = Ride.Status.AcceptedImmediate(timeAccepted)

fun arrive(timeArrived: Instant): ActiveRide {
return ActiveRide(
Expand Down Expand Up @@ -271,7 +279,7 @@ data class ActiveRide(
): Ride {

override val status: Ride.Status
get() = Ride.Status.Active(TODO())
get() = Ride.Status.Active(plannedRoute)

fun start(timeStarted: Instant): CompletingRide {
return CompletingRide(
Expand Down Expand Up @@ -320,7 +328,7 @@ data class CompletingRide(
): Ride {

override val status: Ride.Status
get() = Ride.Status.Active(TODO())
get() = Ride.Status.Active(plannedRoute)

fun complete(timeEnded: Instant): CompletedRide {
return CompletedRide(
Expand Down Expand Up @@ -349,5 +357,5 @@ data class CompletedRide(
override val timeEnded: Instant,
): Ride {
override val status: Ride.Status
get() = Ride.Status.Completed(TODO())
get() = Ride.Status.Completed(plannedRoute)
}
25 changes: 25 additions & 0 deletions core/ui/src/commonMain/kotlin/MessageInput.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2024 Pointyware. Use of this software is governed by the GPL-3.0 license.
*/

package org.pointyware.xyz.core.ui

import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics

/**
*
*/
@Composable
fun MessageInput(
modifier: Modifier = Modifier,
) {
TextField(
value = "",
onValueChange = {},
modifier = modifier.semantics { contentDescription = "Message Input" }
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package org.pointyware.xyz.core.viewmodels
import org.pointyware.xyz.core.entities.ride.Rating
import org.pointyware.xyz.core.entities.data.Uri
import org.pointyware.xyz.core.entities.Uuid
import org.pointyware.xyz.core.entities.profile.Profile

/**
* A brief profile UI state. For more detail see [ProfileUiState].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.pointyware.xyz.core.navigation.XyzNavController
import org.pointyware.xyz.core.ui.AdView
import org.pointyware.xyz.core.ui.AdViewState
import org.pointyware.xyz.core.ui.MapView
import org.pointyware.xyz.core.ui.MessageInput
import org.pointyware.xyz.core.viewmodels.MapUiState
import org.pointyware.xyz.drive.viewmodels.ProviderDashboardViewModel
import org.pointyware.xyz.drive.viewmodels.RideRequestUiState
Expand Down Expand Up @@ -176,17 +177,6 @@ fun DeliveryInfo(
}
}

@Composable
fun MessageInput(
modifier: Modifier = Modifier,
) {
TextField(
value = "",
onValueChange = {},
modifier = modifier.semantics { contentDescription = "Message Input" }
)
}

@Composable
fun TripCompletionView(
onConfirmCompletion: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.pointyware.xyz.core.viewmodels.di.coreViewModelsModule
import org.pointyware.xyz.drive.di.featureDriveModule

/**
* TODO: describe purpose/intent of KoinExt
* Starts koin with the required modules for testing
*/
fun setupKoin() {
startKoin {
Expand Down
Loading