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

Hae Nekku asiakastiedot tietokantaan #6453

Merged
merged 19 commits into from
Mar 5, 2025
Merged

Hae Nekku asiakastiedot tietokantaan #6453

merged 19 commits into from
Mar 5, 2025

Conversation

tahtee
Copy link
Collaborator

@tahtee tahtee commented Feb 28, 2025

Hae Nekku asiakastiedot tietokantaan

@tahtee tahtee added the enhancement Uusi toiminnallisuus tai parannus label Feb 28, 2025
@tahtee tahtee marked this pull request as ready for review February 28, 2025 14:03
${bind{it.unit_size}}
)
ON CONFLICT (number) DO UPDATE SET
name = excluded.name
Copy link
Contributor

@Wnt Wnt Mar 3, 2025

Choose a reason for hiding this comment

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

Tässä ON CONFLICT puolella tulisi varmaan päivittää nimen lisäksi myös customer_group ja unit_size. Muuten synkronointi ei koskaan päivitä olemassaoleville numbereille näitä tietoja.

class NekkuHttpClient(private val env: NekkuEnv, private val jsonMapper: JsonMapper) : NekkuClient {
val client = OkHttpClient()

override fun getCustomers(): List<NekkuCustomer> = request(env, "customers")
Copy link
Contributor

Choose a reason for hiding this comment

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

OkHttp:n kanssa ei tarvita erillistä request utility funktiota, vaan sillä on siistimpää tehdä request suoraan getCustomers funktiossa:

Suggested change
override fun getCustomers(): List<NekkuCustomer> = request(env, "customers")
override fun getCustomers(): List<NekkuCustomer> {
val fullUrl = env.url.resolve("customers").toString()
val request =
//... loput request funktiosta

val nulledCustomersCount =
tx.resetNekkuCustomerNumbersNotContainedWithin(customersFromNekku)
if (nulledCustomersCount != 0)
warner(
Copy link
Contributor

Choose a reason for hiding this comment

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

Erillistä warner parametria ei tarvita. Voit käyttää suoraan logger.warn(.... Jamix intagraation synkronaatio koodissa tuo erillinen warner oli tarpeen, jotta voitiin testeissä tarkistaa, että logille tulee tarpeeksi suurella levelillä viesti jos käytössäolevia diettejä poistuu. Myöhemmin sinne lisättiin myös varoitussähköpostin lähetys jos näin tapahtuu.

@tahtee tahtee force-pushed the Nekku_meal_integration branch from 924f83c to 3b887f3 Compare March 3, 2025 13:21
<div className="bold">
{i18n.unit.groups.updateModal.jamixTitle}
</div>
<InputField
Copy link
Contributor

Choose a reason for hiding this comment

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

Pitäisikö tässä käyttää data.jamixCustomerNumber sijaan ryhmän tiedoista nekku_customer_number? Ja muuttaa input tyypiksi ComboBox jossa olisi kannasta haettu nekku_customer-taulusta vaihtoedot?

tx.resetNekkuCustomerNumbersNotContainedWithin(customersFromNekku)
if (nulledCustomersCount != 0)
logger.warn {
"Nekku custoner list update caused $nulledCustomersCount customer numbers to be set to null"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Nekku custoner list update caused $nulledCustomersCount customer numbers to be set to null"
"Nekku customer list update caused $nulledCustomersCount customer numbers to be set to null"

tahtee added 16 commits March 5, 2025 09:14
# Conflicts:
#	service/src/main/kotlin/fi/espoo/evaka/EvakaEnv.kt
#	service/src/main/kotlin/fi/espoo/evaka/shared/config/EnvConfig.kt

# Conflicts:
#	frontend/src/employee-frontend/components/unit/tab-groups/groups/group/GroupUpdateModal.tsx
#	frontend/src/lib-customizations/defaults/employee/i18n/fi.tsx

# Conflicts:
#	service/src/main/kotlin/fi/espoo/evaka/EvakaEnv.kt
#	service/src/main/kotlin/fi/espoo/evaka/shared/config/EnvConfig.kt
# Conflicts:
#	service/src/main/resources/migrations.txt
@tahtee tahtee force-pushed the Nekku_meal_integration branch from ef781d9 to 05b65e2 Compare March 5, 2025 07:17
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows

private val logger = KotlinLogging.logger {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Käyttämätön muuttuja

Suggested change
private val logger = KotlinLogging.logger {}

@tahtee tahtee merged commit 8c2eab3 into master Mar 5, 2025
28 checks passed
@tahtee tahtee deleted the Nekku_meal_integration branch March 5, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Uusi toiminnallisuus tai parannus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants