openapi: 3.0.3
info:
  title: Repzo API - Inventory Adjustment Reason
  version: 1.0.0
  description: OpenAPI specification for Repzo Inventory Adjustment Reason endpoints.
servers:
  - url: https://sv.api.repzo.me
paths:
  /inventory-adjustment-reason:
    get:
      summary: Find inventory adjustment reasons
      operationId: findInventoryAdjustmentReasons
      parameters:
        - in: query
          name: params
          schema:
            type: object
          description: Query parameters for filtering inventory adjustment reasons
      responses:
        "200":
          description: A list of inventory adjustment reasons
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InventoryAdjustmentReasonFindResult"
    post:
      summary: Create an inventory adjustment reason
      operationId: createInventoryAdjustmentReason
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InventoryAdjustmentReasonCreateBody"
      responses:
        "201":
          description: Inventory adjustment reason created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InventoryAdjustmentReasonCreateResult"
  /inventory-adjustment-reason/{id}:
    get:
      summary: Get an inventory adjustment reason by ID
      operationId: getInventoryAdjustmentReason
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Inventory adjustment reason details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InventoryAdjustmentReasonGetResult"
    put:
      summary: Update an inventory adjustment reason
      operationId: updateInventoryAdjustmentReason
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InventoryAdjustmentReasonUpdateBody"
      responses:
        "200":
          description: Inventory adjustment reason updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InventoryAdjustmentReasonUpdateResult"
    delete:
      summary: Remove an inventory adjustment reason
      operationId: removeInventoryAdjustmentReason
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Inventory adjustment reason removed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InventoryAdjustmentReasonRemoveResult"
components:
  schemas:
    InventoryAdjustmentReasonFindResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/InventoryAdjustmentReason"
        meta:
          type: object
    InventoryAdjustmentReasonCreateBody:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum: [increase, decrease]
        disabled:
          type: boolean
    InventoryAdjustmentReasonCreateResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/InventoryAdjustmentReason"
    InventoryAdjustmentReasonGetResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/InventoryAdjustmentReason"
    InventoryAdjustmentReasonUpdateBody:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum: [increase, decrease]
        disabled:
          type: boolean
    InventoryAdjustmentReasonUpdateResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/InventoryAdjustmentReason"
    InventoryAdjustmentReasonRemoveResult:
      type: object
      properties:
        success:
          type: boolean
    InventoryAdjustmentReason:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
        type:
          type: string
          enum: [increase, decrease]
        disabled:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
