Archived
Type the reports page and turn lint back on in builds
ReportsV2 gets typed API responses (funnel, feedback summary, coupon redemptions, cashup audit, consent) and derived rows. Master-order quantities move into a per-row map, so an option name can no longer overwrite a fixed column. Consent row types move to src/types. Removes unused export helpers and state. With the frontend now at zero lint errors and warnings, next build runs ESLint again (eslint.ignoreDuringBuilds is gone). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,9 +5,6 @@ const nextConfig: NextConfig = {
|
|||||||
images: {
|
images: {
|
||||||
domains: ['images.unsplash.com'],
|
domains: ['images.unsplash.com'],
|
||||||
},
|
},
|
||||||
eslint: {
|
|
||||||
ignoreDuringBuilds: true,
|
|
||||||
},
|
|
||||||
compiler: {
|
compiler: {
|
||||||
removeConsole: process.env.NODE_ENV === 'production',
|
removeConsole: process.env.NODE_ENV === 'production',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,27 +9,8 @@ import { useDismissingState } from "@/hooks/useDismissingState";
|
|||||||
import { ShieldCheck, Send, RefreshCw, HeartPulse, Printer } from "lucide-react";
|
import { ShieldCheck, Send, RefreshCw, HeartPulse, Printer } from "lucide-react";
|
||||||
import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from "@/components/ui/table";
|
import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from "@/components/ui/table";
|
||||||
import { errorMessage } from "@/lib/utils";
|
import { errorMessage } from "@/lib/utils";
|
||||||
import type { Event } from "@/types";
|
import type { Event, ConsentRow, MedicalRow } from "@/types";
|
||||||
|
|
||||||
type ConsentRow = {
|
|
||||||
attendeeId: string;
|
|
||||||
name: string;
|
|
||||||
dateOfBirth: string | null;
|
|
||||||
minor: boolean;
|
|
||||||
parentName: string | null;
|
|
||||||
parentEmail: string | null;
|
|
||||||
parentPhone: string | null;
|
|
||||||
registrationStatus: string;
|
|
||||||
bookedBy: { name: string; email: string };
|
|
||||||
status: "not_required" | "missing" | "pending" | "given" | "declined";
|
|
||||||
request: { id: string; status: string; textVersion: number; signedName: string | null; respondedAt: string | null; lastSentAt: string; remindersSent: number; photoConsent: boolean | null; outdated: boolean } | null;
|
|
||||||
};
|
|
||||||
type MedicalRow = {
|
|
||||||
name: string; dateOfBirth: string | null; parentName: string | null; parentPhone: string | null; parentEmail: string | null;
|
|
||||||
medical: { allergies: string; medication: string; conditions: string; medicalAid: string } | null;
|
|
||||||
emergency: { name: string; phone: string; relationship: string } | null;
|
|
||||||
photoConsent: boolean | null; purged: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
const STATUS_STYLE: Record<ConsentRow["status"], { label: string; cls: string }> = {
|
const STATUS_STYLE: Record<ConsentRow["status"], { label: string; cls: string }> = {
|
||||||
not_required: { label: "Not needed (18+)", cls: "bg-gray-100 text-gray-600" },
|
not_required: { label: "Not needed (18+)", cls: "bg-gray-100 text-gray-600" },
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -251,6 +251,8 @@ export type EventFinancials = {
|
|||||||
effectiveGrossIncomeByMethod: Record<CashupMethod, number>;
|
effectiveGrossIncomeByMethod: Record<CashupMethod, number>;
|
||||||
effectiveTotalRevenue: number;
|
effectiveTotalRevenue: number;
|
||||||
netProfit: number;
|
netProfit: number;
|
||||||
|
// Coupon discounts given on the event's registrations.
|
||||||
|
discountsTotal?: number;
|
||||||
unallocatedDonations: Payment[];
|
unallocatedDonations: Payment[];
|
||||||
unallocatedDonationsTotal: number;
|
unallocatedDonationsTotal: number;
|
||||||
totalDonations: number;
|
totalDonations: number;
|
||||||
@@ -273,6 +275,8 @@ export type RegistrationOption = {
|
|||||||
tranches?: { id: string; quantity: number; priceSnapshot: number; appliedTierId?: string | null }[];
|
tranches?: { id: string; quantity: number; priceSnapshot: number; appliedTierId?: string | null }[];
|
||||||
tickets?: { id: string; quantity?: number }[];
|
tickets?: { id: string; quantity?: number }[];
|
||||||
registration?: Registration;
|
registration?: Registration;
|
||||||
|
// Tranche-aware total for the line, attached by registration list endpoints.
|
||||||
|
lineTotal?: number | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
// A named person on a group registration, for one main-ticket place.
|
// A named person on a group registration, for one main-ticket place.
|
||||||
@@ -413,6 +417,29 @@ export type MessageSendResult<Recipient = { phone: string; name?: string }> = {
|
|||||||
job?: { id: string };
|
job?: { id: string };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// One person's parental-consent status on a youth event (GET /api/consent/events/:id).
|
||||||
|
export type ConsentRow = {
|
||||||
|
attendeeId: string;
|
||||||
|
name: string;
|
||||||
|
dateOfBirth: string | null;
|
||||||
|
minor: boolean;
|
||||||
|
parentName: string | null;
|
||||||
|
parentEmail: string | null;
|
||||||
|
parentPhone: string | null;
|
||||||
|
registrationStatus: string;
|
||||||
|
bookedBy: { name: string; email: string };
|
||||||
|
status: "not_required" | "missing" | "pending" | "given" | "declined";
|
||||||
|
request: { id: string; status: string; textVersion: number; signedName: string | null; respondedAt: string | null; lastSentAt: string; remindersSent: number; photoConsent: boolean | null; outdated: boolean } | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
// One person's medical/emergency details (GET /api/consent/events/:id/medical).
|
||||||
|
export type MedicalRow = {
|
||||||
|
name: string; dateOfBirth: string | null; parentName: string | null; parentPhone: string | null; parentEmail: string | null;
|
||||||
|
medical: { allergies: string; medication: string; conditions: string; medicalAid: string } | null;
|
||||||
|
emergency: { name: string; phone: string; relationship: string } | null;
|
||||||
|
photoConsent: boolean | null; purged: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
// A scanning section (e.g. "Main hall") and the ticket options valid at it.
|
// A scanning section (e.g. "Main hall") and the ticket options valid at it.
|
||||||
export type Section = {
|
export type Section = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user