Files
playzer/apps/backend/src/modules/complex/complex.routes.ts
Jose Selesan 9ee98a4cb4 feat: add city/state/country to complex, new settings page with sidebar, and Biome linting
- Added city, state, and country optional fields to Complex model
- Updated onboarding to include optional location fields
- Created new settings page with sidebar navigation (Datos del Complejo, Canchas)
- Replaced ESLint with Biome for frontend and backend linting
- Added parallel dev script with concurrently
- Migrated register-routes to use direct app.route() pattern
2026-04-10 15:36:15 -03:00

34 lines
1.4 KiB
TypeScript

import { requireAuth } from '@/middlewares/require-auth.middleware';
import { createComplexHandler } from '@/modules/complex/handlers/create-complex.handler';
import { getComplexByIdHandler } from '@/modules/complex/handlers/get-complex-by-id.handler';
import { getComplexBySlugHandler } from '@/modules/complex/handlers/get-complex-by-slug.handler';
import { listMyComplexesHandler } from '@/modules/complex/handlers/list-my-complexes.handler';
import { updateComplexHandler } from '@/modules/complex/handlers/update-complex.handler';
import type { AppEnv } from '@/types/hono';
import { zValidator } from '@hono/zod-validator';
import { createComplexSchema, updateComplexSchema } from '@repo/api-contract';
import { Hono } from 'hono';
import { z } from 'zod';
export const complexRoutes = new Hono<AppEnv>();
const complexIdParamsSchema = z.object({ id: z.uuid() });
const complexSlugParamsSchema = z.object({ slug: z.string().trim().min(1) });
complexRoutes.use('*', requireAuth);
complexRoutes.post('/', zValidator('json', createComplexSchema), createComplexHandler);
complexRoutes.get('/mine', listMyComplexesHandler);
complexRoutes.get(
'/slug/:slug',
zValidator('param', complexSlugParamsSchema),
getComplexBySlugHandler
);
complexRoutes.get('/:id', zValidator('param', complexIdParamsSchema), getComplexByIdHandler);
complexRoutes.patch(
'/:id',
zValidator('param', complexIdParamsSchema),
zValidator('json', updateComplexSchema),
updateComplexHandler
);