openapi: 3.0.1
info:
  title: SqlAccountRestAPI
  version: '1.0'
  contact:
    email: support@example.com
tags:
  - name: App
  - name: BizObject
  - name: Customer
  - name: CustomerInvoice
  - name: History
  - name: CustomerPayment
  - name: SalesInvoice
  - name: SalesOrder
  - name: StockAdjustment
  - name: StockItem
  - name: StockItemTemplate
paths:
  /api/App/login:
    post:
      tags:
        - App
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
          application/x-msgpack:
            schema:
              $ref: '#/components/schemas/LoginRequest'
      responses:
        '200':
          description: Success
  /api/App/info:
    get:
      tags:
        - App
      responses:
        '200':
          description: Success
  /api/App/actions:
    get:
      tags:
        - App
      responses:
        '200':
          description: Success
  /api/App/modules:
    get:
      tags:
        - App
      responses:
        '200':
          description: Success
  /api/App/objects:
    get:
      tags:
        - App
      responses:
        '200':
          description: Success
  /api/App/objects/{name}:
    get:
      tags:
        - App
      parameters:
        - name: name
          in: path
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: Success
  /api/App/update:
    post:
      tags:
        - App
      responses:
        '200':
          description: Success
  /api/biz-objects/query:
    post:
      tags:
        - BizObject
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BizObjectQueryRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/BizObjectQueryRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/BizObjectQueryRequest'
          application/x-msgpack:
            schema:
              $ref: '#/components/schemas/BizObjectQueryRequest'
      responses:
        '200':
          description: Success
  /api/biz-objects/{entityType}:
    post:
      tags:
        - BizObject
      parameters:
        - name: entityType
          in: path
          required: true
          style: simple
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BizObjectRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/BizObjectRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/BizObjectRequest'
          application/x-msgpack:
            schema:
              $ref: '#/components/schemas/BizObjectRequest'
      responses:
        '200':
          description: Success
  /api/biz-objects/{entityType}/{fieldKey}/{fieldValue}:
    put:
      tags:
        - BizObject
      parameters:
        - name: entityType
          in: path
          required: true
          style: simple
          schema:
            type: string
        - name: fieldKey
          in: path
          required: true
          style: simple
          schema:
            type: string
        - name: fieldValue
          in: path
          required: true
          style: simple
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BizObjectUpdateRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/BizObjectUpdateRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/BizObjectUpdateRequest'
          application/x-msgpack:
            schema:
              $ref: '#/components/schemas/BizObjectUpdateRequest'
      responses:
        '200':
          description: Success
  /api/biz-objects/transfer:
    post:
      tags:
        - BizObject
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BizObjectTransferRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/BizObjectTransferRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/BizObjectTransferRequest'
          application/x-msgpack:
            schema:
              $ref: '#/components/schemas/BizObjectTransferRequest'
      responses:
        '200':
          description: Success
  /api/customers/email/{email}:
    get:
      tags:
        - Customer
      parameters:
        - name: email
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/customers/payment:
    post:
      tags:
        - Customer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddCustomerPaymentRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/AddCustomerPaymentRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/AddCustomerPaymentRequest'
          application/x-msgpack:
            schema:
              $ref: '#/components/schemas/AddCustomerPaymentRequest'
      responses:
        '200':
          description: Success
  /api/customers/code/{code}:
    get:
      tags:
        - Customer
      parameters:
        - name: code
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/customers/days-ago/{days}:
    get:
      tags:
        - Customer
      parameters:
        - name: days
          in: path
          required: true
          style: simple
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/customers/from-date/{date}:
    get:
      tags:
        - Customer
      parameters:
        - name: date
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/customer-invoices/docno/{documentNumber}:
    get:
      tags:
        - CustomerInvoice
      parameters:
        - name: documentNumber
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/customer-invoices/days-ago/{days}:
    get:
      tags:
        - CustomerInvoice
      parameters:
        - name: days
          in: path
          required: true
          style: simple
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/customer-invoices/from-date/{date}:
    get:
      tags:
        - CustomerInvoice
      parameters:
        - name: date
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/customer-payments/docno/{documentNumber}:
    get:
      tags:
        - CustomerPayment
      parameters:
        - name: documentNumber
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/customer-payments/days-ago/{days}:
    get:
      tags:
        - CustomerPayment
      parameters:
        - name: days
          in: path
          required: true
          style: simple
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/customer-payments/from-date/{date}:
    get:
      tags:
        - CustomerPayment
      parameters:
        - name: date
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/History/logs:
    get:
      tags:
        - History
      parameters:
        - name: ts
          in: query
          style: form
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
  /api/History/log-detail:
    get:
      tags:
        - History
      parameters:
        - name: fn
          in: query
          required: true
          style: form
          schema:
            type: string
      responses:
        '200':
          description: Success
  /api/History/download:
    get:
      tags:
        - History
      parameters:
        - name: fn
          in: query
          required: true
          style: form
          schema:
            type: string
      responses:
        '200':
          description: Success
  /api/sales-invoices/docno/{documentNumber}:
    get:
      tags:
        - SalesInvoice
      parameters:
        - name: documentNumber
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/sales-invoices/days-ago/{days}:
    get:
      tags:
        - SalesInvoice
      parameters:
        - name: days
          in: path
          required: true
          style: simple
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/sales-invoices/from-date/{date}:
    get:
      tags:
        - SalesInvoice
      parameters:
        - name: date
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/sales-orders/docno/{documentNumber}:
    get:
      tags:
        - SalesOrder
      parameters:
        - name: documentNumber
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/sales-orders/days-ago/{days}:
    get:
      tags:
        - SalesOrder
      parameters:
        - name: days
          in: path
          required: true
          style: simple
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/sales-orders/from-date/{date}:
    get:
      tags:
        - SalesOrder
      parameters:
        - name: date
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/stock-adjustments/docno/{documentNumber}:
    get:
      tags:
        - StockAdjustment
      parameters:
        - name: documentNumber
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/stock-adjustments/days-ago/{days}:
    get:
      tags:
        - StockAdjustment
      parameters:
        - name: days
          in: path
          required: true
          style: simple
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/stock-adjustments/from-date/{date}:
    get:
      tags:
        - StockAdjustment
      parameters:
        - name: date
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/stock-items/code/{code}:
    get:
      tags:
        - StockItem
      parameters:
        - name: code
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/stock-items/days-ago/{days}:
    get:
      tags:
        - StockItem
      parameters:
        - name: days
          in: path
          required: true
          style: simple
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/stock-items/from-date/{date}:
    get:
      tags:
        - StockItem
      parameters:
        - name: date
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/stock-item-templates/code/{code}:
    get:
      tags:
        - StockItemTemplate
      parameters:
        - name: code
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/stock-item-templates/days-ago/{days}:
    get:
      tags:
        - StockItemTemplate
      parameters:
        - name: days
          in: path
          required: true
          style: simple
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
  /api/stock-item-templates/from-date/{date}:
    get:
      tags:
        - StockItemTemplate
      parameters:
        - name: date
          in: path
          required: true
          style: simple
          schema:
            type: string
            default: ''
        - name: limit
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 100
        - name: offset
          in: query
          style: form
          schema:
            type: integer
            format: int32
            default: 0
      responses:
        '200':
          description: Success
components:
  schemas:
    AddCustomerPaymentRequest:
      type: object
      properties:
        documentNo:
          type: string
          nullable: true
          example: '123'
        paymentMethod:
          type: string
          nullable: true
          example: '123'
        project:
          type: string
          nullable: true
          example: '123'
      additionalProperties: false
    BizObjectQueryRequest:
      type: object
      properties:
        sql:
          type: string
          nullable: true
          example: '123'
        params:
          type: object
          additionalProperties: {}
          nullable: true
        offset:
          type: integer
          format: int32
          example: 123
        limit:
          type: integer
          format: int32
          example: 123
      additionalProperties: false
    BizObjectRequest:
      type: object
      properties:
        data:
          type: object
          additionalProperties: {}
          nullable: true
      additionalProperties: false
    BizObjectTransferRequest:
      type: object
      properties:
        fromEntityType:
          type: string
          nullable: true
          example: '123'
        toEntityType:
          type: string
          nullable: true
          example: '123'
        docNo:
          type: string
          nullable: true
          example: '123'
      additionalProperties: false
    BizObjectUpdateRequest:
      type: object
      properties:
        mainKey:
          type: string
          nullable: true
          example: '123'
        data:
          type: object
          additionalProperties: {}
          nullable: true
      additionalProperties: false
    LoginRequest:
      required:
        - password
        - username
      type: object
      properties:
        username:
          minLength: 1
          type: string
          example: abc
        password:
          minLength: 1
          type: string
          example: '123'
      additionalProperties: false
