/**
 * Shared Type Definitions
 * Mecánicas Diesel - ERP Suite
 */

import { Request } from 'express';

/**
 * JWT Payload structure
 */
export interface JwtPayload {
  userId: string;
  email: string;
  tenantId: string;
  role: string;
  iat?: number;
  exp?: number;
}

/**
 * Authenticated Request
 */
export interface AuthRequest extends Request {
  user?: JwtPayload;
  tenantId?: string;
}

/**
 * Standard API Response format
 */
export interface ApiResponse<T = any> {
  success: boolean;
  data?: T;
  error?: {
    message: string;
    code?: string;
    details?: any;
  };
  timestamp?: string;
}

/**
 * Token pair for authentication
 */
export interface TokenPair {
  accessToken: string;
  refreshToken: string;
}
