SYS-18: add production deployment stack for karbe.cosmolan.fr (Stripe test)
- enable Next.js standalone output and add Docker/Caddy production stack - add production env template and deployment runbook - add healthcheck endpoint for container supervision - fix existing lint/type blockers discovered during validation Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
0a366c65db
commit
c9be24a969
11 changed files with 201 additions and 5 deletions
7
src/app/api/health/route.ts
Normal file
7
src/app/api/health/route.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { NextResponse } from "next/server";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
|
||||
export async function GET() {
|
||||
return NextResponse.json({ status: "ok" });
|
||||
}
|
||||
|
|
@ -97,11 +97,16 @@ async function handlePaymentIntentFailed(paymentIntent: Stripe.PaymentIntent) {
|
|||
}
|
||||
|
||||
async function handleSubscriptionUpdated(subscription: Stripe.Subscription) {
|
||||
const currentPeriodEnd =
|
||||
subscription.items.data[0]?.current_period_end ??
|
||||
subscription.trial_end ??
|
||||
subscription.canceled_at;
|
||||
|
||||
await prisma.subscription.upsert({
|
||||
where: { providerSubId: subscription.id },
|
||||
update: {
|
||||
status: mapStripeSubscriptionStatus(subscription.status),
|
||||
renewedAt: fromStripeTimestamp(subscription.current_period_end),
|
||||
renewedAt: fromStripeTimestamp(currentPeriodEnd),
|
||||
canceledAt: fromStripeTimestamp(subscription.canceled_at),
|
||||
},
|
||||
create: {
|
||||
|
|
@ -111,7 +116,7 @@ async function handleSubscriptionUpdated(subscription: Stripe.Subscription) {
|
|||
providerSubId: subscription.id,
|
||||
status: mapStripeSubscriptionStatus(subscription.status),
|
||||
startedAt: fromStripeTimestamp(subscription.start_date) ?? new Date(),
|
||||
renewedAt: fromStripeTimestamp(subscription.current_period_end),
|
||||
renewedAt: fromStripeTimestamp(currentPeriodEnd),
|
||||
canceledAt: fromStripeTimestamp(subscription.canceled_at),
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import Link from "next/link";
|
||||
|
||||
import type { CarbetSearchFilters } from "@/lib/carbet-search";
|
||||
|
||||
type SearchFiltersProps = {
|
||||
|
|
@ -72,12 +74,12 @@ export function SearchFilters({ filters, rivers }: SearchFiltersProps) {
|
|||
</label>
|
||||
|
||||
<div className="flex items-end gap-2 sm:col-span-2 lg:col-span-5 lg:justify-end">
|
||||
<a
|
||||
<Link
|
||||
href="/carbets"
|
||||
className="rounded-md border border-zinc-300 px-4 py-2 text-sm text-zinc-700 hover:bg-zinc-50"
|
||||
>
|
||||
Réinitialiser
|
||||
</a>
|
||||
</Link>
|
||||
<button
|
||||
type="submit"
|
||||
className="rounded-md bg-emerald-600 px-5 py-2 text-sm font-semibold text-white hover:bg-emerald-700"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue