1. Get all Filters
    Endpoint: {base_route}/wp-json/cpbw/v1/dropdown/?search=filters
    Method: GET
    Description: Retrieves a list of filters.
    Response Demo: {
        "name": "filters",
        "values": [
            {
                "optionGroup": "Product",
                "options": {
                    "id": {
                        "title": "ID",
                        "component": "string",
                        "condition": {
                            "equal": "Equal",
                            "not_equal": "Not Equal",
                            "greater": "Greater Than",
                            "greater_equal": "Greater Than or Equal",
                            "lesser": "Less Than",
                            "lesser_equal": "Less Than or Equal",
                            "between": "Between"
                        },
                        "input_type": "number",
                        "fields": {
                            "compare": "",
                            "condition": "",
                            "compare_with": "",
                            "operator": ""
                        }
                    },
                    "title": {
                        "title": "Title",
                        "component": "string",
                        "condition": {
                            "equal": "Equal",
                            "not_equal": "Not Equal",
                            "contain": "Contain",
                            "not_contain": "Does Not Contain",
                            "start_with": "Start With",
                            "end_with": "End With"
                        },
                        "input_type": "text",
                        "fields": {
                            "compare": "",
                            "condition": "",
                            "compare_with": "",
                            "operator": ""
                        }
                    },
                    "categories": {
                        "title": "Categories",
                        "component": "string",
                        "condition": {
                            "in_list": "In List",
                            "not_in_list": "Not In List"
                        },
                        "input_type": {
                            "type": "select",
                            "option_type": "api",
                            "multiple": true,
                            "endpoint": "http://localhost/shop-manager-x/wp-json/cpbw/v1/search/category/?search="
                        },
                        "fields": {
                            "compare": "",
                            "condition": "",
                            "compare_with": "",
                            "operator": ""
                        }
                    },
                }
            },
            {
                "optionGroup": "Price",
                "options": {
                    "regular_price": {
                        "title": "Regular Price",
                        "component": "string",
                        "condition": {
                            "equal": "Equal",
                            "not_equal": "Not Equal",
                            "greater": "Greater Than",
                            "greater_equal": "Greater Than or Equal",
                            "lesser": "Less Than",
                            "lesser_equal": "Less Than or Equal",
                            "between": "Between"
                        },
                        "input_type": "number",
                        "fields": {
                            "compare": "",
                            "condition": "",
                            "compare_with": "",
                            "operator": ""
                        }
                    },
                }
            }
        ]
    }

    #####################################################
    #####################################################

2. Get all condition
    Endpoint: {base_route}/wp-json/cpbw/v1/dropdown/?search=conditions
    Method: GET
    Description: Retrieves a list of conditions.
    Response Demo: {
        "name": "conditions",
        "values": {
            "equal": "Equal",
            "not_equal": "Not Equal",
            "contain": "Contain",
            "not_contain": "Does Not Contain",
            "start_with": "Start With",
            "end_with": "End With",
            "greater": "Greater Than",
            "greater_equal": "Greater Than or Equal",
            "lesser": "Less Than",
            "lesser_equal": "Less Than or Equal",
            "between": "Between",
            "date_between": "Date Between",
            "in_list": "In List",
            "not_in_list": "Not In List"
        }
    }

    #################################################
    #################################################

3. Search API end points
    {base_route}/wp-json/cpbw/v1/search/product?search=product_name
    {base_route}/wp-json/cpbw/v1/search/category?search=category_name
    {base_route}/wp-json/cpbw/v1/search/search/tag?search=tag_name
    {base_route}/wp-json/cpbw/v1/search/attribute?search=attribute_name
    
    ######################################################
    ######################################################

4. Get all filters
    Method: GET
    Description: Retrieves a list of filters.
    Endpoint:{base_route}/wp-json/cpbw/v1/filters

5. Create filter
    Method: POST
    Description: Create a filter.
    Endpoint:{base_route}/wp-json/cpbw/v1/filters
    Data Demo: 
        {
            "name": "Filter test",
            "conditions": [
                {
                "id":"fe8bcbcd-25d5-4773-a8bf-f36e1671572d",
                "base_operator":"and",
                "base_filters":[
                    {
                    "id":"7533cc05-9205-42cb-ae08-2b670c110951",
                    "compare_with":"id",
                    "operator":"and",
                    "condition":"equal",
                    "compare":"15"
                    },
                    {
                    "id":"fed13bf4-8c4e-4049-b2f3-1537bfd2f688",
                    "compare_with":"title",
                    "operator":"or",
                    "condition":"equal",
                    "compare":"test"
                    }
                ]
            },
            {
                "id":"09557e77-9153-4e91-a0e1-a6cfebbacbee",
                "base_operator":"and",
                "base_filters":[
                    {
                    "id":"f0524fbe-65db-4623-b6e3-158a1ae3f581",
                    "compare_with":"description",
                    "operator":"and",
                    "condition":"equal",
                    "compare":"description"
                    }
                ]
            }
            ]
        }

    Response Demo: 
    {
        "id": 5,
        "name": "Filter test",
        "products": [],
        "conditions": [
            {
                "id": "fe8bcbcd-25d5-4773-a8bf-f36e1671572d",
                "base_operator": "and",
                "base_filters": [
                    {
                        "id": "7533cc05-9205-42cb-ae08-2b670c110951",
                        "compare_with": "id",
                        "operator": "and",
                        "condition": "equal",
                        "compare": "15"
                    },
                    {
                        "id": "fed13bf4-8c4e-4049-b2f3-1537bfd2f688",
                        "compare_with": "title",
                        "operator": "or",
                        "condition": "equal",
                        "compare": "test"
                    }
                ]
            },
            {
                "id": "09557e77-9153-4e91-a0e1-a6cfebbacbee",
                "base_operator": "and",
                "base_filters": [
                    {
                        "id": "f0524fbe-65db-4623-b6e3-158a1ae3f581",
                        "compare_with": "description",
                        "operator": "and",
                        "condition": "equal",
                        "compare": "description"
                    }
                ]
            }
        ],
        "created_by": 1,
        "created_date": "2025-02-06T16:55:29+00:00",
        "modified_by": 1,
        "updated_date": "2025-02-06T16:55:29+00:00",
        "_links": {
            "self": [
                {
                    "href": "http://localhost/shop-manager-x/wp-json/cpbw/v1/filters/0",
                    "targetHints": {
                        "allow": [
                            "GET",
                            "POST",
                            "PUT",
                            "PATCH",
                            "DELETE"
                        ]
                    }
                }
            ],
            "collection": [
                {
                    "href": "http://localhost/shop-manager-x/wp-json/cpbw/v1/filters"
                }
            ]
        }
    }
    

