Merge pull request #154 from Tria-plc/alpha

Merge request for lock file and lint issues resolution
This commit is contained in:
Eyob T.
2026-06-14 15:36:39 +03:00
committed by GitHub
5 changed files with 27 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ const renderBedVisualization = (coach: any) => {
if (!isBedCoach || !hasBedPositionData) { if (!isBedCoach || !hasBedPositionData) {
// Regular seat layout // Regular seat layout
const arrangement = coach.seatArrangement || coach.arrangement || '2+2'; const arrangement = coach.seatArrangement || coach.arrangement || '2+2';
const [left, right] = arrangement.split('+').map(p => parseInt(p.trim())); const [left, right] = arrangement.split('+').map((p: string) => parseInt(p.trim()));
const cols = new Map<number, any[]>(); const cols = new Map<number, any[]>();
for (const seat of validSeats) { for (const seat of validSeats) {

View File

@@ -107,7 +107,7 @@ export default function DashboardPage() {
<div className="space-y-6"> <div className="space-y-6">
<div> <div>
<h1 className="text-3xl font-bold text-foreground">Dashboard</h1> <h1 className="text-3xl font-bold text-foreground">Dashboard</h1>
<p className="text-muted-foreground mt-1">Welcome back! Here's your operational summary.</p> <p className="text-muted-foreground mt-1">Welcome back! Here&apos;s your operational summary.</p>
</div> </div>
{/* Primary Metrics */} {/* Primary Metrics */}

View File

@@ -58,12 +58,12 @@ export default function ReportsPage() {
: []; : [];
// Calculate metrics // Calculate metrics
const totalRevenue = bookings.reduce((sum, b: any) => sum + (b.totalMinor || 0), 0); const totalRevenue = bookings.reduce((sum: number, b: any) => sum + (b.totalMinor || 0), 0);
const totalBookings = bookings.length; const totalBookings = bookings.length;
const avgTicketPrice = totalBookings > 0 ? Math.round(totalRevenue / totalBookings) : 0; const avgTicketPrice = totalBookings > 0 ? Math.round(totalRevenue / totalBookings) : 0;
// Group by date for revenue chart // Group by date for revenue chart
const byDate = bookings.reduce((acc, b: any) => { const byDate = bookings.reduce((acc: Record<string, any>, b: any) => {
const date = new Date(b.createdAt).toISOString().split('T')[0]; const date = new Date(b.createdAt).toISOString().split('T')[0];
if (!acc[date]) { if (!acc[date]) {
acc[date] = { totalMinor: 0, count: 0 }; acc[date] = { totalMinor: 0, count: 0 };
@@ -267,12 +267,13 @@ export default function ReportsPage() {
<h3 className="text-lg font-semibold mb-4">Payment Methods</h3> <h3 className="text-lg font-semibold mb-4">Payment Methods</h3>
{bookings.length > 0 ? ( {bookings.length > 0 ? (
<div className="space-y-3"> <div className="space-y-3">
{Object.entries( {(Object.entries(
bookings.reduce((acc, b: any) => { bookings.reduce((acc: Record<string, number>, b: any) => {
const method = b.paymentIntent?.method || 'Unknown'; const method = b.paymentIntent?.method || 'Unknown';
acc[method] = (acc[method] || 0) + 1; acc[method] = (acc[method] || 0) + 1;
return acc; return acc;
}, {} as Record<string, number>) }, {} as Record<string, number>)
) as [string, number][]
) )
.sort(([, a], [, b]) => b - a) .sort(([, a], [, b]) => b - a)
.slice(0, 5) .slice(0, 5)

View File

@@ -1,3 +1,5 @@
export * from "./common/index"; export * from "./common/index";
export * as Freight from "./freight/index"; export * as Freight from "./freight/index";
export * as Passenger from "./passenger/index"; export * as Passenger from "./passenger/index";
export type { PaymentEvent, PaymentEventType, PaymentFailedEvent, PaymentSucceededEvent } from "./common/payments";
export { PaymentIntentSnapshot, InitiatePaymentRequest, PaymentReferenceType, PaymentService } from "./common/payments";

18
pnpm-lock.yaml generated
View File

@@ -473,6 +473,9 @@ importers:
tsconfig-paths: tsconfig-paths:
specifier: ^4.2.0 specifier: ^4.2.0
version: 4.2.0 version: 4.2.0
uuid:
specifier: ^10.0.0
version: 10.0.0
devDependencies: devDependencies:
'@edr/eslint-config': '@edr/eslint-config':
specifier: workspace:* specifier: workspace:*
@@ -510,6 +513,9 @@ importers:
'@types/supertest': '@types/supertest':
specifier: ^6.0.2 specifier: ^6.0.2
version: 6.0.3 version: 6.0.3
'@types/uuid':
specifier: ^9.0.0
version: 9.0.8
jest: jest:
specifier: ^29.7.0 specifier: ^29.7.0
version: 29.7.0(@types/node@20.19.42)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.19.42)(typescript@5.9.3)) version: 29.7.0(@types/node@20.19.42)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.19.42)(typescript@5.9.3))
@@ -4396,6 +4402,9 @@ packages:
'@types/use-sync-external-store@0.0.6': '@types/use-sync-external-store@0.0.6':
resolution: {integrity: sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==} resolution: {integrity: sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==}
'@types/uuid@9.0.8':
resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==}
'@types/validate-npm-package-name@4.0.2': '@types/validate-npm-package-name@4.0.2':
resolution: {integrity: sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw==} resolution: {integrity: sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw==}
@@ -12164,6 +12173,11 @@ packages:
utrie@1.0.2: utrie@1.0.2:
resolution: {integrity: sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==} resolution: {integrity: sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==}
uuid@10.0.0:
resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==}
deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).
hasBin: true
uuid@11.1.1: uuid@11.1.1:
resolution: {integrity: sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==} resolution: {integrity: sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==}
hasBin: true hasBin: true
@@ -17557,6 +17571,8 @@ snapshots:
'@types/use-sync-external-store@0.0.6': {} '@types/use-sync-external-store@0.0.6': {}
'@types/uuid@9.0.8': {}
'@types/validate-npm-package-name@4.0.2': {} '@types/validate-npm-package-name@4.0.2': {}
'@types/validator@13.15.10': {} '@types/validator@13.15.10': {}
@@ -27061,6 +27077,8 @@ snapshots:
dependencies: dependencies:
base64-arraybuffer: 1.0.2 base64-arraybuffer: 1.0.2
uuid@10.0.0: {}
uuid@11.1.1: {} uuid@11.1.1: {}
uuid@3.4.0: {} uuid@3.4.0: {}