guard(epay): force legacy queue for paid CF orders — gis-api has no fulfiller yet
gis-api POST /enrichment/cf only inserts a pending row; no orchestrator worker executes the ePay purchase, so pilot-flag orders silently never complete. EPAY_ORDERING_VIA_GIS_AC=false routes all paid orders through /api/ancpi/order and restores the connected+credits gating on the per-parcel button. Flip the constant after the orchestrator ePay worker ships. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,15 @@
|
||||
|
||||
import type { CfExtractRow } from "@/lib/gis-api-client";
|
||||
|
||||
// GUARD (2026-06-04): ePay ordering via gis-api is NOT live yet. gis-api's
|
||||
// POST /enrichment/cf only inserts a pending CfExtract row — there is no
|
||||
// orchestrator-side worker that executes the paid ePay purchase, so orders
|
||||
// placed through /api/cf/order silently never complete (UI even shows
|
||||
// "Extras CF valid"). Until that fulfiller ships and is verified, ALL paid
|
||||
// ePay orders MUST go through the legacy local queue (/api/ancpi/order).
|
||||
// Flip to true only after the orchestrator ePay worker is deployed.
|
||||
export const EPAY_ORDERING_VIA_GIS_AC = false;
|
||||
|
||||
export function cfApiBase(useGisAc: boolean): string {
|
||||
return useGisAc ? "/api/cf" : "/api/ancpi";
|
||||
}
|
||||
@@ -254,7 +263,9 @@ export async function placeCfOrder(
|
||||
gisFeatureId?: string;
|
||||
},
|
||||
): Promise<{ ok: boolean; error?: string }> {
|
||||
if (useGisAc) {
|
||||
// See EPAY_ORDERING_VIA_GIS_AC — gis-api can't fulfill paid orders yet,
|
||||
// so the pilot flag alone must NOT route ordering away from the queue.
|
||||
if (useGisAc && EPAY_ORDERING_VIA_GIS_AC) {
|
||||
try {
|
||||
const res = await fetch("/api/cf/order", {
|
||||
method: "POST",
|
||||
|
||||
Reference in New Issue
Block a user