openapi: 3.0.3
info:
  title: Repzo API - Adjust Inventory
  version: 1.0.0
  description: OpenAPI specification for Repzo Adjust Inventory endpoints.
servers:
  - url: https://sv.api.repzo.me
paths:
  /adjust-inventory:
    get:
      summary: Find inventory adjustments
      operationId: findInventoryAdjustments
      parameters:
        - in: query
          name: params
          schema:
            type: object
          description: Query parameters for filtering inventory adjustments
      responses:
        "200":
          description: A list of inventory adjustments
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InventoryAdjustmentFindResult"
    post:
      summary: Create an inventory adjustment
      operationId: createInventoryAdjustment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InventoryAdjustmentCreateBody"
      responses:
        "201":
          description: Inventory adjustment created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InventoryAdjustmentCreateResult"
  /adjust-inventory/{id}:
    get:
      summary: Get an inventory adjustment by ID
      operationId: getInventoryAdjustment
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Inventory adjustment details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InventoryAdjustmentGetResult"
components:
  schemas:
    InventoryAdjustmentFindResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/InventoryAdjustment"
        meta:
          type: object
    InventoryAdjustmentCreateBody:
      type: object
      properties:
        warehouse:
          type: string
        rep:
          type: string
        items:
          type: array
          items:
            type: object
            properties:
              product:
                type: string
              variant:
                type: string
              adjustmentQuantity:
                type: number
              reason:
                type: string
        notes:
          type: string
    InventoryAdjustmentCreateResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/InventoryAdjustment"
    InventoryAdjustmentGetResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/InventoryAdjustment"
    InventoryAdjustment:
      type: object
      properties:
        _id:
          type: string
        warehouse:
          type: string
        rep:
          type: string
        items:
          type: array
          items:
            type: object
            properties:
              product:
                type: string
              variant:
                type: string
              adjustmentQuantity:
                type: number
              reason:
                type: string
        notes:
          type: string
        status:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
