Skip to content

Commit

Permalink
remove deprecated post arrival endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Joosakur committed Nov 7, 2024
1 parent 7886836 commit bedc6f0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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<void> {
const { data: json } = await client.request<JsonOf<void>>({
url: uri`/employee-mobile/attendances/units/${request.unitId}/children/${request.childId}/arrival`.toString(),
method: 'POST',
data: request.body satisfies JsonCompatible<ArrivalRequest>
})
return json
}


/**
* Generated from fi.espoo.evaka.attendance.ChildAttendanceController.postArrivals
*/
Expand Down
7 changes: 0 additions & 7 deletions frontend/src/lib-common/generated/api-types/attendance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit bedc6f0

Please sign in to comment.