openapi: 3.0.3
info:
  title: Flo Recruit Web API (CSV Endpoints)
  version: v1
servers:
  - url: https://www.florecruit.com/v1
paths:
  /members/import-csv:
    post:
      tags:
        - members-api
      summary: Import new members to the given product
      description: Creates new members from CSV input; no response body on success, detailed error response on failure.
      operationId: importProductMemberCsv
      parameters:
        - name: product
          in: query
          required: true
          description: Target product to import members into.
          schema:
            type: string
            enum: [RECRUIT, PERFORM, UNI]
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required: [file]
              properties:
                file:
                  type: string
                  format: binary
                  description: CSV file containing member records.
      responses:
        "200":
          description: Members created successfully (no response body).
        "400":
          description: Invalid member data.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MembersCsvValidationResult"
        "401":
          description: Unauthorized.
        "403":
          description: Forbidden.

components:
  schemas:
    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
