From 4f66286df95bbaa7f63120bd90779abfb0a8e129 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 10:53:58 +0200 Subject: [PATCH] =?UTF-8?q?feat(order-summary-component):=20OrderSummary?= =?UTF-8?q?=20f=C3=BCr=20Checkout=20[tsc:fail]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .phase47-state.json | 7 ++- GENERATION_LOG.md | 18 ++++++ apps/web/src/components/OrderSummary.tsx | 75 ++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 apps/web/src/components/OrderSummary.tsx diff --git a/.phase47-state.json b/.phase47-state.json index 5ec0bb3..d85786f 100644 --- a/.phase47-state.json +++ b/.phase47-state.json @@ -1,5 +1,8 @@ { "completed_features": [], - "current_feature": "receipt-component", - "started_at": "2026-05-23T10:53:28.415380" + "current_feature": "order-summary-component", + "started_at": "2026-05-23T10:53:28.415380", + "attempted_features": [ + "receipt-component" + ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index bb7590d..03547b5 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -4764,3 +4764,21 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, +- `10:53:40` **INFO** Committed feature receipt-component +- `10:53:41` **INFO** Pushed: rc=0 + +## Phase-3 Feature: order-summary-component (2026-05-23 10:53:41) + +- `10:53:41` **INFO** Description: OrderSummary für Checkout +- `10:53:41` **INFO** Generating apps/web/src/components/OrderSummary.tsx (OrderSummary-Component. Props: lineItems (array {label, qty, priceCent…) +- `10:53:57` **INFO** wrote 2305 chars in 16.2s (attempt 1) +- `10:53:57` **INFO** Running tsc --noEmit on api… +- `10:53:58` **WARN** tsc errors: +src/db/schema.ts(37,14): error TS7022: 'customers' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(45,59): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/db/schema.ts(49,14): error TS7022: 'projects' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(53,56): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/index.ts(27,25): error TS2769: No overload matches this call. + Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, diff --git a/apps/web/src/components/OrderSummary.tsx b/apps/web/src/components/OrderSummary.tsx new file mode 100644 index 0000000..107ce3f --- /dev/null +++ b/apps/web/src/components/OrderSummary.tsx @@ -0,0 +1,75 @@ +import React from 'react'; + +interface LineItem { + label: string; + qty: number; + priceCents: number; +} + +interface OrderSummaryProps { + lineItems: LineItem[]; + subtotalCents: number; + taxCents: number; + totalCents: number; +} + +const formatCurrency = (cents: number) => { + return new Intl.NumberFormat('de-DE', { + style: 'currency', + currency: 'EUR', + }).format(cents / 100); +}; + +export default function OrderSummary({ + lineItems, + subtotalCents, + taxCents, + totalCents, +}: OrderSummaryProps) { + return ( +
+
+

Bestellübersicht

+
+ +
+ + + + + + + + + {lineItems.map((item, idx) => ( + + + + + ))} + +
ArtikelPreis
+ {item.qty}× + {item.label} + + {formatCurrency(item.qty * item.priceCents)} +
+ +
+
+ Zwischensumme + {formatCurrency(subtotalCents)} +
+
+ MwSt. + {formatCurrency(taxCents)} +
+
+ Gesamtbetrag + {formatCurrency(totalCents)} +
+
+
+
+ ); +} \ No newline at end of file