/**
 * 모든 API 응답에 자동으로 포함되는 기본 메타 정보
 */
export type BaseMeta = {
  /** 요청 고유 ID */
  requestId?: string;
  /** 응답 생성 시간 (ISO 8601 형식) */
  timestamp: string;
  /** 요청 경로 (쿼리 파라미터 포함) */
  path: string;
  /** HTTP 메소드 (GET, POST, etc.) */
  method: string;
  /** HTTP 상태 코드 */
  statusCode: number;
  /** 요청 처리 시간 (밀리초) */
  duration?: number;
};

/**
 * 성공 응답 표준 구조
 */
export type SuccessResponse<T = unknown, M = unknown> = {
  success: true;
  data: T;
  meta?: M;
};

/**
 * 에러 응답 표준 구조
 */
export type ErrorResponse = {
  success: false;
  error: {
    code: string;
    message: string;
  };
  meta?: BaseMeta;
};

/**
 * 모든 API 응답의 표준 형식
 */
export type StandardResponse = SuccessResponse | ErrorResponse;
