Handling Appointment Results

Client applications will be notified of the appointment results through the registered web-hooks with Envase Connect Data. The appointment event will provide the information about the appointment, which has the following structure:

{
    "action": "TRACE_RESULT",
    "orgId": "ENVASE",
    "svcId": "ICTSI-INTEGRATION",
    "type": "APPOINTMENT",
    "payload": {
        "appointmentNumber": "2345",
        "code": "LATE",
        "containerNumber": "",
        "created": "2023-09-12T00:06:39.807Z",
        "updated": "2023-09-12T04:04:23.783Z",
        "cancelled": "2023-09-12T04:04:23.783Z",
        "deliveryOrder": "SUBICTESTENVA",
        "endDate": "2023-09-12T03:59:00.000Z",
        "gateId": "SBITC_GATE",
        "id": "",
        "locationCode": "SBITC",
        "providerId": "ictsi",
        "referenceKey": "ICTSI/PH/SBITC/15261",
        "requestedDate": "2023-09-12T02:00:00.000Z",
        "startDate": "2023-09-12T02:00:00.000Z",
        "company": "SBITC ",
        "companyId": "SBITC",
        "license": "PM162",
        "truck": {
            "id": "test reference",
            "driverLicense": "test license",
            "appointmentNumber": "2345",
            "code": "LATE",
            "company": "SBITC ",
            "companyId": "SBITC",
            "created": "2023-09-12T00:18:45.943Z",
            "endDate": "2023-09-12T03:59:00.000Z",
            "license": "PM162",
            "startDate": "2023-09-12T02:00:00.000Z",
            "updated": "2023-09-12T04:04:23.797Z",
            "cancelled": "2023-09-12T04:04:23.797Z"
        }
    }
}

The root properties orgId and svcId identify the client application and are used by Envase Connect Data to determine which web-hook will be notified. In this case as the event is related to appointment, So OrgId is set to ENVASE and svcId is set to ICTSI-INTEGRATION. The type property will be set to APPOINTMENT. The action will be set to TRACE_RESULT indicating that is a new result for the appointment being traced.