{
  "info": {
    "_postman_id": "off-plan-listing-api",
    "name": "Off-Plan Listing Page API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Complete Off-Plan Listing Page API with filters, pagination, explore by city, and FAQ sections"
  },
  "item": [
    {
      "name": "Listing Endpoint",
      "item": [
        {
          "name": "Get Complete Listing Page",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status code is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has required sections', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.have.property('listing_header');",
                  "    pm.expect(jsonData.data).to.have.property('filters');",
                  "    pm.expect(jsonData.data).to.have.property('properties');",
                  "    pm.expect(jsonData.data).to.have.property('pagination');",
                  "    pm.expect(jsonData.data).to.have.property('explore_by_city');",
                  "    pm.expect(jsonData.data).to.have.property('faq');",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects"]
            },
            "description": "Returns the complete listing page with filters, properties, pagination, explore by city, and FAQ sections"
          },
          "response": []
        },
        {
          "name": "Get Listing Page - Page 2",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects?page=2&per_page=16",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects"],
              "query": [
                {
                  "key": "page",
                  "value": "2"
                },
                {
                  "key": "per_page",
                  "value": "16"
                }
              ]
            },
            "description": "Get listing page with pagination"
          },
          "response": []
        },
        {
          "name": "Filter by State (Dubai)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects?state_id=DXB",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects"],
              "query": [
                {
                  "key": "state_id",
                  "value": "DXB"
                }
              ]
            },
            "description": "Get off-plan projects filtered by state"
          },
          "response": []
        },
        {
          "name": "Sort by Price (Low to High)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects?sort=price_asc",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects"],
              "query": [
                {
                  "key": "sort",
                  "value": "price_asc"
                }
              ]
            },
            "description": "Get off-plan projects sorted by price (ascending)"
          },
          "response": []
        },
        {
          "name": "Filter by Price Range",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects?min_price=1000000&max_price=5000000",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects"],
              "query": [
                {
                  "key": "min_price",
                  "value": "1000000"
                },
                {
                  "key": "max_price",
                  "value": "5000000"
                }
              ]
            },
            "description": "Get off-plan projects within price range (AED 1M - 5M)"
          },
          "response": []
        },
        {
          "name": "Filter by Developer",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects?developer_id=1",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects"],
              "query": [
                {
                  "key": "developer_id",
                  "value": "1"
                }
              ]
            },
            "description": "Get off-plan projects by specific developer"
          },
          "response": []
        },
        {
          "name": "Filter by Completion Year",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects?completion_year=2026",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects"],
              "query": [
                {
                  "key": "completion_year",
                  "value": "2026"
                }
              ]
            },
            "description": "Get off-plan projects completing in specific year"
          },
          "response": []
        },
        {
          "name": "Multiple Filters Combined",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects?state_id=DXB&min_price=1000000&max_price=5000000&sort=price_asc&page=1&per_page=20",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects"],
              "query": [
                {
                  "key": "state_id",
                  "value": "DXB"
                },
                {
                  "key": "min_price",
                  "value": "1000000"
                },
                {
                  "key": "max_price",
                  "value": "5000000"
                },
                {
                  "key": "sort",
                  "value": "price_asc"
                },
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "per_page",
                  "value": "20"
                }
              ]
            },
            "description": "Example with multiple filters applied"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Filter Options",
      "item": [
        {
          "name": "Get Available Filters",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status code is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response contains filter options', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.have.property('developers');",
                  "    pm.expect(jsonData.data).to.have.property('completion_years');",
                  "    pm.expect(jsonData.data).to.have.property('states');",
                  "    pm.expect(jsonData.data).to.have.property('price_range');",
                  "    pm.expect(jsonData.data).to.have.property('sort_options');",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects/filters",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects", "filters"]
            },
            "description": "Returns all available filter options: developers, completion years, states, price range, sort options"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Project Details",
      "item": [
        {
          "name": "Get Single Project Details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan/projects/JW001",
              "host": ["{{base_url}}"],
              "path": ["off-plan", "projects", "JW001"]
            },
            "description": "Returns detailed information for a single off-plan project including apartments, facilities, amenities, and coordinates"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Legacy Endpoints",
      "item": [
        {
          "name": "Get Off-Plan Page (Legacy)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/off-plan",
              "host": ["{{base_url}}"],
              "path": ["off-plan"]
            },
            "description": "Returns basic off-plan page data (hero, guide, sold section, SEO)"
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "http://127.0.0.1:8000/api/v1",
      "type": "string"
    },
    {
      "key": "token",
      "value": "",
      "type": "string"
    }
  ]
}
