Practitionist / Practitionist/elluminar_web

Regional/PPP pricing + multi-currency GA

Open
#21 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

commerce payments post-mvp v2
Dominant language
TypeScript
Stars
1
Forks
0
Avg merge
17h 2m
Merged PRs (30d)
18

Description

Why / Context

PRD §7.2E / §8.6: regional/PPP-adjusted pricing is the mechanism for international expansion (Udemy's existing playbook). Combined with Dodo as Merchant of Record (issue #1), it opens non-India revenue without tax-compliance drag. Schema was built multi-currency from day one precisely so this is activation, not migration.

Schema already in place — NO migration required

  • Price.currency + Price.region (nullable = default) on every sellable, including plan interval prices
  • Order.currency + BigInt minor units everywhere; Cart.currency
  • SubscriptionPlan.providerRefs holds per-currency provider plan ids
  • PaymentProviderKind.DODO routing (issue #1)

Implementation plan

  1. Region model: define pricing regions (e.g., IN, US, EU, SEA, LATAM, ROW) + geo-detection service (IP header on Netlify → region cookie, user-overridable currency switcher).
  2. Pricing engine extension (src/lib/commerce/pricing.ts): resolution order = (currency, region) → (currency, null) → default currency conversion fallback DISABLED (only explicit prices sell — no FX surprises).
  3. Studio pricing UI: per-region price rows for courses/projects (bulk "suggest from PPP index" helper using a maintained multiplier table in PlatformConfig); platform sets plan prices per region.
  4. Cart/checkout: single-currency cart enforcement (mixed-currency add prompts a switch), provider routing INR→Razorpay / else→Dodo.
  5. Subscriptions: create per-currency provider plans; store in providerRefs; upgrade/downgrade stays within currency.
  6. Anti-arbitrage: region locked at purchase to detected region unless override + revalidation; VPN-shopping policy documented (soft enforcement: region-mismatch flag on orders).
  7. Display: localized currency formatting (Intl), tax-inclusive display per region policy, compareAt strikethroughs per region.
  8. Reporting: ledger and payout views group by currency (accounts are already per-currency); FX-normalized revenue reporting for admin (rates table, reporting-only).

Acceptance criteria

  • US visitor sees USD prices where defined; items without USD prices show as unavailable-in-region (not FX-converted)
  • Checkout in USD routes to Dodo, INR to Razorpay; fulfillment identical
  • Region price rows manageable in studio; PPP suggester fills drafts
  • Mixed-currency cart is impossible; switcher migrates the cart
  • Ledger accounts split by currency reconcile per provider

Dependencies / sequencing

  • Requires issue #1 (Dodo MoR). Enhances plans/checkout from MVP M7/M8

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/lib/commerce/pricing.ts, then trace the existing Price, Order, Cart, and SubscriptionPlan providerRefs paths before reading the studio, checkout, and reporting entry points. The work is done when regional prices, currency-specific routing and subscriptions, mixed-currency cart handling, PPP drafts, and the listed ledger and display acceptance criteria are covered without FX fallback.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, frontend, payments
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.