Skip to content

svc-safety-compliance

NovaTrek Safety and Compliance Service  |  Safety  |  v1.0.0  |  NovaTrek Safety Operations

Manages guest safety waivers, incident reporting, safety inspections, and

Swagger UI Download OpenAPI Spec


Integration Context

svc-safety-compliance C4 context diagram

Data Store

Overview

Property Detail
Engine PostgreSQL 15
Schema safety
Tables waivers, incidents, safety_inspections, audit_log
Estimated Volume ~3,000 waiver checks/day
Connection Pool min 5 / max 20 / idle timeout 10min
Backup Strategy Continuous WAL archiving, daily base backup, 7-year retention (regulatory)

Key Features

  • Immutable audit log (append-only)
  • Digital signature verification for waivers
  • Regulatory compliance retention (7 years)

Table Reference

waivers

Signed liability waivers with digital signature verification

Column Type Constraints
waiver_id UUID PK
guest_id UUID NOT NULL
trip_id UUID NOT NULL
waiver_type VARCHAR(50) NOT NULL
signed_at TIMESTAMPTZ NULL
signature_ref VARCHAR(255) NULL (DocuSign envelope ID)
status VARCHAR(20) NOT NULL, DEFAULT 'pending'
expires_at TIMESTAMPTZ NULL
created_at TIMESTAMPTZ NOT NULL

Indexes:

  • idx_waiver_guest_trip on guest_id, trip_id
  • idx_waiver_status on status

incidents

Safety incident reports with severity classification

Column Type Constraints
incident_id UUID PK
trip_id UUID NULL
location_id UUID NULL
severity VARCHAR(20) NOT NULL
description TEXT NOT NULL
reported_by VARCHAR(100) NOT NULL
reported_at TIMESTAMPTZ NOT NULL
resolved_at TIMESTAMPTZ NULL
resolution_notes TEXT NULL

Indexes:

  • idx_incident_severity on severity, reported_at DESC
  • idx_incident_trip on trip_id

audit_log

Immutable append-only audit trail for regulatory compliance

Column Type Constraints
log_id BIGSERIAL PK
entity_type VARCHAR(50) NOT NULL
entity_id UUID NOT NULL
action VARCHAR(20) NOT NULL
actor VARCHAR(100) NOT NULL
details JSONB NOT NULL
logged_at TIMESTAMPTZ NOT NULL, DEFAULT NOW()

Indexes:

  • idx_audit_entity on entity_type, entity_id
  • idx_audit_time on logged_at

Endpoints (8 total)


GET /waivers -- List waivers by guest

View in Swagger UI

GET /waivers sequence diagram

POST /waivers -- Guest signs a safety waiver

View in Swagger UI

POST /waivers sequence diagram

GET /waivers/{waiver_id} -- Get a specific waiver

View in Swagger UI

GET /waivers/{waiver_id} sequence diagram

POST /incidents -- File an incident report

View in Swagger UI

POST /incidents sequence diagram

GET /incidents/{incident_id} -- Get an incident report

View in Swagger UI

GET /incidents/{incident_id} sequence diagram

PATCH /incidents/{incident_id} -- Update an incident report (add follow-up, change status)

View in Swagger UI

PATCH /incidents/{incident_id} sequence diagram

GET /safety-inspections -- List safety inspections for a location

View in Swagger UI

GET /safety-inspections sequence diagram

POST /safety-inspections -- Record a safety inspection

View in Swagger UI

POST /safety-inspections sequence diagram

Consuming Applications

Application Screens Using This Service
Guest Portal Waiver Signing
Operations Dashboard Check-In Station, Safety Incident Board
Adventure App Self Check-In

Events Published

Event Channel Trigger Consumers
incident.reported novatrek.safety.incident.reported POST /incidents svc-notifications, svc-analytics

Events Consumed

Event Producer Channel
emergency.triggered svc-emergency-response novatrek.safety.emergency.triggered