fix(notifications): list the paddle region request for admins while any trip has Tours on

The admin matrix decided a trip addon by the admin's own trips, so with Tours
off for the instance and on for a member's trip the paddle region request still
reached admins but had no row to switch it. Admin-scoped rows now follow the
addon being on for the instance or any trip.
This commit is contained in:
Maurice
2026-11-23 15:10:41 +01:00
parent 146f46c5e3
commit c289541c43
7 changed files with 79 additions and 7 deletions
@@ -95,6 +95,18 @@ export class TripAddonOverridesRepository extends TrekRepository<TripAddonOverri
.execute();
}
/** Whether any trip at all switched the addon on for itself. */
async anyEnabled(addon_id: string): Promise<boolean> {
const row = await this.kysely<OverridesKyselyDB>()
.selectFrom('trip_addon_overrides')
.select('trip_id')
.where('addon_id', '=', addon_id)
.where('enabled', '=', 1)
.limit(1)
.executeTakeFirst();
return row !== undefined;
}
/**
* Whether any trip the user owns or is a member of switched the addon on for
* itself. Routes without a trip (a library, a search across trips) open on