openapi: 3.0.3
info:
  title: Repzo API - Brand
  version: 1.0.0
  description: OpenAPI specification for Repzo Brand endpoints.
servers:
  - url: https://sv.api.repzo.me
paths:
  /product-brand:
    get:
      summary: Find brands
      operationId: findBrands
      parameters:
        - in: query
          name: params
          schema:
            type: object
          description: Query parameters for filtering brands
      responses:
        "200":
          description: A list of brands
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BrandFindResult"
    post:
      summary: Create a brand
      operationId: createBrand
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BrandCreateBody"
      responses:
        "201":
          description: Brand created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BrandCreateResult"
  /product-brand/{id}:
    get:
      summary: Get a brand by ID
      operationId: getBrand
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Brand details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BrandGetResult"
    put:
      summary: Update a brand
      operationId: updateBrand
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BrandUpdateBody"
      responses:
        "200":
          description: Brand updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BrandUpdateResult"
    delete:
      summary: Remove a brand
      operationId: removeBrand
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Brand removed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BrandRemoveResult"
components:
  schemas:
    BrandFindResult:
      type: object
      description: Result of finding brands
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/BrandSchema"
        total_result:
          type: number
          description: Total number of brands
        current_count:
          type: number
          description: Count of brands in current page
        total_pages:
          type: number
          description: Total number of pages
        current_page:
          type: number
          description: Current page number
        per_page:
          type: number
          description: Number of brands per page
        first_page_url:
          type: string
          description: URL for the first page
        last_page_url:
          type: string
          description: URL for the last page
        next_page_url:
          type: string
          nullable: true
          description: URL for the next page
        prev_page_url:
          type: string
          nullable: true
          description: URL for the previous page
        path:
          type: string
          description: Base URL path
    BrandSchema:
      type: object
      description: Brand schema
      properties:
        _id:
          type: string
          description: Unique identifier for the brand
        name:
          type: string
          description: Name of the brand
        local_name:
          type: string
          description: Localized name of the brand
        disabled:
          type: boolean
          description: Whether the brand is disabled
        integration_meta:
          type: object
          additionalProperties: true
          description: Integration metadata
        company_namespace:
          type: array
          items:
            type: string
          description: Company namespaces
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
        __v:
          type: number
          description: Version number
    BrandCreateBody:
      type: object
      description: Body for creating a brand
      required:
        - name
      properties:
        name:
          type: string
          description: Name of the brand
        local_name:
          type: string
          description: Localized name of the brand
        disabled:
          type: boolean
          description: Whether the brand is disabled
        integration_meta:
          type: object
          additionalProperties: true
          description: Integration metadata
        company_namespace:
          type: array
          items:
            type: string
          description: Company namespaces
    BrandCreateResult:
      $ref: "#/components/schemas/BrandSchema"
      description: Result of creating a brand
    BrandGetResult:
      $ref: "#/components/schemas/BrandSchema"
      description: Result of getting a brand
    BrandUpdateBody:
      type: object
      description: Body for updating a brand
      properties:
        name:
          type: string
          description: Name of the brand
        local_name:
          type: string
          description: Localized name of the brand
        disabled:
          type: boolean
          description: Whether the brand is disabled
        integration_meta:
          type: object
          additionalProperties: true
          description: Integration metadata
        company_namespace:
          type: array
          items:
            type: string
          description: Company namespaces
        _id:
          type: string
          description: Unique identifier for the brand
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
        __v:
          type: number
          description: Version number
    BrandUpdateResult:
      $ref: "#/components/schemas/BrandSchema"
      description: Result of updating a brand
    BrandRemoveResult:
      $ref: "#/components/schemas/BrandSchema"
      description: Result of removing a brand
