Pull Future Reservation Service
Saat ini Pull future reservation dapat di lakukan di masing-masing property untuk beberapa OTA tertentu yang menyediakan feature ini. Property dapat melakukan pull future reservasi dengan mengaccess url channel manager > control panel > Agoda > setting > buton pull future reservation. List Ota Yang menyediakan feature ini adalah
- Agoda
- Booking.com
- Airbnb
- Expedia
Jika melakukan Bulk future reservasi sangat sudah di lakukan, untuk itu service ini di buat untuk menghandel Bul Future reservation.
Database
Perlu di buatkan satu table untuk menampung log sehingga akan tau step dari reproduce sampai success di execute. Nama table: pull_reservation Database: Logs
mysql query create table
Queue
Rabbit MQ akan di gunakan untuk menampung queue property. Queue name nya adalah pull_future_reservation
Flow Overview
1. Get list Property
Get list active properties and mapping with the 4 OTAs
fdgdf
2. Push to RabbitMQ Queue
For each valid property:
- Log the activity in a reservation_pull_log (or similar) table and get ID
- Push to RabbitMQ queue with the name:
pull_future_reservation
type Queue struct {
ID int `json:"id"` // Property ID
Name string `json:"name"` // Property Name
OtaName string `json:"ota_name"` // e.g., "booking", "agoda", "airbnb"
OtaId int `json:"ota_id"` // OTA ID
LogId int32 `json:"log_id"` // Log entry ID for tracking
}
3. Worker: Consumer Logic
- Consume from queue:
pull_future_reservation - For each property in the message:
- Hit external script endpoint:
POST http://bookandlink.com/ota/admin_mapping/callResvScript.php
- Payload (as
x-www-form-urlencoded):
formData.Set("codice", strconv.Itoa(prop.ID))
formData.Set("site", prop.OtaName)
formData.Set("flag", "1")
formData.Set("view", "2")
formData.Set("callingLoc", "configBot")
formData.Set("ota_id", strconv.Itoa(prop.OtaId))
- On response:
- Update the related log entry (
log_id) with result/status
- Update the related log entry (
🕒 Scheduler
- n/a