Skip to content

Instantly share code, notes, and snippets.

@valery-lavrik
Created October 31, 2019 13:33
Show Gist options
  • Save valery-lavrik/0c666662f424d0c1ad7abd36ab18da4a to your computer and use it in GitHub Desktop.
Save valery-lavrik/0c666662f424d0c1ad7abd36ab18da4a to your computer and use it in GitHub Desktop.
Новый формат выдачи авиа
{
// напотом
sortFilterHelper: [
0 => { offer_index = 0, baggage_tarrif_index = 0, price_with_baggage = 100, price = 100. duration, time = 10, ...}, // информация из нулевого тарифа
1 => { offer_index = 0, price = 100. duration, time = 10, ...}, // baggage_tarrif_index отсутствует т.к. багажа совсем нет
...
]
offers: [
{
tariffs: [
{
offer_id: "1_0_1",
frs: 0, // индекс
price: 123,
seat_count: "9",
},
{
offer_id: "1_0_1",
frs: 1,
price: 123,
seat_count: "9",
}
],
dirs: [
[0,1,2], // trips
[3,4,5] // trips
],
// подобранные варианты обратный рейсов из других оферов
linked_index: [1,2,3,4] // используя их dir[1] можем подменить
service_class: "E",
start_to_min: 1380,
end_to_min: 870,
start_from_min: 1380,
end_from_min: 870,
duration_minutes: 120,
change_days: 0,
.. возможно еще какие-то данные
},
...
],
trips: [
{
ak: "LH",
oak: null,
airport_code: ["DME", "FRA"],
datetime_iso: ["2019-07-06T00:00:00+03:00", "2019-07-06T00:00:00+03:00"],
flight_number: "LH-1449",
plane_type: "321",
change_airport: false,
change_days: 0,
layover_time_minutes: 45,
stops: [ // или null
{
airport: "IKT"
stop_time: "01:15"
},
airport: "IKT"
stop_time: "01:15"
}
],
},
{...},
{...}
]
farerules: [
// берем старую структуру + source
{
charter: false
charter_block: false
fare_rules: {ADT: [{fare_code: "SBSOVBR",…}, {fare_code: "SBSOVBR/CH25",…}, {fare_code: "NBSOVBR",…},…],…}
is_multi: false
marketing_fare_code: "SBSOVBR"
marketing_tariff_options: {is_baggage: 1, is_cabin: 2, returnable: 1, exchangeable: 0,…}
transit_visa_required: false
source: "svyaznoy_online_v2_tua",
},
...
]
// СЛОВАРИ (как вариант - объединяем все справочники)
dictionaries: {
aircompanies: {},
codes_info: {},
planes: {},
filters: {},
},
// id сессий, наименования источников
search_id: "5d1f49c0d18ed3.19938902",
biletix_sess_id: "onifun0ginpls54g399hh6pqt4",
tickets_sess_id: "5c76e3e9acac5d774739beab6999f63d",
biletix_source_name: "svyaznoy_online_v2", // зачем здесь source, если он имеется в каждом оффере? или перенести в словари
tickets_source_name: "svyaznoy_online_v2_tua",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment