Skip to Content
Living documentation — last reviewed 2026-05-28
FeaturesLocationsLocations — Code Map

Locations — Code Map

API

FilePurpose
apps/api/src/locations/locations.module.tsWires controller + service; imports MembershipsModule.
apps/api/src/locations/locations.controller.tsRoutes, toLocationResponse mapper.
apps/api/src/locations/locations.service.tsCRUD + tier-limit check via @fitkit/shared.checkTierLimit.
apps/api/src/locations/dto/create-location.dto.tsname, address?, city?, country?, latitude?, longitude?, capacity?.
apps/api/src/locations/dto/update-location.dto.tsPartialType of create.

Routes (prefix organizations/:orgId/locations)

MethodPathHandlerNotes
POST/createowner/admin + tier check
GET/listany member
GET/:idgetByIdany member
PATCH/:idupdateowner/admin
DELETE/:idremove (deactivate)owner/admin

Web

  • apps/web/src/components/onboarding/address-autocomplete.tsx — Google Places integration that fills address + city + country + lat/lng.
  • apps/web/src/app/[lang]/(protected)/dashboard/settings/page.tsx and the schedule “locations” tab (i18n keys: schedule.locationsTab, schedule.locationSheet).

DB tables

TableUsed as
locationsOwned.
organizationsDirect parent (FK on locations.organization_id).
class_sessionsReferences location_id (nullable).

Shared schemas

  • LocationResponse in libs/shared/src/lib/schemas/organization.schema.ts (TODO: verify exact file; toResponse shape: { id, name, address, city, country, latitude, longitude, capacity, isActive, createdAt }).
  • checkTierLimit(platformTier, 'maxLocations', currentCount) exported from @fitkit/shared.

Tests

No dedicated locations.service.unit.spec.ts found. Tier limit logic is covered via integration tests on the platform-tiers module. TODO: add unit tests for CRUD + tier rejection.