openapi: 3.0.0
info:
  title: address
  version: '1.0'
servers:
  - url: 'http://localhost:3000'
paths:
  '/business-subject/get/{id}':
    get:
      summary: Your GET endpoint
      tags: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessSubject'
              examples:
                example-1:
                  value:
                    id: 0
                    name: string
                    surname: string
                    companyName: string
                    subjectType: 0
                    businessId: string
                    vatNumber: string
                    taxId: string
                    paymentTime: 0
                    address:
                      - id: 0
                        typeId: 0
                        companyName: string
                        street: string
                        number: string
                        zipCode: 0
                        city: string
                        state: string
                        telContact: string
                        email: string
      operationId: get-address-businessSubject-get
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
  /business-subject/search:
    parameters: []
    post:
      summary: ''
      operationId: post-business-subject
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessSubjectSearchResponse'
              examples:
                example-1:
                  value:
                    businessSubject:
                      - id: 0
                        name: string
                        surname: string
                        companyName: string
                        subjectType: 0
                        businessId: string
                        vatNumber: string
                        taxId: string
                        paymentTime: 0
                        address:
                          - id: 0
                            typeId: 0
                            companyName: string
                            street: string
                            number: string
                            zipCode: 0
                            city: string
                            state: string
                            telContact: string
                            email: string
                    resultCount: 0
                    currentPage: 0
                    currentPageLenght: 0
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessSubjectSearchRequest'
            examples:
              example-1:
                value:
                  searchValue: string
                  filter:
                    value: string
                  pagination:
                    pageLength: 0
                    pageId: 0
                  order:
                    order: string
        description: ''
      description: ''
components:
  schemas:
    BusinessSubjectAddress:
      title: BusinessSubjectAddress
      type: object
      x-examples:
        BusinessSubjectAddress:
          id: 0
          typeId: 0
          companyName: string
          street: string
          number: string
          zipCode: 0
          city: string
          state: string
          telContact: string
          email: string
      properties:
        id:
          type: integer
        typeId:
          type: integer
          description: Typ adresy- Fakturacna alebo dodacia adresa. Vzdy je potrebné aby poleobsahovalo jednu fakturacnu adresu
        companyName:
          type: string
        street:
          type: string
          description: ulica + cislo domu
        number:
          type: string
        zipCode:
          type: integer
          description: PSC
        city:
          type: string
        state:
          type: string
        telContact:
          type: string
        email:
          type: string
      required:
        - typeId
        - street
        - zipCode
        - city
        - state
    BusinessSubjectSearchRequest:
      title: BusinessSubjectSearchRequest
      type: object
      x-examples:
        BusinessSubjectSearchRequest:
          searchValue: string
          filter:
            value: string
          pagination:
            pageLength: 0
            pageId: 0
          order:
            order: string
      properties:
        searchValue:
          type: string
        filter:
          $ref: '#/components/schemas/BusinessSubjectSearchFilter'
        pagination:
          $ref: '#/components/schemas/BusinessSubjectSearchPagination'
        order:
          $ref: '#/components/schemas/BusinessSubjectSearchOrder'
    BusinessSubjectSearchResponse:
      title: BusinessSeubjectSearchResponse
      type: object
      properties:
        businessSubject:
          type: array
          items:
            $ref: '#/components/schemas/BusinessSubject'
        resultCount:
          type: integer
        currentPage:
          type: integer
        currentPageLenght:
          type: integer
      x-examples:
        BusinessSeubjectSearchResponse:
          businessSubject:
            - id: 0
              name: string
              surname: string
              companyName: string
              subjectType: 0
              businessId: string
              vatNumber: string
              taxId: string
              paymentTime: 0
              address:
                - id: 0
                  typeId: 0
                  companyName: string
                  street: string
                  number: string
                  zipCode: 0
                  city: string
                  state: string
                  telContact: string
                  email: string
          resultCount: 0
          currentPage: 0
          currentPageLenght: 0
    BusinessSubjectSearchFilter:
      title: BusinessSubjectSearchFilter
      type: object
      x-examples:
        BusinessSubjectSearchFilter:
          value: string
      properties:
        value:
          type: string
    BusinessSubjectSearchPagination:
      title: BusinessSubjectSearchPagination
      type: object
      properties:
        pageLength:
          type: integer
        pageId:
          type: integer
      x-examples:
        BusinessSubjectSearchPagination:
          pageLength: 0
          pageId: 0
    BusinessSubject:
      title: BuseneesSubject
      type: object
      x-examples:
        BusinessSubject:
          id: 0
          name: string
          surname: string
          companyName: string
          subjectType: 0
          businessId: string
          vatNumber: string
          taxId: string
          paymentTime: 0
          address:
            - id: 0
              typeId: 0
              companyName: string
              street: string
              number: string
              zipCode: 0
              city: string
              state: string
              telContact: string
              email: string
      properties:
        id:
          type: integer
        name:
          type: string
        surname:
          type: string
        companyName:
          type: string
        subjectType:
          type: integer
          description: Typ subjektu- zakaznik/dodavatel
        businessId:
          type: string
          description: ICO
        vatNumber:
          type: string
          description: ICDPH
        taxId:
          type: string
          description: DIC
        paymentTime:
          type: integer
          description: Doba splatnosti subjektu evidovana v dnoch
        address:
          type: array
          description: 'Fakturacna alebo dorucovacia adresa. Fakturacna adresa je povinna. '
          items:
            $ref: '#/components/schemas/BusinessSubjectAddress'
      required:
        - id
        - subjectType
    BusinessSubjectSearchOrder:
      title: busineesSubjectSearchOrder
      type: object
      x-examples:
        BusineesSubjectSearchOrder:
          order: string
      properties:
        order:
          type: string
