swagger: '2.0'
info:
  version: 2.0.0
  title: business-audits
host: localhost
basePath: /rest/admin/v2/
tags:
  - name: business-audits
paths:
  /business-audits:
    get:
      tags:
        - business-audits
      summary: Get the business audits.
      description: 'Get the business audits for user, commands, or both of them.'
      operationId: findBusinessAuditRecordsBetweenTime
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: user
          in: query
          description: The user for query.
          required: false
          type: string
        - name: commandType
          in: query
          description: The command type for query.
          required: false
          type: string
        - name: storeId
          in: query
          description: 'The store id, if no store id passed, then use the default store id 0.'
          required: false
          type: string
        - name: startTime
          in: query
          description: The start time to show the business audit.
          required: true
          type: string
        - name: endTime
          in: query
          description: The end time to show the business audit.
          required: true
          type: string
        - name: offset
          in: query
          description: The index of the first item to be returned.
          required: false
          type: integer
          format: int32
        - name: limit
          in: query
          description: The maximum number of items to be returned.
          required: false
          type: integer
          format: int32
      responses:
        '200':
          description: Get business audits successfully.
          schema:
            $ref: '#/definitions/BusinessAudits'
  '/business-audits/{id}':
    get:
      tags:
        - business-audits
      summary: Get the business audit for a particular id.
      description: 'Get the business audits for a particular id, if no attributes returns but do exist in DB, it means the user does not have authority to view the details of the attributes.'
      operationId: findBusinessAuditById
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: id
          in: path
          description: The business audit id.
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: Get business audit successfully.
          schema:
            $ref: '#/definitions/BusinessAuditDetails'
definitions:
  BusinessAudit:
    type: object
    properties:
      businessAuditId:
        type: integer
        format: int64
      user:
        type: string
      forUserId:
        type: string
      auditTime:
        type: string
        format: date-time
      action:
        type: string
      commandType:
        type: string
      commandName:
        type: string
  BusinessAudits:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/BusinessAudit'
  BusinessAuditDetails:
    type: object
    properties:
      auditSessionId:
        type: string
      auditId:
        type: string
      sequence:
        type: string
      userId:
        type: string
      forUserId:
        type: string
      occurence:
        type: string
      storeId:
        type: string
      action:
        type: string
      workspace:
        type: string
      taskGroup:
        type: string
      task:
        type: string
      commandName:
        type: string
      timestamp:
        type: string
        format: date-time
      events:
        type: string
      attributes:
        $ref: '#/definitions/BusinessAuditParameterDataBean'
  BusinessAuditParameterDataBean:
    type: object
    properties:
      parameterNames:
        type: array
        items:
          type: string
      parameterValues:
        type: array
        items:
          type: string
