openapi: 3.0.0
info:
  title: Unity Api Doc Swagger
  version: 0.1.9
servers:
  - url: https://dev.unity.izyim.com/user-backsys/api
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
paths:
  /login:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  default: one@izyim.com
                password:
                  type: string
                  default: pass123
      responses:
        '200':
          description: response OK
      tags:
        - login
  ###########################################################
  /user/self:
    get:
      security:
        - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - user
  /user/update:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  img:
                    type: array
                    items:
                      type: string
                      default: base64 encode
                  first_name:
                    type: string
                    default: Jeff
                  last_name:
                    type: string
                    default: Bezos
                  email:
                    type: string
                    default: one@izyim.com
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - user
  ###########################################################
  /entity/list:
    get:
      parameters:
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 9
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - entity
  /entity/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - entity
  /entity/store:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    default: Sample Entity
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - entity
  /entity/update/{hash_id}:
    put:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    default: Sample Update Entity
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - entity
  /entity/delete/{hash_id}:
    delete:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - entity
  ###########################################################
  /entity-signature/list:
    get:
      parameters:
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 9
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - entity signature
  /entity-signature/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - entity signature
  /entity-signature/store:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  entity_id:
                    type: array
                    items:
                      type: string
                      default: hash_id
                  type[]:
                    description: 
                      1 = master key, 2 = normal key
                    type: array
                    items:
                      type: integer
                      enum:
                        - 1
                        - 2
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - entity signature
  /entity-signature/delete/{hash_id}:
    delete:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - entity signature
  ###########################################################
  /contract-template/list:
    get:
      parameters:
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 9
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template
  /contract-template/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template
  /contract-template/store:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    default: Sample Contract Entity
                  complete_day_range:
                      type: integer
                      default: 7
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - contract template
  /contract-template/update/{hash_id}:
    put:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    default: Sample Update Contract Entity
                  complete_day_range:
                      type: integer
                      default: 8
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template
  /contract-template/delete/{hash_id}:
    delete:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template
  ###########################################################      
  /contract-template-obligation/list:
    get:
      parameters:
        - in: query
          name: contract_template_id[]
          schema:
            type: array
            items:
              type: string
              description: hash_id
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 9
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation
  /contract-template-obligation/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation
  /contract-template-obligation/store:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  contract_template_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
                  name:
                    type: string
                    default: Sample Contract Entity
                  sequence:
                      type: integer
                      default: 1
                  reference:
                    type: string
                  content:
                    type: string
                  must_complete:
                    type: boolean
                  must_accept:
                    type: boolean
                  complete_day_range:
                      type: integer
                      default: 7
                  type: 
                    type: integer
                    description: 1 = money, 2 = offer_service, 3 = received_service, 4 = request_service, 5 = accept_service
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - contract template obligation
  /contract-template-obligation/update/{hash_id}:
    put:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  contract_template_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
                  name:
                    type: string
                    default: Sample Contract Entity
                  sequence:
                      type: integer
                      default: 1
                  reference:
                    type: string
                  content:
                    type: string
                  must_complete:
                    type: boolean
                  must_accept:
                    type: boolean
                  complete_day_range:
                      type: integer
                      default: 7
                  type: 
                    type: integer
                    description: 1 = money, 2 = offer_service, 3 = received_service, 4 = request_service, 5 = accept_service
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation
  /contract-template-obligation/delete/{hash_id}:
    delete:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation
  ########################################################### 
  /contract-template-obligation-dependency/list:
    get:
      parameters:
        - in: query
          name: contract_template_obligation_id[]
          schema:
            type: array
            items:
              type: string
              description: hash_id
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 9
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation dependency
  /contract-template-obligation-dependency/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation dependency
  /contract-template-obligation-dependency/store:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  contract_template_obligation_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
                  depend_contract_template_obligation_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
                  
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - contract template obligation dependency
  /contract-template-obligation-dependency/delete/{hash_id}:
    delete:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation dependency
  ###########################################################
  /contract-template-obligation-contract-template-dependency/list:
    get:
      parameters:
        - in: query
          name: contract_template_obligation_id[]
          schema:
            type: array
            items:
              type: string
              description: hash_id
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 9
                
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation contract template dependency
  /contract-template-obligation-contract-template-dependency/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation contract template dependency
  /contract-template-obligation-contract-template-dependency/store:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  contract_template_obligation_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
                  depend_contract_template_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
                  
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - contract template obligation contract template dependency
  /contract-template-obligation-contract-template-dependency/delete/{hash_id}:
    delete:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract template obligation contract template dependency
  ###########################################################
  /contract/list:
    get:
      parameters:
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 3 = done, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 3
                - 9
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract
  /contract/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract
  /contract/generate:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  contract_template_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - contract
  /contract/active/{hash_id}:
    put:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract
  /contract/delete/{hash_id}:
    delete:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract
  ###########################################################
  /contract-entity/list:
    get:
      parameters:
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 9
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract entity
  /contract-entity/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract entity
  /contract-entity/store:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  contract_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
                  entity_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - contract entity
  /contract-entity/delete/{hash_id}:
    delete:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract entity
  ###########################################################
  /contract-obligation/list:
    get:
      parameters:
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 3 = done, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 3
                - 9
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract obligation
  /contract-obligation/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract obligation
  /contract-obligation/assign-contract-entity/{hash_id}:
    put:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  contract_entity_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract obligation
  /contract-obligation/update-complete/{hash_id}:
    put:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  entity_signature_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract obligation
  /contract-obligation/update-accept/{hash_id}:
    put:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  entity_signature_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract obligation
  ###########################################################
  /contract-obligation-contract-dependency/list:
    get:
      parameters:
        - in: query
          name: status[]
          description: 
            1 = active, 2 = deactive, 9 = pending
          schema:
            type: array
            items:
              type: integer
              enum:
                - 1
                - 2
                - 9
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract obligation contract dependency
  /contract-obligation-contract-dependency/show/{hash_id}:
    get:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract obligation contract dependency
  /contract-obligation-contract-dependency/store:
    post:
        requestBody:
          content:
            application/json:
              schema:
                type: object
                properties:
                  contract_obligation_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
                  depend_contract_id:
                      type: array
                      items:
                        type: string
                        default: hash_id
        security:
          - bearerAuth: []
        responses:
          '200':
            description: response OK
        tags:
          - contract obligation contract dependency
  /contract-obligation-contract-dependency/delete/{hash_id}:
    delete:
      parameters:
        - in: path
          required: true
          name: hash_id
          schema:
            type: string
      security:
          - bearerAuth: []
      responses:
        '200':
          description: response OK
      tags:
        - contract obligation contract dependency
        
        
        
        
        
        
        
