PMS Mockup API

Property Management System Test API for Booking Synchronization

Test Task Description

Background

You are developing a hotel management system that needs to sync bookings with a Property Management System (PMS). The PMS provides a REST API with the following endpoints:

GET /api/bookings - Returns an array of booking IDs
GET /api/bookings/{id} - Returns booking details including guest_ids array
GET /api/rooms/{id} - Returns room details
GET /api/room-types/{id} - Returns room type details
GET /api/guests/{id} - Returns guest details

Your Task

Create a Laravel Artisan command that:

  1. Fetches all bookings from the PMS API
  2. For each booking, fetches the related room, room type, and guest information
  3. Stores or updates this data in your local database
  4. Handles API rate limiting (2 requests per second)
  5. Provides progress feedback during execution
  6. Can be run multiple times safely (idempotent)

Technical Requirements

  • Use Laravel's HTTP client for API requests
  • Implement proper error handling and logging
  • Use database transactions where appropriate
  • Follow Laravel best practices and conventions
  • Include at least basic unit tests

API Overview

10,000
Initial Bookings
200+
Guests
52
Rooms (max 150)
6
Room Types (max 10)
2/sec
Rate Limit

Filtering by Updated Date

All mass data endpoints (bookings, rooms, room-types, guests) support filtering by the updated_at field. This is particularly useful for incremental synchronization:

# Get only bookings updated after July 20, 2025 curl "https://api.pms.donatix.info/api/bookings?updated_at.gt=2025-07-20" # Get only guests updated after a specific datetime curl "https://api.pms.donatix.info/api/guests?updated_at.gt=2025-07-20T14:30:00" # The same pattern works for all resources: curl "https://api.pms.donatix.info/api/rooms?updated_at.gt=2025-07-20" curl "https://api.pms.donatix.info/api/room-types?updated_at.gt=2025-07-20"
Note: Use updated_at.gt in your URLs for filtering. Laravel internally converts the dot notation to underscore, but you should use the dot notation in your requests. The date can be in any format that PHP's Carbon library can parse (YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, ISO 8601, etc.)