import "server-only";
import type { z } from "zod";
import {
  handleEnquiry,
  type ContactProviders,
  type EnquiryKind,
} from "./contact-handler";
import {
  quickApplyEnquiry,
  quickApplyRequestSchema,
} from "./quick-apply-schema";
export const quickApplyKind: EnquiryKind<
  z.output<typeof quickApplyRequestSchema>
> = {
  schema: quickApplyRequestSchema,
  toEnquiry: quickApplyEnquiry,
  messages: {
    method: "Use the quick apply form to send your details.",
    unreadable:
      "Your details could not be read. Please check them and try again.",
    invalid: "Please check the form fields and complete the security check.",
    received: "Thank you. A MaxCredit consultant will be in touch.",
    limited: "Too many requests. Please wait a few minutes or call 6336 4144.",
    expired: "The security check expired or failed. Please complete it again.",
    mock: "Preview complete. No request was sent.",
    sent: "Thank you. A MaxCredit consultant will call you shortly.",
    failed:
      "We could not confirm your request was sent. Please retry or call 6336 4144.",
  },
};
export const handleQuickApply = (
  request: Request,
  providers: ContactProviders,
) => handleEnquiry(request, providers, quickApplyKind);
