openapi: 3.1.0
info:
  title: api-seab-loader
  contact: { }
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: "2.0"
servers:
  - url: http://localhost:56360
    description: Generated server url
tags:
  - name: Information
    description: Information resources
  - name: Invoices
    description: Invoice resource
  - name: Jobs
    description: Jobs resource
paths:
  /{municipalityId}/jobs/notifier:
    post:
      tags:
        - Jobs
      summary: Triggers notification job.
      description: Triggers notification job.
      operationId: notifier
      parameters:
        - name: municipalityId
          in: path
          description: Municipality id
          required: true
          schema:
            type: string
          example: 2281
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/Problem"
                  - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/jobs/invoiceexporter:
    post:
      tags:
        - Jobs
      summary: Triggers export invoices (to InvoiceCache) job.
      description: Triggers export invoices (to InvoiceCache) job.
      operationId: invoiceExporter
      parameters:
        - name: municipalityId
          in: path
          description: Municipality id
          required: true
          schema:
            type: string
          example: 2281
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/Problem"
                  - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/jobs/dbcleaner:
    post:
      tags:
        - Jobs
      summary: Triggers database cleaning job.
      description: Triggers database cleaning job.
      operationId: dbCleaner
      parameters:
        - name: municipalityId
          in: path
          description: Municipality id
          required: true
          schema:
            type: string
          example: 2281
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/Problem"
                  - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/invoices:
    post:
      tags:
        - Invoices
      summary: Create invoice
      description: Receives and stores invoices in XML-format.
      operationId: createInvoice
      parameters:
        - name: municipalityId
          in: path
          description: Municipality id
          required: true
          schema:
            type: string
          example: 2281
      requestBody:
        content:
          application/octet-stream:
            schema:
              type: string
              format: byte
          application/xml:
            schema:
              type: string
              format: byte
        required: true
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/Problem"
                  - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/information/schedulers:
    get:
      tags:
        - Information
      summary: Scheduler information
      operationId: getSchedulerInformation
      parameters:
        - name: municipalityId
          in: path
          description: Municipality id
          required: true
          schema:
            type: string
          example: 2281
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/SchedulerInformation"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/Problem"
                  - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /api-docs:
    get:
      tags:
        - API
      summary: OpenAPI
      operationId: getApiDocs
      responses:
        "200":
          description: OK
          content:
            application/yaml:
              schema:
                type: string
      x-auth-type: None
      x-throttling-tier: Unlimited
      x-wso2-mutual-ssl: Optional
components:
  schemas:
    Problem:
      type: object
      properties:
        title:
          type: string
        detail:
          type: string
        instance:
          type: string
          format: uri
        type:
          type: string
          format: uri
        status:
          type: integer
          format: int32
    ConstraintViolationProblem:
      type: object
      properties:
        type:
          type: string
          format: uri
        status:
          type: integer
          format: int32
        violations:
          type: array
          items:
            $ref: "#/components/schemas/Violation"
        title:
          type: string
        causeAsProblem:
          $ref: "#/components/schemas/ThrowableProblem"
        detail:
          type: string
        instance:
          type: string
          format: uri
    ThrowableProblem:
      type: object
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
          format: int32
        detail:
          type: string
        instance:
          type: string
          format: uri
        causeAsProblem: { }
    Violation:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
    SchedulerInformation:
      type: object
      description: Scheduler information model
      properties:
        name:
          type: string
          description: Scheduler name
          examples:
            - SchedulerService
        expression:
          type: string
          description: Scheduler expression
          examples:
            - 0 0 13 * * 7
        description:
          type: string
          description: Scheduler human readable description
          examples:
            - "At 13:00, only on Sunday"
  securitySchemes: { }
