openapi: 3.1.0
info:
  title: api-citizenchanges
  contact: {}
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: "3.0"
servers:
- url: http://localhost:60740
  description: Generated server url
paths:
  /{municipalityId}/reminder/batchtrigger/reminder/endofterm:
    get:
      tags:
      - reminder-resource
      description: Use this to do a live run of the batch job. Messages will be sent
        to the citizens if sendMessage is true.
      operationId: runReminderBatch
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: firstErrand
        in: query
        required: true
        schema:
          type: integer
          format: int32
      - name: numOfErrands
        in: query
        required: true
        schema:
          type: integer
          format: int32
      - name: sendMessage
        in: query
        required: true
        schema:
          type: boolean
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                enum:
                - DONE
                - ERROR
        "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"
    post:
      tags:
      - reminder-resource
      operationId: runReminderBatch_1
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: sendMessage
        in: query
        required: true
        schema:
          type: boolean
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                enum:
                - DONE
                - ERROR
        "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}/relocations/batchtrigger/relocations:
    get:
      tags:
      - relocation-check-resource
      operationId: runBatch
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: backtrackDays
        in: query
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                enum:
                - DONE
                - ERROR
        "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"
    post:
      tags:
      - relocation-check-resource
      description: 'Use this if you want to send a set of Citizeninfo to the batch
        job and bypass the citizen api. '
      operationId: runBatch_1
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: backtrackDays
        in: query
        required: true
        schema:
          type: integer
          format: int32
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/CitizenWithChangedAddress"
              uniqueItems: true
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                enum:
                - DONE
                - ERROR
        "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}/daycare/batchtrigger/daycarechecker:
    post:
      tags:
      - day-care-check-resource
      operationId: runDaycareCheckBatch
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: firstErrand
        in: query
        required: true
        schema:
          type: integer
          format: int32
      - name: numOfErrands
        in: query
        required: true
        schema:
          type: integer
          format: int32
      - name: backtrackDays
        in: query
        required: true
        schema:
          type: integer
          format: int32
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
              required:
              - file
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                enum:
                - DONE
                - ERROR
        "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}/reminder/batchtrigger/reminder/endofterm/dryrun:
    get:
      tags:
      - reminder-resource
      description: Use this to do a dry run of the batch job. No messages will be
        sent to the citizens. Sms and email will be sent to the specified recipients.
      operationId: runReminderBatch_2
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: firstErrand
        in: query
        required: true
        schema:
          type: integer
          format: int32
      - name: numOfErrands
        in: query
        required: true
        schema:
          type: integer
          format: int32
      - name: sms
        in: query
        required: true
        schema:
          type: string
      - name: email
        in: query
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                enum:
                - DONE
                - ERROR
        "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}/relocations/meta/recentmoves:
    get:
      tags:
      - relocation-check-resource
      operationId: getRecentMoves
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: backtrackDays
        in: query
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CitizenWithChangedAddress"
                uniqueItems: true
        "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}/daycare/cachedFile:
    get:
      tags:
      - day-care-check-resource
      operationId: checkCachedFile
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: boolean
        "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"
    delete:
      tags:
      - day-care-check-resource
      operationId: deleteCachedFile
      parameters:
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      responses:
        "200":
          description: OK
        "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
        detail:
          type: string
        causeAsProblem:
          $ref: "#/components/schemas/ThrowableProblem"
        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
    CitizenAddress:
      type: object
      properties:
        status:
          type:
          - string
          - "null"
        nrDate:
          type:
          - string
          - "null"
          format: date-time
        realEstateDescription:
          type:
          - string
          - "null"
        co:
          type:
          - string
          - "null"
        address:
          type:
          - string
          - "null"
        addressArea:
          type:
          - string
          - "null"
        addressNumber:
          type:
          - string
          - "null"
        addressLetter:
          type:
          - string
          - "null"
        appartmentNumber:
          type:
          - string
          - "null"
        postalCode:
          type:
          - string
          - "null"
        city:
          type:
          - string
          - "null"
        county:
          type:
          - string
          - "null"
        municipality:
          type:
          - string
          - "null"
        country:
          type:
          - string
          - "null"
        emigrated:
          type:
          - boolean
          - "null"
        addressType:
          type:
          - string
          - "null"
        xCoordLocal:
          type:
          - number
          - "null"
          format: double
        yCoordLocal:
          type:
          - number
          - "null"
          format: double
    CitizenWithChangedAddress:
      type: object
      properties:
        personId:
          type:
          - string
          - "null"
          format: uuid
        personNumber:
          type:
          - string
          - "null"
        classified:
          type:
          - string
          - "null"
        unRegCode:
          type:
          - string
          - "null"
        unRegDate:
          type:
          - string
          - "null"
          format: date-time
        gender:
          type:
          - string
          - "null"
        givenname:
          type:
          - string
          - "null"
        lastname:
          type:
          - string
          - "null"
        typeOfSchool:
          type:
          - string
          - "null"
        custodianFor:
          type:
          - array
          - "null"
          items:
            $ref: "#/components/schemas/CustodyChildrenPupil"
        addresses:
          type:
          - array
          - "null"
          items:
            $ref: "#/components/schemas/CitizenAddress"
    CustodyChildrenPupil:
      type: object
      properties:
        personnumber:
          type:
          - string
          - "null"
        typeOfSchool:
          type:
          - string
          - "null"
        unRegCode:
          type:
          - string
          - "null"
        unRegDate:
          type:
          - string
          - "null"
          format: date-time
  securitySchemes: {}
