fix(ancpi): use JSON body for EpayJsonInterceptor + EditCartItemJson
Root cause from ePay Angular analysis:
- EpayJsonInterceptor needs Content-Type: application/json + {"judet": N}
- EditCartItemJson needs JSON with bigDecimalValue/stringValue structure
- SearchEstate needs basketId in body for JSON response
- Queue skips SearchEstate (data already from eTerra), uses
configureCartItem → submitOrder flow directly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -175,33 +175,11 @@ async function processItem(item: QueueItem): Promise<void> {
|
||||
const basketRowId = await client.addToCart(input.prodId ?? 14200);
|
||||
await updateStatus(extractId, "cart", { basketRowId });
|
||||
|
||||
// Step 3: Search estate on ePay
|
||||
await updateStatus(extractId, "searching");
|
||||
const results = await client.searchEstate(
|
||||
input.nrCadastral,
|
||||
input.judetIndex,
|
||||
input.uatId,
|
||||
);
|
||||
|
||||
if (results.length === 0) {
|
||||
await updateStatus(extractId, "failed", {
|
||||
errorMessage: `Imobilul ${input.nrCadastral} nu a fost găsit în baza ANCPI.`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const estate = results[0]!;
|
||||
await updateStatus(extractId, "searching", {
|
||||
immovableId: estate.immovableId,
|
||||
immovableType: estate.immovableTypeCode,
|
||||
measuredArea: estate.measureadArea,
|
||||
legalArea: estate.legalArea,
|
||||
address: estate.address,
|
||||
});
|
||||
|
||||
// Step 4: Submit order
|
||||
// Step 3: Configure + submit order
|
||||
// Skip SearchEstate — we already have the data from eTerra.
|
||||
// configureCartItem (via EditCartItemJson) + submitOrder (via EditCartSubmit)
|
||||
await updateStatus(extractId, "ordering");
|
||||
const nrCF = input.nrCF ?? estate.electronicIdentifier ?? input.nrCadastral;
|
||||
const nrCF = input.nrCF ?? input.nrCadastral;
|
||||
const orderId = await client.submitOrder({
|
||||
basketRowId,
|
||||
judetIndex: input.judetIndex,
|
||||
|
||||
Reference in New Issue
Block a user