mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 09:51:13 -05:00
58 lines
1.6 KiB
Markdown
58 lines
1.6 KiB
Markdown
# PHASE 4: Entity Services
|
|
**Status:** ⬜ Not Started
|
|
**Estimated Time:** 25-30 hours
|
|
**Priority:** HIGH
|
|
**Depends On:** Phase 1 (Foundation)
|
|
**Blocks:** Phase 12 (Pages Migration)
|
|
|
|
## 🎯 Goal
|
|
Create service layer for all entities (Parks, Rides, Companies, Ride Models) to replace Supabase queries.
|
|
|
|
## Tasks
|
|
|
|
### Task 4.1: Parks Service (5h)
|
|
- [ ] Create `src/services/entities/parksService.ts`
|
|
- [ ] List parks with filters
|
|
- [ ] Get park by ID/slug
|
|
- [ ] Get park rides
|
|
- [ ] Pagination support
|
|
- [ ] Update hooks: `useParks`, `useParkDetail`, `useParkRides`
|
|
|
|
### Task 4.2: Rides Service (5h)
|
|
- [ ] Create `src/services/entities/ridesService.ts`
|
|
- [ ] List rides with filters
|
|
- [ ] Get ride by ID/slug
|
|
- [ ] Get ride reviews/photos/credits
|
|
- [ ] Update hooks: `useRides`, `useRideDetail`
|
|
|
|
### Task 4.3: Companies Service (5h)
|
|
- [ ] Create `src/services/entities/companiesService.ts`
|
|
- [ ] List companies by type
|
|
- [ ] Get company by ID/slug
|
|
- [ ] Get company parks/rides/models
|
|
- [ ] Update company hooks
|
|
|
|
### Task 4.4: Ride Models Service (3h)
|
|
- [ ] Create `src/services/entities/rideModelsService.ts`
|
|
- [ ] List ride models
|
|
- [ ] Get model by ID/slug
|
|
- [ ] Get model installations
|
|
|
|
### Task 4.5: Update All Entity Hooks (7h)
|
|
- [ ] Replace all Supabase calls
|
|
- [ ] Test caching behavior
|
|
- [ ] Verify loading states
|
|
|
|
## Completion Criteria
|
|
- [ ] All entity queries use services
|
|
- [ ] No `supabase.from()` calls remain
|
|
- [ ] All hooks work correctly
|
|
- [ ] Pagination works
|
|
- [ ] Filtering works
|
|
|
|
---
|
|
|
|
## ⏭️ Next Phase
|
|
|
|
Once complete, proceed to [Phase 5: Reviews & Social](./PHASE_05_REVIEWS_SOCIAL.md)
|