UnionInternationalCheminsdeFer / OSDM

Projects related to an open sales & distribution API for public transportation.
https://osdm.io
Apache License 2.0
63 stars 22 forks source link

Add possibility to search bookings with passange.externalRef as a search parameter #732

Closed Linus-Turnit closed 1 month ago

Linus-Turnit commented 1 month ago

In POST /bookings-search we want to have passenger.externalRef in the request body to make it possible to search for bookings coupled to the externalRef.

Customers with CRM systems can then set passenger.externalRef to a CRM-customerId to make it is possible to find "MyBookings" by the search operation.


{
  "origin": {
    "objectType": "string"
  },
  "destination": {
    "objectType": "string"
  },
  "passenger": {
    "externalRef": "string",                   <== New search parameter
    "firstName": "string",
    "lastName": "string",
    "dateOfBirth": "2024-10-18",
    "phoneNumber": "string",
    "email": "string"
  },
  "purchaser": {
    "externalRef": "string",                   <== New search parameter
    "companyName": "string",
    "companyRef": "string",
    "firstName": "string",
    "lastName": "string",
    "dateOfBirth": "2024-10-18",
    "phoneNumber": "string",
    "email": "string"
  },
  "bookingId": "string",
  "bookingCode": "string",
  "externalRef": "string",
  "fulfillmentId": "string",
  "fulfillmentControlNumber": "string",
  "travelDateRange": {
    "startTime": "2024-10-18T06:38:21.568Z",
    "endDate": "2024-10-18T06:38:21.568Z"
  },
  "purchaseDateRange": {
    "startTime": "2024-10-18T06:38:21.568Z",
    "endDate": "2024-10-18T06:38:21.568Z"
  },
  "parameters": {
    "numberOfResults": 10,
    "status": [
      "PREBOOKED"
    ]
  }
}```
jspetrak commented 1 month ago

@Linus-Turnit this is quite late for 3.4.0 :) you are lucky @schlpbch have not packaged the release yet. I can make the PR.

CGantert345 commented 1 month ago

CRM-customerId is personal data, so you are not allowed to use the CRM-customerId as externalRef.

Linus-Turnit commented 1 month ago

If it is a CRM-customerId or another reference in the CRM-system is up to the client in my opinion.

CGantert345 commented 1 month ago

It is not up to the client. The provider is legally not allowed to store these data.