Untitled

                Never    
YAML
       
openapi: 3.0.0
info: 
  description: "descripcion appointment"
  version: "1.0.0."
  title: "Swagger Appointment"
  termsOfService: ""
  contact:
    email: "sebastian.hondarza@kibernum.com"
paths:
  /appointment:
    post:
      tags:
      - private
      summary: Create a new document in the collection.
      operationId: add
      requestBody:
       required: true
       content:
        application/json:
            schema:
             $ref: '#/definitions/Appointment'
      responses:
        '201':
          x-summary: OK
          description:  Create a document of type appointment from the collection, given the asnId.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostSuccessResponse'
        '400':
          x-summary: Bad Request
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateErrorResponse'
        '422':
          x-summary: Unprocessable Entity
          description: Unprocessable Entity - Duplicate key error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DuplicateKeyErrorResponse'
        '500':
          x-summary: Internal Server Error
          description: Non Controlled Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
    get:
      tags:
        - "private"
      summary: "Get all documents from collection"
      operationId: "find"
      responses:
        '200':
          x-summary: OK
          description:  Get all documents of type Appointment from the collection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllSuccessResponse'
        '204':
          x-summary: Not Content
          description: No document found.
        '500':
          x-summary: Internal Server Error
          description: Non Controlled Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
  /appointment/asn/{asnId}/do/{doId}:
    put:
      tags:
      - "private"
      summary: "Update a document from collection"
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/definitions/Appointment'
      description: "Update an existing appointment."
      operationId: "update"
      parameters:
        - in: "path"
          name: asnId
          required: true
          description: asnID of the Appointment collection to get
          schema:
            $ref: "#/definitions/Appointment"
        - in: "path"
          name: doId
          required: true
          description: doID of the Appointment collection to get
          schema:
            $ref: "#/definitions/Appointment"
      responses:
        '200':
          x-summary: OK
          description:  Update a document of type Appointment from the collection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PutSuccessResponse'
        '204':
          x-summary: OK
          description: No content found to be updated.
        '400':
          x-summary: Bad Request
          description: Documemt is not valid
          content:
            application/json:
              schema:
                 $ref: '#/components/schemas/ValidateErrorResponse'
        '422':
          x-summary: Unprocessable Entity
          description: Unprocessable Entity - Duplicate key error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DuplicateKeyErrorResponse'
        '500':
          x-summary: Internal Server Error
          description: Non Controlled Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
    get:
      tags:
      - "private"
      summary: "Get a document from collection"
      description: "Get a document from collection By asnID and doID."
      operationId: "findById"
      parameters:
        - in: "path"
          name: "asnId"
          required: true
          description: asnID of the Appointment collection
          schema:
            $ref: "#/definitions/Appointment"
        - in: "path"
          name: "doId"
          required: true
          description: doID of the Appointment collection
          schema:
            $ref: "#/definitions/Appointment"
      responses:
        '200':
          x-summary: OK
          description:  Get a document of type appointment from the collection, given the asnId and doId.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSuccessResponse'
        '204':
          x-summary: OK
          description: No content found.
        '500':
          x-summary: Internal Server Error
          description: Non Controlled Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
    delete:
      tags:
      - "private"
      summary: "Delete a document from collection"
      operationId: delete
      parameters:
        - in: "path"
          name: "asnId"
          required: true
          description: asnID of the Appointment collection
          schema:
            $ref: "#/definitions/Appointment"
        - in: "path"
          name: "doId"
          required: true
          description: doID of the Appointment collection
          schema:
            $ref: "#/definitions/Appointment"
      responses:
        '200':
          x-summary: OK
          description:  Delete a document of type appointment from the collection, given the asnId and doId.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteSuccessResponse'
        '204':
          x-summary: OK
          description: No content found to be deleted.
        '500':
          x-summary: Internal Server Error
          description: Non Controlled Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
components:
  schemas:
    ResponseStatus:
      type: string
      enum: [success, fail, error]
    GetSuccessResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ResponseStatus'
        data:
            $ref: '#/definitions/Appointment'                       
        message:
          type: string
      required:
      - status
      - data
      - message
    GetAllSuccessResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ResponseStatus'
        data:
            type: array
            items:
              $ref: '#/definitions/Appointment' 
        message:
          type: string
      required:
      - status
      - data
      - message
    PostSuccessResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ResponseStatus'
        data:
          properties:
            insertedId:
              type: string
        message:
          type: string
      required:
      - status
      - data
      - message
    DeleteSuccessResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ResponseStatus'
        message:
          type: string
      required:
      - status
      - data
      - message
    PutSuccessResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ResponseStatus'
        data:
          $ref: '#/definitions/Appointment' 
      required:
      - status
      - data
      - message
    InternalErrorResponse:
      properties:
        status:
          type: string
          example: error
        code: 
          type: string
        message:
          type: string
    ValidateErrorResponse: 
      type: object
      properties: 
        status: 
          type: string
          example: fail
        data: 
          type: object
          properties: 
            isJoi: 
              type: boolean
            name: string
            details:
              type: array
              items:
                properties:
                type: object
            _object:
                properties:
                  type: object
        message: 
          type: string
      required: 
        - status
        - data
        - message
    DuplicateKeyErrorResponse: 
      properties: 
        status: 
          type: string
          example: fail
        code: 
          type: string
          example: MongoError
        message: 
          type: string
          example: E11000 duplicate key error.
      required: 
        - status
        - code
        - message
      type: object
definitions:
  Appointment:
    type: "object"
    properties:
      appointment:
        type: array
        items:
          type: object
          properties: 
            asnId:
              type: string
              maximun: 30
              required: true
            distributionOrderId:
              type: string
              maximun: 30              
            appointmentId:
              type: string
              maximun: 20
            originFacilityAliasId:
              type: string
              maximun: 20
            destinationFacilityAliasId:
              type: string
              maximun: 20
            subOrderId:
              type: string
              maximun: 22
            lpnId:
              type: string
              maximun: 18
            appointmentStatusDate:
              type: string

Raw Text