This commit is contained in:
Eric Gullickson
2025-10-16 19:20:30 -05:00
parent 225520ad30
commit 5638d3960b
68 changed files with 4164 additions and 18995 deletions

View File

@@ -19,6 +19,7 @@ import { fuelLogsRoutes } from './features/fuel-logs/api/fuel-logs.routes';
import { stationsRoutes } from './features/stations/api/stations.routes';
import tenantManagementRoutes from './features/tenant-management/index';
import { documentsRoutes } from './features/documents/api/documents.routes';
import { maintenanceRoutes } from './features/maintenance';
async function buildApp(): Promise<FastifyInstance> {
const app = Fastify({
@@ -113,26 +114,9 @@ async function buildApp(): Promise<FastifyInstance> {
await app.register(documentsRoutes, { prefix: '/api' });
await app.register(fuelLogsRoutes, { prefix: '/api' });
await app.register(stationsRoutes, { prefix: '/api' });
await app.register(maintenanceRoutes, { prefix: '/api' });
await app.register(tenantManagementRoutes);
// Maintenance feature placeholder (not yet implemented)
await app.register(async (fastify) => {
// Maintenance routes - basic placeholder for future implementation
fastify.get('/api/maintenance*', async (_request, reply) => {
return reply.code(501).send({
error: 'Not Implemented',
message: 'Maintenance feature not yet implemented'
});
});
fastify.post('/api/maintenance*', async (_request, reply) => {
return reply.code(501).send({
error: 'Not Implemented',
message: 'Maintenance feature not yet implemented'
});
});
});
// 404 handler
app.setNotFoundHandler(async (_request, reply) => {
return reply.code(404).send({ error: 'Route not found' });