From 779c9a8a6e2202004edc56e9c34e82b56c357f16 Mon Sep 17 00:00:00 2001 From: Tommi Leinamo Date: Fri, 8 Dec 2023 09:23:10 +0200 Subject: [PATCH] Add actions for timetables API /to-combine endpoint --- metadata/hsl/actions.graphql | 15 +++++++++++++++ metadata/hsl/actions.yaml | 18 +++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/metadata/hsl/actions.graphql b/metadata/hsl/actions.graphql index 06b42305..b091f873 100644 --- a/metadata/hsl/actions.graphql +++ b/metadata/hsl/actions.graphql @@ -6,6 +6,12 @@ type Mutation { replaceTimetables(arg1: ReplaceTimetablesInput!): ReplaceTimetablesOutput } +type Query { + toCombineTargetVehicleScheduleFrameId( + arg1: ToCombineTargetVehicleScheduleFrameIdInput! + ): ToCombineTargetVehicleScheduleFrameIdOutput +} + type Query { toReplaceVehicleScheduleFrameIds( arg1: ToReplaceVehicleScheduleFrameIdsInput! @@ -22,6 +28,11 @@ input ReplaceTimetablesInput { targetPriority: Int! } +input ToCombineTargetVehicleScheduleFrameIdInput { + stagingVehicleScheduleFrameId: uuid! + targetPriority: Int! +} + input ToReplaceVehicleScheduleFrameIdsInput { stagingVehicleScheduleFrameId: uuid! targetPriority: Int! @@ -35,6 +46,10 @@ type ReplaceTimetablesOutput { replacedVehicleScheduleFrameIds: [uuid]! } +type ToCombineTargetVehicleScheduleFrameIdOutput { + toCombineTargetVehicleScheduleFrameId: uuid! +} + type ToReplaceVehicleScheduleFrameIdsOutput { toReplaceVehicleScheduleFrameIds: [uuid]! } diff --git a/metadata/hsl/actions.yaml b/metadata/hsl/actions.yaml index 5aedc475..1dc866bf 100644 --- a/metadata/hsl/actions.yaml +++ b/metadata/hsl/actions.yaml @@ -23,6 +23,21 @@ actions: query_params: {} template_engine: Kriti version: 2 + - name: toCombineTargetVehicleScheduleFrameId + definition: + kind: "" + handler: http://jore4-timetablesapi:8080/timetables/to-combine + request_transform: + method: GET + query_params: + stagingVehicleScheduleFrameId: "{{$body.input.arg1.stagingVehicleScheduleFrameId}}" + targetPriority: "{{$body.input.arg1.targetPriority}}" + request_headers: + add_headers: {} + remove_headers: + - content-type + template_engine: Kriti + version: 2 - name: toReplaceVehicleScheduleFrameIds definition: kind: "" @@ -43,10 +58,11 @@ custom_types: input_objects: - name: CombineTimetablesInput - name: ReplaceTimetablesInput + - name: ToCombineTargetVehicleScheduleFrameIdInput - name: ToReplaceVehicleScheduleFrameIdsInput objects: - name: CombineTimetablesOutput - name: ReplaceTimetablesOutput + - name: ToCombineTargetVehicleScheduleFrameIdOutput - name: ToReplaceVehicleScheduleFrameIdsOutput - scalars: []