diff --git a/.phase9-state.json b/.phase9-state.json index f8f1c6e..ef043a2 100644 --- a/.phase9-state.json +++ b/.phase9-state.json @@ -1,8 +1,9 @@ { "completed_features": [], - "current_feature": "two-factor-auth-stub", + "current_feature": "billing-stub", "started_at": "2026-05-23T06:02:21.166704", "attempted_features": [ - "webhooks-config" + "webhooks-config", + "two-factor-auth-stub" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 7a3802a..f7fc9ef 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -1056,3 +1056,20 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 2 of 3, '(plugin: FastifyPluginAsync<{ 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 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy +- `06:04:42` **INFO** Committed feature two-factor-auth-stub +- `06:04:42` **INFO** Pushed: rc=0 + +## Phase-3 Feature: billing-stub (2026-05-23 06:04:42) + +- `06:04:42` **INFO** Description: Plans-Page mit Pricing-Tiers (UI only, kein Stripe) +- `06:04:42` **INFO** Generating apps/web/src/pages/Billing.tsx (Billing/Plans-Page. 3 Pricing-Cards: 'Free' (0€, 1 User, 100 entries/M…) +- `06:05:29` **INFO** wrote 5423 chars in 47.2s (attempt 1) +- `06:05:29` **INFO** Running tsc --noEmit on api… +- `06:05:31` **WARN** tsc errors: +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, FastifyBaseLogger, FastifyTypeProvider>, opts: { ...; }, done: (err?: Error | undefined) => void): void'. + Overload 2 of 3, '(plugin: FastifyPluginAsync<{ 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 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy diff --git a/apps/web/src/pages/Billing.tsx b/apps/web/src/pages/Billing.tsx new file mode 100644 index 0000000..4fd0a0c --- /dev/null +++ b/apps/web/src/pages/Billing.tsx @@ -0,0 +1,141 @@ +import { useQuery } from "@tanstack/react-query" +import { api } from "../lib/api" +import { toast } from "react-hot-toast" + +interface Plan { + name: string + price: string + description: string + features: string[] + highlighted?: boolean +} + +const PLANS: Plan[] = [ + { + name: "Free", + price: "0€", + description: "Perfect for individuals getting started.", + features: ["1 User", "100 entries / month", "Basic Support", "Community Access"], + }, + { + name: "Team", + price: "12€", + description: "Scale your business with collaboration.", + features: ["Unlimited Users", "Unlimited entries", "Customers & Projects", "Priority Email Support"], + highlighted: true, + }, + { + name: "Enterprise", + price: "Custom", + description: "Advanced security and dedicated support.", + features: ["Custom SLA", "SSO / SAML", "Audit Logs", "Dedicated Account Manager"], + }, +] + +export default function Billing() { + const { data: currentUser, isLoading } = useQuery({ + queryKey: ["me"], + queryFn: () => api.getMe(), + }) + + // Mocking current plan as 'Free' for now as per requirements + const currentPlan = "Free" + + const handleUpgrade = (planName: string) => { + toast.success(`Stripe-Integration for ${planName} comes in v2`) + } + + if (isLoading) { + return
Loading billing details...
+ } + + return ( +
+
+
+

Billing & Plans

+

Choose the right plan for your organization's needs.

+
+
+ Current Plan: + + {currentPlan} + +
+
+ +
+ {PLANS.map((plan) => ( +
+ {plan.highlighted && ( + + MOST POPULAR + + )} + +
+

{plan.name}

+
+ {plan.price} + {plan.price !== "Custom" && ( + /user/month + )} +
+

{plan.description}

+
+ +
    + {plan.features.map((feature) => ( +
  • + + + + {feature} +
  • + ))} +
+ + +
+ ))} +
+ +
+

Payment Method

+
+
+
+ CARD +
+
+

No card on file

+

Add a payment method to upgrade your plan

+
+
+ +
+
+
+ ) +} \ No newline at end of file