feat(order-summary-component): OrderSummary für Checkout [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 10:53:58 +02:00
parent 14884ff684
commit 4f66286df9
3 changed files with 98 additions and 2 deletions

View File

@ -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"
]
}

View File

@ -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<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
- `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<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,

View File

@ -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 (
<div className="w-full max-w-md mx-auto bg-white rounded-lg shadow-sm border border-slate-200 overflow-hidden">
<div className="p-4 border-b border-slate-100">
<h3 className="text-lg font-semibold text-slate-900">Bestellübersicht</h3>
</div>
<div className="p-4">
<table className="w-full text-sm text-left">
<thead>
<tr className="text-slate-500 border-b border-slate-100">
<th className="py-2 font-medium">Artikel</th>
<th className="py-2 text-right font-medium">Preis</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-50">
{lineItems.map((item, idx) => (
<tr key={idx}>
<td className="py-3 text-slate-700">
<span className="font-medium mr-2">{item.qty}×</span>
{item.label}
</td>
<td className="py-3 text-right text-slate-700">
{formatCurrency(item.qty * item.priceCents)}
</td>
</tr>
))}
</tbody>
</table>
<div className="mt-6 space-y-2 border-t border-slate-100 pt-4">
<div className="flex justify-between text-slate-600">
<span>Zwischensumme</span>
<span>{formatCurrency(subtotalCents)}</span>
</div>
<div className="flex justify-between text-slate-600">
<span>MwSt.</span>
<span>{formatCurrency(taxCents)}</span>
</div>
<div className="flex justify-between text-lg font-bold text-slate-900 pt-2">
<span>Gesamtbetrag</span>
<span>{formatCurrency(totalCents)}</span>
</div>
</div>
</div>
</div>
);
}