Add hierarchical route grouping for multi-area locations
Locations like Mt. Moon (with 1F, B1F, B2F floors) are now grouped so only one encounter can be logged per location group, enforcing Nuzlocke first-encounter rules correctly. - Add parent_route_id column with self-referential FK to routes table - Add parent/children relationships on Route model - Update games API to return hierarchical route structure - Add validation in encounters API to prevent parent route encounters and duplicate encounters within sibling routes (409 conflict) - Update frontend with collapsible RouteGroup component - Auto-derive route groups from PokeAPI location/location-area structure - Regenerate seed data with 70 parent routes and 315 child routes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,11 @@ export interface Route {
|
||||
name: string
|
||||
gameId: number
|
||||
order: number
|
||||
parentRouteId: number | null
|
||||
}
|
||||
|
||||
export interface RouteWithChildren extends Route {
|
||||
children: Route[]
|
||||
}
|
||||
|
||||
export interface Pokemon {
|
||||
|
||||
Reference in New Issue
Block a user