openapi: 3.0.3
info:
  title: MedicalTrace API
  version: 0.1.0-demo
  description: |
    Demonstration contract for client integrators.
    Every example uses fictional organizations and DEMO-BED-001.
    This file is not a dump of a production database.
servers:
  - url: https://api.medicaltrace.net/v1
    description: MedicalTrace API. Examples on this contract use demonstration records only.
paths:
  /auth/login:
    post:
      operationId: login
      summary: Sign in with a local demo user
      requestBody:
        required: true
        content:
          application/json:
            example:
              email: manufacturer@demo.medicaltrace.local
              password: password123
      responses:
        '200':
          description: Demo token and memberships
          content:
            application/json:
              example:
                accessToken: demo.local.jwt
                user:
                  id: aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa
                  email: manufacturer@demo.medicaltrace.local
                  name: Demo Manufacturer Admin
  /equipment:
    post:
      operationId: registerEquipment
      summary: Register fictional equipment
      parameters:
        - $ref: '#/components/parameters/OrganizationId'
      requestBody:
        required: true
        content:
          application/json:
            example:
              category: hospital_bed
              model: DemoBed 100
              serialNumber: SN-DEMO-001
      responses:
        '201':
          description: Demo passport created
          content:
            application/json:
              example:
                id: 44444444-4444-4444-8444-444444444444
                serialNumber: SN-DEMO-001
                passportId: ppt_demo_bed_001
                lifecycleStatus: ACTIVE
components:
  parameters:
    OrganizationId:
      name: X-Organization-Id
      in: header
      required: true
      schema:
        type: string
        example: 11111111-1111-4111-8111-111111111111
      description: Demo Manufacturer. Not proof of membership by itself.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Local demo JWT. The published sample value is the placeholder demo.local.jwt.
security:
  - bearerAuth: []
