feat(pricing): implement phase 1 - EUR and USD price parity and EU country currency mapping

This commit is contained in:
Urvish Prajapati 2026-11-20 15:46:28 +05:30
parent 551631773e
commit 342ca856d9
3 changed files with 11 additions and 3 deletions

View File

@ -262,7 +262,7 @@ export default function App() {
return {
priceInr: livePlan.price_inr ?? item.priceInr,
priceUsd: livePlan.price_usd ?? item.priceUsd,
priceEur: item.priceEur,
priceEur: livePlan.price_eur ?? livePlan.price_usd ?? item.priceEur,
isActive: livePlan.is_active !== undefined ? livePlan.is_active : true,
};
}
@ -703,6 +703,7 @@ export default function App() {
...item,
priceInr: live.priceInr,
priceUsd: live.priceUsd,
priceEur: live.priceEur,
};
})
);
@ -783,6 +784,7 @@ export default function App() {
...module,
priceInr: live.priceInr,
priceUsd: live.priceUsd,
priceEur: live.priceEur,
};
const exists = cart.find(item => item.code === module.code);

View File

@ -665,7 +665,7 @@ export const CatalogSection: React.FC<CatalogSectionProps> = ({
category: 'Bundle',
priceInr: pInr,
priceUsd: pUsd,
priceEur: pUsd,
priceEur: cPlan.price_eur ?? pUsd,
desc: cPlan.description || 'Custom bundled access.',
color: 'from-slate-700 to-slate-900'
};
@ -717,7 +717,7 @@ export const CatalogSection: React.FC<CatalogSectionProps> = ({
</span>
) : (
<span className="text-xs font-extrabold text-slate-700">
{currency === 'INR' ? `₹${pInr}` : `$${pUsd}`}
{currency === 'INR' ? `₹${pInr}` : currency === 'EUR' ? `€${cPlan.price_eur ?? pUsd}` : `$${pUsd}`}
</span>
)}
{!isUnlocked && (

View File

@ -54,6 +54,12 @@ export const COUNTRY_CODES: CountryCode[] = [
{ iso2: 'HR', code: '+385', label: '🇭🇷 +385', country: 'Croatia', currency: 'EUR', minLength: 8, maxLength: 9, placeholder: '8 to 9 digits' },
{ iso2: 'SK', code: '+421', label: '🇸🇰 +421', country: 'Slovakia', currency: 'EUR', minLength: 9, maxLength: 9, placeholder: '9-digit mobile number' },
{ iso2: 'BG', code: '+359', label: '🇧🇬 +359', country: 'Bulgaria', currency: 'EUR', minLength: 8, maxLength: 9, placeholder: '8 to 9 digits' },
{ iso2: 'CY', code: '+357', label: '🇨🇾 +357', country: 'Cyprus', currency: 'EUR', minLength: 8, maxLength: 8, placeholder: '8-digit phone number' },
{ iso2: 'EE', code: '+372', label: '🇪🇪 +372', country: 'Estonia', currency: 'EUR', minLength: 7, maxLength: 8, placeholder: '7 to 8 digits' },
{ iso2: 'LV', code: '+371', label: '🇱🇻 +371', country: 'Latvia', currency: 'EUR', minLength: 8, maxLength: 8, placeholder: '8-digit phone number' },
{ iso2: 'LT', code: '+370', label: '🇱🇹 +370', country: 'Lithuania', currency: 'EUR', minLength: 8, maxLength: 8, placeholder: '8-digit phone number' },
{ iso2: 'MT', code: '+356', label: '🇲🇹 +356', country: 'Malta', currency: 'EUR', minLength: 8, maxLength: 8, placeholder: '8-digit phone number' },
{ iso2: 'SI', code: '+386', label: '🇸🇮 +386', country: 'Slovenia', currency: 'EUR', minLength: 8, maxLength: 8, placeholder: '8-digit phone number' },
{ iso2: 'RU', code: '+7', label: '🇷🇺 +7', country: 'Russia', currency: 'USD', minLength: 10, maxLength: 10, placeholder: '10-digit mobile number' },
{ iso2: 'TR', code: '+90', label: '🇹🇷 +90', country: 'Turkey', currency: 'USD', minLength: 10, maxLength: 10, placeholder: '10-digit mobile number' },