Feat/579 currency conversion localized pricing#733
Open
Essence-3 wants to merge 3 commits into
Open
Conversation
IMPLEMENTATION SUMMARY: - Currency Detection: Implemented CurrencyDetectionService supporting 50+ countries - Currency Conversion API: Full conversion service with exchangerate-api integration - Localized Pricing Display: PricingService with locale-aware formatting - Payment Processing: Support for payments in local currency with exchange rates NEW MODULES: - CurrencyModule: Core currency operations and REST API - PaymentsModule: Localized pricing for payment processing - CoursesModule: Localized course pricing display - UsersModule: User location and currency preference storage NEW SERVICES: - CurrencyService: Convert, format, and validate currencies - ExchangeRateService: Fetch and cache exchange rates - CurrencyDetectionService: Map locations to currencies - PricingService: Calculate localized pricing - LocalizedCourseService: Get course pricing by user location DATABASE MIGRATIONS: - Add location fields to users (country, countryCode, timezone, city) - Add preferredCurrency to users - Add currency field to courses API ENDPOINTS: - POST /currency/convert - Convert amounts between currencies - POST /currency/convert-multiple - Batch conversions - GET /currency/details/:code - Currency information - POST /currency/detect - Detect currency from location - GET /currency/supported - List supported currencies - GET /currency/rates - Get exchange rates - POST /currency/rates/refresh - Refresh rates - POST /pricing/localize - Get localized pricing - POST /pricing/for-payment - Payment-ready pricing - POST /pricing/multi-currency - Multi-currency pricing - POST /pricing/apply-discount - Apply discounts - POST /pricing/apply-tax - Apply taxes FEATURES: ✅ Automatic currency detection by country/timezone ✅ Real-time exchange rate updates (24-hour cache) ✅ Support for 50+ currencies and countries ✅ Locale-aware price formatting ✅ Discount and tax calculations in local currency ✅ Payment metadata tracking with exchange rates ✅ Proper handling of zero-decimal currencies (JPY, KRW) ✅ Comprehensive error handling and fallbacks BACKWARD COMPATIBLE: - All defaults to USD currency - Existing payment processing unchanged - User location fields are optional - No breaking changes to existing APIs
|
@Essence-3 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Kindly resolve conflict and fix workflow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issue
Closes #N
What does this PR do?
Type of change
Pre-merge checklist (required)
Branch & metadata
feature/issue-<N>-<slug>/fix/issue-<N>-<slug>conventiondevelopormain)Code quality & tests
npm run lint:ci— zero ESLint warningsnpm run format:check— Prettier reports no changes needednpm run typecheck— zero TypeScript errorsnpm run test:ci— all tests pass, coverage ≥ 70%.spec.tsunit testsError handling & NestJS best practices
class-validator/class-transformerdecorators and are wired through NestJS pipes (e.g. globalValidationPipeor explicit)any/unknownreaching the domain)BadRequestException,UnauthorizedException,ForbiddenException,NotFoundException) instead of genericErrorLoggeror central logger service) with meaningful, structured messagesAuthGuard, role/permissions guards, custom guards) are applied to all new/modified endpoints where appropriateAPI documentation / Swagger
/api(or Swagger UI) reflects new/changed endpoints correctlyBreaking changes
Breaking change description (if applicable)
Test evidence (required)
Commands run locally
Manual / API verification
Screenshots / recordings (if applicable)
Closes #579