import type { BaseResponse } from "@/shared/types/SharedTypes";

export type AdminType = {
  business: string;
  createdAt: string;
  deletedAt: string | null;
  firstName: string;
  id: string;
  lastName: string;
  phone: string;
};

export type BusinessType = {
  id: string;
  name: string;
  slug: string;
  logoUrl: string | null;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  admin: AdminType;
};

export type BusinessResponseType = BaseResponse<BusinessType>;

export const getAdminFullName = (admin?: AdminType | null): string =>
  [admin?.firstName, admin?.lastName].filter(Boolean).join(" ");
