mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
These reports resolved ctx.directions and never read it, so a user restricted to one trade direction saw every row, and a user with no trade access — where directions is [] and the rule is show nothing — saw all of them. first-last-mile-bookings scopes on the booking's own direction; the other five scope on ts.direction. global-logistics-wagons uses the fragment form so a log row whose schedule is gone stays visible, which is the rule the other ledgers apply to rows carrying no direction. Also adds the missing soft-delete guards: b.deleted_at on the first/last mile booking join, ts.deleted_at on the wagon-teu-utilization and global-logistics-wagons schedule joins. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>