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 Live Service (Dev) Azure Portal CI/CD Pipeline Source Code Technology Stack

Delivery Status

Delivery Wave: 3 -- Day-of-Adventure Operations

Stage Status
Infrastructure (Bicep) ✅ complete
Database Schema (Flyway) ✅ complete
Deployed to Dev ✅ complete
Smoke Tested ✅ complete
Deployed to Prod not-started
Pipeline Status
CI Pipeline ✅ complete
CD Pipeline ✅ complete

Azure Resources (Dev):


Integration Context

svc-safety-compliance C4 context diagram

Generated from architecture/specs/svc-safety-compliance.yaml + cross-service-calls.yaml

Data Store

Entity Relationship Diagram

svc-safety-compliance entity relationship diagram

Generated from architecture/metadata/data-stores.yaml

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

Solutions Affecting This Service

Ticket Solution Capabilities Date
NTK-10006 Real-Time Adventure Tracking and Emergency Alerting System CAP-3.3, CAP-3.2, CAP-2.1 2026-03-20

Endpoints (8 total)


GET /waivers -- List waivers by guest

View in Swagger UI

GET /waivers sequence diagram

Generated from architecture/specs/svc-safety-compliance.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


POST /waivers -- Guest signs a safety waiver

View in Swagger UI

POST /waivers sequence diagram

Architect-authored — overrides auto-generated baseline Source: architecture/diagrams/endpoints/svc-safety-compliance--post-waivers.puml


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

View in Swagger UI

GET /waivers/{waiver_id} sequence diagram

Generated from architecture/specs/svc-safety-compliance.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


POST /incidents -- File an incident report

View in Swagger UI

POST /incidents sequence diagram

Architect-authored — overrides auto-generated baseline Source: architecture/diagrams/endpoints/svc-safety-compliance--post-incidents.puml


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

View in Swagger UI

GET /incidents/{incident_id} sequence diagram

Generated from architecture/specs/svc-safety-compliance.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


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

View in Swagger UI

PATCH /incidents/{incident_id} sequence diagram

Generated from architecture/specs/svc-safety-compliance.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


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

View in Swagger UI

GET /safety-inspections sequence diagram

Generated from architecture/specs/svc-safety-compliance.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


POST /safety-inspections -- Record a safety inspection

View in Swagger UI

POST /safety-inspections sequence diagram

Generated from architecture/specs/svc-safety-compliance.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


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