import { z } from "zod";
import {
  NOTIFICATION_RESOURCE_KIND,
  resolveNotificationContext,
  runGuardedNotificationWrite
} from "../../lib/routeHelpers.js";
const metadata = {
  PUT: { requireAuth: true }
};
async function PUT(req) {
  const { service, scope, ctx } = await resolveNotificationContext(req);
  const guarded = await runGuardedNotificationWrite(
    ctx.container,
    scope,
    req,
    {
      resourceKind: NOTIFICATION_RESOURCE_KIND,
      operation: "update"
    },
    () => service.markAllAsRead(scope)
  );
  if (!guarded.ok) return guarded.response;
  return Response.json({ ok: true, count: guarded.result });
}
const openApi = {
  PUT: {
    summary: "Mark all notifications as read",
    tags: ["Notifications"],
    responses: {
      200: {
        description: "All notifications marked as read",
        content: {
          "application/json": {
            schema: z.object({
              ok: z.boolean(),
              count: z.number()
            })
          }
        }
      }
    }
  }
};
export {
  PUT,
  metadata,
  openApi
};
//# sourceMappingURL=route.js.map
