Skip to content

apps/api/src/features/rideshare/rideshare.service.ts ​

Auto-generated by scripts/generate-file-docs.ts. Do not edit — overwritten on every run.

Purpose ​

RideshareService — community ride share trip board. Member-only feature (VISITOR may not list, view, post, or request rides). A trip is posted by a driver with a fixed seat count; other members request a seat, and the driver confirms or declines each request. When the count of CONFIRMED passengers reaches seats the trip is auto transitioned from OPEN to FULL. Status transitions (driven entirely by side-effects in this service — the PATCH endpoint cannot set status directly): OPEN ──confirmPassenger() fills last seat──▶ FULL OPEN | FULL ──cancelTrip()──▶ CANCELLED OPEN | FULL ──(future: departureCron)──▶ DEPARTED ──▶ COMPLETED Cancelled passengers free a seat; if a confirmed passenger cancels and the trip was FULL, it auto-reopens to OPEN. Notifications: cancelTrip() fans out to every CONFIRMED passenger via the shared notifier. Future enhancement: notify driver on request, notify requester on confirm/decline. /

Exports ​

  • export interface ListTripsParams
  • export interface ListTripsResult
  • export interface TripPassengerView
  • export interface TripDetail
  • export class RideshareService
  • export const rideshareService

Imports ​

  • ../../adapters/db
  • ../../lib/errors
  • ../../lib/logger
  • ../../lib/notifier.factory
  • ../../lib/pagination
  • ../../middleware/requireAuth
  • @prisma/client

Imported by ​

Heritage Community Hub — Internal. Access restricted via Cloudflare Access + Entra ID.