From bedc6f01f995c3b34d9cc29970e4865e24b44bd1 Mon Sep 17 00:00:00 2001 From: Joosa Kurvinen Date: Thu, 7 Nov 2024 14:38:49 +0200 Subject: [PATCH] remove deprecated post arrival endpoint --- .../generated/api-clients/attendance.ts | 20 --------- .../generated/api-types/attendance.ts | 7 ---- .../attendance/ChildAttendanceController.kt | 42 ------------------- 3 files changed, 69 deletions(-) diff --git a/frontend/src/employee-mobile-frontend/generated/api-clients/attendance.ts b/frontend/src/employee-mobile-frontend/generated/api-clients/attendance.ts index c1f9e9c67e..b1b4c03110 100644 --- a/frontend/src/employee-mobile-frontend/generated/api-clients/attendance.ts +++ b/frontend/src/employee-mobile-frontend/generated/api-clients/attendance.ts @@ -6,7 +6,6 @@ import LocalDate from 'lib-common/local-date' import { AbsenceRangeRequest } from 'lib-common/generated/api-types/attendance' -import { ArrivalRequest } from 'lib-common/generated/api-types/attendance' import { ArrivalsRequest } from 'lib-common/generated/api-types/attendance' import { AttendanceChild } from 'lib-common/generated/api-types/attendance' import { ChildAttendanceStatusResponse } from 'lib-common/generated/api-types/attendance' @@ -151,25 +150,6 @@ export async function postAbsenceRange( } -/** -* Generated from fi.espoo.evaka.attendance.ChildAttendanceController.postArrivalDeprecated -*/ -export async function postArrivalDeprecated( - request: { - unitId: UUID, - childId: UUID, - body: ArrivalRequest - } -): Promise { - const { data: json } = await client.request>({ - url: uri`/employee-mobile/attendances/units/${request.unitId}/children/${request.childId}/arrival`.toString(), - method: 'POST', - data: request.body satisfies JsonCompatible - }) - return json -} - - /** * Generated from fi.espoo.evaka.attendance.ChildAttendanceController.postArrivals */ diff --git a/frontend/src/lib-common/generated/api-types/attendance.ts b/frontend/src/lib-common/generated/api-types/attendance.ts index 9dbab165ab..6198b664e2 100644 --- a/frontend/src/lib-common/generated/api-types/attendance.ts +++ b/frontend/src/lib-common/generated/api-types/attendance.ts @@ -34,13 +34,6 @@ export interface AbsenceRangeRequest { range: FiniteDateRange } -/** -* Generated from fi.espoo.evaka.attendance.ChildAttendanceController.ArrivalRequest -*/ -export interface ArrivalRequest { - arrived: string -} - /** * Generated from fi.espoo.evaka.attendance.ChildAttendanceController.ArrivalsRequest */ diff --git a/service/src/main/kotlin/fi/espoo/evaka/attendance/ChildAttendanceController.kt b/service/src/main/kotlin/fi/espoo/evaka/attendance/ChildAttendanceController.kt index fce7a15993..b8a8f3fd47 100644 --- a/service/src/main/kotlin/fi/espoo/evaka/attendance/ChildAttendanceController.kt +++ b/service/src/main/kotlin/fi/espoo/evaka/attendance/ChildAttendanceController.kt @@ -6,7 +6,6 @@ package fi.espoo.evaka.attendance import fi.espoo.evaka.Audit import fi.espoo.evaka.AuditId -import fi.espoo.evaka.ForceCodeGenType import fi.espoo.evaka.absence.AbsenceCategory import fi.espoo.evaka.absence.AbsenceType import fi.espoo.evaka.absence.AbsenceUpsert @@ -227,47 +226,6 @@ class ChildAttendanceController( } } - data class ArrivalRequest( - @ForceCodeGenType(String::class) @DateTimeFormat(pattern = "HH:mm") val arrived: LocalTime - ) - - @PostMapping("/employee-mobile/attendances/units/{unitId}/children/{childId}/arrival") - fun postArrivalDeprecated( - db: Database, - user: AuthenticatedUser.MobileDevice, - clock: EvakaClock, - @PathVariable unitId: DaycareId, - @PathVariable childId: ChildId, - @RequestBody body: ArrivalRequest, - ) { - db.connect { dbc -> - dbc.transaction { tx -> - accessControl.requirePermissionFor( - tx, - user, - clock, - Action.Unit.UPDATE_CHILD_ATTENDANCES, - unitId, - ) - tx.fetchChildPlacementBasics(childId, unitId, clock.today()) - try { - tx.insertAttendance( - childId = childId, - unitId = unitId, - date = clock.today(), - range = TimeInterval(body.arrived, null), - ) - } catch (e: Exception) { - throw mapPSQLException(e) - } - } - } - Audit.ChildAttendancesArrivalCreate.log( - targetId = AuditId(childId), - objectId = AuditId(unitId), - ) - } - @PostMapping("/employee-mobile/attendances/units/{unitId}/children/{childId}/return-to-coming") fun returnToComing( db: Database,