openapi: 3.0.3
info:
  title: Flo Recruit Web API (CSV Endpoints)
  version: v1
servers:
  - url: https://www.florecruit.com/v1

paths:
  /matters-csv/upload-csv:
    post:
      tags:
        - matter-api
      summary: Upload matters CSV for a review cycle
      description: Accepts a CSV file upload and associates it with the provided review cycle. Returns 200 OK on success.
      operationId: uploadMattersCSV
      parameters:
        - name: reviewCycleId
          in: query
          required: true
          description: Review cycle identifier.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required: [file]
              properties:
                file:
                  type: string
                  format: binary
                  description: CSV file containing matters data.
      responses:
        "200":
          description: OK
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                type: string
        "404":
          description: Not Found
          content:
            "*/*":
              schema:
                type: string
        "500":
          description: Internal Server Error
          content:
            "*/*":
              schema:
                type: string

components:
  schemas:
    # Schemas defined in the CSV endpoints documentation (shared across these endpoints)
    MembersCsvValidationResult:
      type: object
      properties:
        fileError:
          $ref: "#/components/schemas/FileError"
        rowColumnErrors:
          type: array
          items:
            $ref: "#/components/schemas/RowColumnError"

    FileError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
          enum:
            - EMPTY_FILE
            - INVALID_FILE_FORMAT
            - MISSING_REQUIRED_COLUMNS
            - UNEXPECTED_COLUMNS
            - FILE_SIZE_EXCEEDED

    RowColumnError:
      type: object
      properties:
        columnName:
          type: string
        message:
          type: string
        rowNumber:
          type: integer
          format: int32
        type:
          type: string
          enum:
            - EMPTY_REQUIRED_VALUE
            - INVALID_EMAIL
            - INVALID_FORMAT
            - INVALID_URL
            - INVALID_YEAR
            - INVALID_DATE_FORMAT
            - DUPLICATE_VALUE
            - EXISTING_USER_CONFLICT
            - INVALID_LIST_SELECTION
            - INVALID_SSO_ID
            - ROW_VALUE_CONFLICT
            - UNKNOWN
        value:
          type: string
