openapi: 3.0.3
info:
  title: Repzo API - Custom List Item
  version: 1.0.0
  description: OpenAPI specification for Repzo Custom List Item endpoints.
servers:
  - url: https://sv.api.repzo.me
paths:
  /custom-list-item:
    get:
      summary: Find custom list items
      operationId: findCustomListItems
      parameters:
        - in: query
          name: params
          schema:
            type: object
          description: Query parameters for filtering custom list items
      responses:
        "200":
          description: A list of custom list items
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListItemFindResult"
    post:
      summary: Create a custom list item
      operationId: createCustomListItem
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomListItemCreateBody"
      responses:
        "201":
          description: Custom list item created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListItemCreateResult"
  /custom-list-item/{id}:
    get:
      summary: Get a custom list item by ID
      operationId: getCustomListItem
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Custom list item details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListItemGetResult"
    put:
      summary: Update a custom list item
      operationId: updateCustomListItem
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomListItemUpdateBody"
      responses:
        "200":
          description: Custom list item updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListItemUpdateResult"
    delete:
      summary: Remove a custom list item
      operationId: removeCustomListItem
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Custom list item removed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListItemRemoveResult"
components:
  schemas:
    CustomListItemFindResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/CustomListItem"
        meta:
          type: object
    CustomListItemCreateBody:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
        customList:
          type: string
        disabled:
          type: boolean
    CustomListItemCreateResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/CustomListItem"
    CustomListItemGetResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/CustomListItem"
    CustomListItemUpdateBody:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
        customList:
          type: string
        disabled:
          type: boolean
    CustomListItemUpdateResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/CustomListItem"
    CustomListItemRemoveResult:
      type: object
      properties:
        success:
          type: boolean
    CustomListItem:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
        value:
          type: string
        customList:
          type: string
        disabled:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
