-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calendar synchronisation #125
Conversation
According to the recent changes on Roomorama's Publish API, availabilities are no longer supported when publishing properties on Roomorama. Instead, an `update_calendar` API call needs to be performed to update the availabilities calendar in bulk.
This class is focused on performing synchronisation of property data, so the change in naming aims to make the difference with the upcoming calendar synchronisation class more stark.
To be run on deployments so that changes to the YML file are reflected on the background workers on the database.
These will allow sync process to be used across different synchronisation types (property metadata and calendar of availabilities.)
Coordinates calendar fetching with suppliers the same way property metadata is coordinated by +Workers::PropertySynchronisation+.
Deprecated in favour of the new +stats+ column.
@rmascarenhas updated the new task on staging |
Looks good 👍 |
[ci skip]
So this works on top of a new bulk availability endpoint from Roomorama right? is there a corresponding PR for that project? |
# date: data[:date], | ||
# available: data[:available], | ||
# nightly_rate: data[:nightly_price] | ||
# ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot a
calendar.add(entry)
Also, for @Traf333: I think you were working on something to automate host creation on concierge/roomorama? I created a |
Got it! Looks good! |
# Indicates availabilities and prices. | ||
TYPES = %w(metadata availabilities) | ||
|
||
# possibile statuses a worker can be in: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
It's a good PR. Additional thanks for Just to clarify. As I understood now instead of Let's merge it. 👍 |
[ci skip]
@Traf333 yes, you are right.
Thanks everyone! |
This introduces the changes that we have been talking about and started as a discussion on #100
Summary
"calendar.SupplierName"
. The skeleton should be similar to the previousWorkers::Synchronisation
(nowWorkers::PropertySynchronisation
)Dynamic sections above were ommited for simplicity.
BackgroundWorker
entity, which can be of typemetadata
(existing workers) orcalendar
(new workers). The schema for workers is defined per supplier onconfig/suppliers.yml
, but the association happens on thehost
level. This means that for now we can stick all hosts to the same frequency for property metadata/availabilities synchronising, but in the future, we should be able to have customised frenquencies for different hosts of the same supplier.Here's how AtLeisure is currently defined:
This means that all hosts from AtLeisure will be triggered:
For WayToStay, since it operates on a diff API that includes availabilities, we might want to skip the
availabilities
section and have only metadata (so the process would use bothWorkers::PropertySynchronisation
andWorkers::CalendarSynchronisation
.) But that is to be decided on a per supplier basis.update_calendar
was removed. The publish API call on Roomorama does not accept availabilities on that endpoint anymore, and instead, availabilities are uploaded in bulk via theupdate_calendar
API call, used byCalendarSynchronisation
. That is the current way to synchronise calendarsMisc
config/suppliers.yml
and see if the random defaults I assumed there make senseupdate_calendar
is no longer availablebundle exec rake hosts:update_worker_definitions
will have to be run on every deployment after the existingsuppliers:load
rake task.👀