/** Health controller for the {{ module_title }} NestJS integration. */

import {
  Controller,
  Get,
  HttpCode,
  HttpStatus,
} from "@nestjs/common";

import { {{ module_class_name }}Service } from "./{{ module_name }}.service";

@Controller("api/health/module")
export class {{ module_class_name }}HealthController {
  constructor(private readonly service: {{ module_class_name }}Service) {}

  @Get("{{ module_kebab }}")
  @HttpCode(HttpStatus.OK)
  getModuleHealth(): Record<string, unknown> {
    const payload = this.service.getHealthPayload();
    return {
      ...payload,
      status: payload.status ?? "ok",
    };
  }
}
