/modifier/{storeid}:
  get:
    tags:
    - modifier
    description: Return all the modifiers belong to given store
    operationId: listModifiers
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: list of modifier
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Modifier'
  post:
    tags:
    - modifier
    description: Update/Create modifier
    operationId: saveModifier
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    requestBody:
      required: true
      content:
        application/json: 
          schema: 
            $ref: '#/components/schemas/Modifier'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      $ref#upsert: './responses/20x-upsert.yaml'

/modifier/{storeid}/{id}:
  get:
    tags:
    - modifier
    description: Return the modifier with given id
    operationId: loadModifier
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    - $ref#id: './parameters/objectid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: modifier detail
        content:
          application/json:
            schema:
              type: object
              properties: 
                value:
                  $ref: '#/components/schemas/Modifier'
  delete:
    tags:
    - modifier
    description: Delete a modifier with given id
    operationId: deleteModifier
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    - $ref#id: './parameters/objectid.yaml'
    responses:
      $ref#4xx: './responses/4xx.yaml'
      $ref#204: './responses/204.yaml'

/modifier/{storeid}/{id}/import:
  post:
    tags:
    - modifier
    description: Import modifier options by csv file and return an id to track import process.
    operationId: importModifierOption
    security:
    - bearerAuth: []
    parameters:
    - $ref#storeid: './parameters/storeid.yaml'
    - $ref#id: './parameters/objectid.yaml'
    requestBody:
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              file:
                type: string
                format: binary
    responses:
      $ref#4xx: './responses/4xx.yaml'
      200:
        description: data import start
        content:
            application/json:
              schema:
                type: object
                properties:
                  importid:
                    description: import id to track import process
                    type: string

/modifier/{storeid}/{id}/addOption:
  post:
    tags:
      - modifier
    description: Add a modifier option to a specific modifier for a store.
    operationId: addModifierOption
    security:
      - bearerAuth: []
    parameters:
      - $ref#storeid: './parameters/storeid.yaml'
      - $ref#id: './parameters/objectid.yaml'
    requestBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - id
              - name
            properties:
              id:
                type: string
                description: Identifier for the new modifier option.
              price:
                type: number
                description: Price associated with the modifier option.
              percent:
                type: number
                description: Optional percentage value associated with the modifier option.
              name2:
                type: string
                description: Secondary name or additional description for the modifier option.
              name:
                type: string
                description: Primary name of the modifier option.
    responses:
        $ref#4xx: './responses/4xx.yaml'
        $ref#204: './responses/204.yaml'