Subversion Repositories SmartDukaan

Rev

Hide changed files | Details | Compare with Previous | Blame | RSS feed

Filtering Options

Rev Age Author Path Log message Diff Changes
36795 11 d 14 h amit /trunk/profitmandi-dao/src/main/resources/sql/ Add pending-indent phantom-cleanup migrations (drafts + PAYMENT_FAILED)

selectPendingIndentWalletAmount counts any billing/refund-NULL order regardless
of status, so abandoned draft orders and old PAYMENT_FAILED orders inflated
partner 'unbilled PO' and broke finance reco.

- cleanup_abandoned_draft_orders.sql: 2019-21 never-submitted, wallet-never-debited
drafts (status=0, not rejected) -> PAYMENT_FAILED + refund_timestamp. ~1970 rows.
- cleanup_phantom_payment_failed.sql: 2017-19 PAYMENT_FAILED orders counted as
unbilled PO -> drop ONLY phantom (no-debit or net-settled) via refund_timestamp;
KEEP net-committed (real payable). Temp-table form to avoid locking the live DB.

Both data-only (no code), idempotent, ran on hadb1; pending prod + replicas.
 
/trunk/profitmandi-dao/src/main/resources/sql/cleanup_abandoned_draft_orders.sql
/trunk/profitmandi-dao/src/main/resources/sql/cleanup_phantom_payment_failed.sql