import type { FastifyInstance } from "fastify";
import { env } from "../config/env.js";

export async function publicRoutes(app: FastifyInstance): Promise<void> {
  app.get("/health", async () => ({
    status: "ok",
    service: "fedeo-push-api",
  }));

  app.get("/v1/public-config", async () => ({
    webPushPublicKey: env.WEB_PUSH_PUBLIC_KEY || null,
    iosBundleId: env.IOS_BUNDLE_ID,
    androidSenderId: env.ANDROID_SENDER_ID || null,
    capabilities: ["ios_push", "minimal_payload", "instance_hmac"],
  }));
}
