Install
Works with Drupal: ^9.4 || ^10.2 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
## Summary
This release adds a complete JSON import pipeline for `special_night` nodes
inside the `beehotel_pricealterators` sub-module. Site builders can now
configure the import from the UI, while developers can run it via two new
Drush commands. A sample JSON fixture is included for testing.
## What's New
### JSON import for Special Nights
The Special Nights alterator now supports importing `special_night` nodes
from JSON files generated by external pricing tools (e.g. Airbnb scraping).
- New **"Import from JSON"** collapsible fieldset in the Special Nights
configuration form, with the following settings:
- Enable/disable the import.
- Source directory containing `*.json` files.
- Number of nights and adults (used by the scraper).
- Discount percentages for Airbnb and partner channels.
- Status of imported nodes (Published / Draft).
- Import is idempotent: existing nodes are matched by `field_nights.value`
(check-in date) and updated instead of duplicated.
### New Drush commands
Two commands are registered by `beehotel_pricealterators`:
- `drush bhpas:check` (alias `bhpas:status`)
Validates the configuration and prerequisites without writing to the
database. Exits with a non-zero code if the configuration is not ready,
making it suitable as a guard in cron jobs.
- `drush bhpas:import`
Imports or updates `special_night` nodes from the configured directory.
Options:
- `--dry-run`: show what would be created/updated.
- `--force`: run even if `import_enabled` is `FALSE`.
- `--source-dir`: override the configured directory for a single run.
### Sample JSON fixture
A reference JSON file is shipped in `tests/fixtures/special_night_2026-10-24.json`
and documented in `tests/fixtures/README.md`. It can be used to verify the
import pipeline without running the external scraper.
## For Site Builders
1. Go to **Configuration » BEE Hotel » Price Alterators » Special Nights**.
2. Expand **Import from JSON**.
3. Set the source directory to the folder containing the `*.json` files.
4. Adjust the discount percentages and node status as needed.
5. Save the form.
6. Run `drush bhpas:import` manually, or add it to cron.
**Recommended cron entry:**
```cron
10 */4 * * * cd /path/to/drupal && vendor/bin/drush bhpas:check && vendor/bin/drush bhpas:import