swagger: "2.0"
info:
  description: "Dashboard API for several use."
  version: 1.0.0
  title: SS6 Dashboard
  termsOfService: "http://transformore.net"
  contact:
    email: ss6@ppa.co.id
host: api34.transformore.net
basePath: /v2
schemes:
  - http
paths:
  "/rkb/v1/form?dept={dept}":
    get:
      tags:
        - rkbapi
      summary: List RKB 
      description: Returns All Form RKB by (Dept) 
      operationId: All Form RKB by (Dept) 
      produces:
        - application/json
      schema: 
        $ref: "#/components/schemas/getrkbform"
      parameters:
        - name: dept
          in: query
          description: dept for filtering
          required: true
          schema : 
            type: string
            enum:
              - PRO
              - PLT
              - ENG
              - HCG
              - SHE
              - FLO
              - PAC
              - MNG
              - COE
          explode: true
      responses:
        "200":
          description: successful operation
  "/rkb/v1/form/itemDetail?id={id}":
    get:
      tags:
        - rkbapi
      summary: List RKB Detail
      description: Returns All Form Item Detail  By (id)
      operationId: All Form Item Detail BY (id)
      produces:
        - application/json
      schema: 
        $ref: "#/components/schemas/getitemdetail"
      parameters:
        - name: id
          in: query
          description: id for filtering
          required: true
          schema : 
            type: string
          explode: true
      responses:
        "200":
          description: successful operation
  "/rkb/v1/approval?nrp={nrp}":
    get:
      tags:
        - rkbapi
      summary: Approval-outstanding-rkb
      description: Returns All Form RKB Approval (Nrp)
      operationId: All Form RKB Approval (Nrp)
      produces:
        - application/json
      schema: 
        $ref: "#/components/schemas/getformrkbapproval"
      parameters:
        - name: nrp
          in: query
          description: nrp for filtering
          required: true
          schema : 
            type: string
          explode: true
      responses:
        "200":
          description: successful operation
  "/rkb/v1/approval/falog?nrp={nrp}":
    get:
      tags:
        - rkbapi
      summary: Action-outstanding-falog
      description: Returns All Form RKB Approval Falog (Nrp)
      operationId: All Form RKB Approval Falog (Nrp)
      produces:
        - application/json
      schema: 
        $ref: "#/components/schemas/getformrkbapprovalfalog"
      parameters:
        - name: nrp
          in: query
          description: nrp for filtering
          required: true
          schema : 
            type: string
          explode: true
      responses:
        "200":
          description: successful operation
  "/rkb/v1/duration?dept={dept}":
    get:
      tags:
        - rkbapi
      summary: List duration RKB 
      description: Returns All Form duration RKB by (Dept) 
      operationId: All Form duration RKB by (Dept) 
      produces:
        - application/json
      parameters:
        - name: dept
          in: query
          description: dept for filtering
          required: true
          schema : 
            type: string
          explode: true
      responses:
        "200":
          description: successful operation
  "/rkb/v1/form/create/":  
    post:
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema: 
              $ref: "#/components/schemas/createrkbform"
              properties:
                id:
                  type: string
                dept:
                  type: enum
                tanggal:
                  type: datetime
                nrp:
                  type: string
                nama:
                  type: string
                posisi:
                  type: string
                status:
                  type: enum
      tags:
        - rkbapi
      summary: create rkb  
      description: create rkb form 
      operationId: create rkb form
      produces:
        - application/xml
        - application/json
      responses:
        '200':
          description: successful operation
      security:
        - petstore_auth:
          - 'write:pets'
  "/rkb/v1/form/create-items/":  
    post:
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema: 
              $ref: "#/components/schemas/createitems"
              properties:
                id:
                  type: string
                id_rkb:
                  type: string
                nama:
                  type: string
                ukuran:
                  type: string
                kuantitas:
                  type: integer
                satuan:
                  type: string
                keterangan:
                  type: string
                ref_link:
                  type: string
                lampiran:
                  type: string
                  format: binary
      tags:
        - rkbapi
      summary: create rkb items 
      description: create rkb-items 
      operationId: create rkb-items
      produces:
        - application/xml
        - application/json
      responses:
        '200':
          description: successful operation
          schema:
            type: array
      security:
        - petstore_auth:
          - 'write:pets'
  "/rkb/v1/approval":  
    put:
      tags:
        - rkbapi
      summary: action-rkb
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/updateapproval"
      responses:
        '200':
            description: successful operation
            schema:
              type: array
  "/rkb/v1/approval/falog":  
    put:
      tags:
        - rkbapi
      summary: action-falog
      # parameters:
      #   - name: id
      #     in: path
      #     required: true
      #     schema:
      #       type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/updateapprovalfalog"
      responses:
        '200':
            description: successful operation
            schema:
              type: array
  "/rkb/v1/serahterima/falog":  
    put:
      tags:
        - rkbapi
      summary: tanda-terima
      # parameters:
      #   - name: id
      #     in: path
      #     required: true
      #     schema:
      #       type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/updatetandaterimafalog"
      responses:
        '200':
            description: successful operation
            schema:
              type: array
components:
  schemas:
    getrkbform:
      type: object
      required:
        - "dept"
      properties:
        dept:
          type: "enum"
          enum: ["PRO", "PLT", "ENG", "HCG", "SHE", "FLO", "PAC", "MNG", COE"]
    getitemdetail:
      type: object
      required:
        - "id"
      properties:
        dept:
          type: "char"
          format: uuid
          example: "7f8f06ae-06a7-11ee-ae11-040300000000"
    getformrkbapproval:
      type: object
      required:
        - "nrp"
      properties:
        dept:
          type: "string"
          example: "8060050"
    getformrkbapprovalfalog:
      type: object
      required:
        - "nrp"
      properties:
        dept:
          type: "string"
          example: "16041180"
    createrkbform:
      type: object
      properties:
        id:
          type: "string"
          example: "93fdd2a1-80be-476b-9d22-121212121212"
        dept:
          type: "enum"
          enum: ['PRO', 'PLT', 'ENG', 'HCG', 'SHE', 'FLO', 'PAC', 'MNG', 'COE']
        tanggal:
          type: "datetime"
          example: "2023-06-13 11:11:00"
        nrp:
          type: "string"
          example: "22004393"
        nama:
          type: "string"
          example: "Raihani"
        posisi:
          type: "string"
          example: "ICT"
        status: 
          type: "enum"
          enum: ['Waiting Approval SH','Reject SH','Waiting Approval SM','Reject SM','Waiting Accept','On Proccess','Ready','Finish']
    createitems:
      type: object
      properties:
        id: 
          type: "string"
          example: "testing-rkbitems-01"
        id_rkb:
          type: "string"
          example: "93fdd2a1-80be-476b-9d22-121212121212"
        nama:
          type: "string"
          example: "Logitech Mouse Wireless M171 Black"
        ukuran:
          type: "string"
          example: "1,39 inci"
        kuantitas:
          type: "integer"
          example: "1"
        satuan:
          type: "string"
          example: "pcs"
        keterangan:
          type: "string"
          example: "Mouse Wireless Bluetooth"
        ref_link:
          type: "string"
          example: "https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.logitech.com%2Fid-id%2Fproducts%2Fmice.html&psig=AOvVaw0jllgKVJwwEEPRehAyroAz&ust=1686460631496000&source=images&cd=vfe&ved=0CBEQjRxqFwoTCMDEtsr5t_8CFQAAAAAdAAAAABAE"
        lampiran:
          type: array
          items:
            type: "string"
            format: binary
        status:
          type: enum
          enum: ['Waiting Approval SH','Reject SH','Waiting Approval SM','Reject SM','Waiting Accept','On Proccess','Ready','Finish']
    updateapproval:
      type: object
      required:
        - "id"
        - "level"
        - "nrp_appv"
        - "nama_appv"
        - "posisi_appv"
        - "status"
      properties:
        id:
          type: "string"
          example: "93fdd2a1-80be-476b-9d22-121212121212"
        level:
          type: "string"
          example: "SH"
        nrp_appv:
          type: "string"
          example: "13050464"
        nama_appv: 
          type: "string"
          example: "AGUS SUNYOTO"
        posisi_appv: 
          type: "string"
          example: "SECTION HEAD COE"
        data_items:
          properties:
            id:
              type: string
            id_item: 
              type: string
            kuantitas:
              type: integer
            status:
              type: string
            alasan:
              type: string
          example:
            - 
              id: "xxxxxxxxxxxxxxxrkbitems001"
              id_item: "testing-rkbitems-01"
              kuantitas: "1"
              status: "Approved"
              alasan: "kebutuhan kerja"
            - 
              id: "xxxxxxxxxxxxxxxrkbitems002"
              id_item: "testing-rkbitems-02"
              kuantitas: "2"
              status: "Rejected"
              alasan: "kebutuhan kerja"
    updateapprovalfalog:
      type: object
      required:
        - "id"
        - "level"
        - "nrp_appv"
        - "nama_appv"
        - "posisi_appv"
      properties:
        id:
          type: "string"
          example: "93fdd2a1-80be-476b-9d22-121212121212"
        level:
          type: "string"
          example: LOG
        nrp_appv:
          type: "string"
          example: "18125575"
        nama_appv: 
          type: "string"
          example: "BAGUS SANYOTO"
        posisi_appv: 
          type: "string"
          example: "GROUP LEADER LOGISTIC"
        data_items:
          properties:
            id:
              type: char
            id_item: 
              type: char
            status:
              type: string
          example:
            - 
              id: "xxxxxxxxxxxxxxxrkbitems012"
              id_item: "testing-rkbitems-01"
              kuantitas: "1"
              status: "Approved"
              alasan: "Pengajuan di setujui"
    updatetandaterimafalog:
      type: object
      required:
        - "id"
        - "level"
        - "nrp_appv"
        - "nama_appv"
        - "posisi_appv"
      properties:
        id:
          type: "string"
          example: "93fdd2a1-80be-476b-9d22-121212121212"
        level:
          type: "string"
          example: "LOG"
        nrp_appv:
          type: "string"
          example: "15060959"
        nama_appv: 
          type: "string"
          example: "DWI MAULANA SIDI"
        posisi_appv: 
          type: "string"
          example: "GROUP LEADER LOGISTIC"
        data_items:
          properties:
            id:
              type: string
            id_item: 
              type: string
            status:
              type: string
          example:
            - 
              id: "xx-xx-xx-falog001"
              id_item: "testing-rkbitems-01"
              kuantitas: "1"
              status: "Approved"
              alasan: "Barang sudah diterima oleh Yoga nrp 20000257"


        
        