# Legacy `/v1.1` Endpoint Inventory

Last audited: 2026-09-16
Repository: `tiar-webapp`
Base branch: `development`

## Purpose

This document records only `/v1.1` references that have not been migrated to
the v1 adapter flow. Endpoints already using v1 are intentionally omitted.

The inventory distinguishes between:

- **Active legacy** — a current route or page can call the endpoint.
- **Fallback** — the migrated flow uses v1 when explicitly selected, but a
  legacy default remains reachable when the backend option is omitted.
- **Unused legacy** — the endpoint remains in compatibility code or constants,
  but no current application flow imports or calls it.

This is a migration inventory, not an approval to remove the legacy service.
Each endpoint must be replaced and browser-tested before its legacy code is
deleted.

## Active legacy calls

### Authentication compatibility flows

| Method | Legacy endpoint | Current entry point | Source |
|---|---|---|---|
| `POST` | `/v1.1/request-otp` | `/api/auth/request-otp` | [authService.ts:100](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/auth/authService.ts:100) |
| `POST` | `/v1.1/verify-otp` | `/api/auth/verify-otp` | [authService.ts:273](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/auth/authService.ts:273) |
| `POST` | `/v1.1/logout` | `/api/auth/logout` | [authService.ts:377](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/auth/authService.ts:377) |
| `POST` | `/v1.1/request-password-reset` | `/api/auth/forgot-password` | [authService.ts:661](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/auth/authService.ts:661) |
| `POST` | `/v1.1/reset-password` | `/api/auth/reset-password` | [authService.ts:711](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/auth/authService.ts:711) |
| `POST` | `/v1.1/set-password` | `/api/auth/set-password` | [authService.ts:463](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/auth/authService.ts:463) |

The current login, check-email, sign-up, email-verification, sign-up
set-password, change-password, current-user, and refresh flows use v1 and are
therefore not listed here.

### Organizations

| Method | Legacy endpoint | Usage | Source |
|---|---|---|---|
| `GET` | `/v1.1/organizations` | Organization list and current-organization lookup | [organizationService.ts:51](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/organization/organizationService.ts:51) |
| `GET` | `/v1.1/organizations?code={code}` | Tenant/organization lookup by code | [organizationService.ts:96](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/organization/organizationService.ts:96) |

Organization lookup remains legacy compatibility code for non-presentation
organization fields. Tenant branding and support presentation data are not
read from these endpoints anymore: branding uses `/v1/tenant/branding`, and
authenticated support uses `/v1/tenant/support`, with local source-code
defaults when the v1 request is unavailable.

### Map, nearest station, and location data

| Method | Legacy endpoint | Current usage | Source |
|---|---|---|---|
| `GET` | `/v1.1/chargepoints?...` | Map listing and nearest-chargepoint lookup | [chargePointService.ts:273](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/chargepoint/chargePointService.ts:273), [chargePointService.ts:351](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/chargepoint/chargePointService.ts:351) |
| `GET` | `/v1.1/locations/{id}` | Session-detail location lookup | [chargePointService.ts:297](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/chargepoint/chargePointService.ts:297) |
| `GET` | `/v1.1/chargepoints/{id}` | Legacy/default station-detail fallback | [chargePointService.ts:222](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/chargepoint/chargePointService.ts:222) |

The main stations list and station-detail pages explicitly select the v1
adapter. Map and nearest-station flows still use the legacy service.

### Connector detail

| Method | Legacy endpoint | Current entry point | Source |
|---|---|---|---|
| `GET` | `/v1.1/connectors/{id}` | `/api/connectors/{id}` | [connectorService.ts:42](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/connector/connectorService.ts:42) |

### Reservations

| Method | Legacy endpoint | Current entry point | Source |
|---|---|---|---|
| `GET` | `/v1.1/reservations?...` | `/api/reservations` | [reservationService.ts:58](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/reservation/reservationService.ts:58) |
| `GET` | `/v1.1/reservations/{id}` | `/api/reservations/{id}` | [reservationService.ts:139](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/reservation/reservationService.ts:139) |
| `POST` | `/v1.1/reservations` | `/api/reservations` | [reservationService.ts:161](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/reservation/reservationService.ts:161) |
| `PUT` | `/v1.1/reservations/{id}` | `/api/reservations/{id}` | [reservationService.ts:187](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/reservation/reservationService.ts:187) |
| `DELETE` | `/v1.1/reservations/{id}` | `/api/reservations/{id}` | [reservationService.ts:213](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/reservation/reservationService.ts:213) |

### Notifications

| Method | Legacy endpoint | Current entry point | Source |
|---|---|---|---|
| `GET` | `/v1.1/notifications` | `/api/notifications` | [notificationService.ts:148](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/notifications/notificationService.ts:148) |
| `POST` | `/v1.1/notifications/subscribe` | `/api/notifications/subscribe` | [notificationService.ts:63](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/notifications/notificationService.ts:63) |
| `POST` | `/v1.1/notifications/unsubscribe` | `/api/notifications/unsubscribe` | [notificationService.ts:94](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/notifications/notificationService.ts:94) |
| `POST` | `/v1.1/notifications/test` | `/api/notifications/test` | [notificationService.ts:125](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/notifications/notificationService.ts:125) |

The notification list request previously returned HTTP 401 during browser
validation.

### Power categories

| Method | Legacy endpoint | Current entry point | Source |
|---|---|---|---|
| `GET` | `/v1.1/power-categories?organization_code={code}` | `/api/power-categories` | [power-categories/route.ts:57](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/app/api/power-categories/route.ts:57) |

## Fallback and compatibility calls

The session list, detail, start, stop, and stream flows are v1-only. Legacy
session methods were removed from `SessionService`.

### Legacy wallet compatibility routes

| Method | Legacy endpoint | Current source |
|---|---|---|
| `GET` | `/v1.1/wallets/me` | [wallet/route.ts:22](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/app/api/wallet/route.ts:22) |
| `POST` | `/v1.1/wallets/topup` | [wallet/route.ts:79](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/app/api/wallet/route.ts:79) |
| `GET` | `/v1.1/wallets/transactions` | [wallet/transactions/route.ts:32](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/app/api/wallet/transactions/route.ts:32) |

The current wallet page and main top-up flow use v1 adapters. These routes are
kept as compatibility code until their consumers are removed or confirmed
unused.

### Tenant branding and support

| Method | v1 endpoint | Current entry point |
|---|---|---|
| `GET` | `/v1/tenant/branding` | Server presentation resolver, app shell, metadata, manifest, PWA assets |
| `GET` | `/v1/tenant/support` | Server presentation resolver and support page |

The support endpoint uses only the server-held access-token cookie. Neither
endpoint falls back to `/v1.1/organizations` for branding or support values.

## Unused legacy references

These references remain in source but no current application import was found
for the corresponding legacy method during this audit:

| Area | Legacy endpoints | Source |
|---|---|---|
| Old auth implementations | `/v1.1/check-email`, `/v1.1/sign-up`, `/v1.1/login-password`, `/v1.1/signup/set-password`, `/v1.1/change-password`, `/v1.1/email-verification/verify` | [authService.ts](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/auth/authService.ts) |
| User by-ID compatibility methods | `GET/PATCH /v1.1/users/{id}` | [userService.ts:128](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/user/userService.ts:128) |
| Old top-up service | `/v1.1/users/me`, `/v1.1/topups`, `/v1.1/topups/virtual-account`, `/v1.1/topups/over-the-counter`, `/v1.1/topups/qr`, `/v1.1/topups/ewallet`, `/v1.1/topups/credit-card` | [topupService.ts](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/topup/topupService.ts) |
| Withdrawal account management | `GET /v1.1/accounts?organization_code={code}` | [withdrawalService.ts:78](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/services/withdrawal/withdrawalService.ts:78) |
| Duplicate chargepoint service | `/v1.1/chargepoints...` | [chargepoint.service.ts](/Users/kevin/Downloads/parking-plus/tiar-webapp-worktrees/docs-inventory-legacy-v1-1/src/modules/chargepointModule/list/services/chargepoint.service.ts) |

`src/lib/constants/apiEndpoints.ts` also contains legacy path constants for
credit cards, sessions, chargepoints, reservations, connectors, wallet,
transactions, notifications, organizations, and auth. These are definitions,
not direct network calls, and no current consumers were found in this audit.

## Migrated in the current change

The following flows no longer call `/v1.1` at runtime:

- Session list and session actions through `SessionService`.
- Session-detail chargepoint lookup; it now uses the v1 chargepoint adapter and
  the v1 session's location label.
- Transaction list and transaction detail.
- Saved credit-card lookup, deletion, and v1 credit-card session creation.
- Chargepoint lookup used by the session widget.

These paths are intentionally absent from the active legacy inventory above.

## Next migration order

1. Confirm and migrate active legacy Auth flows: forgot password and logout.
2. Map/nearest/location and power categories.
3. Notifications.
4. Reservations.
5. Remove unused legacy compatibility code only after the active callers are
   migrated and UAT is recorded.
