Skip to content

Accommodation Import Workflow

lukmay edited this page Nov 27, 2023 · 2 revisions
flowchart TD
    subgraph TINlist
    A1(Import Acco TINlist)

    end

    subgraph Over Night Check
    A2(Import Accommodations \n active List LTS) --> B2(Import and update AccoHGVInfo) --> C2(Compare with all Accommodations in DB \n and correct all missind changes)


    end

    subgraph Main Import
    A(Get Acco Changed List) --> B(Load all\nrequisites/mappings\n XML, DB, Calls)
    B --> C(Single import each\nAccommodation)
    C --> D(Assign Mappings,\nCalculate Distance\netc.)
    D --> E{Has\nIndependent\nData}
    E --NO-->F(Check if Grastronomy\nis available DB Call)
    E --Yes-->G(Get Independent\nData and assign it)
    G --> F
    F --> H{Check if more\nLanguage are\needed}
    H --NO--> I{Check if\naccommodation\nis on hgv Booking}
    H --Yes--> J(GET Language Data\nand add to object)
    J --> I
    I --Yes--> K(Import HGV Room Data \n assign mappings \n deactivate rooms)
    I --NO--> L(Import LTS Rooms \n assign mappings and deactivate)
    K --> L
    L --> M(Save Data)
    M --> N(Create Reduced Data)
    N --> O(Compare Objects)
    O --> P(Send push to publisher)
    P --> Q(GetHotelOverview for each Hotel)

    end
Loading

Accommodation Import Workflow

This document outlines the workflow to import and process accommodations data for a tourism platform. We'll look at how accommodations data is imported, transformed, and eventually pushed to various publishers.

1. Importing Accommodation Features

  • SOAP CALL to GetTin (LTS Interface).
  • Update the database with the result from https://tourism.api.opendatahub.com/v1/AccommodationFeatures.

2. Identifying Changes

  • SOAP CALL to GetHotelChanged with Datetime.now -1 to identify changes from the previous day.
  • This will result in a list of accommodation IDs that have changed.

3. Processing Accommodations

Pre Import Operations:

  • Load all mapping XML files:
    • AccoTypes.xml
    • AccoCategories.xml
    • ...
  • Load additional data from DB:
    • metainfoaccommodation: Ruleset to create metaDesc / metaTitle for IDM.
    • District and Municipality List: Load once and process through the entire import.

Conditions:

  • Start import only when (A0CoC property change) was recorded on the date.

Data Parsing:

  • SOAP Call to GetHotelBaseDataS4(de/it/en).
  • Parse the accommodation details:
    • Map properties using XML lists.
    • Calculate distance.
    • Assign location info from AccoCustomLocation.
    • Create Metadesc + MetaTitle using metainfoaccommodation.

4. Additional Data Retrieval

  • If the badge "Alto Adige per tutti" is assigned:

    • SOAP CALL to GetIndependentData (LTS Interface) and add the result to the accommodation info.
  • Check if there's a related gastronomy entry in the DB for the accommodation and add the result to the accommodation info.

  • If the accommodation supports multiple languages, retrieve details using GetHotelBaseDataS4 with additional languages.

  • During each accommodation import, an additional LTS method, "GetHotelOverview," is called.

    • This method retrieves detailed information about the accommodation, including:
      • Total number of rooms, categorized by type (single, double, triple, etc.).
      • Details about apartments, parking facilities, and camping units.
      • Information on room sizes and various service timings (check-in/out, reception, room service, baggage service).
  • Every night, there is a synchronization process with the HGV Interface.

    • The method used for this process is "getHotelList."
    • Each accommodation is updated with the following information obtained from HGV:
      • Bookability status.
      • Availability date.
      • Starting price.

5. Room Data Integration

HGV Rooms:

  • Make 3 POST requests to MSS getRoomList for languages de/it/en.
  • Parse the JSON response using roomamenities.xml and features.xml.
  • Delete rooms that are no longer present.

LTS Rooms:

  • SOAP Call to GetGroupBaseData.
  • Parse the response to retrieve room data using roomamenities.xml.
  • Integrate room data with the main accommodation object.

6. Final Steps and Publishing

  • Create a reduced dataset whenever data is saved.
  • Compare accommodation details and associated data before and after the update:
    • Accommodation data
    • Room details
    • Image gallery
  • If there are changes and the accommodation is marked for publishing, send a push to idm-marketplace.
  • For inactive accommodations:
    • Import the active accommodations list from LTS.
    • SOAP CALL to GetHotelChanged with a fixed past date (e.g., 1900).
    • Compare the list with the current DB and reimport accommodations that need to be set to inactive.

Finally, generate JSON files such as Acco Booking List and Acco Complete List.

This workflow ensures that the accommodation data on the platform is always up-to-date and consistent with the source data. The usage of SOAP for data retrieval and XML for mappings facilitates the integration and transformation of complex data structures.

Clone this wiki locally