Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 156 additions & 51 deletions gov_api/exampleInput.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,161 @@
{
"debug": true,
"userData": {
"firstName": "נעם",
"lastName": "געש",
"id": "123456789",
"email": "[email protected]",
"phone": "0536218158",
"complaintType": "no_stop",
"description": "the bus didn't stop, despite I was in the station and waved really hard :("
},
"databusData": {
"operator": 5,
"loc": [32.090954, 34.822861],
"color": 22,
"bearing": 252,
"recorded_at_time": 1721836808000,
"point": {
"id": 4234669318,
"siri_snapshot_id": 1295402,
"siri_ride_stop_id": 1949443533,
"recorded_at_time": "2024-07-24T16:00:08+00:00",
"lon": 34.822861,
"lat": 32.090954,
"bearing": 252,
"velocity": 22,
"distance_from_journey_start": 8130,
"distance_from_siri_ride_stop_meters": 92,
"siri_snapshot__id": 1295402,
"siri_snapshot__snapshot_id": "2024/07/24/16/00",
"siri_snapshot__etl_status": "loaded",
"siri_snapshot__etl_start_time": "2024-07-24T16:00:50.381498+00:00",
"siri_snapshot__etl_end_time": "2024-07-24T16:01:39.312956+00:00",
"siri_snapshot__error": "",
"siri_snapshot__num_successful_parse_vehicle_locations": 7203,
"siri_snapshot__num_failed_parse_vehicle_locations": 2,
"siri_snapshot__num_added_siri_rides": 323,
"siri_snapshot__num_added_siri_ride_stops": 3002,
"siri_snapshot__num_added_siri_routes": 0,
"siri_snapshot__num_added_siri_stops": 0,
"siri_snapshot__last_heartbeat": "2024-07-24T16:01:22.660122+00:00",
"siri_snapshot__created_by": "siri-etl-6c5955846-dcdxx",
"siri_ride__id": 76618275,
"siri_ride__journey_ref": "2024-07-24-501877",
"siri_ride__scheduled_start_time": "2024-07-24T15:25:00+00:00",
"siri_ride__vehicle_ref": "53109603",
"siri_ride__first_vehicle_location_id": 4234378290,
"siri_ride__last_vehicle_location_id": 4234811079,
"siri_ride__duration_minutes": 60,
"siri_ride__gtfs_ride_id": 81853537,
"siri_route__id": 185,
"siri_route__line_ref": 2544,
"siri_route__operator_ref": 5
"data": {
"contactType": {
"selectContactType": "1",
"isChosenType": true
},
"personalDetails": {
"firstName": "נעם",
"lastName": "געש",
"iDNum": "212121214",
"mobile": "0536218158",
"phone": "",
"contactOptions": "1",
"fax": "",
"email": "[email protected]",
"city": {
"dataCode": -1,
"dataText": ""
},
"street": "",
"houseNumber": "",
"appartment": "",
"postBox": "",
"zipCode": "",
"name": "personalDetails",
"state": "completed",
"next": "",
"prev": "",
"isClosed": true
},
"requestSubject": {
"applySubject": {
"dataCode": "0",
"dataText": "אוטובוס"
},
"applyType": {
"dataCode": "3",
"dataText": "אי עצירה בתחנה"
},
"name": "requestSubject",
"state": "completed",
"next": "",
"prev": "",
"isClosed": true
},
"requestDetails": {
"taxi": {
"taxiType": "2"
},
"busAndOther": {
"ravKav": true,
"ravKavNumber": "",
"reportdate": "",
"reportTime": "",
"addingFrequencyReason": [],
"operator": {
"dataCode": 5,
"dataText": "אגד"
},
"addOrRemoveStation": "2",
"driverName": "",
"licenseNum": "",
"eventDate": "",
"eventHour": "",
"fromHour": "",
"toHour": "",
"fillByMakatOrAddress": "2",
"makatStation": "",
"lineNumberText": "",
"lineNumberFromList": {
"dataText": ""
},
"direction": {
"dataText": ""
},
"raisingStation": {
"dataText": ""
},
"applyContent": "the bus didn't stop, despite I was in the station and waved really hard :(",
"busDirectionFrom": "",
"busDirectionTo": "",
"raisingStationCity": {
"dataText": ""
},
"destinationStationCity": {
"dataText": ""
},
"raisingStationAddress": "",
"cityId": "",
"cityName": "",
"originCityCode": "",
"originCityName": "",
"destinationCityCode": "",
"destinationCityText": "",
"directionCode": "",
"stationName": "",
"lineCode": ""
},
"train": {
"trainType": "1",
"eventDate": "",
"eventHour": "",
"startStation": {
"dataText": ""
},
"destinationStation": {
"dataText": ""
},
"number": "",
"applyContent": ""
},
"requestSubjectCode": "",
"requestTypeCode": "",
"title": "",
"name": "requestDetails",
"state": "notValidated",
"next": "",
"prev": "",
"isClosed": false
},
"documentAttachment": {
"documentsList": [
{
"attacmentName": ""
}
],
"name": "documentAttachment",
"state": "notValidated",
"next": "",
"prev": "",
"isClosed": true
},
"followStatus": {
"contactIdList": [
{
"ticketNumber": ""
}
],
"contactIdResultList": [],
"name": "followStatus",
"state": "notValidated",
"next": "",
"prev": "",
"isClosed": true
},
"containersViewModel": {
"showPrintButton": true,
"isTabsMode": false,
"validatedStatus": true
},
"formInformation": {
"referenceNumber": "",
"stageStatus": "",
"loadingDate": "",
"firstLoadingDate": "",
"isMobile": false,
"language": ""
}
}
}
2 changes: 1 addition & 1 deletion src/controllers/complaints.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function sendComplaint(request, reply) {

if (isDebug) {
request.log.info('Complaint submitted in debug mode');
return reply.status(200).send({ success: true, debug: true, xml });
return reply.status(200).send({ success: true, debug: true, xml, referenceNumber });
}

const response = await axios.post(URL, xml, { headers: { 'Content-Type': 'application/xml' }, timeout: 30000 });
Expand Down
Loading