You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
973 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { addFlockPricingOptionsJob } from "@/workers/rpa/queue";
import type { FlockCheckoutTier } from "@/lib/flock/flock-checkout-selection";
import type { FlockQuoteInput } from "@/workers/rpa/flock/types";
export type FlockPricingOptionsJobData = {
quoteId: string;
requestId: string;
customerId: string;
preferredTier: FlockCheckoutTier;
reference?: string | null;
input: FlockQuoteInput;
/** 首价 park 的会话 id;有则复用驻留页刮档,勿冷启动 */
quoteSessionId?: string | null;
};
export async function enqueueFlockPricingOptionsJob(
data: FlockPricingOptionsJobData,
): Promise<void> {
if (process.env.RPA_QUEUE_ENABLED === "false") {
console.log(
`[rpa-queue] 队列已禁用 flock-pricing-options quote_id=${data.quoteId}`,
);
return;
}
await addFlockPricingOptionsJob(data);
console.log(
`[rpa-queue] 已入队 flock-pricing-options quote_id=${data.quoteId} tier=${data.preferredTier}`,
);
}