import { registerAs } from "@nestjs/config";

export default registerAs("notifier", () => ({
  /** mark-paid callback URL per owning service (PaymentService discriminator routes here). */
  passengerUrl:
    process.env.PAYMENT_NOTIFY_PASSENGER_URL ??
    "http://localhost:3002/internal/payments/mark-paid",
  freightUrl:
    process.env.PAYMENT_NOTIFY_FREIGHT_URL ??
    "http://localhost:3001/internal/payments/mark-paid",
  relayIntervalMs: parseInt(process.env.OUTBOX_RELAY_INTERVAL_MS ?? "5000", 10),
  maxAttempts: parseInt(process.env.OUTBOX_MAX_ATTEMPTS ?? "10", 10),
  httpTimeoutMs: parseInt(process.env.NOTIFY_HTTP_TIMEOUT_MS ?? "10000", 10),
  relayBatchSize: parseInt(process.env.OUTBOX_RELAY_BATCH_SIZE ?? "20", 10),
}));
