Skip to content

Commit

Permalink
Näytetään hakemuksen muokkaajan nimi hakemusnäkymässä
Browse files Browse the repository at this point in the history
  • Loading branch information
kechpaja-at-gofore committed Dec 13, 2024
1 parent dec5d7f commit f368a22
Show file tree
Hide file tree
Showing 24 changed files with 251 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default React.memo(function BasicsSection({
}: BasicsSectionProps) {
const t = useTranslation()

const created = application.createdDate?.toLocalDate()
const modified = application.modifiedDate?.toLocalDate()
const created = application.createdAt?.toLocalDate()
const modified = application.modifiedAt?.toLocalDate()

return (
<div>
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/e2e-test/dev-api/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2950,11 +2950,12 @@ export const applicationFixture = (
status,
transferApplication,
allowOtherGuardianAccess: true,
createdDate: null,
createdAt: HelsinkiDateTime.now(),
createdBy: systemInternalUser.id,
modifiedAt: HelsinkiDateTime.now(),
modifiedBy: systemInternalUser.id,
dueDate: null,
modifiedDate: null,
sentDate: null,
formModified: HelsinkiDateTime.now()
sentDate: null
})

const feeThresholds = {
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/e2e-test/generated/api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,15 @@ export interface DevApplicationWithForm {
checkedByAdmin: boolean
childId: PersonId
confidential: boolean | null
createdDate: HelsinkiDateTime | null
createdAt: HelsinkiDateTime
createdBy: EvakaUserId
dueDate: LocalDate | null
form: ApplicationForm
formModified: HelsinkiDateTime
guardianId: PersonId
hideFromGuardian: boolean
id: ApplicationId
modifiedDate: HelsinkiDateTime | null
modifiedAt: HelsinkiDateTime
modifiedBy: EvakaUserId
origin: ApplicationOrigin
otherGuardians: PersonId[]
sentDate: LocalDate | null
Expand Down Expand Up @@ -1180,11 +1181,10 @@ export function deserializeJsonDevAbsence(json: JsonOf<DevAbsence>): DevAbsence
export function deserializeJsonDevApplicationWithForm(json: JsonOf<DevApplicationWithForm>): DevApplicationWithForm {
return {
...json,
createdDate: (json.createdDate != null) ? HelsinkiDateTime.parseIso(json.createdDate) : null,
createdAt: HelsinkiDateTime.parseIso(json.createdAt),
dueDate: (json.dueDate != null) ? LocalDate.parseIso(json.dueDate) : null,
form: deserializeJsonApplicationForm(json.form),
formModified: HelsinkiDateTime.parseIso(json.formModified),
modifiedDate: (json.modifiedDate != null) ? HelsinkiDateTime.parseIso(json.modifiedDate) : null,
modifiedAt: HelsinkiDateTime.parseIso(json.modifiedAt),
sentDate: (json.sentDate != null) ? LocalDate.parseIso(json.sentDate) : null
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export default React.memo(function ApplicationStatusSection({

<Label>{i18n.application.state.modified}</Label>
<span data-qa="application-modified-date">
{application.modifiedDate?.format() ?? ''}
{application.modifiedAt?.format() ?? ''}
</span>

<Label>{i18n.application.state.modifiedBy}</Label>
<span data-qa="application-modified-by-name">
{application.modifiedBy?.name ?? ''}
</span>

<Label inputRow={!!dueDateEditor}>{i18n.application.state.due}</Label>
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/lib-common/generated/api-types/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export interface ApplicationDetails {
childId: PersonId
childRestricted: boolean
confidential: boolean | null
createdDate: HelsinkiDateTime | null
createdAt: HelsinkiDateTime | null
createdBy: EvakaUser | null
dueDate: LocalDate | null
dueDateSetManuallyAt: HelsinkiDateTime | null
form: ApplicationForm
Expand All @@ -132,7 +133,8 @@ export interface ApplicationDetails {
hasOtherGuardian: boolean
hideFromGuardian: boolean
id: ApplicationId
modifiedDate: HelsinkiDateTime | null
modifiedAt: HelsinkiDateTime | null
modifiedBy: EvakaUser | null
origin: ApplicationOrigin
otherGuardianLivesInSameAddress: boolean | null
sentDate: LocalDate | null
Expand Down Expand Up @@ -831,12 +833,12 @@ export function deserializeJsonApplicationDetails(json: JsonOf<ApplicationDetail
return {
...json,
attachments: json.attachments.map(e => deserializeJsonApplicationAttachment(e)),
createdDate: (json.createdDate != null) ? HelsinkiDateTime.parseIso(json.createdDate) : null,
createdAt: (json.createdAt != null) ? HelsinkiDateTime.parseIso(json.createdAt) : null,
dueDate: (json.dueDate != null) ? LocalDate.parseIso(json.dueDate) : null,
dueDateSetManuallyAt: (json.dueDateSetManuallyAt != null) ? HelsinkiDateTime.parseIso(json.dueDateSetManuallyAt) : null,
form: deserializeJsonApplicationForm(json.form),
guardianDateOfDeath: (json.guardianDateOfDeath != null) ? LocalDate.parseIso(json.guardianDateOfDeath) : null,
modifiedDate: (json.modifiedDate != null) ? HelsinkiDateTime.parseIso(json.modifiedDate) : null,
modifiedAt: (json.modifiedAt != null) ? HelsinkiDateTime.parseIso(json.modifiedAt) : null,
sentDate: (json.sentDate != null) ? LocalDate.parseIso(json.sentDate) : null
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ export const fi = {
origin: 'Hakemuksen lähetysmuoto',
sent: 'Saapunut',
modified: 'Muokattu viimeksi',
modifiedBy: 'Muokkaaja',
due: 'Käsiteltävä viimeistään'
},
date: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,10 @@ fun Database.Transaction.insertApplication(
guardianId = guardian.id,
guardianRestricted = false,
guardianDateOfDeath = null,
createdDate = HelsinkiDateTime.now(),
modifiedDate = HelsinkiDateTime.now(),
createdAt = HelsinkiDateTime.now(),
createdBy = testDecisionMaker_1.toEvakaUser(),
modifiedAt = HelsinkiDateTime.now(),
modifiedBy = testDecisionMaker_1.toEvakaUser(),
sentDate = null,
dueDate = null,
dueDateSetManuallyAt = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class GetApplicationIntegrationTests : FullApplicationTest(resetDbBeforeEach = t
db.transaction { tx ->
tx.execute {
sql(
"UPDATE application SET created = '2020-01-01T00:00:00Z' WHERE id = ${bind(old)}"
"UPDATE application SET created_at = '2020-01-01T00:00:00Z' WHERE id = ${bind(old)}"
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class SchemaConventionsTest : PureJdbiTest(resetDbBeforeEach = false) {
fun `creation timestamp should be called 'created_at' instead of 'created'`() {
val permittedViolations =
setOf(
"application",
"application_form",
"application_note",
"application_other_guardian",
Expand Down Expand Up @@ -125,7 +124,6 @@ class SchemaConventionsTest : PureJdbiTest(resetDbBeforeEach = false) {
fun `update timestamp should be called 'updated_at' instead of 'updated'`() {
val permittedViolations =
setOf(
"application",
"application_form",
"application_note",
"application_other_guardian",
Expand Down Expand Up @@ -395,7 +393,6 @@ class SchemaConventionsTest : PureJdbiTest(resetDbBeforeEach = false) {
fun `'created_by' column should be 'uuid' and NOT NULL`() {
val permittedViolations =
setOf(
Column(ColumnRef("application", "created_by"), "uuid", nullable = true),
Column(
ColumnRef("assistance_need_decision", "created_by"),
"uuid",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ScheduledJobsTest : FullApplicationTest(resetDbBeforeEach = true) {
) =
tx.execute {
sql(
"UPDATE application SET created = ${bind(created)} WHERE id = ${bind(applicationId)}"
"UPDATE application SET created_at = ${bind(created)} WHERE id = ${bind(applicationId)}"
)
}

Expand Down
20 changes: 14 additions & 6 deletions service/src/integrationTest/kotlin/fi/espoo/evaka/test/TestData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import fi.espoo.evaka.shared.domain.HelsinkiDateTime
import fi.espoo.evaka.testAdult_1
import fi.espoo.evaka.testChild_1
import fi.espoo.evaka.testDaycare
import fi.espoo.evaka.testDecisionMaker_1
import fi.espoo.evaka.toEvakaUser
import java.time.LocalDate
import java.time.LocalTime
import java.util.UUID
Expand Down Expand Up @@ -50,8 +52,10 @@ private fun applicationDetails(vararg preferredUnits: PreferredUnit, shiftCare:
guardianDateOfDeath = null,
checkedByAdmin = true,
confidential = false,
createdDate = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
modifiedDate = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
createdAt = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
createdBy = testDecisionMaker_1.toEvakaUser(),
modifiedAt = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
modifiedBy = testDecisionMaker_1.toEvakaUser(),
sentDate = LocalDate.of(2021, 1, 15),
dueDate = null,
dueDateSetManuallyAt = null,
Expand Down Expand Up @@ -144,8 +148,10 @@ val validPreschoolApplication =
guardianDateOfDeath = null,
checkedByAdmin = true,
confidential = false,
createdDate = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
modifiedDate = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
createdAt = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
createdBy = testDecisionMaker_1.toEvakaUser(),
modifiedAt = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
modifiedBy = testDecisionMaker_1.toEvakaUser(),
sentDate = LocalDate.of(2021, 1, 15),
dueDate = null,
dueDateSetManuallyAt = null,
Expand Down Expand Up @@ -239,8 +245,10 @@ fun validClubApplication(preferredUnit: DevDaycare, preferredStartDate: LocalDat
guardianDateOfDeath = null,
checkedByAdmin = true,
confidential = false,
createdDate = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
modifiedDate = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
createdAt = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
createdBy = testDecisionMaker_1.toEvakaUser(),
modifiedAt = HelsinkiDateTime.of(LocalDate.of(2021, 8, 15), LocalTime.of(12, 0)),
modifiedBy = testDecisionMaker_1.toEvakaUser(),
sentDate = LocalDate.of(2021, 1, 15),
dueDate = null,
dueDateSetManuallyAt = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ data class ApplicationDetails(
val guardianDateOfDeath: LocalDate?,
val checkedByAdmin: Boolean,
val confidential: Boolean?,
val createdDate: HelsinkiDateTime?,
val modifiedDate: HelsinkiDateTime?,
val createdAt: HelsinkiDateTime?,
val createdBy: EvakaUser?,
val modifiedAt: HelsinkiDateTime?,
val modifiedBy: EvakaUser?,
val sentDate: LocalDate?,
val dueDate: LocalDate?,
val dueDateSetManuallyAt: HelsinkiDateTime?,
Expand Down
Loading

0 comments on commit f368a22

Please sign in to comment.