From 4ee593f407f87c15a60121d9f86bdcde46849f25 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Mon, 17 Aug 2026 19:23:56 +0530 Subject: [PATCH] fix(db): pricing_packages.price_inr was seeded as rupees, treated as paise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 58 of 59 rows were inserted with plain rupee-looking values (499, 999, 1999, ...) but every consumer (apps/payments/src/main.rs) treats price_inr as paise, so PayU would have charged 1/100th of the intended price. Confirmed zero rows in payments/orders — pre-launch data fix, not a refund situation. Co-Authored-By: Claude Sonnet 5 --- ...000000_fix_pricing_packages_paise.down.sql | 5 +++++ ...17000000_fix_pricing_packages_paise.up.sql | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 crates/db/migrations/20260817000000_fix_pricing_packages_paise.down.sql create mode 100644 crates/db/migrations/20260817000000_fix_pricing_packages_paise.up.sql diff --git a/crates/db/migrations/20260817000000_fix_pricing_packages_paise.down.sql b/crates/db/migrations/20260817000000_fix_pricing_packages_paise.down.sql new file mode 100644 index 0000000..2aa2bdd --- /dev/null +++ b/crates/db/migrations/20260817000000_fix_pricing_packages_paise.down.sql @@ -0,0 +1,5 @@ +BEGIN; + +UPDATE pricing_packages SET price_inr = price_inr / 100 WHERE price_inr >= 100 AND price_inr < 1000000 AND price_inr != 25000; + +COMMIT; diff --git a/crates/db/migrations/20260817000000_fix_pricing_packages_paise.up.sql b/crates/db/migrations/20260817000000_fix_pricing_packages_paise.up.sql new file mode 100644 index 0000000..9999eb3 --- /dev/null +++ b/crates/db/migrations/20260817000000_fix_pricing_packages_paise.up.sql @@ -0,0 +1,19 @@ +-- pricing_packages.price_inr is treated as PAISE by every consumer (see +-- apps/payments/src/main.rs's paise_to_rupee_string call, and the comment +-- on that column at apps/payments/src/main.rs:196) but 58 of the 59 rows +-- (all but the JOB_SEEKER "Starter Pack" seeded correctly at 25000 = ₹250 +-- in 20260721070000_seed_pricing_packages.up.sql) were inserted with plain +-- rupee-looking values (499, 999, 1999, 4999, 9999, ...). PayU would divide +-- by 100 and charge 1/100th of the intended price, e.g. a "₹999 Growth" +-- package would actually charge ₹9.99. +-- +-- Threshold price_inr < 10000 catches exactly the mis-seeded rows and +-- leaves the correctly-seeded 25000 row untouched. Confirmed no purchases +-- have gone through pricing_packages yet (this is pre-launch), so this is +-- a data-fix, not a refund situation. + +BEGIN; + +UPDATE pricing_packages SET price_inr = price_inr * 100 WHERE price_inr < 10000; + +COMMIT;