alpha wip
This commit is contained in:
@@ -5,9 +5,9 @@ import { useRouter, useParams } from 'next/navigation';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Card from '@/components/ui/Card';
|
||||
import FeatureLimitationTooltip from '@/components/alpha/FeatureLimitationTooltip';
|
||||
import { League } from '@/domain/entities/League';
|
||||
import { Race } from '@/domain/entities/Race';
|
||||
import { Driver } from '@/domain/entities/Driver';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { Race } from '@gridpilot/racing-domain/entities/Race';
|
||||
import { Driver } from '@gridpilot/racing-domain/entities/Driver';
|
||||
import { getLeagueRepository, getRaceRepository, getDriverRepository } from '@/lib/di-container';
|
||||
|
||||
export default function LeagueDetailPage() {
|
||||
|
||||
@@ -5,9 +5,9 @@ import { useRouter, useParams } from 'next/navigation';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Card from '@/components/ui/Card';
|
||||
import StandingsTable from '@/components/alpha/StandingsTable';
|
||||
import { League } from '@/domain/entities/League';
|
||||
import { Standing } from '@/domain/entities/Standing';
|
||||
import { Driver } from '@/domain/entities/Driver';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { Standing } from '@gridpilot/racing-domain/entities/Standing';
|
||||
import { Driver } from '@gridpilot/racing-domain/entities/Driver';
|
||||
import {
|
||||
getLeagueRepository,
|
||||
getStandingRepository,
|
||||
|
||||
@@ -6,7 +6,7 @@ import LeagueCard from '@/components/alpha/LeagueCard';
|
||||
import CreateLeagueForm from '@/components/alpha/CreateLeagueForm';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Card from '@/components/ui/Card';
|
||||
import { League } from '@/domain/entities/League';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { getLeagueRepository } from '@/lib/di-container';
|
||||
|
||||
export default function LeaguesPage() {
|
||||
|
||||
@@ -5,8 +5,8 @@ import { useRouter, useParams } from 'next/navigation';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Card from '@/components/ui/Card';
|
||||
import FeatureLimitationTooltip from '@/components/alpha/FeatureLimitationTooltip';
|
||||
import { Race } from '@/domain/entities/Race';
|
||||
import { League } from '@/domain/entities/League';
|
||||
import { Race } from '@gridpilot/racing-domain/entities/Race';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { getRaceRepository, getLeagueRepository } from '@/lib/di-container';
|
||||
import CompanionStatus from '@/components/alpha/CompanionStatus';
|
||||
import CompanionInstructions from '@/components/alpha/CompanionInstructions';
|
||||
|
||||
@@ -6,10 +6,10 @@ import Button from '@/components/ui/Button';
|
||||
import Card from '@/components/ui/Card';
|
||||
import ResultsTable from '@/components/alpha/ResultsTable';
|
||||
import ImportResultsForm from '@/components/alpha/ImportResultsForm';
|
||||
import { Race } from '@/domain/entities/Race';
|
||||
import { League } from '@/domain/entities/League';
|
||||
import { Result } from '@/domain/entities/Result';
|
||||
import { Driver } from '@/domain/entities/Driver';
|
||||
import { Race } from '@gridpilot/racing-domain/entities/Race';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { Result } from '@gridpilot/racing-domain/entities/Result';
|
||||
import { Driver } from '@gridpilot/racing-domain/entities/Driver';
|
||||
import {
|
||||
getRaceRepository,
|
||||
getLeagueRepository,
|
||||
|
||||
@@ -6,8 +6,8 @@ import Button from '@/components/ui/Button';
|
||||
import Card from '@/components/ui/Card';
|
||||
import RaceCard from '@/components/alpha/RaceCard';
|
||||
import ScheduleRaceForm from '@/components/alpha/ScheduleRaceForm';
|
||||
import { Race, RaceStatus } from '@/domain/entities/Race';
|
||||
import { League } from '@/domain/entities/League';
|
||||
import { Race, RaceStatus } from '@gridpilot/racing-domain/entities/Race';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { getRaceRepository, getLeagueRepository } from '@/lib/di-container';
|
||||
|
||||
export default function RacesPage() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState } from 'react';
|
||||
import Card from '../ui/Card';
|
||||
import Button from '../ui/Button';
|
||||
import { Race } from '../../domain/entities/Race';
|
||||
import { Race } from '@gridpilot/racing-domain/entities/Race';
|
||||
|
||||
interface CompanionInstructionsProps {
|
||||
race: Race;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useRouter } from 'next/navigation';
|
||||
import Input from '../ui/Input';
|
||||
import Button from '../ui/Button';
|
||||
import DataWarning from './DataWarning';
|
||||
import { Driver } from '../../domain/entities/Driver';
|
||||
import { Driver } from '@gridpilot/racing-domain/entities/Driver';
|
||||
import { getDriverRepository } from '../../lib/di-container';
|
||||
|
||||
interface FormErrors {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useRouter } from 'next/navigation';
|
||||
import Input from '../ui/Input';
|
||||
import Button from '../ui/Button';
|
||||
import DataWarning from './DataWarning';
|
||||
import { League } from '../../domain/entities/League';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { getLeagueRepository, getDriverRepository } from '../../lib/di-container';
|
||||
|
||||
interface FormErrors {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState } from 'react';
|
||||
import Button from '../ui/Button';
|
||||
import DataWarning from './DataWarning';
|
||||
import { Result } from '../../domain/entities/Result';
|
||||
import { Result } from '@gridpilot/racing-domain/entities/Result';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
interface ImportResultsFormProps {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { League } from '../../domain/entities/League';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import Card from '../ui/Card';
|
||||
|
||||
interface LeagueCardProps {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { Race } from '../../domain/entities/Race';
|
||||
import { Race } from '@gridpilot/racing-domain/entities/Race';
|
||||
|
||||
interface RaceCardProps {
|
||||
race: Race;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { Result } from '../../domain/entities/Result';
|
||||
import { Driver } from '../../domain/entities/Driver';
|
||||
import { Result } from '@gridpilot/racing-domain/entities/Result';
|
||||
import { Driver } from '@gridpilot/racing-domain/entities/Driver';
|
||||
|
||||
interface ResultsTableProps {
|
||||
results: Result[];
|
||||
|
||||
@@ -5,11 +5,11 @@ import { useRouter } from 'next/navigation';
|
||||
import Button from '../ui/Button';
|
||||
import Input from '../ui/Input';
|
||||
import DataWarning from './DataWarning';
|
||||
import { Race } from '../../domain/entities/Race';
|
||||
import { League } from '../../domain/entities/League';
|
||||
import { SessionType } from '../../domain/entities/Race';
|
||||
import { Race } from '@gridpilot/racing-domain/entities/Race';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { SessionType } from '@gridpilot/racing-domain/entities/Race';
|
||||
import { getRaceRepository, getLeagueRepository } from '../../lib/di-container';
|
||||
import { InMemoryRaceRepository } from '../../infrastructure/repositories/InMemoryRaceRepository';
|
||||
import { InMemoryRaceRepository } from '@gridpilot/racing-infrastructure/repositories/InMemoryRaceRepository';
|
||||
|
||||
interface ScheduleRaceFormProps {
|
||||
preSelectedLeagueId?: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { Standing } from '../../domain/entities/Standing';
|
||||
import { Driver } from '../../domain/entities/Driver';
|
||||
import { Standing } from '@gridpilot/racing-domain/entities/Standing';
|
||||
import { Driver } from '@gridpilot/racing-domain/entities/Driver';
|
||||
|
||||
interface StandingsTableProps {
|
||||
standings: Standing[];
|
||||
|
||||
@@ -5,23 +5,23 @@
|
||||
* Allows easy swapping to persistent repositories later.
|
||||
*/
|
||||
|
||||
import { Driver } from '../domain/entities/Driver';
|
||||
import { League } from '../domain/entities/League';
|
||||
import { Race } from '../domain/entities/Race';
|
||||
import { Result } from '../domain/entities/Result';
|
||||
import { Standing } from '../domain/entities/Standing';
|
||||
import { Driver } from '@gridpilot/racing-domain/entities/Driver';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { Race } from '@gridpilot/racing-domain/entities/Race';
|
||||
import { Result } from '@gridpilot/racing-domain/entities/Result';
|
||||
import { Standing } from '@gridpilot/racing-domain/entities/Standing';
|
||||
|
||||
import { IDriverRepository } from '../application/ports/IDriverRepository';
|
||||
import { ILeagueRepository } from '../application/ports/ILeagueRepository';
|
||||
import { IRaceRepository } from '../application/ports/IRaceRepository';
|
||||
import { IResultRepository } from '../application/ports/IResultRepository';
|
||||
import { IStandingRepository } from '../application/ports/IStandingRepository';
|
||||
import type { IDriverRepository } from '@gridpilot/racing-domain/ports/IDriverRepository';
|
||||
import type { ILeagueRepository } from '@gridpilot/racing-domain/ports/ILeagueRepository';
|
||||
import type { IRaceRepository } from '@gridpilot/racing-domain/ports/IRaceRepository';
|
||||
import type { IResultRepository } from '@gridpilot/racing-domain/ports/IResultRepository';
|
||||
import type { IStandingRepository } from '@gridpilot/racing-domain/ports/IStandingRepository';
|
||||
|
||||
import { InMemoryDriverRepository } from '../infrastructure/repositories/InMemoryDriverRepository';
|
||||
import { InMemoryLeagueRepository } from '../infrastructure/repositories/InMemoryLeagueRepository';
|
||||
import { InMemoryRaceRepository } from '../infrastructure/repositories/InMemoryRaceRepository';
|
||||
import { InMemoryResultRepository } from '../infrastructure/repositories/InMemoryResultRepository';
|
||||
import { InMemoryStandingRepository } from '../infrastructure/repositories/InMemoryStandingRepository';
|
||||
import { InMemoryDriverRepository } from '@gridpilot/racing-infrastructure/repositories/InMemoryDriverRepository';
|
||||
import { InMemoryLeagueRepository } from '@gridpilot/racing-infrastructure/repositories/InMemoryLeagueRepository';
|
||||
import { InMemoryRaceRepository } from '@gridpilot/racing-infrastructure/repositories/InMemoryRaceRepository';
|
||||
import { InMemoryResultRepository } from '@gridpilot/racing-infrastructure/repositories/InMemoryResultRepository';
|
||||
import { InMemoryStandingRepository } from '@gridpilot/racing-infrastructure/repositories/InMemoryStandingRepository';
|
||||
|
||||
/**
|
||||
* Seed data for development
|
||||
|
||||
63
package-lock.json
generated
63
package-lock.json
generated
@@ -1504,10 +1504,30 @@
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@gridpilot/automation-domain": {
|
||||
"resolved": "packages/automation-domain",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@gridpilot/automation-infrastructure": {
|
||||
"resolved": "packages/automation-infrastructure",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@gridpilot/companion": {
|
||||
"resolved": "apps/companion",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@gridpilot/racing-application": {
|
||||
"resolved": "packages/racing-application",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@gridpilot/racing-domain": {
|
||||
"resolved": "packages/racing-domain",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@gridpilot/racing-infrastructure": {
|
||||
"resolved": "packages/racing-infrastructure",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@gridpilot/website": {
|
||||
"resolved": "apps/website",
|
||||
"link": true
|
||||
@@ -13412,6 +13432,49 @@
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
},
|
||||
"packages/automation-domain": {
|
||||
"name": "@gridpilot/automation-domain",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"packages/automation-infrastructure": {
|
||||
"name": "@gridpilot/automation-infrastructure",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@gridpilot/automation-domain": "*"
|
||||
}
|
||||
},
|
||||
"packages/racing-application": {
|
||||
"name": "@gridpilot/racing-application",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@gridpilot/racing-domain": "*"
|
||||
}
|
||||
},
|
||||
"packages/racing-domain": {
|
||||
"name": "@gridpilot/racing-domain",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"packages/racing-infrastructure": {
|
||||
"name": "@gridpilot/racing-infrastructure",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@gridpilot/racing-domain": "*",
|
||||
"uuid": "^9.0.0"
|
||||
}
|
||||
},
|
||||
"packages/racing-infrastructure/node_modules/uuid": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
|
||||
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10
packages/automation-domain/package.json
Normal file
10
packages/automation-domain/package.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "@gridpilot/automation-domain",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./entities/*": "./entities/*.ts",
|
||||
"./services/*": "./services/*.ts",
|
||||
"./value-objects/*": "./value-objects/*.ts"
|
||||
}
|
||||
}
|
||||
13
packages/automation-infrastructure/package.json
Normal file
13
packages/automation-infrastructure/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "@gridpilot/automation-infrastructure",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./adapters/*": "./adapters/*.ts",
|
||||
"./config/*": "./config/*.ts",
|
||||
"./repositories/*": "./repositories/*.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gridpilot/automation-domain": "*"
|
||||
}
|
||||
}
|
||||
3
packages/racing-application/index.ts
Normal file
3
packages/racing-application/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// Re-export use cases and mappers when added
|
||||
export * from './use-cases';
|
||||
export * from './mappers';
|
||||
@@ -5,11 +5,11 @@
|
||||
* These mappers handle the Server Component -> Client Component boundary in Next.js 15.
|
||||
*/
|
||||
|
||||
import { Driver } from '@/domain/entities/Driver';
|
||||
import { League } from '@/domain/entities/League';
|
||||
import { Race } from '@/domain/entities/Race';
|
||||
import { Result } from '@/domain/entities/Result';
|
||||
import { Standing } from '@/domain/entities/Standing';
|
||||
import { Driver } from '@gridpilot/racing-domain/entities/Driver';
|
||||
import { League } from '@gridpilot/racing-domain/entities/League';
|
||||
import { Race } from '@gridpilot/racing-domain/entities/Race';
|
||||
import { Result } from '@gridpilot/racing-domain/entities/Result';
|
||||
import { Standing } from '@gridpilot/racing-domain/entities/Standing';
|
||||
|
||||
export type DriverDTO = {
|
||||
id: string;
|
||||
2
packages/racing-application/mappers/index.ts
Normal file
2
packages/racing-application/mappers/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Mappers for converting between domain entities and DTOs
|
||||
// Example: driverToDTO, leagueToDTO, etc.
|
||||
9
packages/racing-application/package.json
Normal file
9
packages/racing-application/package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "@gridpilot/racing-application",
|
||||
"version": "0.1.0",
|
||||
"main": "./index.ts",
|
||||
"types": "./index.ts",
|
||||
"dependencies": {
|
||||
"@gridpilot/racing-domain": "*"
|
||||
}
|
||||
}
|
||||
2
packages/racing-application/use-cases/index.ts
Normal file
2
packages/racing-application/use-cases/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Use cases will be added as needed
|
||||
// Example: CreateDriverUseCase, CreateLeagueUseCase, etc.
|
||||
7
packages/racing-domain/package.json
Normal file
7
packages/racing-domain/package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "@gridpilot/racing-domain",
|
||||
"version": "0.1.0",
|
||||
"main": "./index.ts",
|
||||
"types": "./index.ts",
|
||||
"dependencies": {}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* Defines async methods using domain entities as types.
|
||||
*/
|
||||
|
||||
import { Driver } from '../../domain/entities/Driver';
|
||||
import { Driver } from '../entities/Driver';
|
||||
|
||||
export interface IDriverRepository {
|
||||
/**
|
||||
@@ -5,7 +5,7 @@
|
||||
* Defines async methods using domain entities as types.
|
||||
*/
|
||||
|
||||
import { League } from '../../domain/entities/League';
|
||||
import { League } from '../entities/League';
|
||||
|
||||
export interface ILeagueRepository {
|
||||
/**
|
||||
@@ -5,7 +5,7 @@
|
||||
* Defines async methods using domain entities as types.
|
||||
*/
|
||||
|
||||
import { Race, RaceStatus } from '../../domain/entities/Race';
|
||||
import { Race, RaceStatus } from '../entities/Race';
|
||||
|
||||
export interface IRaceRepository {
|
||||
/**
|
||||
@@ -5,7 +5,7 @@
|
||||
* Defines async methods using domain entities as types.
|
||||
*/
|
||||
|
||||
import { Result } from '../../domain/entities/Result';
|
||||
import { Result } from '../entities/Result';
|
||||
|
||||
export interface IResultRepository {
|
||||
/**
|
||||
@@ -5,7 +5,7 @@
|
||||
* Includes methods for calculating and retrieving standings.
|
||||
*/
|
||||
|
||||
import { Standing } from '../../domain/entities/Standing';
|
||||
import { Standing } from '../entities/Standing';
|
||||
|
||||
export interface IStandingRepository {
|
||||
/**
|
||||
10
packages/racing-infrastructure/package.json
Normal file
10
packages/racing-infrastructure/package.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "@gridpilot/racing-infrastructure",
|
||||
"version": "0.1.0",
|
||||
"main": "./index.ts",
|
||||
"types": "./index.ts",
|
||||
"dependencies": {
|
||||
"@gridpilot/racing-domain": "*",
|
||||
"uuid": "^9.0.0"
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Driver } from '../../domain/entities/Driver';
|
||||
import { IDriverRepository } from '../../application/ports/IDriverRepository';
|
||||
import { Driver } from '@gridpilot/racing-domain/entities/Driver';
|
||||
import type { IDriverRepository } from '@gridpilot/racing-domain/ports/IDriverRepository';
|
||||
|
||||
export class InMemoryDriverRepository implements IDriverRepository {
|
||||
private drivers: Map<string, Driver>;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user