@bytebrand/fe-ui-core-autobahn 1.0.105 → 1.0.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vdp/VdpModules.tsx +14 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.105",
3
+ "version": "1.0.106",
4
4
  "description": "auto.de md3 (Autobahn) design system — UI primitives, cards, chrome, VDP modules, theme CSS and locales. Ships raw TypeScript source (like fe-ui-core before it); each consumer's bundler compiles it.",
5
5
  "main": "index.ts",
6
6
  "license": "UNLICENSED",
@@ -2089,6 +2089,11 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
2089
2089
  totalRepaymentBase != null && totalRepaymentBase > 0
2090
2090
  ? down + totalRepaymentBase + (hasAddServices ? (addServicesCost as number) : hasAddServicesRow ? addServicesRowValue : 0)
2091
2091
  : undefined;
2092
+ // Fahrzeugpreis/Anschaffungspreis disclosure line: the "no package" basePrice — but when the
2093
+ // package is bundled into the rate (toggle ON) the financed object includes it, so the shown
2094
+ // price does too. Same rule for financing and leasing (only the row labels differ).
2095
+ const packageInRate = !!withAddServices && addServicesCostRaw != null && addServicesCostRaw > 0;
2096
+ const displayVehiclePrice = (basePrice ?? price) + (packageInRate ? (addServicesCostRaw as number) : 0);
2092
2097
 
2093
2098
  let rows: Array<[string, string, boolean?]>;
2094
2099
  if (isLease) {
@@ -2103,11 +2108,14 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
2103
2108
  // final grand total is mathematically identical to the financing total's own
2104
2109
  // down + grossAmount + package formula, just built up in the two visible stages Figma shows.
2105
2110
  const residual = finalInstallment != null && finalInstallment > 0 ? finalInstallment : 0;
2106
- const ratesSum = grossAmount != null && grossAmount > 0 ? grossAmount - residual : undefined;
2111
+ // Σ Leasingraten = the full term × the monthly rate — exactly what the row label
2112
+ // "(N × amount)" states. (Previously derived as grossAmount − residual, which is
2113
+ // (N−1) × monthly for Restwertleasing and contradicted the label by one rate.)
2114
+ const ratesSum = monthly != null && monthly > 0 ? monthly * term : undefined;
2107
2115
  const subtotalWithPackage = ratesSum != null ? ratesSum + down + (hasAddServicesRow ? addServicesRowValue : 0) : undefined;
2108
2116
  const grandTotal = subtotalWithPackage != null ? subtotalWithPackage + residual : undefined;
2109
2117
  rows = [
2110
- [t('autobahn:modal.leaseVehiclePrice'), `${eurCents(basePrice ?? price)} €`],
2118
+ [t('autobahn:modal.leaseVehiclePrice'), `${eurCents(displayVehiclePrice)} €`],
2111
2119
  [t('autobahn:modal.term'), t('autobahn:modal.months', { months: term, count: term })],
2112
2120
  ...(annualMileage != null ? ([[t('autobahn:modal.annualMileage'), `${eur(annualMileage)} km`]] as Array<[string, string]>) : []),
2113
2121
  [t('autobahn:modal.leaseDownPayment'), `${eurCents(down)} €`],
@@ -2121,6 +2129,9 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
2121
2129
  ...(ratesSum != null && hasAddServicesRow
2122
2130
  ? ([[t('autobahn:modal.addServicesRowLease'), `${eurCents(addServicesRowValue)} €`]] as Array<[string, string]>)
2123
2131
  : []),
2132
+ // The rates the calculation actually ran with (Figma): nominal + effective APR.
2133
+ ...(nominalRate != null && nominalRate > 0 ? ([[t('autobahn:modal.nominalRate'), pct(nominalRate)]] as Array<[string, string]>) : []),
2134
+ ...(apr != null && apr > 0 ? ([[t('autobahn:modal.effectiveRate'), pct(apr)]] as Array<[string, string]>) : []),
2124
2135
  ...(subtotalWithPackage != null
2125
2136
  ? ([[hasAddServicesRow ? t('autobahn:modal.subtotalWithPackage') : t('autobahn:modal.subtotalNoPackage'), `${eurCents(subtotalWithPackage)} €`, true]] as Array<
2126
2137
  [string, string, boolean]
@@ -2143,7 +2154,7 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
2143
2154
  // pass totalFinancingAmount yet.
2144
2155
  const totalRepaymentValue = totalRepaymentBase;
2145
2156
  rows = [
2146
- [t('autobahn:modal.vehiclePrice'), `${eurCents(basePrice ?? price)} €`],
2157
+ [t('autobahn:modal.vehiclePrice'), `${eurCents(displayVehiclePrice)} €`],
2147
2158
  [t('autobahn:modal.term'), t('autobahn:modal.months', { months: term, count: term })],
2148
2159
  [t('autobahn:modal.downPayment'), `${eurCents(down)} €`],
2149
2160
  [t('autobahn:modal.monthlyRateCount', { count: regularRateCount }), `${eurCents(monthly)} €`],