import { randomUUID } from 'crypto';
import type { PurchaseIdGeneratorPort } from '../application/purchase-id-generator.port';

export class DefaultPurchaseIdGeneratorPort implements PurchaseIdGeneratorPort {
  generatePurchaseOrderId(): string {
    return `po-${randomUUID()}`;
  }
}

export function createDefaultPurchaseIdGeneratorPort(): PurchaseIdGeneratorPort {
  return new DefaultPurchaseIdGeneratorPort();
}
