// Vite ?raw import는 seed CSV를 빌드 타임 상수로 번들합니다.
// eslint-disable-next-line import/no-unresolved
import seedTenantCSVRaw from "../../../../seed-tenant.csv?raw";
import type { TenantSummary } from "../../../lib/adminApi";
import { parseTenantCSV } from "./tenantCsvImport";

const seedTenants = parseTenantCSV(seedTenantCSVRaw);
const seedTenantIds = new Set(
  seedTenants.map((row) => row.tenantId.trim().toLowerCase()).filter(Boolean),
);

export function isSeedTenant(tenant: Pick<TenantSummary, "id">): boolean {
  return seedTenantIds.has(tenant.id.trim().toLowerCase());
}

export function getSeedTenantIds(): string[] {
  return Array.from(seedTenantIds);
}
