Skip to content

[BE-44] Door access hardware integration (Kisi / Brivo API) #1232

Description

@yusuftomilola

Overview

Members access the hub through physical doors using key cards or fobs. Integrating with smart lock systems (Kisi or Brivo) allows the platform to auto-grant access on booking confirmation and revoke it on cancellation — eliminating manual card management.

Context

  • ConfirmBookingProvider: backend/src/bookings/providers/confirm-booking.provider.ts
  • CancelBookingProvider: backend/src/bookings/providers/cancel-booking.provider.ts
  • CheckInProvider: backend/src/workspace-tracking/providers/check-in.provider.ts
  • User entity: backend/src/users/entities/user.entity.ts

Tasks

  • Create AccessCredential entity: id, userId (FK), externalCredentialId (string — Kisi/Brivo credential ID), provider (KISI / BRIVO), isActive (bool), grantedAt, revokedAt (nullable), createdAt
  • Create AccessIntegration entity (singleton): id, provider, apiKey (encrypted), isEnabled, configuredAt
  • POST /integrations/access/configure — admin stores Kisi/Brivo API key (admin only)
  • GET /integrations/access/status — returns whether integration is configured and enabled (admin only)
  • On booking CONFIRMED: if access integration enabled, call provider API to create a credential for the member; store AccessCredential record
  • On booking CANCELLED or COMPLETED: revoke the member's access credential via provider API; mark isActive = false
  • GET /integrations/access/logs — admin view of access grant/revoke events (paginated)

Files to Modify / Create

  • New: backend/src/integrations/access-control/ (module, entities, controller, service)
  • backend/src/bookings/providers/confirm-booking.provider.ts
  • backend/src/bookings/providers/cancel-booking.provider.ts
  • backend/src/app.module.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions