@bytebrand/fe-ui-core-autobahn 1.0.11 → 1.0.12

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.
@@ -422,6 +422,12 @@ const PpRow: React.FunctionComponent<PpRowProps> = ({ label, value, unit, old, f
422
422
  */
423
423
  export const PricePaths: React.FunctionComponent<PricePathsProps> = ({ car, t }) => {
424
424
  const hasLease = car.lease != null;
425
+ // Terms of the config the displayed rate was actually computed with (per-car:
426
+ // dealer rate + the user's saved localStorage adjustments) — default config
427
+ // terms only when the car doesn't carry its own.
428
+ const finFirstInstallment =
429
+ car.finFirstInstallment != null ? car.finFirstInstallment.toLocaleString('de-DE') : _finFirstInstallment;
430
+ const finMonths = car.finMonths ?? _finMonths;
425
431
  return (
426
432
  <div className="pricepaths">
427
433
  <div className="pp-hero">
@@ -432,9 +438,9 @@ export const PricePaths: React.FunctionComponent<PricePathsProps> = ({ car, t })
432
438
  </div>
433
439
  <div className="pp-hero-terms">
434
440
  {t('autobahn:card.price.financeTerms', {
435
- firstInstallment: _finFirstInstallment,
436
- months: _finMonths,
437
- count: _finMonths,
441
+ firstInstallment: finFirstInstallment,
442
+ months: finMonths,
443
+ count: finMonths,
438
444
  })}
439
445
  </div>
440
446
  </div>
package/cards/types.ts CHANGED
@@ -57,6 +57,13 @@ export interface AutobahnCar {
57
57
  // --- price (always real) ---
58
58
  /** financing monthly rate in EUR — the LEAD price on every card. */
59
59
  monthly: number;
60
+ /**
61
+ * financing terms the `monthly` rate was computed with — the per-car merged
62
+ * config (dealer rate + the user's saved localStorage adjustments, ADV-157).
63
+ * Absent → the card falls back to the fe-financing default-config terms.
64
+ */
65
+ finFirstInstallment?: number;
66
+ finMonths?: number;
60
67
  /** purchase price in EUR (raw number; formatted de-DE by the cards). */
61
68
  price: number;
62
69
 
@@ -305,6 +305,11 @@ export function toAutobahnCar(storeCar: any, deps: ToAutobahnCarDeps = {}): Auto
305
305
  // (getFinancing.ts:82 `monthlyInstallment`), spread into price.financing by
306
306
  // transformDataForVehicles (DataTransformers.ts:345). It is the LEAD price.
307
307
  const monthly = num(price?.financing?.monthlyInstallment) ?? 0;
308
+ // financing terms the monthly rate was computed with — same merged per-car
309
+ // config (dealer rate + the user's saved localStorage adjustments, ADV-157).
310
+ // Emitted only when real; the cards fall back to the default-config terms.
311
+ const finFirstInstallment = num(price?.financing?.firstInstallment);
312
+ const finMonths = num(price?.financing?.rawPaybackPeriod) ?? num(price?.financing?.paybackPeriod);
308
313
  // price ← price.currentSalesPrice (DataTransformers.ts:352).
309
314
  const purchase = num(price?.currentSalesPrice) ?? 0;
310
315
 
@@ -410,6 +415,8 @@ export function toAutobahnCar(storeCar: any, deps: ToAutobahnCarDeps = {}): Auto
410
415
 
411
416
  // price
412
417
  monthly,
418
+ ...(finFirstInstallment != null ? { finFirstInstallment } : {}),
419
+ ...(finMonths != null ? { finMonths } : {}),
413
420
  price: purchase,
414
421
 
415
422
  // media
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
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",