openapi: 3.0.0
info:
  title: Logistics Microservice API
  description: |
    Logistics and delivery management microservice.
    Handles shipment tracking, delivery routes, and vehicle management.
    
    **Database**: emmanylcode_logistics
    **Service ID**: logistics-service
    **Version**: 1.0.0
  version: 1.0.0

servers:
  - url: http://localhost/projects/SMS-MICROSERVICES/logistics-service/public
    description: Development Logistics Service
  - url: https://logistics.emmanylcode.local
    description: Production Logistics Service

security:
  - BearerAuth: []

components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

  schemas:
    Shipment:
      type: object
      properties:
        id:
          type: integer
        order_id:
          type: integer
        tracking_number:
          type: string
        status:
          type: string
          enum: [pending, in_transit, delivered, cancelled]
        estimated_delivery:
          type: string
          format: date-time
        actual_delivery:
          type: string
          format: date-time

    Vehicle:
      type: object
      properties:
        id:
          type: integer
        registration_number:
          type: string
        driver_name:
          type: string
        status:
          type: string
          enum: [available, in_transit, maintenance]

paths:
  /api/logistics/shipments/{shipmentId}:
    get:
      summary: Track shipment
      operationId: trackShipment
      tags:
        - Shipments
      parameters:
        - name: shipmentId
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Shipment tracking retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Shipment'

tags:
  - name: Shipments
    description: Shipment tracking endpoints
