// src/server/features/system/system.schema.ts
// Zod schemas for system feature validation

import { z } from 'zod';
import { LogConfigSchema, UpdateLogConfigSchema } from '@shared/contracts/logger';

// Wrapper for standard API responses
const createApiResponse = <T extends z.ZodTypeAny>(dataSchema: T) =>
  z.object({
    success: z.boolean(),
    data: dataSchema,
  });

// GET /logs Response
export const getLogConfigResponseSchema = createApiResponse(LogConfigSchema);

// PATCH /logs Request Body
export const updateLogConfigBodySchema = UpdateLogConfigSchema;

// PATCH /logs Response
export const updateLogConfigResponseSchema = createApiResponse(LogConfigSchema);

// Error Response
export const errorResponseSchema = z.object({
  success: z.boolean(),
  error: z.string(),
});
