openapi: 3.0.0
info:
  title: Location Microservice API
  description: |
    Location and geographical data management microservice.
    Handles location data, coordinates, and geographical queries.
    
    **Database**: emmanylcode_location
    **Service ID**: location-service
    **Version**: 1.0.0
  version: 1.0.0

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

security:
  - BearerAuth: []

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

  schemas:
    Coordinate:
      type: object
      properties:
        latitude:
          type: number
          format: float
        longitude:
          type: number
          format: float

    Location:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        address:
          type: string
        coordinate:
          $ref: '#/components/schemas/Coordinate'
        created_at:
          type: string
          format: date-time

paths:
  /api/locations:
    get:
      summary: List locations
      operationId: listLocations
      tags:
        - Locations
      responses:
        '200':
          description: Locations retrieved
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Location'

tags:
  - name: Locations
    description: Location management endpoints
