openapi: 3.0.3
info:
  title: Laravel
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://isbe-master.devel.ogsoftdev.com'
tags:
  -
    name: Authentication
    description: ''
  -
    name: Esbe
    description: ''
  -
    name: SCloud
    description: ''
paths:
  /api/login:
    post:
      summary: 'User Login'
      operationId: userLogin
      description: "   Authenticates a user with login credentials and returns a bearer token.\n   The token should be included in the Authorization header for subsequent API requests."
      parameters: []
      responses:
        200:
          description: 'Successful authentication'
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    ID: null
                    LOGIN: null
                properties:
                  data:
                    type: object
                    properties:
                      ID:
                        type: string
                        example: null
                      LOGIN:
                        type: string
                        example: null
      tags:
        - Authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                login:
                  type: 'The login name'
                  description: string
                  example: molestias
                password:
                  type: 'The password'
                  description: string
                  example: qWMYx!^p5=
              required:
                - login
                - password
      security: []
  /api/esbe/orders:
    post:
      summary: Orders
      operationId: orders
      description: "   This endpoint create an empty order.\n   The next step is to add products to the order."
      parameters:
        -
          in: query
          name: user_id
          description: 'ID of the user placing the order'
          example: 6
          required: true
          schema:
            type: integer
            description: 'ID of the user placing the order'
            example: 6
        -
          in: query
          name: transport_service_id
          description: 'ID of the transport service'
          example: 20
          required: false
          schema:
            type: integer
            description: 'ID of the transport service'
            example: 20
        -
          in: query
          name: billing_plan_id
          description: 'ID of the billing plan'
          example: 13
          required: false
          schema:
            type: integer
            description: 'ID of the billing plan'
            example: 13
        -
          in: query
          name: transport_premise_id
          description: 'ID of the transport premise'
          example: 6
          required: false
          schema:
            type: integer
            description: 'ID of the transport premise'
            example: 6
        -
          in: query
          name: order_date
          description: 'Date of the order'
          example: et
          required: false
          schema:
            type: date
            description: 'Date of the order'
            example: et
        -
          in: query
          name: note
          description: 'Optional note for the order'
          example: dignissimos
          required: false
          schema:
            type: string
            description: 'Optional note for the order'
            example: dignissimos
        -
          in: query
          name: delivery_date
          description: 'Date of the delivery'
          example: nesciunt
          required: false
          schema:
            type: date
            description: 'Date of the delivery'
            example: nesciunt
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  order_id: 'int Example: 12345'
                properties:
                  order_id:
                    type: string
                    example: 'int Example: 12345'
      tags:
        - Esbe
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: integer
                  description: ''
                  example: 17
                  nullable: true
                transport_service_id:
                  type: integer
                  description: ''
                  example: 11
                  nullable: true
                billing_plan_id:
                  type: integer
                  description: ''
                  example: 20
                  nullable: true
                transport_premise_id:
                  type: integer
                  description: ''
                  example: 11
                  nullable: true
                order_date:
                  type: string
                  description: 'Must be a valid date.'
                  example: '2026-02-04T08:37:40'
                  nullable: true
                note:
                  type: string
                  description: ''
                  example: omnis
                  nullable: true
                delivery_date:
                  type: string
                  description: 'Must be a valid date.'
                  example: '2026-02-04T08:37:40'
                  nullable: true
      security: []
  '/api/esbe/orders/{order}/item':
    post:
      summary: 'Add Single Item'
      operationId: addSingleItem
      description: '   This endpoint adds a single item to an existing order.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  order_item_id: 'int Example: 67890'
                  personalized_product_id: 'int Example: 54321'
                properties:
                  order_item_id:
                    type: string
                    example: 'int Example: 67890'
                  personalized_product_id:
                    type: string
                    example: 'int Example: 54321'
      tags:
        - Esbe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: integer
                  description: "ID of the\n  user who owns the order."
                  example: 41994
                product_id:
                  type: integer
                  description: "The ID\n  of the product (SN_ID)."
                  example: 101
                quantity:
                  type: integer
                  description: "The\n  quantity of the product."
                  example: 2
                price:
                  type: numeric
                  description: "The total\n  price for the given quantity of this item."
                  example: 150.5
                price_wo_vat:
                  type: numeric
                  description: "The\n  total price without VAT."
                  example: 124.38
                parent_product_id:
                  type: integer
                  description: "The ID of the parent personalized product, if\n   this is a secondary item."
                  example: 9876
              required:
                - user_id
                - product_id
                - quantity
                - price
                - price_wo_vat
      security: []
    put:
      summary: 'Update Single Item'
      operationId: updateSingleItem
      description: '   This endpoint update a single item in an existing order.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  personalized_product_id: 'int Example: 54321'
                properties:
                  personalized_product_id:
                    type: string
                    example: 'int Example: 54321'
      tags:
        - Esbe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: integer
                  description: "ID of the\n  user who owns the order."
                  example: 41994
                product_id:
                  type: integer
                  description: "The ID\n  of the product (SN_ID)."
                  example: 101
                quantity:
                  type: integer
                  description: "The\n  quantity of the product."
                  example: 2
                price:
                  type: numeric
                  description: "The total\n  price for the given quantity of this item."
                  example: 150.5
                price_wo_vat:
                  type: numeric
                  description: "The\n  total price without VAT."
                  example: 124.38
              required:
                - user_id
                - product_id
                - quantity
                - price
                - price_wo_vat
      security: []
    delete:
      summary: 'Remove Single Item'
      operationId: removeSingleItem
      description: '   This endpoint removes a single item from an existing order.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: 'boolean Example: true'
                properties:
                  success:
                    type: string
                    example: 'boolean Example: true'
      tags:
        - Esbe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                product_id:
                  type: integer
                  description: 'The ID of the product/item to remove from the order.'
                  example: 12345
              required:
                - product_id
      security: []
    parameters:
      -
        in: path
        name: order
        description: 'The order.'
        example: voluptatibus
        required: true
        schema:
          type: string
  '/api/esbe/orders/{order}/realize':
    post:
      summary: 'Finalize Order'
      operationId: finalizeOrder
      description: "   This endpoint finalizes or \"realizes\" an order that has all its items.\n   This is the final step to make an order active."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Order finalized successfully.'
                properties:
                  message:
                    type: string
                    example: 'Order finalized successfully.'
      tags:
        - Esbe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                delivery_date:
                  type: string
                  description: 'The planned delivery date for the order.'
                  example: '2025-09-10 00:00:00'
                note:
                  type: string
                  description: 'An optional note for the realization.'
                  example: ipsam
                recipient_person:
                  type: string
                  description: 'The name of the recipient.'
                  example: deserunt
                recipient_phone:
                  type: string
                  description: 'The phone number of the recipient.'
                  example: ut
                reference_number:
                  type: string
                  description: 'The reference number of the order.'
                  example: aut
                recipient_city:
                  type: string
                  description: 'The city of the recipient.'
                  example: itaque
                recipient_zip:
                  type: string
                  description: 'The zip code of the recipient.'
                  example: id
                recipient_street:
                  type: string
                  description: 'The street of the recipient.'
                  example: et
                recipient_house_id:
                  type: string
                  description: 'The house ID of the recipient.'
                  example: omnis
                transport_premise_id:
                  type: integer
                  description: 'The ID of the transport premise.'
                  example: 12
                transport_service_id:
                  type: integer
                  description: 'The ID of the transport service.'
                  example: 15
                billing_plan_id:
                  type: integer
                  description: 'The ID of the billing plan.'
                  example: 13
              required:
                - delivery_date
      security: []
    parameters:
      -
        in: path
        name: order
        description: 'The order.'
        example: soluta
        required: true
        schema:
          type: string
  '/api/esbe/orders/{order}/generate-number':
    post:
      summary: 'Generate Order Number'
      operationId: generateOrderNumber
      description: "   This endpoint generates a unique order number for an existing order.\n   If the order already has a number, it returns the existing one."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: 'boolean Example: true'
                  order_number: 'int Example: 202409240001'
                  updated: 'boolean Example: true'
                properties:
                  success:
                    type: string
                    example: 'boolean Example: true'
                  order_number:
                    type: string
                    example: 'int Example: 202409240001'
                  updated:
                    type: string
                    example: 'boolean Example: true'
      tags:
        - Esbe
      security: []
    parameters:
      -
        in: path
        name: order
        description: 'The order.'
        example: nobis
        required: true
        schema:
          type: string
  '/api/esbe/orders/{order}/user':
    patch:
      summary: 'Update Order User'
      operationId: updateOrderUser
      description: "   This endpoint updates the user assigned to an order and all its items.\n   It also updates associated personalized products and service data."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: 'boolean Example: true'
                  user_id: 'int Example: 12345'
                properties:
                  success:
                    type: string
                    example: 'boolean Example: true'
                  user_id:
                    type: string
                    example: 'int Example: 12345'
      tags:
        - Esbe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: integer
                  description: 'The ID of the user to assign to the order.'
                  example: 12345
              required:
                - user_id
      security: []
    parameters:
      -
        in: path
        name: order
        description: 'The order.'
        example: quaerat
        required: true
        schema:
          type: string
  '/api/esbe/orders/{order}':
    delete:
      summary: 'Delete Order'
      operationId: deleteOrder
      description: '   This endpoint deletes an order. This should be used for cleanup if the ordering process fails.'
      parameters: []
      responses:
        204:
          description: ''
          content:
            application/json:
              schema:
                type: object
                nullable: true
      tags:
        - Esbe
      security: []
    parameters:
      -
        in: path
        name: order
        description: 'The order.'
        example: et
        required: true
        schema:
          type: string
  /api/esbe/send-email-using-template:
    post:
      summary: 'Send Email Using Template'
      operationId: sendEmailUsingTemplate
      description: "   This endpoint sends an email using a predefined template.\n   It processes the template with provided parameters and sends the email to the specified recipient."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  result: 'string Example: success'
                  eo_ids: 'string Example: 123,456'
                properties:
                  result:
                    type: string
                    example: 'string Example: success'
                  eo_ids:
                    type: string
                    example: 'string Example: 123,456'
      tags:
        - Esbe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  description: 'Email sender address'
                  example: sender@example.com
                to:
                  type: string
                  description: 'Email recipient address'
                  example: recipient@example.com
                ctype:
                  type: string
                  description: 'Content type'
                  example: ipsa
                sched:
                  type: string
                  description: 'Schedule parameter'
                  example: aut
                ct:
                  type: string
                  description: 'CT parameter'
                  example: sit
                tt_name:
                  type: string
                  description: 'Template name'
                  example: order_confirmation
                params:
                  type: string
                  description: 'Template parameters'
                  example: recusandae
                parsep:
                  type: string
                  description: 'Parameter separator'
                  example: et
                valsep:
                  type: string
                  description: 'Value separator'
                  example: omnis
              required:
                - to
                - tt_name
      security: []
  /api/s-cloud/tickets:
    get:
      summary: 'Maintenance List'
      operationId: maintenanceList
      description: "   This endpoint allows a user to get a list of maintenance list.\n   The list is filtered by the user's access rights and the type of maintenance list.\n   The response includes warnings, unread messages, and last activity time for each maintenance list."
      parameters:
        -
          in: query
          name: myScloudUserId
          description: 'ID of the SCloud user'
          example: 123
          required: true
          schema:
            type: integer
            description: 'ID of the SCloud user'
            example: 123
        -
          in: query
          name: zombieDays
          description: 'Number of days to consider a maintenance as zombie'
          example: 30
          required: true
          schema:
            type: integer
            description: 'Number of days to consider a maintenance as zombie'
            example: 30
        -
          in: query
          name: iAmReferee
          description: 'Indicates if the user is a referee'
          example: true
          required: true
          schema:
            type: boolean
            description: 'Indicates if the user is a referee'
            example: true
        -
          in: query
          name: iAmSupervisor
          description: 'Indicates if the user is a supervisor'
          example: false
          required: true
          schema:
            type: boolean
            description: 'Indicates if the user is a supervisor'
            example: false
        -
          in: query
          name: 0
          description: 'Number of users to return per page (optional)'
          example: 10
          required: false
          schema:
            type: integer
            description: 'Number of users to return per page (optional)'
            example: 10
        -
          in: query
          name: 1
          description: 'Page number to return (optional)'
          example: 1
          required: false
          schema:
            type: integer
            description: 'Page number to return (optional)'
            example: 1
        -
          in: query
          name: 2
          description: 'Filter by type ID of the maintenance list'
          example: '448,463,479'
          required: false
          schema:
            type: string
            description: 'Filter by type ID of the maintenance list'
            example: '448,463,479'
        -
          in: query
          name: 3
          description: 'Filter by types of the maintenance list'
          example: 'type1,type2'
          required: false
          schema:
            type: string
            description: 'Filter by types of the maintenance list'
            example: 'type1,type2'
        -
          in: query
          name: 4
          description: 'Filter by machine IDs of the maintenance list'
          example: '1,2,3'
          required: false
          schema:
            type: string
            description: 'Filter by machine IDs of the maintenance list'
            example: '1,2,3'
        -
          in: query
          name: 5
          description: 'Filter by last activity date from (optional)'
          example: '2023-01-01'
          required: false
          schema:
            type: string
            description: 'Filter by last activity date from (optional)'
            example: '2023-01-01'
        -
          in: query
          name: 6
          description: 'Order by column and direction'
          example: 'name:asc,created_at:desc'
          required: false
          schema:
            type: string
            description: 'Order by column and direction'
            example: 'name:asc,created_at:desc'
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      typeId: null
                      description: null
                      name: null
                      id: null
                      startTime: null
                      userId: null
                      lastActivity: null
                      allMessages: 0
                      warning: null
                      unreadMessages: null
                    -
                      typeId: null
                      description: null
                      name: null
                      id: null
                      startTime: null
                      userId: null
                      lastActivity: null
                      allMessages: 0
                      warning: null
                      unreadMessages: null
                properties:
                  data:
                    type: array
                    example:
                      -
                        typeId: null
                        description: null
                        name: null
                        id: null
                        startTime: null
                        userId: null
                        lastActivity: null
                        allMessages: 0
                        warning: null
                        unreadMessages: null
                      -
                        typeId: null
                        description: null
                        name: null
                        id: null
                        startTime: null
                        userId: null
                        lastActivity: null
                        allMessages: 0
                        warning: null
                        unreadMessages: null
                    items:
                      type: object
                      properties:
                        typeId:
                          type: string
                          example: null
                        description:
                          type: string
                          example: null
                        name:
                          type: string
                          example: null
                        id:
                          type: string
                          example: null
                        startTime:
                          type: string
                          example: null
                        userId:
                          type: string
                          example: null
                        lastActivity:
                          type: string
                          example: null
                        allMessages:
                          type: integer
                          example: 0
                        warning:
                          type: string
                          example: null
                        unreadMessages:
                          type: string
                          example: null
      tags:
        - SCloud
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                myScloudUserId:
                  type: integer
                  description: ''
                  example: 14
                zombieDays:
                  type: integer
                  description: 'Must be at least 0.'
                  example: 40
                iAmReferee:
                  type: boolean
                  description: ''
                  example: true
                iAmSupervisor:
                  type: boolean
                  description: ''
                  example: false
              required:
                - myScloudUserId
                - zombieDays
                - iAmReferee
                - iAmSupervisor
      security: []
