import type { User } from '../../users/entities/user.entity';
import type { Restaurant } from '../../restaurants/entities/restaurant.entity';

export interface UserLoginResponse {
  id: string;
  firstName: string;
  lastName?: string;
  phone: string;
 
  isActive?: boolean;
  restaurant: {
    id: string;
    name: string;
    slug: string;
  };
}

export class UserLoginTransformer {
  static transform(user: User, restaurant: Restaurant): UserLoginResponse {
    return {
      id: user.id,
      firstName: user.firstName,
      lastName: user.lastName,
      phone: user.phone,
      isActive: user.isActive,
      restaurant: {
        id: restaurant.id,
        name: restaurant.name,
        slug: restaurant.slug,
      },
    };
  }
}
