Reorganize testing infrastructure and fix Oracle cursor loop syntax
Major changes: - Fix cursor loop syntax in 04_import_comenzi.sql using BULK COLLECT pattern - Remove obsolete test scripts (apply_fix.py, check_*.py, debug_functions.py, test_*.py) - Add comprehensive README.md files for api/ and api/tests/ directories - Keep only essential testing scripts (final_validation.py, test_syntax.py) - Update PRD.md with latest project status 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -322,9 +322,20 @@ CREATE OR REPLACE PACKAGE BODY PACK_IMPORT_COMENZI AS
|
||||
-- pINFO('IMPORTA_COMANDA ' || p_nr_comanda_ext || ': Procesez articol ' || v_articol_count || ': ' || v_sku || ', cant: ' || v_cantitate_web || ', pret: ' || v_pret_web, 'IMPORT_COMENZI');
|
||||
|
||||
-- STEP 3: Gaseste maparile pentru acest SKU
|
||||
FOR art_rec IN (
|
||||
SELECT * FROM TABLE(gaseste_articol_roa(v_sku, v_pret_web, v_cantitate_web))
|
||||
) LOOP
|
||||
DECLARE
|
||||
v_articole_table t_articol_table;
|
||||
v_articol_idx NUMBER;
|
||||
BEGIN
|
||||
-- Apeleaza functia si stocheaza rezultatele
|
||||
SELECT * BULK COLLECT INTO v_articole_table
|
||||
FROM TABLE(gaseste_articol_roa(v_sku, v_pret_web, v_cantitate_web));
|
||||
|
||||
-- Itereaza prin rezultate
|
||||
IF v_articole_table.COUNT > 0 THEN
|
||||
FOR v_articol_idx IN 1..v_articole_table.COUNT LOOP
|
||||
DECLARE
|
||||
art_rec t_articol_result := v_articole_table(v_articol_idx);
|
||||
BEGIN
|
||||
IF art_rec.success = 1 THEN
|
||||
-- Adauga articolul la comanda
|
||||
BEGIN
|
||||
@@ -353,7 +364,13 @@ CREATE OR REPLACE PACKAGE BODY PACK_IMPORT_COMENZI AS
|
||||
v_articole_eroare := v_articole_eroare + 1;
|
||||
-- pINFO('ERROR IMPORTA_COMANDA ' || p_nr_comanda_ext || ': SKU nu a putut fi mapat: ' || v_sku || ' - ' || art_rec.error_message, 'IMPORT_COMENZI');
|
||||
END IF;
|
||||
END LOOP;
|
||||
END; -- End art_rec DECLARE block
|
||||
END LOOP; -- End v_articol_idx loop
|
||||
ELSE
|
||||
v_articole_eroare := v_articole_eroare + 1;
|
||||
-- pINFO('WARN IMPORTA_COMANDA ' || p_nr_comanda_ext || ': Niciun articol gasit pentru SKU: ' || v_sku, 'IMPORT_COMENZI');
|
||||
END IF;
|
||||
END; -- End DECLARE block pentru v_articole_table
|
||||
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
|
||||
Reference in New Issue
Block a user