@bytebrand/fe-ui-core-autobahn 1.0.100 → 1.0.102

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.
@@ -699,7 +699,7 @@
699
699
  "vehiclePrice": "Fahrzeugpreis ggf. inkl. MwSt.",
700
700
  "leasingAmount": "Leasingbetrag",
701
701
  "netLoanAmount": "Nettodarlehensbetrag",
702
- "downPayment": "Sonderzahlung",
702
+ "downPayment": "Anzahlung",
703
703
  "annualMileage": "Laufleistung / Jahr",
704
704
  "term": "Vertragslaufzeit",
705
705
  "months": "{{months}} Monat",
@@ -699,7 +699,7 @@
699
699
  "vehiclePrice": "Vehicle price (incl. VAT, if applicable)",
700
700
  "leasingAmount": "Leasing amount",
701
701
  "netLoanAmount": "Net loan amount",
702
- "downPayment": "Special payment",
702
+ "downPayment": "Down payment",
703
703
  "annualMileage": "Mileage / year",
704
704
  "term": "Contract term",
705
705
  "months": "{{months}} month",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.100",
3
+ "version": "1.0.102",
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",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@bytebrand/car-schema-selectors": "^2.0.7",
13
- "@bytebrand/fe-financing": "^5.14.12",
13
+ "@bytebrand/fe-financing": "^5.14.15",
14
14
  "classnames": "2.2.6",
15
15
  "clsx": "^2.1.1",
16
16
  "d3-format": "1.4.5",
@@ -1845,6 +1845,11 @@ export interface FinanceDetailsModalProps {
1845
1845
  /** car make+model — mobile sheet subtitle under the title (mockup). */
1846
1846
  vehicleName?: string;
1847
1847
  price: number;
1848
+ /** "No package" reference price (common.basePrice = originalSalesPrice + margin) — the
1849
+ * Repräsentatives Beispiel's Fahrzeugpreis/Anschaffungspreis line uses THIS, not `price`
1850
+ * (which is the real, package-dependent Kaufen/rate-basis price shown everywhere else).
1851
+ * Falls back to `price` when not supplied. */
1852
+ basePrice?: number;
1848
1853
  monthly: number;
1849
1854
  /** struck old rate (oldMonthlyInstallment, isStrikeShown-gated) — red line-through next to the rate. */
1850
1855
  oldMonthly?: number;
@@ -1859,8 +1864,14 @@ export interface FinanceDetailsModalProps {
1859
1864
  netLoanAmount?: number;
1860
1865
  /** Schlussrate (balloon final installment); shown only when > 0. */
1861
1866
  finalInstallment?: number;
1862
- /** Gesamt(rückzahlungs)betrag from the config; shown only when > 0 (never the wrong monthly·term). */
1867
+ /** Gesamt(rückzahlungs)betrag from the config; shown only when > 0 (never the wrong monthly·term).
1868
+ * Drives the bold "Gesamtbelastung inkl. Anzahlung" grand total ONLY — the "Gesamtbetrag
1869
+ * Finanzierung" disclosure line itself uses totalFinancingAmount below instead. */
1863
1870
  grossAmount?: number;
1871
+ /** getFinancing's totalFinancingAmount = (paybackPeriod-1)×monthlyCarPrice + finalInstallment —
1872
+ * the simpler Repräsentatives-Beispiel total (uniform Folgerate, no separate 1.Rate), financing
1873
+ * only. Falls back to grossAmount when not supplied. */
1874
+ totalFinancingAmount?: number;
1864
1875
  /** Sollzinssatz p.a. (%); shown only when > 0. */
1865
1876
  nominalRate?: number;
1866
1877
  /** slider bounds — when the change handlers are supplied, the modal shows adjustment sliders. */
@@ -1921,6 +1932,7 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
1921
1932
  mode,
1922
1933
  vehicleName,
1923
1934
  price,
1935
+ basePrice,
1924
1936
  monthly,
1925
1937
  oldMonthly,
1926
1938
  listPrice,
@@ -1931,6 +1943,7 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
1931
1943
  netLoanAmount,
1932
1944
  finalInstallment,
1933
1945
  grossAmount,
1946
+ totalFinancingAmount,
1934
1947
  nominalRate,
1935
1948
  downMin,
1936
1949
  downMax,
@@ -2091,7 +2104,7 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
2091
2104
  const subtotalWithPackage = ratesSum != null ? ratesSum + down + (hasAddServicesRow ? addServicesRowValue : 0) : undefined;
2092
2105
  const grandTotal = subtotalWithPackage != null ? subtotalWithPackage + residual : undefined;
2093
2106
  rows = [
2094
- [t('autobahn:modal.leaseVehiclePrice'), `${eurCents(price)} €`],
2107
+ [t('autobahn:modal.leaseVehiclePrice'), `${eurCents(basePrice ?? price)} €`],
2095
2108
  [t('autobahn:modal.term'), t('autobahn:modal.months', { months: term, count: term })],
2096
2109
  ...(annualMileage != null ? ([[t('autobahn:modal.annualMileage'), `${eur(annualMileage)} km`]] as Array<[string, string]>) : []),
2097
2110
  [t('autobahn:modal.leaseDownPayment'), `${eurCents(down)} €`],
@@ -2117,19 +2130,29 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
2117
2130
  ...(listPrice != null && listPrice > 0 ? ([[t('autobahn:modal.listPriceLease'), `${eurCents(listPrice)} €`]] as Array<[string, string]>) : []),
2118
2131
  ];
2119
2132
  } else {
2133
+ // Ballonfinanzierung: `term` includes the Schlussrate as its final slot, so only
2134
+ // (term-1) of them are regular Folgerate-value installments. Without a balloon, all
2135
+ // `term` payments are regular — no adjustment.
2136
+ const hasBalloon = finalInstallment != null && finalInstallment > 0;
2137
+ const regularRateCount = hasBalloon ? term - 1 : term;
2138
+ // Repräsentatives-Beispiel total for THIS line only — falls back to grossAmount when the
2139
+ // page hasn't been updated to pass totalFinancingAmount yet.
2140
+ const totalRepaymentValue = totalFinancingAmount ?? grossAmount;
2120
2141
  rows = [
2121
- [t('autobahn:modal.vehiclePrice'), `${eurCents(price)} €`],
2142
+ [t('autobahn:modal.vehiclePrice'), `${eurCents(basePrice ?? price)} €`],
2122
2143
  [t('autobahn:modal.term'), t('autobahn:modal.months', { months: term, count: term })],
2123
2144
  [t('autobahn:modal.downPayment'), `${eurCents(down)} €`],
2124
- [t('autobahn:modal.monthlyRateCount', { count: term }), `${eurCents(monthly)} €`],
2125
- ...(finalInstallment != null && finalInstallment > 0 ? ([[t('autobahn:modal.finalInstallment'), `${eurCents(finalInstallment)} €`]] as Array<[string, string]>) : []),
2145
+ [t('autobahn:modal.monthlyRateCount', { count: regularRateCount }), `${eurCents(monthly)} €`],
2146
+ ...(hasBalloon ? ([[t('autobahn:modal.finalInstallment'), `${eurCents(finalInstallment)} €`]] as Array<[string, string]>) : []),
2126
2147
  ...(hasAddServicesRow
2127
2148
  ? ([[t('autobahn:modal.addServicesRow'), `${eurCents(addServicesRowValue)} €`]] as Array<[string, string]>)
2128
2149
  : []),
2129
2150
  ...(nominalRate != null && nominalRate > 0 ? ([[t('autobahn:modal.nominalRate'), pct(nominalRate)]] as Array<[string, string]>) : []),
2130
2151
  [t('autobahn:modal.effectiveRate'), pct(apr)],
2131
2152
  [t('autobahn:modal.netLoanAmount'), `${eurCents(netto)} €`],
2132
- ...(grossAmount != null && grossAmount > 0 ? ([[t('autobahn:modal.totalRepayment'), `${eurCents(grossAmount)} €`]] as Array<[string, string]>) : []),
2153
+ ...(totalRepaymentValue != null && totalRepaymentValue > 0
2154
+ ? ([[t('autobahn:modal.totalRepayment'), `${eurCents(totalRepaymentValue)} €`]] as Array<[string, string]>)
2155
+ : []),
2133
2156
  ...(totalCost != null
2134
2157
  ? ([[hasAddServices || hasAddServicesRow ? t('autobahn:modal.totalCostWithPackage') : t('autobahn:modal.totalCost'), `${eurCents(totalCost)} €`, true]] as Array<
2135
2158
  [string, string, boolean]