feat(receipt-component): Receipt-Layout (Belegdruck) [tsc:fail]
This commit is contained in:
parent
0ced4d5bb5
commit
14884ff684
@ -5,6 +5,7 @@
|
||||
"attempted_features": [
|
||||
"price-tag-component",
|
||||
"time-ago-component",
|
||||
"address-component"
|
||||
"address-component",
|
||||
"icon-button-component"
|
||||
]
|
||||
}
|
||||
5
.phase47-state.json
Normal file
5
.phase47-state.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"completed_features": [],
|
||||
"current_feature": "receipt-component",
|
||||
"started_at": "2026-05-23T10:53:28.415380"
|
||||
}
|
||||
@ -4739,3 +4739,28 @@ 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:49:06` **INFO** Committed feature icon-button-component
|
||||
- `10:49:06` **INFO** Pushed: rc=0
|
||||
|
||||
## Phase-46 Run beendet (2026-05-23 10:49:06)
|
||||
|
||||
- `10:49:06` **INFO** OK: 0, Attempted: 4, Total: 4
|
||||
|
||||
## 🚀 Phase-47 Codegen-Run gestartet (2026-05-23 10:53:28)
|
||||
|
||||
|
||||
## Phase-3 Feature: receipt-component (2026-05-23 10:53:28)
|
||||
|
||||
- `10:53:28` **INFO** Description: Receipt-Layout (Belegdruck)
|
||||
- `10:53:28` **INFO** Generating apps/web/src/components/Receipt.tsx (Receipt-Component. Props: items (array {label, amount}), total, curren…)
|
||||
- `10:53:39` **INFO** wrote 1490 chars in 10.7s (attempt 1)
|
||||
- `10:53:39` **INFO** Running tsc --noEmit on api…
|
||||
- `10:53:40` **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>,
|
||||
|
||||
48
apps/web/src/components/Receipt.tsx
Normal file
48
apps/web/src/components/Receipt.tsx
Normal file
@ -0,0 +1,48 @@
|
||||
import React from 'react';
|
||||
|
||||
interface ReceiptItem {
|
||||
label: string;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
interface ReceiptProps {
|
||||
items: ReceiptItem[];
|
||||
total: number;
|
||||
currency?: string;
|
||||
}
|
||||
|
||||
const Receipt: React.FC<ReceiptProps> = ({ items, total, currency = '€' }) => {
|
||||
return (
|
||||
<div className="w-full max-w-xs mx-auto p-6 bg-white shadow-sm border border-gray-200 font-mono text-sm text-gray-800">
|
||||
<div className="text-center mb-6">
|
||||
<h2 className="text-lg font-bold uppercase tracking-widest">Receipt</h2>
|
||||
<p className="text-xs text-gray-500">{new Date().toLocaleDateString()}</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2 mb-6">
|
||||
{items.map((item, index) => (
|
||||
<div key={index} className="flex justify-between items-baseline gap-4">
|
||||
<span className="truncate">{item.label}</span>
|
||||
<div className="flex-grow border-b border-dotted border-gray-300 mx-1 mb-1" />
|
||||
<span className="whitespace-nowrap">
|
||||
{item.amount.toFixed(2)} {currency}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="border-t-2 border-black pt-4 flex justify-between items-center font-bold text-base">
|
||||
<span>TOTAL</span>
|
||||
<span>
|
||||
{total.toFixed(2)} {currency}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="mt-8 text-center text-[10px] text-gray-400 uppercase tracking-tighter">
|
||||
Thank you for your business
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Receipt;
|
||||
97
scripts/phase47_features.py
Normal file
97
scripts/phase47_features.py
Normal file
@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Phase-47: standalone components — Receipt, OrderSummary, Calendar, MapPlaceholder."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio, datetime, json, sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
from phase2_features import Feature, FileGen, ROOT, log, log_section
|
||||
from phase3_features import run_feature_v2
|
||||
|
||||
PHASE_STATE = ROOT / ".phase47-state.json"
|
||||
|
||||
FEATURES: list[Feature] = [
|
||||
Feature(
|
||||
name="receipt-component",
|
||||
description="Receipt-Layout (Belegdruck)",
|
||||
files=[FileGen(
|
||||
path="apps/web/src/components/Receipt.tsx",
|
||||
purpose=(
|
||||
"Receipt-Component. Props: items (array {label, amount}), total, currency? (default '€'). "
|
||||
"Vertikal: Items mit dotted-line zwischen label und amount. Total fett unten. Mono-font. "
|
||||
"Tailwind. Export default."
|
||||
),
|
||||
)],
|
||||
),
|
||||
Feature(
|
||||
name="order-summary-component",
|
||||
description="OrderSummary für Checkout",
|
||||
files=[FileGen(
|
||||
path="apps/web/src/components/OrderSummary.tsx",
|
||||
purpose=(
|
||||
"OrderSummary-Component. Props: lineItems (array {label, qty, priceCents}), subtotalCents, taxCents, totalCents. "
|
||||
"Tabelle mit qty × label, Preis. Subtotal/Tax/Total summary block unten. "
|
||||
"Tailwind. Export default."
|
||||
),
|
||||
)],
|
||||
),
|
||||
Feature(
|
||||
name="calendar-month-grid-component",
|
||||
description="MonthGrid (read-only Display-Komponente)",
|
||||
files=[FileGen(
|
||||
path="apps/web/src/components/CalendarMonthGrid.tsx",
|
||||
purpose=(
|
||||
"CalendarMonthGrid-Component. Props: year, month (0-11), highlightDates?: array Date, onDayClick?(date). "
|
||||
"Grid 7 Spalten x 6 Reihen. Header Mo-So. Heutiger Tag highlighted. Klick auf Day-Cell ruft onDayClick. "
|
||||
"Tailwind. Export default."
|
||||
),
|
||||
)],
|
||||
),
|
||||
Feature(
|
||||
name="map-placeholder-component",
|
||||
description="MapPlaceholder (kein echtes Map, nur grayed)",
|
||||
files=[FileGen(
|
||||
path="apps/web/src/components/MapPlaceholder.tsx",
|
||||
purpose=(
|
||||
"MapPlaceholder-Component. Props: lat?, lng?, address?, height? (default '300px'). "
|
||||
"Grauer Box mit Map-Icon (lucide MapPin) zentriert + 'Karte nicht verfügbar' + optional address. "
|
||||
"Tailwind. Export default."
|
||||
),
|
||||
)],
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def load_state():
|
||||
if PHASE_STATE.exists():
|
||||
return json.loads(PHASE_STATE.read_text())
|
||||
return {"completed_features": [], "current_feature": None, "started_at": datetime.datetime.now().isoformat()}
|
||||
|
||||
|
||||
def save_state(state):
|
||||
PHASE_STATE.write_text(json.dumps(state, indent=2))
|
||||
|
||||
|
||||
async def main():
|
||||
log_section("🚀 Phase-47 Codegen-Run gestartet")
|
||||
state = load_state()
|
||||
for feature in FEATURES:
|
||||
if feature.name in state.get("completed_features", []):
|
||||
continue
|
||||
state["current_feature"] = feature.name; save_state(state)
|
||||
try:
|
||||
success = await run_feature_v2(feature)
|
||||
state.setdefault("completed_features" if success else "attempted_features", []).append(feature.name)
|
||||
save_state(state)
|
||||
except Exception as e:
|
||||
log(f"❌ {feature.name} crashed: {e}", level="ERROR")
|
||||
state.setdefault("attempted_features", []).append(feature.name); save_state(state)
|
||||
log_section("Phase-47 Run beendet")
|
||||
log(f"OK: {len(state.get('completed_features', []))}, Attempted: {len(state.get('attempted_features', []))}, Total: {len(FEATURES)}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(asyncio.run(main()))
|
||||
Loading…
Reference in New Issue
Block a user