-
Notifications
You must be signed in to change notification settings - Fork 2
feat(model/event): Implement event repository #23
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
Conversation
Add an event repository and an event data class, to get and add data to the database
74a64c9
to
5eb1e54
Compare
fun getNewUid(): String | ||
|
||
fun addEvent(event: Event, onSuccess: () -> Unit, onFailure: (Exception) -> Unit) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to ask to the coaches about the updateEvent function: is it really necessary to write one in the repository since it is essentially a copy of the addEvent function of the repository or not.
|
||
private fun hydrate(doc: DocumentSnapshot): Event? { | ||
|
||
val event = doc.toObject(Event::class.java) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not know this worked, nice
gradle/libs.versions.toml
Outdated
@@ -145,6 +146,7 @@ play-services-auth = { module = "com.google.android.gms:play-services-auth", ver | |||
play-services-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "playServicesMaps" } | |||
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" } | |||
test-core-ktx = { group = "androidx.test", name = "core-ktx", version.ref = "androidxCoreKtx" } | |||
firebase-common-ktx = { group = "com.google.firebase", name = "firebase-common-ktx", version.ref = "firebaseCommonKtx" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove these dependencies as they are unused
app/build.gradle.kts
Outdated
@@ -171,6 +171,7 @@ dependencies { | |||
implementation(libs.androidx.material3) | |||
implementation(libs.androidx.navigation.compose) | |||
implementation(platform(libs.androidx.compose.bom)) | |||
implementation(libs.firebase.common.ktx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove this dependency as it is unused
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Review
-
Logging in
hydrate()
Function: Thehydrate()
function currently returnsnull
if the conversion fails. It would be beneficial to log the error, as this will make future debugging easier and help identify issues during runtime. -
Description Improvement: The PR description is too brief. Providing more detail would be helpful. One line is not enough to describe the changes and their purpose. Here's an example template for improving descriptions: PR Template Example.
-
Positive Feedback: The code is clean and well-structured. Great job on implementing comprehensive testing for your event repository! The attention to testing is commendable. Keep up the good work!
Add event repository and event data type