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

MKMPT-20 Caching mechanism to store data in local DB from API #9

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

pawanmindera
Copy link

JIRA-Ticket

Added SQLDelight to store data

video.webm

@pawanmindera pawanmindera added the enhancement New feature or request label May 23, 2024
@pawanmindera pawanmindera self-assigned this May 23, 2024
@pawanmindera pawanmindera changed the base branch from main to develop May 23, 2024 12:21
build.gradle.kts Outdated
@@ -42,7 +42,7 @@ buildscript {
}
}
dependencies {
classpath(libs.sqldelight.plugin)
// classpath(libs.sqldelight.plugin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we delete this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation(libs.ktor.logging)
implementation(libs.ktor.serialization)
implementation(libs.kotlinx.serialization)
implementation(projects.features.currencyexchange.data.remote.mindera.rest.schema)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting I hope I did it right

import app.cash.sqldelight.db.SqlDriver
import app.cash.sqldelight.driver.native.NativeSqliteDriver
import com.mindera.currencyexchange.database.AppDatabase
//
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -22,7 +22,9 @@ kotlin {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.datetime)
implementation(projects.common.coroutinesKtx)
implementation(projects.common.domain) }
implementation(projects.common.domain)
implementation(projects.features.currencyexchange.data.remote.mindera.rest.schema)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting I hope I did it right

@pawanmindera pawanmindera requested a review from neteinstein June 7, 2024 10:14
Comment on lines 35 to 40
implementation(
projects.features.currencyexchange.data.remote.mindera.rest.schema
)
implementation(
projects.features.currencyexchange.data.remote.mindera.rest.sample
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
implementation(
projects.features.currencyexchange.data.remote.mindera.rest.schema
)
implementation(
projects.features.currencyexchange.data.remote.mindera.rest.sample
)
implementation(projects.features.currencyexchange.data.remote.mindera.rest.schema)
implementation(projects.features.currencyexchange.data.remote.mindera.rest.sample)

Copy link
Author

@pawanmindera pawanmindera Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 79 to 80


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 11 to 17


suspend fun getAllCurrencies(): List<DomainCurrencyExchangeResponseItem>

suspend fun removeAllCurrencies()


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
suspend fun getAllCurrencies(): List<DomainCurrencyExchangeResponseItem>
suspend fun removeAllCurrencies()
suspend fun getAllCurrencies(): List<DomainCurrencyExchangeResponseItem>
suspend fun removeAllCurrencies()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 26 to 28
implementation(
projects.features.currencyexchange.data.remote.mindera.rest.schema
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
implementation(
projects.features.currencyexchange.data.remote.mindera.rest.schema
)
implementation(projects.features.currencyexchange.data.remote.mindera.rest.schema)

Copy link
Author

@pawanmindera pawanmindera Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.gradle.kts Outdated
@@ -42,7 +42,6 @@ buildscript {
}
}
dependencies {
classpath(libs.sqldelight.plugin)
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:11.1.3")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this into the toml file :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation(projects.common.domain) }
implementation(projects.common.domain)
implementation(projects.features.currencyexchange.data.remote.mindera.rest.schema)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong but the indentation seems weird to me 😅 seems like the curly bracket is not aligned with the dependencies

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's aliged. Please check the image

Screenshot 2024-06-07 at 4 48 40 PM

suspend fun getCurrencyExchange(endpoint: String): List<DomainCurrencyExchangeResponseItem>

fun insertCurrency(currency: CurrencyExchangeResponseItem)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👾 😅

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pawanmindera pawanmindera requested a review from djrsousa June 7, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants