/**
 * ID Mapping DB Mapper
 *
 * Maps Prisma IdMapping entity to Domain UserIdMapping type
 *
 * NOTE: This is an infrastructure concern - Prisma is BFF's ORM implementation detail.
 * Domain layer should not know about Prisma types.
 */

import type { IdMapping as PrismaIdMapping } from "@prisma/client";
import type { UserIdMapping } from "@customer-portal/domain/mappings";

/**
 * Maps Prisma IdMapping entity to Domain UserIdMapping type
 */
export function mapPrismaMappingToDomain(mapping: PrismaIdMapping): UserIdMapping {
  return {
    id: mapping.userId,
    userId: mapping.userId,
    whmcsClientId: mapping.whmcsClientId,
    sfAccountId: mapping.sfAccountId,
    createdAt: mapping.createdAt,
    updatedAt: mapping.updatedAt,
  };
}
