Initial Commit

This commit is contained in:
Eric Gullickson
2025-09-17 16:09:15 -05:00
parent 0cdb9803de
commit a052040e3a
373 changed files with 437090 additions and 6773 deletions

View File

@@ -11,6 +11,7 @@ import {
StationParams
} from '../domain/stations.types';
import { StationsController } from './stations.controller';
import { tenantMiddleware } from '../../../core/middleware/tenant';
export const stationsRoutes: FastifyPluginAsync = async (
fastify: FastifyInstance,
@@ -20,25 +21,25 @@ export const stationsRoutes: FastifyPluginAsync = async (
// POST /api/stations/search - Search nearby stations
fastify.post<{ Body: StationSearchBody }>('/stations/search', {
preHandler: fastify.authenticate,
preHandler: [fastify.authenticate, tenantMiddleware],
handler: stationsController.searchStations.bind(stationsController)
});
// POST /api/stations/save - Save a station to user's favorites
fastify.post<{ Body: SaveStationBody }>('/stations/save', {
preHandler: fastify.authenticate,
preHandler: [fastify.authenticate, tenantMiddleware],
handler: stationsController.saveStation.bind(stationsController)
});
// GET /api/stations/saved - Get user's saved stations
fastify.get('/stations/saved', {
preHandler: fastify.authenticate,
preHandler: [fastify.authenticate, tenantMiddleware],
handler: stationsController.getSavedStations.bind(stationsController)
});
// DELETE /api/stations/saved/:placeId - Remove saved station
fastify.delete<{ Params: StationParams }>('/stations/saved/:placeId', {
preHandler: fastify.authenticate,
preHandler: [fastify.authenticate, tenantMiddleware],
handler: stationsController.removeSavedStation.bind(stationsController)
});
};
@@ -46,4 +47,4 @@ export const stationsRoutes: FastifyPluginAsync = async (
// For backward compatibility during migration
export function registerStationsRoutes() {
throw new Error('registerStationsRoutes is deprecated - use stationsRoutes Fastify plugin instead');
}
}