more fixin logging, UI update #1, source maps fix
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Failing after 12s
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Failing after 12s
This commit is contained in:
@@ -1580,10 +1580,10 @@ BEGIN
|
||||
FROM public.flyers
|
||||
WHERE flyer_id = NEW.flyer_id;
|
||||
|
||||
-- Tier 3 logging: Log when flyer lookup fails
|
||||
-- Tier 3 logging: Log when flyer has missing validity dates (degrades gracefully)
|
||||
IF flyer_valid_from IS NULL OR flyer_valid_to IS NULL THEN
|
||||
PERFORM fn_log('ERROR', 'update_price_history_on_flyer_item_insert',
|
||||
'Flyer not found or missing validity dates',
|
||||
PERFORM fn_log('WARNING', 'update_price_history_on_flyer_item_insert',
|
||||
'Flyer missing validity dates - skipping price history update',
|
||||
v_context);
|
||||
RETURN NEW;
|
||||
END IF;
|
||||
@@ -1853,11 +1853,11 @@ BEGIN
|
||||
UPDATE public.flyers SET item_count = item_count - 1 WHERE flyer_id = OLD.flyer_id;
|
||||
END IF;
|
||||
|
||||
-- Tier 3 logging: Log if flyer not found
|
||||
-- Tier 3 logging: Log if flyer not found (expected during CASCADE delete, so INFO level)
|
||||
GET DIAGNOSTICS v_rows_updated = ROW_COUNT;
|
||||
IF v_rows_updated = 0 THEN
|
||||
PERFORM fn_log('ERROR', 'update_flyer_item_count',
|
||||
'Flyer not found for item count update',
|
||||
PERFORM fn_log('INFO', 'update_flyer_item_count',
|
||||
'Flyer not found for item count update (likely CASCADE delete)',
|
||||
v_context);
|
||||
END IF;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user