Last active
November 29, 2018 16:08
-
-
Save scepion1d/4283787ad2db70e05dc55e5ea32fc19d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create offer | |
offer = Offer.new( | |
{ | |
"id"=>3454, | |
"order_id"=>9206599, | |
"entries"=>[ | |
{"id"=>5796, "uid"=>2651, "cover"=>{"id"=>896780, "image"=>{"big"=>{"url"=>"https://storage.googleapis.com/iqbanket-media/production/uploads/media/896780/media/big.jpg", "width"=>845, "height"=>500}}, "title"=>nil, "is_vertical"=>false}, "price"=>123, "title"=>"Красивый", "banquet"=>{"id"=>2992, "title"=>"Тестовый", "address"=>"Варварка 14", "contacts"=>[{"id"=>7483, "name"=>"Eduard A", "role"=>"Начальник кислых щей", "email"=>"", "phone"=>"+79634698719", "position"=>1, "for_client"=>true}, {"id"=>1847, "name"=>"Eris", "role"=>"Кислые щи", "email"=>"", "phone"=>"+79634698720", "position"=>2, "for_client"=>true}, {"id"=>2001, "name"=>"Кто-то там второй", "role"=>"Кислые щи", "email"=>"scepion1d.dev@gmail.com", "phone"=>"+79220135341", "position"=>1, "for_client"=>true}]}, "regions"=>[{"id"=>4, "name"=>"ЮВАО"}], "subways"=>[{"id"=>7574, "line"=>"filyovskaya", "name"=>"Александровский сад", "color"=>"#19C1F3", "minutes_to"=>22, "station_id"=>53}], "added_at"=>"2018-11-20 18:52:11", "hall_type"=>{"id"=>1, "title"=>"Ресторан"}, "price_note"=>nil, "updated_at"=>"2018-11-20 18:56:13", "capacity_to"=>123, "capacity_from"=>50, "order_sent_at"=>"2018-11-20 18:56:13"}, | |
{"id"=>3454, "uid"=>600, "cover"=>{"id"=>27344, "image"=>{"big"=>{"url"=>"https://storage.googleapis.com/iqbanket-media/production/uploads/media/27344/media/big.jpg", "width"=>845, "height"=>500}}, "title"=>"", "is_vertical"=>false}, "price"=>4000, "title"=>"Гофер", "banquet"=>{"id"=>1839, "title"=>"Ноев Ковчег", "address"=>"Малый Ивановский переулок, д. 9", "contacts"=>[{"id"=>6444, "name"=>"Олег Александрович", "role"=>"", "email"=>"director@noevkovcheg.ru", "phone"=>"+79104077326", "position"=>2, "for_client"=>nil}, {"id"=>6599, "name"=>"Ирина Викторовна", "role"=>"управляющая, только для С.В.", "email"=>"777@noevkovcheg.ru", "phone"=>"+79169452540", "position"=>3, "for_client"=>false}, {"id"=>6441, "name"=>"Наталья", "role"=>"менеджеры", "email"=>"manager@noevkovcheg.ru", "phone"=>"+74959170717", "position"=>1, "for_client"=>true}, {"id"=>6512, "name"=>"Елена Владимировна", "role"=>"гл. бухгалтер", "email"=>"findept@noevkovcheg.ru", "phone"=>"+79165395433", "position"=>4, "for_client"=>nil}, {"id"=>6442, "name"=>"Ресторан", "role"=>"", "email"=>"", "phone"=>"+74959173108", "position"=>0, "for_client"=>true}, {"id"=>107, "name"=>"Елена, Светлана", "role"=>"кассир", "email"=>nil, "phone"=>nil, "position"=>5, "for_client"=>false}, {"id"=>505, "name"=>"Анастасия", "role"=>"Менеджер по продвижению", "email"=>"pr@noevkovcheg.ru", "phone"=>"+79268472208", "position"=>6, "for_client"=>false}, {"id"=>7396, "name"=>"Марина", "role"=>"пиар!", "email"=>"", "phone"=>"+79037850030", "position"=>7, "for_client"=>nil}]}, "regions"=>[{"id"=>1, "name"=>"ЦАО"}], "subways"=>[{"id"=>7093, "line"=>"tagansko_krasnopresnenskaya", "name"=>"Китай-город", "color"=>"#8E479C", "minutes_to"=>8, "station_id"=>74}], "added_at"=>"2018-11-20 18:55:20", "hall_type"=>{"id"=>10, "title"=>"Банкетный зал"}, "price_note"=>nil, "updated_at"=>"2018-11-20 18:55:20", "capacity_to"=>30, "capacity_from"=>15, "order_sent_at"=>"2018-11-20 18:55:20", "special_prices"=>[{"id"=>232, "note"=>nil, "price"=>4000, "theme"=>{"id"=>4, "name"=>"Корпоратив", "title"=>nil}, "end_date"=>"2017-12-31", "begin_date"=>"2017-12-15", "created_at"=>"2017-10-09T16:23:07.078Z", "weekend_price"=>nil}, {"id"=>233, "note"=>nil, "price"=>3000, "theme"=>{"id"=>10, "name"=>"Поминки", "title"=>""}, "end_date"=>nil, "begin_date"=>nil, "created_at"=>"2017-10-09T16:23:24.645Z", "weekend_price"=>nil}, {"id"=>234, "note"=>nil, "price"=>3500, "theme"=>{"id"=>1, "name"=>"Свадьба", "title"=>nil}, "end_date"=>nil, "begin_date"=>nil, "created_at"=>"2017-10-09T16:23:39.111Z", "weekend_price"=>nil}]}, | |
{"id"=>4444, "uid"=>470, "cover"=>{"id"=>47514, "image"=>{"big"=>{"url"=>"https://storage.googleapis.com/iqbanket-media/production/uploads/media/47514/media/big.jpg", "width"=>845, "height"=>500}}, "title"=>"", "is_vertical"=>false}, "price"=>3000, "title"=>"Лофт / Караоке", "banquet"=>{"id"=>1675, "title"=>"Колесо Времени", "address"=>"Орликов переулок, 5, стр. 2", "contacts"=>[{"id"=>3856, "name"=>"ресторан", "role"=>"", "email"=>"7551328@mail.ru", "phone"=>"+74992584858", "position"=>2, "for_client"=>false}, {"id"=>3858, "name"=>"Надежда ", "role"=>"управляющие", "email"=>"manager-kolesovremeni@mail.ru", "phone"=>"+79684615280", "position"=>1, "for_client"=>true}, {"id"=>6344, "name"=>"Наталья УШЛА", "role"=>"", "email"=>"", "phone"=>nil, "position"=>2, "for_client"=>false}, {"id"=>7751, "name"=>"Елена УШЛА", "role"=>"", "email"=>"", "phone"=>nil, "position"=>3, "for_client"=>false}, {"id"=>596, "name"=>"Герман (каша малаша)", "role"=>nil, "email"=>"koleso-vremeni@mail.ru", "phone"=>"+79152954813", "position"=>1, "for_client"=>false}]}, "regions"=>[{"id"=>1, "name"=>"ЦАО"}], "subways"=>[{"id"=>4027, "line"=>"koltsevaya", "name"=>"Комсомольская", "color"=>"#894E35", "minutes_to"=>4, "station_id"=>35}, {"id"=>4028, "line"=>"sokolnicheskaya", "name"=>"Красные ворота", "color"=>"#ED1B35", "minutes_to"=>7, "station_id"=>34}], "added_at"=>"2018-11-20 18:55:30", "hall_type"=>{"id"=>1, "title"=>"Ресторан"}, "price_note"=>nil, "updated_at"=>"2018-11-20 18:55:30", "capacity_to"=>50, "capacity_from"=>10} | |
], | |
"status"=>nil, | |
"created_at"=>Time.parse("Tue, 20 Nov 2018 13:52:02 UTC +00:00"), | |
"updated_at"=>Time.parse("Tue, 20 Nov 2018 13:56:15 UTC +00:00"), | |
"slug"=>"aT2ox6Byu7_XW01usmq9U18C8J8", | |
"viewed_at"=>nil, | |
"final_choice_id"=>nil | |
} | |
) | |
offer.save | |
# Send order to banquet form IQ | |
# hall_id manager_id lead_id text source | |
SendOrderToBanquetWorker.new.perform(5796, 22, 9206599, 'У клиента нет пожеланий', 'IQ') | |
# Send order to banquet form SB | |
# hall_id manager_id lead_id text source | |
SendOrderToBanquetWorker.new.perform(5796, 22, 9206599, 'У клиента нет пожеланий', 'SB') | |
# Send offer to client from IQ | |
# lead_id manager_id text client_info source | |
SendOrderToClientWorker.new.perform(9206599, 22, 'Подборка залов по вашему запросу', { email: 'scepion1d.dev@gmail.com', name: 'Кислые Щи' }, 'IQ') | |
# Send offer to client from SB | |
# lead_id manager_id text client_info source | |
SendOrderToClientWorker.new.perform(9206599, 22, 'Подборка залов по вашему запросу', { email: 'scepion1d.dev@gmail.com', name: 'Кислые Щи' }, 'SB') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment