-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
${bind{it.unit_size}} | ||
) | ||
ON CONFLICT (number) DO UPDATE SET | ||
name = excluded.name |
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.
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 number
eille 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") |
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.
OkHttp:n kanssa ei tarvita erillistä request
utility funktiota, vaan sillä on siistimpää tehdä request suoraan getCustomers
funktiossa:
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( |
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.
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.
924f83c
to
3b887f3
Compare
<div className="bold"> | ||
{i18n.unit.groups.updateModal.jamixTitle} | ||
</div> | ||
<InputField |
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.
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" |
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.
"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" |
# 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
ef781d9
to
05b65e2
Compare
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.assertThrows | ||
|
||
private val logger = KotlinLogging.logger {} |
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.
Käyttämätön muuttuja
private val logger = KotlinLogging.logger {} |
Hae Nekku asiakastiedot tietokantaan