import { eq } from 'drizzle-orm';
import type { DrizzleClient } from '../client.js';
import { platformImageLimits } from '../schema.js';

export async function updatePlatformImageLimits(
  db: DrizzleClient,
  next: { maxImagesPerDeal: number; maxImagesPerSku: number },
  userId: string,
): Promise<void> {
  await db
    .update(platformImageLimits)
    .set({
      ...next,
      updatedAt: new Date(),
      updatedByUserId: userId,
    })
    .where(eq(platformImageLimits.id, 1));
}
