import { getComplexUsersOverview } from '@/modules/complex/services/complex-members.service';
import type { AppContext } from '@/types/hono';
import { z } from 'zod';

const complexParamsSchema = z.object({
  id: z.uuid(),
});

export async function listComplexUsersHandler(c: AppContext) {
  const user = c.get('user');
  const params = complexParamsSchema.parse(c.req.param());
  const result = await getComplexUsersOverview(user.id, params.id);
  return c.json(result);
}
