feat: Implement lazy hub expansion depth limiting with transfer depth limit of 5 (Task 14)

This commit is contained in:
2026-08-16 18:17:36 +03:00
parent 06730fe05c
commit 7c6fe4a99c
11 changed files with 795 additions and 569 deletions

View File

@@ -0,0 +1,24 @@
-- Migration: Create transfer_rules table for MCT (Minimum Connection Time) values
-- This table stores minimum connection time rules based on transfer context:
-- - airport_internal/through: 30 min (within same airport, through transfer)
-- - airport_internal/separate: 60 min (within same airport, separate transfers)
-- - station_internal: 30 min (between stations in same city)
-- - airport_to_city/small: 60 min (airport to small city)
-- - airport_to_city/million_plus: 90 min (airport to million+ city)
CREATE TABLE IF NOT EXISTS transfer_rules (
id SERIAL PRIMARY KEY,
rule_key VARCHAR(50) NOT NULL UNIQUE,
min_transfer_time_minutes INTEGER NOT NULL,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Insert default MCT values
INSERT INTO transfer_rules (rule_key, min_transfer_time_minutes, description) VALUES
('airport_internal_through', 30, 'Minimum transfer time for internal connections at the same airport (through transfer)'),
('airport_internal_separate', 60, 'Minimum transfer time for internal connections at the same airport (separate transfers)'),
('station_internal', 30, 'Minimum transfer time between stations in the same city'),
('airport_to_city_small', 60, 'Minimum transfer time from airport to small city'),
('airport_to_city_million_plus', 90, 'Minimum transfer time from airport to million-plus city');