bmc_hub/migrations/170_hardware_default_rental_prices.sql
Christian 4a52bdb5d6 feat: Implement quick-rent functionality for hardware assets
- Added QuickRentCreateInput model to handle quick-rent requests.
- Introduced quick_rent_preview endpoint to check existing subscriptions.
- Created quick_rent_hardware endpoint to manage rental subscriptions, asset bindings, and startup order drafts.
- Updated SQL queries to ensure proper data retrieval and handling.
- Added default rental price columns to hardware_assets table via migration.
- Enhanced UI in sag templates for better user experience and accessibility.
- Refactored existing code for improved readability and maintainability.
2026-04-21 01:34:40 +02:00

17 lines
1.3 KiB
SQL

-- Migration 170: Default rental prices on hardware assets
-- Stores asset-level default prices used to prefill quick-rent flow.
ALTER TABLE hardware_assets
ADD COLUMN IF NOT EXISTS rental_default_start_price DECIMAL(10,2)
CHECK (rental_default_start_price IS NULL OR rental_default_start_price >= 0),
ADD COLUMN IF NOT EXISTS rental_default_freight_price DECIMAL(10,2)
CHECK (rental_default_freight_price IS NULL OR rental_default_freight_price >= 0),
ADD COLUMN IF NOT EXISTS rental_default_preparation_price DECIMAL(10,2)
CHECK (rental_default_preparation_price IS NULL OR rental_default_preparation_price >= 0),
ADD COLUMN IF NOT EXISTS rental_default_operations_monthly_price DECIMAL(10,2)
CHECK (rental_default_operations_monthly_price IS NULL OR rental_default_operations_monthly_price >= 0);
COMMENT ON COLUMN hardware_assets.rental_default_start_price IS 'Default startup price for quick-rent orders.';
COMMENT ON COLUMN hardware_assets.rental_default_freight_price IS 'Default freight price for quick-rent orders.';
COMMENT ON COLUMN hardware_assets.rental_default_preparation_price IS 'Default preparation price for quick-rent orders.';
COMMENT ON COLUMN hardware_assets.rental_default_operations_monthly_price IS 'Default monthly operations price for quick-rent orders.';