{
  "info": {
    "name": "SPARESHUB - Filter POST APIs (Options Scenarios)",
    "description": "POST endpoints only for filter APIs. Includes multiple options scenarios.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "http://127.0.0.1:8000/api" },
    { "key": "customer_token", "value": "" },
    { "key": "category_id", "value": "1" },
    { "key": "label_id", "value": "1" },
    { "key": "brand_id", "value": "1" }
  ],
  "item": [
    {
      "name": "POST /filter - keyword only",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"q\": \"oil\"\n}"
        },
        "url": "{{base_url}}/filter"
      }
    },
    {
      "name": "POST /filter - category + label + brand + price + sort",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"keyword\": \"synthetic\",\n  \"category_id\": {{category_id}},\n  \"label_id\": {{label_id}},\n  \"brand_id\": {{brand_id}},\n  \"price_min\": 10,\n  \"price_max\": 300,\n  \"sort\": \"price_desc\"\n}"
        },
        "url": "{{base_url}}/filter"
      }
    },
    {
      "name": "POST /filter - vehicle based filtering",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"vehicle_id\": 1,\n  \"price_max\": 500,\n  \"sort\": \"price_asc\"\n}"
        },
        "url": "{{base_url}}/filter"
      }
    },
    {
      "name": "POST /filter - direct option keys",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"car_make\": \"Toyota\",\n  \"car_model\": \"Corolla\",\n  \"year\": \"2020\",\n  \"engine_type\": \"Petrol\",\n  \"engine_size\": \"1.8\",\n  \"fuel_type\": \"Gasoline\",\n  \"color\": \"Black\"\n}"
        },
        "url": "{{base_url}}/filter"
      }
    },
    {
      "name": "POST /filter/options - single option",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"options\": [\n    { \"name\": \"car_make\", \"value\": \"Toyota\" }\n  ]\n}"
        },
        "url": "{{base_url}}/filter/options"
      }
    },
    {
      "name": "POST /filter/options - two options (AND)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"options\": [\n    { \"name\": \"car_make\", \"value\": \"Toyota\" },\n    { \"name\": \"car_model\", \"value\": \"Corolla\" }\n  ]\n}"
        },
        "url": "{{base_url}}/filter/options"
      }
    },
    {
      "name": "POST /filter/options - full car spec",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"options\": [\n    { \"name\": \"car_make\", \"value\": \"Toyota\" },\n    { \"name\": \"car_model\", \"value\": \"Camry\" },\n    { \"name\": \"year\", \"value\": \"2021\" },\n    { \"name\": \"engine_type\", \"value\": \"Petrol\" },\n    { \"name\": \"engine_size\", \"value\": \"2.5\" }\n  ],\n  \"sort\": \"price_asc\"\n}"
        },
        "url": "{{base_url}}/filter/options"
      }
    },
    {
      "name": "POST /filter/options - with category/label/brand",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"category_id\": {{category_id}},\n  \"label_id\": {{label_id}},\n  \"brand_id\": {{brand_id}},\n  \"price_min\": 50,\n  \"price_max\": 700,\n  \"sort\": \"price_desc\",\n  \"options\": [\n    { \"name\": \"car_make\", \"value\": \"Hyundai\" },\n    { \"name\": \"fuel_type\", \"value\": \"Gasoline\" }\n  ]\n}"
        },
        "url": "{{base_url}}/filter/options"
      }
    },
    {
      "name": "POST /filter/options - keyword + options",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"q\": \"filter\",\n  \"options\": [\n    { \"name\": \"car_make\", \"value\": \"Toyota\" },\n    { \"name\": \"color\", \"value\": \"Black\" }\n  ]\n}"
        },
        "url": "{{base_url}}/filter/options"
      }
    },
    {
      "name": "POST /filter/options - validation fail example",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Accept", "value": "application/json" },
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Authorization", "value": "Bearer {{customer_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"price_min\": 10\n}"
        },
        "url": "{{base_url}}/filter/options"
      }
    }
  ]
}
