{
    "info": {
        "_postman_id": "b3e3e3e3-1234-5678-90ab-cdef12345678",
        "name": "Supply Order Alternatives",
        "description": "Collection for Supply Order Item Alternatives management, including proposal, approval process, and comparison.",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "variable": [
        {
            "key": "base_url",
            "value": "https://backend.rzain.com.tr/api/v1",
            "type": "string"
        },
        {
            "key": "token",
            "value": "",
            "type": "string"
        }
    ],
    "item": [
        {
            "name": "Alternatives",
            "item": [
                {
                    "name": "Propose Alternative",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"alternative_item_name\": \"Premium Alternative Item\",\n    \"alternative_item_id\": 123, \n    \"alternative_price\": 150.00,\n    \"serial_number\": \"SN-2024-001\",\n    \"model\": \"Pro Model X\",\n    \"manufacturer\": \"Top Manufacturer\",\n    \"notes\": \"This is a better quality alternative available immediately.\",\n    \"category_id\": 5\n}"
                        },
                        "url": {
                            "raw": "{{base_url}}/supply/items/:item_id/alternatives/propose",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "items",
                                ":item_id",
                                "alternatives",
                                "propose"
                            ],
                            "variable": [
                                {
                                    "key": "item_id",
                                    "value": "1",
                                    "description": "ID of the supply order item"
                                }
                            ]
                        },
                        "description": "Propose a new alternative for a supply order item. Requires `alternative_item_name` and `alternative_price`. Optional fields include `serial_number`, `model`, `alternative_item_id` (from catalog), etc."
                    },
                    "response": []
                },
                {
                    "name": "Get Alternatives for Item",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/supply/items/:item_id/alternatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "items",
                                ":item_id",
                                "alternatives"
                            ],
                            "variable": [
                                {
                                    "key": "item_id",
                                    "value": "1",
                                    "description": "ID of the supply order item"
                                }
                            ]
                        },
                        "description": "Retrieve all proposed alternatives for a specific supply order item."
                    },
                    "response": []
                },
                {
                    "name": "Get Comparison",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/supply/items/:item_id/alternatives/:alternative_id/comparison",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "items",
                                ":item_id",
                                "alternatives",
                                ":alternative_id",
                                "comparison"
                            ],
                            "variable": [
                                {
                                    "key": "item_id",
                                    "value": "1",
                                    "description": "ID of the supply order item"
                                },
                                {
                                    "key": "alternative_id",
                                    "value": "1",
                                    "description": "ID of the alternative to compare"
                                }
                            ]
                        },
                        "description": "Get a detailed comparison between the original item and a specific alternative, including price analysis, match percentage, and specifications."
                    },
                    "response": []
                },
                {
                    "name": "Get Pending Alternatives (Admin)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/supply/alternatives/pending",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "alternatives",
                                "pending"
                            ]
                        },
                        "description": "Retrieve all alternatives that are currently pending approval."
                    },
                    "response": []
                },
                {
                    "name": "Approve Alternative",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"approval_notes\": \"Approved based on better availability and price match.\"\n}"
                        },
                        "url": {
                            "raw": "{{base_url}}/supply/alternatives/:alternative_id/approve",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "alternatives",
                                ":alternative_id",
                                "approve"
                            ],
                            "variable": [
                                {
                                    "key": "alternative_id",
                                    "value": "1",
                                    "description": "ID of the alternative to approve"
                                }
                            ]
                        },
                        "description": "Approve a proposed alternative. This will update the original order item to use this alternative."
                    },
                    "response": []
                },
                {
                    "name": "Reject Alternative",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"rejection_reason\": \"Price is too high compared to market value.\"\n}"
                        },
                        "url": {
                            "raw": "{{base_url}}/supply/alternatives/:alternative_id/reject",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "alternatives",
                                ":alternative_id",
                                "reject"
                            ],
                            "variable": [
                                {
                                    "key": "alternative_id",
                                    "value": "1",
                                    "description": "ID of the alternative to reject"
                                }
                            ]
                        },
                        "description": "Reject a proposed alternative. Requires a `rejection_reason`."
                    },
                    "response": []
                },
                {
                    "name": "Send for Approval",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/supply/alternatives/:alternative_id/send-for-approval",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "alternatives",
                                ":alternative_id",
                                "send-for-approval"
                            ],
                            "variable": [
                                {
                                    "key": "alternative_id",
                                    "value": "1",
                                    "description": "ID of the alternative"
                                }
                            ]
                        },
                        "description": "Update the status of an alternative to 'pending_approval'."
                    },
                    "response": []
                },
                {
                    "name": "Suggest Alternatives",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/supply/items/:item_id/alternatives/suggest?search_term=drill&min_price=10&max_price=1000",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "items",
                                ":item_id",
                                "alternatives",
                                "suggest"
                            ],
                            "query": [
                                {
                                    "key": "search_term",
                                    "value": "drill",
                                    "description": "Optional search term provided by user"
                                },
                                {
                                    "key": "min_price",
                                    "value": "10",
                                    "description": "Optional minimum price filter"
                                },
                                {
                                    "key": "max_price",
                                    "value": "1000",
                                    "description": "Optional maximum price filter"
                                },
                                {
                                    "key": "category_id",
                                    "value": "5",
                                    "description": "Optional category ID filter",
                                    "disabled": true
                                },
                                {
                                    "key": "manufacturer",
                                    "value": "Bosch",
                                    "description": "Optional manufacturer filter",
                                    "disabled": true
                                }
                            ],
                            "variable": [
                                {
                                    "key": "item_id",
                                    "value": "1",
                                    "description": "ID of the supply order item"
                                }
                            ]
                        },
                        "description": "Get automatic suggestions from the catalog for a supply order item. Supports various filters."
                    },
                    "response": []
                },
                {
                    "name": "Search Alternatives (POST)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"search_term\": \"heavy duty\",\n    \"limit\": 20,\n    \"min_price\": 100\n}"
                        },
                        "url": {
                            "raw": "{{base_url}}/supply/items/:item_id/alternatives/search",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "items",
                                ":item_id",
                                "alternatives",
                                "search"
                            ],
                            "variable": [
                                {
                                    "key": "item_id",
                                    "value": "1",
                                    "description": "ID of the supply order item"
                                }
                            ]
                        },
                        "description": "Search for alternatives using a POST request for more complex filtering options."
                    },
                    "response": []
                },
                {
                    "name": "Get Original Item Details",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/supply/items/:item_id/original-details",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "supply",
                                "items",
                                ":item_id",
                                "original-details"
                            ],
                            "variable": [
                                {
                                    "key": "item_id",
                                    "value": "1",
                                    "description": "ID of the supply order item"
                                }
                            ]
                        },
                        "description": "Retrieve details of the original item, including its unified catalog naming and image."
                    },
                    "response": []
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{token}}",
                "type": "string"
            }
        ]
    },
    "event": [
        {
            "listen": "prerequest",
            "script": {
                "type": "text/javascript",
                "exec": [
                    ""
                ]
            }
        },
        {
            "listen": "test",
            "script": {
                "type": "text/javascript",
                "exec": [
                    ""
                ]
            }
        }
    ]
}